@sjcrh/proteinpaint-client 2.74.2 → 2.76.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{2dmaf-b2d78c57.js → 2dmaf-74b99126.js} +1 -1
- package/dist/AppHeader-cecb39c2.js +1 -0
- package/dist/{ColorScale-9c76aef3.js → ColorScale-21cab8d2.js} +1 -1
- package/dist/DEanalysis-95bad59a.js +1 -0
- package/dist/Disco-a6e921a0.js +1 -0
- package/dist/Disco.UI-9ad999ed.js +1 -0
- package/dist/{DragControls-586f72db.js → DragControls-e3b6a937.js} +1 -1
- package/dist/{DziViewer-6311327c.js → DziViewer-354a790d.js} +1 -1
- package/dist/FilterRxComp-701a1480.js +1 -0
- package/dist/{FilterStateless-046081c2.js → FilterStateless-54c0b763.js} +1 -1
- package/dist/{HicApp-40e44cba.js → HicApp-d5a946bf.js} +1 -1
- package/dist/{OrbitControls-0cda1772.js → OrbitControls-694652cd.js} +1 -1
- package/dist/WSIViewer-dc7f8eb0.js +1 -0
- package/dist/adSandbox-f438e388.js +1 -0
- package/dist/app-3320ab6f.js +1 -0
- package/dist/app-649f8357.js +1 -0
- package/dist/app-b369b169.js +1 -0
- package/dist/app.js +1 -1
- package/dist/bam-431875ef.js +1 -0
- package/dist/barchart-8277ed43.js +1 -0
- package/dist/barchart.events-da29c90d.js +1 -0
- package/dist/{bars.renderer-5f7a4174.js → bars.renderer-dcfdd59b.js} +1 -1
- package/dist/block-6aedd569.js +1 -0
- package/dist/block.lazyload-87b12654.js +1 -0
- package/dist/block.legend-d3f61ef7.js +1 -0
- package/dist/{block.mds-effc078d.js → block.mds-3ad17dfa.js} +1 -1
- package/dist/{block.mds.cnv-ec861a26.js → block.mds.cnv-857ba868.js} +1 -1
- package/dist/{block.mds.expressionrank-a2ad7c80.js → block.mds.expressionrank-7e3b208c.js} +1 -1
- package/dist/{block.mds.expressionstat-31dc5595.js → block.mds.expressionstat-f2d31c86.js} +1 -1
- package/dist/{block.mds.geneboxplot-3ca857ce.js → block.mds.geneboxplot-f0fbaf12.js} +1 -1
- package/dist/{block.mds.junction-debba938.js → block.mds.junction-7f87f48f.js} +1 -1
- package/dist/{block.mds.svcnv-8dc5abdf.js → block.mds.svcnv-ac035c12.js} +1 -1
- package/dist/{block.mds.svcnv.share-81e62600.js → block.mds.svcnv.share-886d9479.js} +1 -1
- package/dist/block.mds2-7852c1ee.js +1 -0
- package/dist/{block.svg-9121e8e7.js → block.svg-9b916fa6.js} +1 -1
- package/dist/{block.tk.aicheck-c1b478e9.js → block.tk.aicheck-6770e333.js} +1 -1
- package/dist/{block.tk.ase-0f6ded48.js → block.tk.ase-ee807e59.js} +1 -1
- package/dist/{block.tk.bam-7cd06aee.js → block.tk.bam-00fba6e8.js} +1 -1
- package/dist/{block.tk.bedgraphdot-3ef8b94e.js → block.tk.bedgraphdot-7fda78e9.js} +1 -1
- package/dist/{block.tk.bigwig.ui-d1248810.js → block.tk.bigwig.ui-cc1a42f3.js} +1 -1
- package/dist/{block.tk.hicstraw-ee731e55.js → block.tk.hicstraw-526470e3.js} +1 -1
- package/dist/{block.tk.junction-4d8cab4d.js → block.tk.junction-b43a4cda.js} +1 -1
- package/dist/{block.tk.junction.textmatrixui-a6430b27.js → block.tk.junction.textmatrixui-a60ed78a.js} +1 -1
- package/dist/{block.tk.ld-8429a18b.js → block.tk.ld-d15bde41.js} +1 -1
- package/dist/{block.tk.menu-3f31f958.js → block.tk.menu-3aeb93c6.js} +1 -1
- package/dist/{block.tk.pgv-07e46705.js → block.tk.pgv-9af2bd64.js} +1 -1
- package/dist/boxplot-e17a17b7.js +1 -0
- package/dist/brainImaging-bf2ceee9.js +1 -0
- package/dist/{brush-c386fe3d.js → brush-aa175142.js} +1 -1
- package/dist/categorical-a52014a1.js +1 -0
- package/dist/condition-c646e357.js +1 -0
- package/dist/controls-287e6efa.js +1 -0
- package/dist/{controls.btns-1cb2bfab.js → controls.btns-79b805dd.js} +1 -1
- package/dist/controls.config-28d6d6a8.js +1 -0
- package/dist/cuminc-9e275854.js +1 -0
- package/dist/{customdata.inputui-cbd712ea.js → customdata.inputui-dc49d94b.js} +1 -1
- package/dist/dataDownload-3a3d4f33.js +1 -0
- package/dist/databrowser.ui-d8d3f8fd.js +1 -0
- package/dist/{density-19266ebf.js → density-a82a8b1c.js} +1 -1
- package/dist/dictionary-c5a19d90.js +1 -0
- package/dist/{drag-0b968811.js → drag-7b30ba17.js} +1 -1
- package/dist/{e2pca-b8752945.js → e2pca-82765817.js} +1 -1
- package/dist/{ep-a86b185a.js → ep-d017ec2f.js} +1 -1
- package/dist/facet-a9b44ef3.js +1 -0
- package/dist/{fusion.parse-244b2b97.js → fusion.parse-d40d0b9d.js} +1 -1
- package/dist/geneExpClustering-34c3f518.js +1 -0
- package/dist/geneExpression-0d1b7244.js +1 -0
- package/dist/{geneExpression-e0430f2e.js → geneExpression-589f485b.js} +1 -1
- package/dist/{geneExpression-387205bf.js → geneExpression-7d14983f.js} +1 -1
- package/dist/geneORA-903a780f.js +1 -0
- package/dist/{geneVariant-7de021b6.js → geneVariant-89601b34.js} +1 -1
- package/dist/geneVariant-92c4e870.js +1 -0
- package/dist/{genefusion.ui-a331de19.js → genefusion.ui-7e22e811.js} +1 -1
- package/dist/{genesearch-ea59f5d4.js → genesearch-a4e19f0d.js} +1 -1
- package/dist/geneset-108a39d2.js +1 -0
- package/dist/genomeBrowser-12f86a36.js +1 -0
- package/dist/genomeBrowser.controls-d5067811.js +1 -0
- package/dist/{groupsetting-20ffef77.js → groupsetting-b4416a96.js} +1 -1
- package/dist/gsea-543dab25.js +1 -0
- package/dist/hierCluster-26e14090.js +1 -0
- package/dist/hierCluster.config-98e82dff.js +1 -0
- package/dist/{hierCluster.interactivity-9b433033.js → hierCluster.interactivity-e56f6542.js} +1 -1
- package/dist/hierCluster.renderers-74a64cf5.js +1 -0
- package/dist/{html.legend-abb5452e.js → html.legend-a3f4ebfe.js} +1 -1
- package/dist/imagePlot-b9eae4ae.js +1 -0
- package/dist/{lasso-55cf4057.js → lasso-f767f634.js} +1 -1
- package/dist/launch.adhoc-abca6af3.js +1 -0
- package/dist/leftlabel.sample-24c2388d.js +1 -0
- package/dist/legacyDataset-e0e201ab.js +1 -0
- package/dist/{log-cf45fcf2.js → log-99af3443.js} +1 -1
- package/dist/{lollipop-c5b6e615.js → lollipop-806f8fa4.js} +1 -1
- package/dist/{maf-7535f1f9.js → maf-b06579e4.js} +1 -1
- package/dist/{maftimeline-1292ab62.js → maftimeline-4840a380.js} +1 -1
- package/dist/matrix-00bb50ff.js +1 -0
- package/dist/matrix.cells-914dd0c6.js +1 -0
- package/dist/{matrix.cluster-168bc96b.js → matrix.cluster-783ceab0.js} +1 -1
- package/dist/matrix.config-6ce74dfe.js +1 -0
- package/dist/matrix.controls-7b2a6f95.js +1 -0
- package/dist/{matrix.data-b1d0febe.js → matrix.data-dac4f1b7.js} +1 -1
- package/dist/{matrix.dom-00defa30.js → matrix.dom-4e10bbe9.js} +1 -1
- package/dist/matrix.groups-b9fca14a.js +1 -0
- package/dist/matrix.interactivity-84169b43.js +1 -0
- package/dist/{matrix.layout-c2345231.js → matrix.layout-dd5a44fd.js} +1 -1
- package/dist/matrix.legend-ac6d45e6.js +1 -0
- package/dist/matrix.renderers-78010275.js +1 -0
- package/dist/matrix.serieses-9b4fd744.js +1 -0
- package/dist/matrix.sort-014d798d.js +1 -0
- package/dist/{matrix.sorterUi-a741ba2e.js → matrix.sorterUi-9bf7e6f9.js} +1 -1
- package/dist/{mavb-92136d17.js → mavb-c6be46fc.js} +1 -1
- package/dist/{mds.fimo-c03115b4.js → mds.fimo-bff6a1ed.js} +1 -1
- package/dist/mds.samplescatterplot-9a02b9fb.js +1 -0
- package/dist/{mds.survivalplot-366db380.js → mds.survivalplot-055549f4.js} +1 -1
- package/dist/{metaboliteIntensity-ddb6e480.js → metaboliteIntensity-fac92f8b.js} +1 -1
- package/dist/niceNumLabels-238aabce.js +1 -0
- package/dist/{nodrag-2c046d31.js → nodrag-16ad4b03.js} +1 -1
- package/dist/{notify-44ebc0df.js → notify-224cccbd.js} +1 -1
- package/dist/{numeric-918d4686.js → numeric-b0b17185.js} +1 -1
- package/dist/numeric.binary-1f9e93f2.js +1 -0
- package/dist/numeric.continuous-ebcd0567.js +1 -0
- package/dist/numeric.discrete-7b97044a.js +1 -0
- package/dist/numeric.spline-1be88f3d.js +1 -0
- package/dist/numeric.toggle-7fa2a770.js +1 -0
- package/dist/oncomatrix-351af2a0.js +1 -0
- package/dist/{parseData-e66308cd.js → parseData-21fe9822.js} +1 -1
- package/dist/partjson.esm-b3f1fc21.js +1 -0
- package/dist/{plot.2dvaf-73dbfbd1.js → plot.2dvaf-18a35e4b.js} +1 -1
- package/dist/plot.app-30c4b8e5.js +1 -0
- package/dist/plot.barplot-7c4865a2.js +1 -0
- package/dist/{plot.boxplot-641da058.js → plot.boxplot-fe3046c6.js} +1 -1
- package/dist/plot.brainImaging-2ceb6023.js +1 -0
- package/dist/plot.disco-6011f87f.js +1 -0
- package/dist/{plot.dzi-41ea26e5.js → plot.dzi-6728a7c8.js} +1 -1
- package/dist/plot.ssgq-5581dc56.js +1 -0
- package/dist/{plot.vaf2cov-80e58833.js → plot.vaf2cov-b2284c64.js} +1 -1
- package/dist/{plot.wsi-51cc48ef.js → plot.wsi-9a9d4034.js} +1 -1
- package/dist/profileBarchart-0476f1f8.js +1 -0
- package/dist/profileHome-32eb9b50.js +1 -0
- package/dist/profilePlot-c7e099e8.js +1 -0
- package/dist/profilePolar-6b981e63.js +1 -0
- package/dist/profileRadar-bca1cc03.js +1 -0
- package/dist/profileRadarFacility-bbb1ecd8.js +1 -0
- package/dist/profileSummary-b114204f.js +1 -0
- package/dist/recover-49e09de0.js +1 -0
- package/dist/regression.inputs-a761f40d.js +1 -0
- package/dist/regression.inputs.values.table-5929d25a.js +1 -0
- package/dist/regression.results-69bc42d0.js +1 -0
- package/dist/{renderPvalueTable-895a72c2.js → renderPvalueTable-dc5d15f2.js} +1 -1
- package/dist/sampleScatter-2d0ed680.js +1 -0
- package/dist/{sampleScatter.rendererThree-5e686004.js → sampleScatter.rendererThree-0b12ac61.js} +2 -2
- package/dist/sampleView-484ab133.js +1 -0
- package/dist/samplelst-689796e6.js +1 -0
- package/dist/{samplematrix-2a1d7d82.js → samplematrix-2b137a05.js} +1 -1
- package/dist/scatter-205e013f.js +1 -0
- package/dist/{select2Terms-b4fffc50.js → select2Terms-b21e184a.js} +1 -1
- package/dist/{selectGenomeWithTklst-acf7e568.js → selectGenomeWithTklst-466995b4.js} +1 -1
- package/dist/singleCellCellType-5db730bb.js +1 -0
- package/dist/{singleCellGeneExpression-6de17162.js → singleCellGeneExpression-7147a2d0.js} +1 -1
- package/dist/singleCellPlot-73b2738f.js +1 -0
- package/dist/{singlecell-f76c856a.js → singlecell-24409b72.js} +1 -1
- package/dist/singlecell-bca774ed.js +1 -0
- package/dist/{snp-9590a1b4.js → snp-37d06246.js} +1 -1
- package/dist/snp-a8388ce4.js +1 -0
- package/dist/snplocus-7a1ea8c9.js +1 -0
- package/dist/{snplst-007a1926.js → snplst-6865d7c7.js} +1 -1
- package/dist/{spliceevent.a53ss.diagram-63dfef69.js → spliceevent.a53ss.diagram-e2eab72b.js} +1 -1
- package/dist/{spliceevent.exonskip.diagram-76fa9af8.js → spliceevent.exonskip.diagram-4d5df3a1.js} +1 -1
- package/dist/spliceevent.exonskip.getdefault-a94aad6e.js +1 -0
- package/dist/{spliceevent.noeventdiagram-64a099e0.js → spliceevent.noeventdiagram-ea97b0fb.js} +1 -1
- package/dist/{spliceevent.phrase-770c8cac.js → spliceevent.phrase-c5832470.js} +1 -1
- package/dist/{stattable-f1189f0f.js → stattable-7c5ecc2f.js} +1 -1
- package/dist/{style.gdc-89cfdb0f.js → style.gdc-131f3c77.js} +1 -1
- package/dist/summary-5ec455d3.js +1 -0
- package/dist/{sunburst-d5379952.js → sunburst-533902a7.js} +1 -1
- package/dist/survival-92250664.js +1 -0
- package/dist/survival-e16e068f.js +1 -0
- package/dist/{svg.download-86850940.js → svg.download-35926549.js} +1 -1
- package/dist/{svg.legend-a94b0697.js → svg.legend-8d490df2.js} +1 -1
- package/dist/{svgraph-c57b9ae3.js → svgraph-6fac8cbc.js} +1 -1
- package/dist/{svmr-cf6f1b27.js → svmr-d07ff695.js} +1 -1
- package/dist/table-29d5a973.js +1 -0
- package/dist/table-ad744310.js +1 -0
- package/dist/termInfo-bf99a37e.js +1 -0
- package/dist/{termdb.bins-9faa5170.js → termdb.bins-8b656cc3.js} +1 -1
- package/dist/termsetting-33ea66f1.js +1 -0
- package/dist/tk-071a7550.js +1 -0
- package/dist/{toggleButtons-002aeda1.js → toggleButtons-dbdbad01.js} +1 -1
- package/dist/tp.ui-9c2e9fc5.js +1 -0
- package/dist/tslib.es6-c3c2d88f.js +1 -0
- package/dist/tvs.density-f6128793.js +1 -0
- package/dist/{tvs.geneVariant-3a65ad94.js → tvs.geneVariant-ca4bdbb1.js} +1 -1
- package/dist/tvs.numeric-0260a825.js +1 -0
- package/dist/{tvs.samplelst-1eeb586b.js → tvs.samplelst-cb71b3bf.js} +1 -1
- package/dist/{uiUtils-1336bad7.js → uiUtils-f1bd2bcc.js} +1 -1
- package/dist/{variantBrowser-f0c812c1.js → variantBrowser-7c540224.js} +1 -1
- package/dist/{vcf-c4a23924.js → vcf-5cc55588.js} +1 -1
- package/dist/violin-2ba509eb.js +1 -0
- package/dist/violin.interactivity-4da6d7a9.js +1 -0
- package/dist/{violin.renderer-dafd89fa.js → violin.renderer-ce024265.js} +1 -1
- package/dist/{violinRenderer-8215f40d.js → violinRenderer-f7c96a60.js} +1 -1
- package/dist/{viridis-ffd14c4d.js → viridis-01ab20c5.js} +1 -1
- package/dist/{y-dd197cc9.js → y-67939f83.js} +1 -1
- package/dist/{zoom-9c63e74c.js → zoom-25dce8b9.js} +1 -1
- package/package.json +6 -4
- package/dist/AppHeader-a2a7e518.js +0 -1
- package/dist/DEanalysis-a6b50e49.js +0 -1
- package/dist/Disco-1c71b7dd.js +0 -1
- package/dist/Disco.UI-4c16ee50.js +0 -1
- package/dist/FilterRxComp-242f4615.js +0 -1
- package/dist/WSIViewer-d90032d7.js +0 -1
- package/dist/adSandbox-3528c372.js +0 -1
- package/dist/app-07dee349.js +0 -1
- package/dist/app-a8c4854a.js +0 -1
- package/dist/app-ade9c62a.js +0 -1
- package/dist/bam-92483a98.js +0 -1
- package/dist/barchart-3e69d094.js +0 -1
- package/dist/barchart.events-9b11d97e.js +0 -1
- package/dist/block-dcb130fb.js +0 -1
- package/dist/block.lazyload-9f031cac.js +0 -1
- package/dist/block.legend-b2987cd9.js +0 -1
- package/dist/block.mds2-de6e0986.js +0 -1
- package/dist/boxplot-1178fffc.js +0 -1
- package/dist/brainImaging-98ed7aa2.js +0 -1
- package/dist/categorical-26528ce8.js +0 -1
- package/dist/condition-b0d74550.js +0 -1
- package/dist/controls-0bacec22.js +0 -1
- package/dist/controls.config-0ccc9d79.js +0 -1
- package/dist/controls.divide-a9fe9466.js +0 -1
- package/dist/controls.overlay-fe20d41d.js +0 -1
- package/dist/controls.term1-faa2efcf.js +0 -1
- package/dist/cuminc-7e2cac2d.js +0 -1
- package/dist/dataDownload-ade8d840.js +0 -1
- package/dist/databrowser.ui-716f0519.js +0 -1
- package/dist/dictionary-3f83ce63.js +0 -1
- package/dist/facet-6850cfed.js +0 -1
- package/dist/geneExpClustering-7fd3c87e.js +0 -1
- package/dist/geneExpression-6462537d.js +0 -1
- package/dist/geneORA-7eb818c4.js +0 -1
- package/dist/geneVariant-b58e924a.js +0 -1
- package/dist/geneset-9f69ad3f.js +0 -1
- package/dist/genomeBrowser-1b2b83f7.js +0 -1
- package/dist/genomeBrowser.controls-cd8ddeb1.js +0 -1
- package/dist/gsea-36376589.js +0 -1
- package/dist/hierCluster-f1e30c19.js +0 -1
- package/dist/hierCluster.config-da3510b1.js +0 -1
- package/dist/hierCluster.renderers-610d8860.js +0 -1
- package/dist/imagePlot-7089bdff.js +0 -1
- package/dist/launch.adhoc-d229fd55.js +0 -1
- package/dist/leftlabel.sample-a919168c.js +0 -1
- package/dist/legacyDataset-1cbcb67d.js +0 -1
- package/dist/matrix-0614794d.js +0 -1
- package/dist/matrix.cells-819d4991.js +0 -1
- package/dist/matrix.config-c54ca273.js +0 -1
- package/dist/matrix.controls-5eca7822.js +0 -1
- package/dist/matrix.groups-4660dd70.js +0 -1
- package/dist/matrix.interactivity-23d83183.js +0 -1
- package/dist/matrix.legend-2e647224.js +0 -1
- package/dist/matrix.renderers-43445f4f.js +0 -1
- package/dist/matrix.serieses-972fbe5d.js +0 -1
- package/dist/matrix.sort-80d9b788.js +0 -1
- package/dist/mds.samplescatterplot-1623e6d0.js +0 -1
- package/dist/niceNumLabels-6cfc1508.js +0 -1
- package/dist/numeric.binary-80467e8b.js +0 -1
- package/dist/numeric.continuous-69a62a15.js +0 -1
- package/dist/numeric.discrete-86181905.js +0 -1
- package/dist/numeric.spline-1b07fd13.js +0 -1
- package/dist/numeric.toggle-37c4bee8.js +0 -1
- package/dist/oncomatrix-475271da.js +0 -1
- package/dist/plot.app-aa916e0e.js +0 -1
- package/dist/plot.barplot-8b440a2b.js +0 -1
- package/dist/plot.brainImaging-2f796b0c.js +0 -1
- package/dist/plot.disco-43e18d2f.js +0 -1
- package/dist/plot.ssgq-e49cb70b.js +0 -1
- package/dist/profileBarchart-91463ab6.js +0 -1
- package/dist/profileHome-d37a6821.js +0 -1
- package/dist/profilePlot-9ca577cb.js +0 -1
- package/dist/profilePolar-19c7da5b.js +0 -1
- package/dist/profileRadar-8bf094e3.js +0 -1
- package/dist/profileRadarFacility-f9fd8971.js +0 -1
- package/dist/profileSummary-93999c14.js +0 -1
- package/dist/recover-36ada47f.js +0 -1
- package/dist/regression.inputs-cb57ece6.js +0 -1
- package/dist/regression.inputs.values.table-908bb37a.js +0 -1
- package/dist/regression.results-c186a8dc.js +0 -1
- package/dist/roundValue-b0d0517c.js +0 -1
- package/dist/sampleScatter-9d5b3630.js +0 -1
- package/dist/sampleView-2d895023.js +0 -1
- package/dist/samplelst-9f8343ff.js +0 -1
- package/dist/scatter-b4992f64.js +0 -1
- package/dist/singleCellCellType-84a0c2cf.js +0 -1
- package/dist/singleCellPlot-2f2b8619.js +0 -1
- package/dist/singlecell-90567dde.js +0 -1
- package/dist/snp-79ec95ba.js +0 -1
- package/dist/snplocus-cb629be1.js +0 -1
- package/dist/spliceevent.exonskip.getdefault-31d2950c.js +0 -1
- package/dist/summary-b77bef3c.js +0 -1
- package/dist/survival-61ab375a.js +0 -1
- package/dist/survival-80a0ade9.js +0 -1
- package/dist/table-79e3e776.js +0 -1
- package/dist/table-eee91e14.js +0 -1
- package/dist/termInfo-f851b415.js +0 -1
- package/dist/tk-75566002.js +0 -1
- package/dist/tp.ui-02911b56.js +0 -1
- package/dist/tslib.es6-1f85f553.js +0 -1
- package/dist/tvs.density-026fca97.js +0 -1
- package/dist/tvs.numeric-3f3d9919.js +0 -1
- package/dist/violin-1515c3e6.js +0 -1
- package/dist/violin.interactivity-8e2f480d.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as t}from"./tslib.es6-1f85f553.js";import{s as e,P as n,b as i,h as s}from"./app-a8c4854a.js";var r=':root,\n:host {\n --ol-background-color: white;\n --ol-accent-background-color: #F5F5F5;\n --ol-subtle-background-color: rgba(128, 128, 128, 0.25);\n --ol-partial-background-color: rgba(255, 255, 255, 0.75);\n --ol-foreground-color: #333333;\n --ol-subtle-foreground-color: #666666;\n --ol-brand-color: #00AAFF;\n}\n\n.ol-box {\n box-sizing: border-box;\n border-radius: 2px;\n border: 1.5px solid var(--ol-background-color);\n background-color: var(--ol-partial-background-color);\n}\n\n.ol-mouse-position {\n top: 8px;\n right: 8px;\n position: absolute;\n}\n\n.ol-scale-line {\n background: var(--ol-partial-background-color);\n border-radius: 4px;\n bottom: 8px;\n left: 8px;\n padding: 2px;\n position: absolute;\n}\n\n.ol-scale-line-inner {\n border: 1px solid var(--ol-subtle-foreground-color);\n border-top: none;\n color: var(--ol-foreground-color);\n font-size: 10px;\n text-align: center;\n margin: 1px;\n will-change: contents, width;\n transition: all 0.25s;\n}\n\n.ol-scale-bar {\n position: absolute;\n bottom: 8px;\n left: 8px;\n}\n\n.ol-scale-bar-inner {\n display: flex;\n}\n\n.ol-scale-step-marker {\n width: 1px;\n height: 15px;\n background-color: var(--ol-foreground-color);\n float: right;\n z-index: 10;\n}\n\n.ol-scale-step-text {\n position: absolute;\n bottom: -5px;\n font-size: 10px;\n z-index: 11;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-text {\n position: absolute;\n font-size: 12px;\n text-align: center;\n bottom: 25px;\n color: var(--ol-foreground-color);\n text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-singlebar {\n position: relative;\n height: 10px;\n z-index: 9;\n box-sizing: border-box;\n border: 1px solid var(--ol-foreground-color);\n}\n\n.ol-scale-singlebar-even {\n background-color: var(--ol-subtle-foreground-color);\n}\n\n.ol-scale-singlebar-odd {\n background-color: var(--ol-background-color);\n}\n\n.ol-unsupported {\n display: none;\n}\n\n.ol-viewport,\n.ol-unselectable {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n\n.ol-viewport canvas {\n all: unset;\n overflow: hidden;\n}\n\n.ol-viewport {\n touch-action: pan-x pan-y;\n}\n\n.ol-selectable {\n -webkit-touch-callout: default;\n -webkit-user-select: text;\n -moz-user-select: text;\n user-select: text;\n}\n\n.ol-grabbing {\n cursor: -webkit-grabbing;\n cursor: -moz-grabbing;\n cursor: grabbing;\n}\n\n.ol-grab {\n cursor: move;\n cursor: -webkit-grab;\n cursor: -moz-grab;\n cursor: grab;\n}\n\n.ol-control {\n position: absolute;\n background-color: var(--ol-subtle-background-color);\n border-radius: 4px;\n}\n\n.ol-zoom {\n top: .5em;\n left: .5em;\n}\n\n.ol-rotate {\n top: .5em;\n right: .5em;\n transition: opacity .25s linear, visibility 0s linear;\n}\n\n.ol-rotate.ol-hidden {\n opacity: 0;\n visibility: hidden;\n transition: opacity .25s linear, visibility 0s linear .25s;\n}\n\n.ol-zoom-extent {\n top: 4.643em;\n left: .5em;\n}\n\n.ol-full-screen {\n right: .5em;\n top: .5em;\n}\n\n.ol-control button {\n display: block;\n margin: 1px;\n padding: 0;\n color: var(--ol-subtle-foreground-color);\n font-weight: bold;\n text-decoration: none;\n font-size: inherit;\n text-align: center;\n height: 1.375em;\n width: 1.375em;\n line-height: .4em;\n background-color: var(--ol-background-color);\n border: none;\n border-radius: 2px;\n}\n\n.ol-control button::-moz-focus-inner {\n border: none;\n padding: 0;\n}\n\n.ol-zoom-extent button {\n line-height: 1.4em;\n}\n\n.ol-compass {\n display: block;\n font-weight: normal;\n will-change: transform;\n}\n\n.ol-touch .ol-control button {\n font-size: 1.5em;\n}\n\n.ol-touch .ol-zoom-extent {\n top: 5.5em;\n}\n\n.ol-control button:hover,\n.ol-control button:focus {\n text-decoration: none;\n outline: 1px solid var(--ol-subtle-foreground-color);\n color: var(--ol-foreground-color);\n}\n\n.ol-zoom .ol-zoom-in {\n border-radius: 2px 2px 0 0;\n}\n\n.ol-zoom .ol-zoom-out {\n border-radius: 0 0 2px 2px;\n}\n\n.ol-attribution {\n text-align: right;\n bottom: .5em;\n right: .5em;\n max-width: calc(100% - 1.3em);\n display: flex;\n flex-flow: row-reverse;\n align-items: center;\n}\n\n.ol-attribution a {\n color: var(--ol-subtle-foreground-color);\n text-decoration: none;\n}\n\n.ol-attribution ul {\n margin: 0;\n padding: 1px .5em;\n color: var(--ol-foreground-color);\n text-shadow: 0 0 2px var(--ol-background-color);\n font-size: 12px;\n}\n\n.ol-attribution li {\n display: inline;\n list-style: none;\n}\n\n.ol-attribution li:not(:last-child):after {\n content: " ";\n}\n\n.ol-attribution img {\n max-height: 2em;\n max-width: inherit;\n vertical-align: middle;\n}\n\n.ol-attribution button {\n flex-shrink: 0;\n}\n\n.ol-attribution.ol-collapsed ul {\n display: none;\n}\n\n.ol-attribution:not(.ol-collapsed) {\n background: var(--ol-partial-background-color);\n}\n\n.ol-attribution.ol-uncollapsible {\n bottom: 0;\n right: 0;\n border-radius: 4px 0 0;\n}\n\n.ol-attribution.ol-uncollapsible img {\n margin-top: -.2em;\n max-height: 1.6em;\n}\n\n.ol-attribution.ol-uncollapsible button {\n display: none;\n}\n\n.ol-zoomslider {\n top: 4.5em;\n left: .5em;\n height: 200px;\n}\n\n.ol-zoomslider button {\n position: relative;\n height: 10px;\n}\n\n.ol-touch .ol-zoomslider {\n top: 5.5em;\n}\n\n.ol-overviewmap {\n left: 0.5em;\n bottom: 0.5em;\n}\n\n.ol-overviewmap.ol-uncollapsible {\n bottom: 0;\n left: 0;\n border-radius: 0 4px 0 0;\n}\n\n.ol-overviewmap .ol-overviewmap-map,\n.ol-overviewmap button {\n display: block;\n}\n\n.ol-overviewmap .ol-overviewmap-map {\n border: 1px solid var(--ol-subtle-foreground-color);\n height: 150px;\n width: 150px;\n}\n\n.ol-overviewmap:not(.ol-collapsed) button {\n bottom: 0;\n left: 0;\n position: absolute;\n}\n\n.ol-overviewmap.ol-collapsed .ol-overviewmap-map,\n.ol-overviewmap.ol-uncollapsible button {\n display: none;\n}\n\n.ol-overviewmap:not(.ol-collapsed) {\n background: var(--ol-subtle-background-color);\n}\n\n.ol-overviewmap-box {\n border: 1.5px dotted var(--ol-subtle-foreground-color);\n}\n\n.ol-overviewmap .ol-overviewmap-box:hover {\n cursor: move;\n}\n\n.ol-overviewmap .ol-viewport:hover {\n cursor: pointer;\n}\n';e(r);class o{constructor(t){this.propagationStopped;this.defaultPrevented;this.type=t;this.target=null}preventDefault(){this.defaultPrevented=true}stopPropagation(){this.propagationStopped=true}}var a=o;var l={PROPERTYCHANGE:"propertychange"};class h{constructor(){this.disposed=false}dispose(){if(!this.disposed){this.disposed=true;this.disposeInternal()}}disposeInternal(){}}var c=h;function u(t,e){return t>e?1:t<e?-1:0}function d(t,e,n){if(t[0]<=e){return 0}const i=t.length;if(e<=t[i-1]){return i-1}if(typeof n==="function"){for(let s=1;s<i;++s){const i=t[s];if(i===e){return s}if(i<e){if(n(e,t[s-1],i)>0){return s-1}return s}}return i-1}if(n>0){for(let n=1;n<i;++n){if(t[n]<e){return n-1}}return i-1}if(n<0){for(let n=1;n<i;++n){if(t[n]<=e){return n}}return i-1}for(let n=1;n<i;++n){if(t[n]==e){return n}if(t[n]<e){if(t[n-1]-e<e-t[n]){return n-1}return n}}return i-1}function f(t,e){const n=Array.isArray(e)?e:[e];const i=n.length;for(let e=0;e<i;e++){t[t.length]=n[e]}}function g(t,e){const n=t.length;if(n!==e.length){return false}for(let i=0;i<n;i++){if(t[i]!==e[i]){return false}}return true}function p(t,e,n){const i=e||u;return t.every((function(e,s){if(s===0){return true}const r=i(t[s-1],e);return!(r>0||n&&r===0)}))}function _(){return true}function m(){return false}function y(){}function E(t){let e;let n;let i;return function(){const s=Array.prototype.slice.call(arguments);if(!n||this!==i||!g(s,n)){i=this;n=s;e=t.apply(this,arguments)}return e}}function v(t){function e(){let e;try{e=t()}catch(t){return Promise.reject(t)}if(e instanceof Promise){return e}return Promise.resolve(e)}return e()}function x(t){for(const e in t){delete t[e]}}function w(t){let e;for(e in t){return false}return!e}class C extends c{constructor(t){super();this.eventTarget_=t;this.pendingRemovals_=null;this.dispatching_=null;this.listeners_=null}addEventListener(t,e){if(!t||!e){return}const n=this.listeners_||(this.listeners_={});const i=n[t]||(n[t]=[]);if(!i.includes(e)){i.push(e)}}dispatchEvent(t){const e=typeof t==="string";const n=e?t:t.type;const i=this.listeners_&&this.listeners_[n];if(!i){return}const s=e?new a(t):t;if(!s.target){s.target=this.eventTarget_||this}const r=this.dispatching_||(this.dispatching_={});const o=this.pendingRemovals_||(this.pendingRemovals_={});if(!(n in r)){r[n]=0;o[n]=0}++r[n];let l;for(let t=0,e=i.length;t<e;++t){if("handleEvent"in i[t]){l=i[t].handleEvent(s)}else{l=i[t].call(this,s)}if(l===false||s.propagationStopped){l=false;break}}if(--r[n]===0){let t=o[n];delete o[n];while(t--){this.removeEventListener(n,y)}delete r[n]}return l}disposeInternal(){this.listeners_&&x(this.listeners_)}getListeners(t){return this.listeners_&&this.listeners_[t]||undefined}hasListener(t){if(!this.listeners_){return false}return t?t in this.listeners_:Object.keys(this.listeners_).length>0}removeEventListener(t,e){if(!this.listeners_){return}const n=this.listeners_[t];if(!n){return}const i=n.indexOf(e);if(i!==-1){if(this.pendingRemovals_&&t in this.pendingRemovals_){n[i]=y;++this.pendingRemovals_[t]}else{n.splice(i,1);if(n.length===0){delete this.listeners_[t]}}}}}var b=C;var R={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function T(t,e,n,i,s){if(s){const s=n;n=function(){t.removeEventListener(e,n);s.apply(i??this,arguments)}}else if(i&&i!==t){n=n.bind(i)}const r={target:t,type:e,listener:n};t.addEventListener(e,n);return r}function I(t,e,n,i){return T(t,e,n,i,true)}function S(t){if(t&&t.target){t.target.removeEventListener(t.type,t.listener);x(t)}}class M extends b{constructor(){super();this.on=this.onInternal;this.once=this.onceInternal;this.un=this.unInternal;this.revision_=0}changed(){++this.revision_;this.dispatchEvent(R.CHANGE)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){const n=t.length;const i=new Array(n);for(let s=0;s<n;++s){i[s]=T(this,t[s],e)}return i}return T(this,t,e)}onceInternal(t,e){let n;if(Array.isArray(t)){const i=t.length;n=new Array(i);for(let s=0;s<i;++s){n[s]=I(this,t[s],e)}}else{n=I(this,t,e)}e.ol_key=n;return n}unInternal(t,e){const n=e.ol_key;if(n){A(n)}else if(Array.isArray(t)){for(let n=0,i=t.length;n<i;++n){this.removeEventListener(t[n],e)}}else{this.removeEventListener(t,e)}}}M.prototype.on;M.prototype.once;M.prototype.un;function A(t){if(Array.isArray(t)){for(let e=0,n=t.length;e<n;++e){S(t[e])}}else{S(t)}}var P=M;function L(){throw new Error("Unimplemented abstract method.")}let O=0;function D(t){return t.ol_uid||(t.ol_uid=String(++O))}class F extends a{constructor(t,e,n){super(t);this.key=e;this.oldValue=n}}class N extends P{constructor(t){super();this.on;this.once;this.un;D(this);this.values_=null;if(t!==undefined){this.setProperties(t)}}get(t){let e;if(this.values_&&this.values_.hasOwnProperty(t)){e=this.values_[t]}return e}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}getPropertiesInternal(){return this.values_}hasProperties(){return!!this.values_}notify(t,e){let n;n=`change:${t}`;if(this.hasListener(n)){this.dispatchEvent(new F(n,t,e))}n=l.PROPERTYCHANGE;if(this.hasListener(n)){this.dispatchEvent(new F(n,t,e))}}addChangeListener(t,e){this.addEventListener(`change:${t}`,e)}removeChangeListener(t,e){this.removeEventListener(`change:${t}`,e)}set(t,e,n){const i=this.values_||(this.values_={});if(n){i[t]=e}else{const n=i[t];i[t]=e;if(n!==e){this.notify(t,n)}}}setProperties(t,e){for(const n in t){this.set(n,t[n],e)}}applyProperties(t){if(!t.values_){return}Object.assign(this.values_||(this.values_={}),t.values_)}unset(t,e){if(this.values_&&t in this.values_){const n=this.values_[t];delete this.values_[t];if(w(this.values_)){this.values_=null}if(!e){this.notify(t,n)}}}}var k=N;var z={ADD:"add",REMOVE:"remove"};const G={LENGTH:"length"};class V extends a{constructor(t,e,n){super(t);this.element=e;this.index=n}}class K extends k{constructor(t,e){super();this.on;this.once;this.un;e=e||{};this.unique_=!!e.unique;this.array_=t?t:[];if(this.unique_){for(let t=0,e=this.array_.length;t<e;++t){this.assertUnique_(this.array_[t],t)}}this.updateLength_()}clear(){while(this.getLength()>0){this.pop()}}extend(t){for(let e=0,n=t.length;e<n;++e){this.push(t[e])}return this}forEach(t){const e=this.array_;for(let n=0,i=e.length;n<i;++n){t(e[n],n,e)}}getArray(){return this.array_}item(t){return this.array_[t]}getLength(){return this.get(G.LENGTH)}insertAt(t,e){if(t<0||t>this.getLength()){throw new Error("Index out of bounds: "+t)}if(this.unique_){this.assertUnique_(e)}this.array_.splice(t,0,e);this.updateLength_();this.dispatchEvent(new V(z.ADD,e,t))}pop(){return this.removeAt(this.getLength()-1)}push(t){if(this.unique_){this.assertUnique_(t)}const e=this.getLength();this.insertAt(e,t);return this.getLength()}remove(t){const e=this.array_;for(let n=0,i=e.length;n<i;++n){if(e[n]===t){return this.removeAt(n)}}return undefined}removeAt(t){if(t<0||t>=this.getLength()){return undefined}const e=this.array_[t];this.array_.splice(t,1);this.updateLength_();this.dispatchEvent(new V(z.REMOVE,e,t));return e}setAt(t,e){const n=this.getLength();if(t>=n){this.insertAt(t,e);return}if(t<0){throw new Error("Index out of bounds: "+t)}if(this.unique_){this.assertUnique_(e,t)}const i=this.array_[t];this.array_[t]=e;this.dispatchEvent(new V(z.REMOVE,i,t));this.dispatchEvent(new V(z.ADD,e,t))}updateLength_(){this.set(G.LENGTH,this.array_.length)}assertUnique_(t,e){for(let n=0,i=this.array_.length;n<i;++n){if(this.array_[n]===t&&n!==e){throw new Error("Duplicate item added to a unique collection")}}}}var j=K;var X={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",MAX_ZOOM:"maxZoom",MIN_ZOOM:"minZoom",SOURCE:"source",MAP:"map"};function W(t,e){if(!t){throw new Error(e)}}function Y(t,e,n){return Math.min(Math.max(t,e),n)}function Z(t,e,n,i,s,r){const o=s-n;const a=r-i;if(o!==0||a!==0){const l=((t-n)*o+(e-i)*a)/(o*o+a*a);if(l>1){n=s;i=r}else if(l>0){n+=o*l;i+=a*l}}return U(t,e,n,i)}function U(t,e,n,i){const s=n-t;const r=i-e;return s*s+r*r}function B(t){const e=t.length;for(let n=0;n<e;n++){let i=n;let s=Math.abs(t[n][n]);for(let r=n+1;r<e;r++){const e=Math.abs(t[r][n]);if(e>s){s=e;i=r}}if(s===0){return null}const r=t[i];t[i]=t[n];t[n]=r;for(let i=n+1;i<e;i++){const s=-t[i][n]/t[n][n];for(let r=n;r<e+1;r++){if(n==r){t[i][r]=0}else{t[i][r]+=s*t[n][r]}}}}const n=new Array(e);for(let i=e-1;i>=0;i--){n[i]=t[i][e]/t[i][i];for(let s=i-1;s>=0;s--){t[s][e]-=t[s][i]*n[i]}}return n}function H(t){return t*Math.PI/180}function q(t,e){const n=t%e;return n*e<0?n+e:n}function $(t,e,n){return t+n*(e-t)}function J(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}function Q(t,e){return Math.floor(J(t,e))}function tt(t,e){return Math.ceil(J(t,e))}class et extends k{constructor(t){super();this.on;this.once;this.un;this.background_=t.background;const e=Object.assign({},t);if(typeof t.properties==="object"){delete e.properties;Object.assign(e,t.properties)}e[X.OPACITY]=t.opacity!==undefined?t.opacity:1;W(typeof e[X.OPACITY]==="number","Layer opacity must be a number");e[X.VISIBLE]=t.visible!==undefined?t.visible:true;e[X.Z_INDEX]=t.zIndex;e[X.MAX_RESOLUTION]=t.maxResolution!==undefined?t.maxResolution:Infinity;e[X.MIN_RESOLUTION]=t.minResolution!==undefined?t.minResolution:0;e[X.MIN_ZOOM]=t.minZoom!==undefined?t.minZoom:-Infinity;e[X.MAX_ZOOM]=t.maxZoom!==undefined?t.maxZoom:Infinity;this.className_=e.className!==undefined?e.className:"ol-layer";delete e.className;this.setProperties(e);this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(t){const e=this.state_||{layer:this,managed:t===undefined?true:t};const n=this.getZIndex();e.opacity=Y(Math.round(this.getOpacity()*100)/100,0,1);e.visible=this.getVisible();e.extent=this.getExtent();e.zIndex=n===undefined&&!e.managed?Infinity:n;e.maxResolution=this.getMaxResolution();e.minResolution=Math.max(this.getMinResolution(),0);e.minZoom=this.getMinZoom();e.maxZoom=this.getMaxZoom();this.state_=e;return e}getLayersArray(t){return L()}getLayerStatesArray(t){return L()}getExtent(){return this.get(X.EXTENT)}getMaxResolution(){return this.get(X.MAX_RESOLUTION)}getMinResolution(){return this.get(X.MIN_RESOLUTION)}getMinZoom(){return this.get(X.MIN_ZOOM)}getMaxZoom(){return this.get(X.MAX_ZOOM)}getOpacity(){return this.get(X.OPACITY)}getSourceState(){return L()}getVisible(){return this.get(X.VISIBLE)}getZIndex(){return this.get(X.Z_INDEX)}setBackground(t){this.background_=t;this.changed()}setExtent(t){this.set(X.EXTENT,t)}setMaxResolution(t){this.set(X.MAX_RESOLUTION,t)}setMinResolution(t){this.set(X.MIN_RESOLUTION,t)}setMaxZoom(t){this.set(X.MAX_ZOOM,t)}setMinZoom(t){this.set(X.MIN_ZOOM,t)}setOpacity(t){W(typeof t==="number","Layer opacity must be a number");this.set(X.OPACITY,t)}setVisible(t){this.set(X.VISIBLE,t)}setZIndex(t){this.set(X.Z_INDEX,t)}disposeInternal(){if(this.state_){this.state_.layer=null;this.state_=null}super.disposeInternal()}}var nt=et;var it={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"};var st={ANIMATING:0,INTERACTING:1};var rt={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};const ot=42;const at=256;const lt={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class ht{constructor(t){this.code_=t.code;this.units_=t.units;this.extent_=t.extent!==undefined?t.extent:null;this.worldExtent_=t.worldExtent!==undefined?t.worldExtent:null;this.axisOrientation_=t.axisOrientation!==undefined?t.axisOrientation:"enu";this.global_=t.global!==undefined?t.global:false;this.canWrapX_=!!(this.global_&&this.extent_);this.getPointResolutionFunc_=t.getPointResolution;this.defaultTileGrid_=null;this.metersPerUnit_=t.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||lt[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(t){this.global_=t;this.canWrapX_=!!(t&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(t){this.defaultTileGrid_=t}setExtent(t){this.extent_=t;this.canWrapX_=!!(this.global_&&t)}setWorldExtent(t){this.worldExtent_=t}setGetPointResolution(t){this.getPointResolutionFunc_=t}getPointResolutionFunc(){return this.getPointResolutionFunc_}}var ct=ht;const ut=6378137;const dt=Math.PI*ut;const ft=[-dt,-dt,dt,dt];const gt=[-180,-85,180,85];const pt=ut*Math.log(Math.tan(Math.PI/2));class _t extends ct{constructor(t){super({code:t,units:"m",extent:ft,global:true,worldExtent:gt,getPointResolution:function(t,e){return t/Math.cosh(e[1]/ut)}})}}const mt=[new _t("EPSG:3857"),new _t("EPSG:102100"),new _t("EPSG:102113"),new _t("EPSG:900913"),new _t("http://www.opengis.net/def/crs/EPSG/0/3857"),new _t("http://www.opengis.net/gml/srs/epsg.xml#3857")];function yt(t,e,n){const i=t.length;n=n>1?n:2;if(e===undefined){if(n>2){e=t.slice()}else{e=new Array(i)}}for(let s=0;s<i;s+=n){e[s]=dt*t[s]/180;let n=ut*Math.log(Math.tan(Math.PI*(+t[s+1]+90)/360));if(n>pt){n=pt}else if(n<-pt){n=-pt}e[s+1]=n}return e}function Et(t,e,n){const i=t.length;n=n>1?n:2;if(e===undefined){if(n>2){e=t.slice()}else{e=new Array(i)}}for(let s=0;s<i;s+=n){e[s]=180*t[s]/dt;e[s+1]=360*Math.atan(Math.exp(t[s+1]/ut))/Math.PI-90}return e}const vt=6378137;const xt=[-180,-90,180,90];const wt=Math.PI*vt/180;class Ct extends ct{constructor(t,e){super({code:t,units:"degrees",extent:xt,axisOrientation:e,global:true,metersPerUnit:wt,worldExtent:xt})}}const bt=[new Ct("CRS:84"),new Ct("EPSG:4326","neu"),new Ct("urn:ogc:def:crs:OGC:1.3:CRS84"),new Ct("urn:ogc:def:crs:OGC:2:84"),new Ct("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new Ct("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Ct("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let Rt={};function Tt(t){return Rt[t]||Rt[t.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function It(t,e){Rt[t]=e}let St={};function Mt(t,e,n){const i=t.getCode();const s=e.getCode();if(!(i in St)){St[i]={}}St[i][s]=n}function At(t,e){let n;if(t in St&&e in St[t]){n=St[t][e]}return n}var Pt={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function Lt(t){const e=Gt();for(let n=0,i=t.length;n<i;++n){Zt(e,t[n])}return e}function Ot(t,e){if(e){e[0]=t[0];e[1]=t[1];e[2]=t[2];e[3]=t[3];return e}return t.slice()}function Dt(t,e,n){let i,s;if(e<t[0]){i=t[0]-e}else if(t[2]<e){i=e-t[2]}else{i=0}if(n<t[1]){s=t[1]-n}else if(t[3]<n){s=n-t[3]}else{s=0}return i*i+s*s}function Ft(t,e){return kt(t,e[0],e[1])}function Nt(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function kt(t,e,n){return t[0]<=e&&e<=t[2]&&t[1]<=n&&n<=t[3]}function zt(t,e){const n=t[0];const i=t[1];const s=t[2];const r=t[3];const o=e[0];const a=e[1];let l=Pt.UNKNOWN;if(o<n){l=l|Pt.LEFT}else if(o>s){l=l|Pt.RIGHT}if(a<i){l=l|Pt.BELOW}else if(a>r){l=l|Pt.ABOVE}if(l===Pt.UNKNOWN){l=Pt.INTERSECTING}return l}function Gt(){return[Infinity,Infinity,-Infinity,-Infinity]}function Vt(t,e,n,i,s){if(s){s[0]=t;s[1]=e;s[2]=n;s[3]=i;return s}return[t,e,n,i]}function Kt(t){return Vt(Infinity,Infinity,-Infinity,-Infinity,t)}function jt(t,e){const n=t[0];const i=t[1];return Vt(n,i,n,i,e)}function Xt(t,e,n,i,s){const r=Kt(s);return Ut(r,t,e,n,i)}function Wt(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function Yt(t,e){if(e[0]<t[0]){t[0]=e[0]}if(e[2]>t[2]){t[2]=e[2]}if(e[1]<t[1]){t[1]=e[1]}if(e[3]>t[3]){t[3]=e[3]}return t}function Zt(t,e){if(e[0]<t[0]){t[0]=e[0]}if(e[0]>t[2]){t[2]=e[0]}if(e[1]<t[1]){t[1]=e[1]}if(e[1]>t[3]){t[3]=e[1]}}function Ut(t,e,n,i,s){for(;n<i;n+=s){Bt(t,e[n],e[n+1])}return t}function Bt(t,e,n){t[0]=Math.min(t[0],e);t[1]=Math.min(t[1],n);t[2]=Math.max(t[2],e);t[3]=Math.max(t[3],n)}function Ht(t,e){let n;n=e($t(t));if(n){return n}n=e(Jt(t));if(n){return n}n=e(oe(t));if(n){return n}n=e(re(t));if(n){return n}return false}function qt(t){let e=0;if(!he(t)){e=ae(t)*ie(t)}return e}function $t(t){return[t[0],t[1]]}function Jt(t){return[t[2],t[1]]}function Qt(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function te(t,e){let n;if(e==="bottom-left"){n=$t(t)}else if(e==="bottom-right"){n=Jt(t)}else if(e==="top-left"){n=re(t)}else if(e==="top-right"){n=oe(t)}else{throw new Error("Invalid corner")}return n}function ee(t,e,n,i,s){const[r,o,a,l,h,c,u,d]=ne(t,e,n,i);return Vt(Math.min(r,a,h,u),Math.min(o,l,c,d),Math.max(r,a,h,u),Math.max(o,l,c,d),s)}function ne(t,e,n,i){const s=e*i[0]/2;const r=e*i[1]/2;const o=Math.cos(n);const a=Math.sin(n);const l=s*o;const h=s*a;const c=r*o;const u=r*a;const d=t[0];const f=t[1];return[d-l+u,f-h-c,d-l-u,f-h+c,d+l-u,f+h+c,d+l+u,f+h-c,d-l+u,f-h-c]}function ie(t){return t[3]-t[1]}function se(t,e,n){const i=n?n:Gt();if(le(t,e)){if(t[0]>e[0]){i[0]=t[0]}else{i[0]=e[0]}if(t[1]>e[1]){i[1]=t[1]}else{i[1]=e[1]}if(t[2]<e[2]){i[2]=t[2]}else{i[2]=e[2]}if(t[3]<e[3]){i[3]=t[3]}else{i[3]=e[3]}}else{Kt(i)}return i}function re(t){return[t[0],t[3]]}function oe(t){return[t[2],t[3]]}function ae(t){return t[2]-t[0]}function le(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function he(t){return t[2]<t[0]||t[3]<t[1]}function ce(t,e){if(e){e[0]=t[0];e[1]=t[1];e[2]=t[2];e[3]=t[3];return e}return t}function ue(t,e){const n=(t[2]-t[0])/2*(e-1);const i=(t[3]-t[1])/2*(e-1);t[0]-=n;t[2]+=n;t[1]-=i;t[3]+=i}function de(t,e,n){let i=false;const s=zt(t,e);const r=zt(t,n);if(s===Pt.INTERSECTING||r===Pt.INTERSECTING){i=true}else{const o=t[0];const a=t[1];const l=t[2];const h=t[3];const c=e[0];const u=e[1];const d=n[0];const f=n[1];const g=(f-u)/(d-c);let p,_;if(!!(r&Pt.ABOVE)&&!(s&Pt.ABOVE)){p=d-(f-h)/g;i=p>=o&&p<=l}if(!i&&!!(r&Pt.RIGHT)&&!(s&Pt.RIGHT)){_=f-(d-l)*g;i=_>=a&&_<=h}if(!i&&!!(r&Pt.BELOW)&&!(s&Pt.BELOW)){p=d-(f-a)/g;i=p>=o&&p<=l}if(!i&&!!(r&Pt.LEFT)&&!(s&Pt.LEFT)){_=f-(d-o)*g;i=_>=a&&_<=h}}return i}function fe(t,e){const n=e.getExtent();const i=Qt(t);if(e.canWrapX()&&(i[0]<n[0]||i[0]>=n[2])){const e=ae(n);const s=Math.floor((i[0]-n[0])/e);const r=s*e;t[0]-=r;t[2]-=r}return t}function ge(t,e,n){if(e.canWrapX()){const i=e.getExtent();if(!isFinite(t[0])||!isFinite(t[2])){return[[i[0],t[1],i[2],t[3]]]}fe(t,e);const s=ae(i);if(ae(t)>s&&!n){return[[i[0],t[1],i[2],t[3]]]}if(t[0]<i[0]){return[[t[0]+s,t[1],i[2],t[3]],[i[0],t[1],t[2],t[3]]]}if(t[2]>i[2]){return[[t[0],t[1],i[2],t[3]],[i[0],t[1],t[2]-s,t[3]]]}}return[t]}function pe(t,e){t[0]+=+e[0];t[1]+=+e[1];return t}function _e(t,e){let n=true;for(let i=t.length-1;i>=0;--i){if(t[i]!=e[i]){n=false;break}}return n}function me(t,e){const n=Math.cos(e);const i=Math.sin(e);const s=t[0]*n-t[1]*i;const r=t[1]*n+t[0]*i;t[0]=s;t[1]=r;return t}function ye(t,e){t[0]*=e;t[1]*=e;return t}function Ee(t,e){if(e.canWrapX()){const n=ae(e.getExtent());const i=ve(t,e,n);if(i){t[0]-=i*n}}return t}function ve(t,e,n){const i=e.getExtent();let s=0;if(e.canWrapX()&&(t[0]<i[0]||t[0]>i[2])){n=n||ae(i);s=Math.floor((t[0]-i[0])/n)}return s}const xe=6371008.8;function we(t,e,n){n=n||xe;const i=H(t[1]);const s=H(e[1]);const r=(s-i)/2;const o=H(e[0]-t[0])/2;const a=Math.sin(r)*Math.sin(r)+Math.sin(o)*Math.sin(o)*Math.cos(i)*Math.cos(s);return 2*n*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}const Ce={info:1,warn:2,error:3,none:4};let be=Ce.info;function Re(...t){if(be>Ce.warn){return}console.warn(...t)}let Te=true;function Ie(t){const e=t===undefined?true:t;Te=!e}function Se(t,e){if(e!==undefined){for(let n=0,i=t.length;n<i;++n){e[n]=t[n]}e=e}else{e=t.slice()}return e}function Me(t,e){if(e!==undefined&&t!==e){for(let n=0,i=t.length;n<i;++n){e[n]=t[n]}t=e}return t}function Ae(t){It(t.getCode(),t);Mt(t,t,Se)}function Pe(t){t.forEach(Ae)}function Le(t){return typeof t==="string"?Tt(t):t||null}function Oe(t,e,n,i){t=Le(t);let s;const r=t.getPointResolutionFunc();if(r){s=r(e,n);if(i&&i!==t.getUnits()){const e=t.getMetersPerUnit();if(e){s=s*e/lt[i]}}}else{const r=t.getUnits();if(r=="degrees"&&!i||i=="degrees"){s=e}else{const o=ze(t,Le("EPSG:4326"));if(o===Me&&r!=="degrees"){s=e*t.getMetersPerUnit()}else{let t=[n[0]-e/2,n[1],n[0]+e/2,n[1],n[0],n[1]-e/2,n[0],n[1]+e/2];t=o(t,t,2);const i=we(t.slice(0,2),t.slice(2,4));const r=we(t.slice(4,6),t.slice(6,8));s=(i+r)/2}const a=i?lt[i]:t.getMetersPerUnit();if(a!==undefined){s/=a}}}return s}function De(t){Pe(t);t.forEach((function(e){t.forEach((function(t){if(e!==t){Mt(e,t,Se)}}))}))}function Fe(t,e,n,i){t.forEach((function(t){e.forEach((function(e){Mt(t,e,n);Mt(e,t,i)}))}))}function Ne(t,e){if(!t){return Le(e)}if(typeof t==="string"){return Le(t)}return t}function ke(t,e){if(t===e){return true}const n=t.getUnits()===e.getUnits();if(t.getCode()===e.getCode()){return n}const i=ze(t,e);return i===Se&&n}function ze(t,e){const n=t.getCode();const i=e.getCode();let s=At(n,i);if(!s){s=Me}return s}function Ge(t,e){const n=Le(t);const i=Le(e);return ze(n,i)}function Ve(t,e,n){const i=Ge(e,n);return i(t,undefined,t.length)}function Ke(t,e){{return t}}function je(t,e){{if(Te&&!_e(t,[0,0])&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90){Te=false;Re("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")}return t}}function Xe(t,e){{return t}}function We(t,e){{return t}}function Ye(){De(mt);De(bt);Fe(bt,mt,yt,Et)}Ye();function Ze(t,e,n){return function(i,s,r,o,a){if(!i){return undefined}if(!s&&!e){return i}const l=e?0:r[0]*s;const h=e?0:r[1]*s;const c=a?a[0]:0;const u=a?a[1]:0;let d=t[0]+l/2+c;let f=t[2]-l/2+c;let g=t[1]+h/2+u;let p=t[3]-h/2+u;if(d>f){d=(f+d)/2;f=d}if(g>p){g=(p+g)/2;p=g}let _=Y(i[0],d,f);let m=Y(i[1],g,p);if(o&&n&&s){const t=30*s;_+=-t*Math.log(1+Math.max(0,d-i[0])/t)+t*Math.log(1+Math.max(0,i[0]-f)/t);m+=-t*Math.log(1+Math.max(0,g-i[1])/t)+t*Math.log(1+Math.max(0,i[1]-p)/t)}return[_,m]}}function Ue(t){return t}function Be(t,e,n,i){const s=ae(e)/n[0];const r=ie(e)/n[1];if(i){return Math.min(t,Math.max(s,r))}return Math.min(t,Math.min(s,r))}function He(t,e,n){let i=Math.min(t,e);const s=50;i*=Math.log(1+s*Math.max(0,t/e-1))/s+1;if(n){i=Math.max(i,n);i/=Math.log(1+s*Math.max(0,n/t-1))/s+1}return Y(i,n/2,e*2)}function qe(t,e,n,i){e=e!==undefined?e:true;return function(s,r,o,a){if(s!==undefined){const l=t[0];const h=t[t.length-1];const c=n?Be(l,n,o,i):l;if(a){if(!e){return Y(s,h,c)}return He(s,c,h)}const u=Math.min(c,s);const f=Math.floor(d(t,u,r));if(t[f]>c&&f<t.length-1){return t[f+1]}return t[f]}return undefined}}function $e(t,e,n,i,s,r){i=i!==undefined?i:true;n=n!==undefined?n:0;return function(o,a,l,h){if(o!==undefined){const c=s?Be(e,s,l,r):e;if(h){if(!i){return Y(o,n,c)}return He(o,c,n)}const u=1e-9;const d=Math.ceil(Math.log(e/c)/Math.log(t)-u);const f=-a*(.5-u)+.5;const g=Math.min(c,o);const p=Math.floor(Math.log(e/g)/Math.log(t)+f);const _=Math.max(d,p);const m=e/Math.pow(t,_);return Y(m,n,c)}return undefined}}function Je(t,e,n,i,s){n=n!==undefined?n:true;return function(r,o,a,l){if(r!==undefined){const o=i?Be(t,i,a,s):t;if(!n||!l){return Y(r,e,o)}return He(r,o,e)}return undefined}}function Qe(t){if(t!==undefined){return 0}return undefined}function tn(t){if(t!==undefined){return t}return undefined}function en(t){const e=2*Math.PI/t;return function(t,n){if(n){return t}if(t!==undefined){t=Math.floor(t/e+.5)*e;return t}return undefined}}function nn(t){const e=t===undefined?H(5):t;return function(t,n){if(n||t===undefined){return t}if(Math.abs(t)<=e){return 0}return t}}function sn(t){return Math.pow(t,3)}function rn(t){return 1-sn(1-t)}function on(t){return 3*t*t-2*t*t*t}function an(t){return t}new Array(6);function ln(){return[1,0,0,1,0,0]}function hn(t,e){const n=e[0];const i=e[1];e[0]=t[0]*n+t[2]*i+t[4];e[1]=t[1]*n+t[3]*i+t[5];return e}function cn(t,e,n,i,s,r,o,a){const l=Math.sin(r);const h=Math.cos(r);t[0]=i*h;t[1]=s*l;t[2]=-i*l;t[3]=s*h;t[4]=o*i*h-a*i*l+e;t[5]=o*s*l+a*s*h+n;return t}function un(t,e){const n=dn(e);W(n!==0,"Transformation matrix cannot be inverted");const i=e[0];const s=e[1];const r=e[2];const o=e[3];const a=e[4];const l=e[5];t[0]=o/n;t[1]=-s/n;t[2]=-r/n;t[3]=i/n;t[4]=(r*l-o*a)/n;t[5]=-(i*l-s*a)/n;return t}function dn(t){return t[0]*t[3]-t[1]*t[2]}const fn=[1e6,1e6,1e6,1e6,2,2];function gn(t){const e="matrix("+t.map(((t,e)=>Math.round(t*fn[e])/fn[e])).join(", ")+")";return e}function pn(t,e,n,i,s,r){r=r?r:[];let o=0;for(let a=e;a<n;a+=i){const e=t[a];const n=t[a+1];r[o++]=s[0]*e+s[2]*n+s[4];r[o++]=s[1]*e+s[3]*n+s[5]}if(r&&r.length!=o){r.length=o}return r}function _n(t,e,n,i,s,r,o){o=o?o:[];const a=Math.cos(s);const l=Math.sin(s);const h=r[0];const c=r[1];let u=0;for(let s=e;s<n;s+=i){const e=t[s]-h;const n=t[s+1]-c;o[u++]=h+e*a-n*l;o[u++]=c+e*l+n*a;for(let e=s+2;e<s+i;++e){o[u++]=t[e]}}if(o&&o.length!=u){o.length=u}return o}function mn(t,e,n,i,s,r,o,a){a=a?a:[];const l=o[0];const h=o[1];let c=0;for(let o=e;o<n;o+=i){const e=t[o]-l;const n=t[o+1]-h;a[c++]=l+s*e;a[c++]=h+r*n;for(let e=o+2;e<o+i;++e){a[c++]=t[e]}}if(a&&a.length!=c){a.length=c}return a}function yn(t,e,n,i,s,r,o){o=o?o:[];let a=0;for(let l=e;l<n;l+=i){o[a++]=t[l]+s;o[a++]=t[l+1]+r;for(let e=l+2;e<l+i;++e){o[a++]=t[e]}}if(o&&o.length!=a){o.length=a}return o}const En=ln();class vn extends k{constructor(){super();this.extent_=Gt();this.extentRevision_=-1;this.simplifiedGeometryMaxMinSquaredTolerance=0;this.simplifiedGeometryRevision=0;this.simplifyTransformedInternal=E(((t,e,n)=>{if(!n){return this.getSimplifiedGeometry(e)}const i=this.clone();i.applyTransform(n);return i.getSimplifiedGeometry(e)}))}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return L()}closestPointXY(t,e,n,i){return L()}containsXY(t,e){const n=this.getClosestPoint([t,e]);return n[0]===t&&n[1]===e}getClosestPoint(t,e){e=e?e:[NaN,NaN];this.closestPointXY(t[0],t[1],e,Infinity);return e}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return L()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const t=this.computeExtent(this.extent_);if(isNaN(t[0])||isNaN(t[1])){Kt(t)}this.extentRevision_=this.getRevision()}return ce(this.extent_,t)}rotate(t,e){L()}scale(t,e,n){L()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return L()}getType(){return L()}applyTransform(t){L()}intersectsExtent(t){return L()}translate(t,e){L()}transform(t,e){const n=Le(t);const i=n.getUnits()=="tile-pixels"?function(t,i,s){const r=n.getExtent();const o=n.getWorldExtent();const a=ie(o)/ie(r);cn(En,o[0],o[3],a,-a,0,0,0);pn(t,0,t.length,s,En,i);return Ge(n,e)(t,i,s)}:Ge(n,e);this.applyTransform(i);return this}}var xn=vn;class wn extends xn{constructor(){super();this.layout="XY";this.stride=2;this.flatCoordinates}computeExtent(t){return Xt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return L()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()){this.simplifiedGeometryMaxMinSquaredTolerance=0;this.simplifiedGeometryRevision=this.getRevision()}if(t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance){return this}const e=this.getSimplifiedGeometryInternal(t);const n=e.getFlatCoordinates();if(n.length<this.flatCoordinates.length){return e}this.simplifiedGeometryMaxMinSquaredTolerance=t;return this}getSimplifiedGeometryInternal(t){return this}getStride(){return this.stride}setFlatCoordinates(t,e){this.stride=bn(t);this.layout=t;this.flatCoordinates=e}setCoordinates(t,e){L()}setLayout(t,e,n){let i;if(t){i=bn(t)}else{for(let t=0;t<n;++t){if(e.length===0){this.layout="XY";this.stride=2;return}e=e[0]}i=e.length;t=Cn(i)}this.layout=t;this.stride=i}applyTransform(t){if(this.flatCoordinates){t(this.flatCoordinates,this.flatCoordinates,this.stride);this.changed()}}rotate(t,e){const n=this.getFlatCoordinates();if(n){const i=this.getStride();_n(n,0,n.length,i,t,e,n);this.changed()}}scale(t,e,n){if(e===undefined){e=t}if(!n){n=Qt(this.getExtent())}const i=this.getFlatCoordinates();if(i){const s=this.getStride();mn(i,0,i.length,s,t,e,n,i);this.changed()}}translate(t,e){const n=this.getFlatCoordinates();if(n){const i=this.getStride();yn(n,0,n.length,i,t,e,n);this.changed()}}}function Cn(t){let e;if(t==2){e="XY"}else if(t==3){e="XYZ"}else if(t==4){e="XYZM"}return e}function bn(t){let e;if(t=="XY"){e=2}else if(t=="XYZ"||t=="XYM"){e=3}else if(t=="XYZM"){e=4}return e}var Rn=wn;function Tn(t,e,n,i,s,r,o){const a=t[e];const l=t[e+1];const h=t[n]-a;const c=t[n+1]-l;let u;if(h===0&&c===0){u=e}else{const d=((s-a)*h+(r-l)*c)/(h*h+c*c);if(d>1){u=n}else if(d>0){for(let s=0;s<i;++s){o[s]=$(t[e+s],t[n+s],d)}o.length=i;return}else{u=e}}for(let e=0;e<i;++e){o[e]=t[u+e]}o.length=i}function In(t,e,n,i,s){let r=t[e];let o=t[e+1];for(e+=i;e<n;e+=i){const n=t[e];const i=t[e+1];const a=U(r,o,n,i);if(a>s){s=a}r=n;o=i}return s}function Sn(t,e,n,i,s){for(let r=0,o=n.length;r<o;++r){const o=n[r];s=In(t,e,o,i,s);e=o}return s}function Mn(t,e,n,i,s,r,o,a,l,h,c){if(e==n){return h}let u,d;if(s===0){d=U(o,a,t[e],t[e+1]);if(d<h){for(u=0;u<i;++u){l[u]=t[e+u]}l.length=i;return d}return h}c=c?c:[NaN,NaN];let f=e+i;while(f<n){Tn(t,f-i,f,i,o,a,c);d=U(o,a,c[0],c[1]);if(d<h){h=d;for(u=0;u<i;++u){l[u]=c[u]}l.length=i;f+=i}else{f+=i*Math.max((Math.sqrt(d)-Math.sqrt(h))/s|0,1)}}if(r){Tn(t,n-i,e,i,o,a,c);d=U(o,a,c[0],c[1]);if(d<h){h=d;for(u=0;u<i;++u){l[u]=c[u]}l.length=i}}return h}function An(t,e,n,i,s,r,o,a,l,h,c){c=c?c:[NaN,NaN];for(let u=0,d=n.length;u<d;++u){const d=n[u];h=Mn(t,e,d,i,s,r,o,a,l,h,c);e=d}return h}function Pn(t,e,n,i){for(let i=0,s=n.length;i<s;++i){t[e++]=n[i]}return e}function Ln(t,e,n,i){for(let s=0,r=n.length;s<r;++s){const r=n[s];for(let n=0;n<i;++n){t[e++]=r[n]}}return e}function On(t,e,n,i,s){s=s?s:[];let r=0;for(let o=0,a=n.length;o<a;++o){const a=Ln(t,e,n[o],i);s[r++]=a;e=a}s.length=r;return s}function Dn(t,e,n,i,s,r,o){const a=(n-e)/i;if(a<3){for(;e<n;e+=i){r[o++]=t[e];r[o++]=t[e+1]}return o}const l=new Array(a);l[0]=1;l[a-1]=1;const h=[e,n-i];let c=0;while(h.length>0){const n=h.pop();const r=h.pop();let o=0;const a=t[r];const u=t[r+1];const d=t[n];const f=t[n+1];for(let e=r+i;e<n;e+=i){const n=t[e];const i=t[e+1];const s=Z(n,i,a,u,d,f);if(s>o){c=e;o=s}}if(o>s){l[(c-e)/i]=1;if(r+i<c){h.push(r,c)}if(c+i<n){h.push(c,n)}}}for(let n=0;n<a;++n){if(l[n]){r[o++]=t[e+n*i];r[o++]=t[e+n*i+1]}}return o}function Fn(t,e){return e*Math.round(t/e)}function Nn(t,e,n,i,s,r,o){if(e==n){return o}let a=Fn(t[e],s);let l=Fn(t[e+1],s);e+=i;r[o++]=a;r[o++]=l;let h,c;do{h=Fn(t[e],s);c=Fn(t[e+1],s);e+=i;if(e==n){r[o++]=h;r[o++]=c;return o}}while(h==a&&c==l);while(e<n){const n=Fn(t[e],s);const u=Fn(t[e+1],s);e+=i;if(n==h&&u==c){continue}const d=h-a;const f=c-l;const g=n-a;const p=u-l;if(d*p==f*g&&(d<0&&g<d||d==g||d>0&&g>d)&&(f<0&&p<f||f==p||f>0&&p>f)){h=n;c=u;continue}r[o++]=h;r[o++]=c;a=h;l=c;h=n;c=u}r[o++]=h;r[o++]=c;return o}function kn(t,e,n,i,s,r,o,a){for(let l=0,h=n.length;l<h;++l){const h=n[l];o=Nn(t,e,h,i,s,r,o);a.push(o);e=h}return o}function zn(t,e,n,i,s){s=s!==undefined?s:[];let r=0;for(let o=e;o<n;o+=i){s[r++]=t.slice(o,o+i)}s.length=r;return s}function Gn(t,e,n,i,s){s=s!==undefined?s:[];let r=0;for(let o=0,a=n.length;o<a;++o){const a=n[o];s[r++]=zn(t,e,a,i,s[r]);e=a}s.length=r;return s}function Vn(t,e,n,i){let s=0;const r=t[n-i];const o=t[n-i+1];let a=0;let l=0;for(;e<n;e+=i){const n=t[e]-r;const i=t[e+1]-o;s+=l*n-a*i;a=n;l=i}return s/2}function Kn(t,e,n,i){let s=0;for(let r=0,o=n.length;r<o;++r){const o=n[r];s+=Vn(t,e,o,i);e=o}return s}class jn extends Rn{constructor(t,e){super();this.maxDelta_=-1;this.maxDeltaRevision_=-1;if(e!==undefined&&!Array.isArray(t[0])){this.setFlatCoordinates(e,t)}else{this.setCoordinates(t,e)}}clone(){return new jn(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,e,n,i){if(i<Dt(this.getExtent(),t,e)){return i}if(this.maxDeltaRevision_!=this.getRevision()){this.maxDelta_=Math.sqrt(In(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0));this.maxDeltaRevision_=this.getRevision()}return Mn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,true,t,e,n,i)}getArea(){return Vn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return zn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){const e=[];e.length=Dn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0);return new jn(e,"XY")}getType(){return"LinearRing"}intersectsExtent(t){return false}setCoordinates(t,e){this.setLayout(e,t,1);if(!this.flatCoordinates){this.flatCoordinates=[]}this.flatCoordinates.length=Ln(this.flatCoordinates,0,t,this.stride);this.changed()}}var Xn=jn;class Wn extends Rn{constructor(t,e){super();this.setCoordinates(t,e)}clone(){const t=new Wn(this.flatCoordinates.slice(),this.layout);t.applyProperties(this);return t}closestPointXY(t,e,n,i){const s=this.flatCoordinates;const r=U(t,e,s[0],s[1]);if(r<i){const t=this.stride;for(let e=0;e<t;++e){n[e]=s[e]}n.length=t;return r}return i}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(t){return jt(this.flatCoordinates,t)}getType(){return"Point"}intersectsExtent(t){return kt(t,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(t,e){this.setLayout(e,t,0);if(!this.flatCoordinates){this.flatCoordinates=[]}this.flatCoordinates.length=Pn(this.flatCoordinates,0,t,this.stride);this.changed()}}var Yn=Wn;function Zn(t,e,n,i,s){const r=Ht(s,(function(s){return!Un(t,e,n,i,s[0],s[1])}));return!r}function Un(t,e,n,i,s,r){let o=0;let a=t[n-i];let l=t[n-i+1];for(;e<n;e+=i){const n=t[e];const i=t[e+1];if(l<=r){if(i>r&&(n-a)*(r-l)-(s-a)*(i-l)>0){o++}}else if(i<=r&&(n-a)*(r-l)-(s-a)*(i-l)<0){o--}a=n;l=i}return o!==0}function Bn(t,e,n,i,s,r){if(n.length===0){return false}if(!Un(t,e,n[0],i,s,r)){return false}for(let e=1,o=n.length;e<o;++e){if(Un(t,n[e-1],n[e],i,s,r)){return false}}return true}function Hn(t,e,n,i,s,r,o){let a,l,h,c,d,f,g;const p=s[r+1];const _=[];for(let s=0,r=n.length;s<r;++s){const r=n[s];c=t[r-i];f=t[r-i+1];for(a=e;a<r;a+=i){d=t[a];g=t[a+1];if(p<=f&&g<=p||f<=p&&p<=g){h=(p-f)/(g-f)*(d-c)+c;_.push(h)}c=d;f=g}}let m=NaN;let y=-Infinity;_.sort(u);c=_[0];for(a=1,l=_.length;a<l;++a){d=_[a];const s=Math.abs(d-c);if(s>y){h=(c+d)/2;if(Bn(t,e,n,i,h,p)){m=h;y=s}}c=d}if(isNaN(m)){m=s[r]}if(o){o.push(m,p,y);return o}return[m,p,y]}function qn(t,e,n,i,s){let r;e+=i;for(;e<n;e+=i){r=s(t.slice(e-i,e),t.slice(e,e+i));if(r){return r}}return false}function $n(t,e,n,i,s){const r=Ut(Gt(),t,e,n,i);if(!le(s,r)){return false}if(Nt(s,r)){return true}if(r[0]>=s[0]&&r[2]<=s[2]){return true}if(r[1]>=s[1]&&r[3]<=s[3]){return true}return qn(t,e,n,i,(function(t,e){return de(s,t,e)}))}function Jn(t,e,n,i,s){if($n(t,e,n,i,s)){return true}if(Un(t,e,n,i,s[0],s[1])){return true}if(Un(t,e,n,i,s[0],s[3])){return true}if(Un(t,e,n,i,s[2],s[1])){return true}if(Un(t,e,n,i,s[2],s[3])){return true}return false}function Qn(t,e,n,i,s){if(!Jn(t,e,n[0],i,s)){return false}if(n.length===1){return true}for(let e=1,r=n.length;e<r;++e){if(Zn(t,n[e-1],n[e],i,s)){if(!$n(t,n[e-1],n[e],i,s)){return false}}}return true}function ti(t,e,n,i){while(e<n-i){for(let s=0;s<i;++s){const r=t[e+s];t[e+s]=t[n-i+s];t[n-i+s]=r}e+=i;n-=i}}function ei(t,e,n,i){let s=0;let r=t[n-i];let o=t[n-i+1];for(;e<n;e+=i){const n=t[e];const i=t[e+1];s+=(n-r)*(i+o);r=n;o=i}return s===0?undefined:s>0}function ni(t,e,n,i,s){s=s!==undefined?s:false;for(let r=0,o=n.length;r<o;++r){const o=n[r];const a=ei(t,e,o,i);if(r===0){if(s&&a||!s&&!a){return false}}else{if(s&&!a||!s&&a){return false}}e=o}return true}function ii(t,e,n,i,s){s=s!==undefined?s:false;for(let r=0,o=n.length;r<o;++r){const o=n[r];const a=ei(t,e,o,i);const l=r===0?s&&a||!s&&!a:s&&!a||!s&&a;if(l){ti(t,e,o,i)}e=o}return e}class si extends Rn{constructor(t,e,n){super();this.ends_=[];this.flatInteriorPointRevision_=-1;this.flatInteriorPoint_=null;this.maxDelta_=-1;this.maxDeltaRevision_=-1;this.orientedRevision_=-1;this.orientedFlatCoordinates_=null;if(e!==undefined&&n){this.setFlatCoordinates(e,t);this.ends_=n}else{this.setCoordinates(t,e)}}appendLinearRing(t){if(!this.flatCoordinates){this.flatCoordinates=t.getFlatCoordinates().slice()}else{f(this.flatCoordinates,t.getFlatCoordinates())}this.ends_.push(this.flatCoordinates.length);this.changed()}clone(){const t=new si(this.flatCoordinates.slice(),this.layout,this.ends_.slice());t.applyProperties(this);return t}closestPointXY(t,e,n,i){if(i<Dt(this.getExtent(),t,e)){return i}if(this.maxDeltaRevision_!=this.getRevision()){this.maxDelta_=Math.sqrt(Sn(this.flatCoordinates,0,this.ends_,this.stride,0));this.maxDeltaRevision_=this.getRevision()}return An(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,true,t,e,n,i)}containsXY(t,e){return Bn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)}getArea(){return Kn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(t){let e;if(t!==undefined){e=this.getOrientedFlatCoordinates().slice();ii(e,0,this.ends_,this.stride,t)}else{e=this.flatCoordinates}return Gn(e,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const t=Qt(this.getExtent());this.flatInteriorPoint_=Hn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0);this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new Yn(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(t){if(t<0||this.ends_.length<=t){return null}return new Xn(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLinearRings(){const t=this.layout;const e=this.flatCoordinates;const n=this.ends_;const i=[];let s=0;for(let r=0,o=n.length;r<o;++r){const o=n[r];const a=new Xn(e.slice(s,o),t);i.push(a);s=o}return i}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;if(ni(t,0,this.ends_,this.stride)){this.orientedFlatCoordinates_=t}else{this.orientedFlatCoordinates_=t.slice();this.orientedFlatCoordinates_.length=ii(this.orientedFlatCoordinates_,0,this.ends_,this.stride)}this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[];const n=[];e.length=kn(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),e,0,n);return new si(e,"XY",n)}getType(){return"Polygon"}intersectsExtent(t){return Qn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2);if(!this.flatCoordinates){this.flatCoordinates=[]}const n=On(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=n.length===0?0:n[n.length-1];this.changed()}}function ri(t){if(he(t)){throw new Error("Cannot create polygon from empty extent")}const e=t[0];const n=t[1];const i=t[2];const s=t[3];const r=[e,n,e,s,i,s,i,n,e,n];return new si(r,"XY",[r.length])}const oi=0;class ai extends k{constructor(t){super();this.on;this.once;this.un;t=Object.assign({},t);this.hints_=[0,0];this.animations_=[];this.updateAnimationKey_;this.projection_=Ne(t.projection,"EPSG:3857");this.viewportSize_=[100,100];this.targetCenter_=null;this.targetResolution_;this.targetRotation_;this.nextCenter_=null;this.nextResolution_;this.nextRotation_;this.cancelAnchor_=undefined;if(t.projection){Ie()}if(t.center){t.center=je(t.center,this.projection_)}if(t.extent){t.extent=We(t.extent,this.projection_)}this.applyOptions_(t)}applyOptions_(t){const e=Object.assign({},t);for(const t in rt){delete e[t]}this.setProperties(e,true);const n=ci(t);this.maxResolution_=n.maxResolution;this.minResolution_=n.minResolution;this.zoomFactor_=n.zoomFactor;this.resolutions_=t.resolutions;this.padding_=t.padding;this.minZoom_=n.minZoom;const i=hi(t);const s=n.constraint;const r=ui(t);this.constraints_={center:i,resolution:s,rotation:r};this.setRotation(t.rotation!==undefined?t.rotation:0);this.setCenterInternal(t.center!==undefined?t.center:null);if(t.resolution!==undefined){this.setResolution(t.resolution)}else if(t.zoom!==undefined){this.setZoom(t.zoom)}}get padding(){return this.padding_}set padding(t){let e=this.padding_;this.padding_=t;const n=this.getCenterInternal();if(n){const i=t||[0,0,0,0];e=e||[0,0,0,0];const s=this.getResolution();const r=s/2*(i[3]-e[3]+e[1]-i[1]);const o=s/2*(i[0]-e[0]+e[2]-i[2]);this.setCenterInternal([n[0]+r,n[1]-o])}}getUpdatedOptions_(t){const e=this.getProperties();if(e.resolution!==undefined){e.resolution=this.getResolution()}else{e.zoom=this.getZoom()}e.center=this.getCenterInternal();e.rotation=this.getRotation();return Object.assign({},e,t)}animate(t){if(this.isDef()&&!this.getAnimating()){this.resolveConstraints(0)}const e=new Array(arguments.length);for(let t=0;t<e.length;++t){let n=arguments[t];if(n.center){n=Object.assign({},n);n.center=je(n.center,this.getProjection())}if(n.anchor){n=Object.assign({},n);n.anchor=je(n.anchor,this.getProjection())}e[t]=n}this.animateInternal.apply(this,e)}animateInternal(t){let e=arguments.length;let n;if(e>1&&typeof arguments[e-1]==="function"){n=arguments[e-1];--e}let i=0;for(;i<e&&!this.isDef();++i){const t=arguments[i];if(t.center){this.setCenterInternal(t.center)}if(t.zoom!==undefined){this.setZoom(t.zoom)}else if(t.resolution){this.setResolution(t.resolution)}if(t.rotation!==undefined){this.setRotation(t.rotation)}}if(i===e){if(n){li(n,true)}return}let s=Date.now();let r=this.targetCenter_.slice();let o=this.targetResolution_;let a=this.targetRotation_;const l=[];for(;i<e;++i){const t=arguments[i];const e={start:s,complete:false,anchor:t.anchor,duration:t.duration!==undefined?t.duration:1e3,easing:t.easing||on,callback:n};if(t.center){e.sourceCenter=r;e.targetCenter=t.center.slice();r=e.targetCenter}if(t.zoom!==undefined){e.sourceResolution=o;e.targetResolution=this.getResolutionForZoom(t.zoom);o=e.targetResolution}else if(t.resolution){e.sourceResolution=o;e.targetResolution=t.resolution;o=e.targetResolution}if(t.rotation!==undefined){e.sourceRotation=a;const n=q(t.rotation-a+Math.PI,2*Math.PI)-Math.PI;e.targetRotation=a+n;a=e.targetRotation}if(di(e)){e.complete=true}else{s+=e.duration}l.push(e)}this.animations_.push(l);this.setHint(st.ANIMATING,1);this.updateAnimations_()}getAnimating(){return this.hints_[st.ANIMATING]>0}getInteracting(){return this.hints_[st.INTERACTING]>0}cancelAnimations(){this.setHint(st.ANIMATING,-this.hints_[st.ANIMATING]);let t;for(let e=0,n=this.animations_.length;e<n;++e){const n=this.animations_[e];if(n[0].callback){li(n[0].callback,false)}if(!t){for(let e=0,i=n.length;e<i;++e){const i=n[e];if(!i.complete){t=i.anchor;break}}}}this.animations_.length=0;this.cancelAnchor_=t;this.nextCenter_=null;this.nextResolution_=NaN;this.nextRotation_=NaN}updateAnimations_(){if(this.updateAnimationKey_!==undefined){cancelAnimationFrame(this.updateAnimationKey_);this.updateAnimationKey_=undefined}if(!this.getAnimating()){return}const t=Date.now();let e=false;for(let n=this.animations_.length-1;n>=0;--n){const i=this.animations_[n];let s=true;for(let n=0,r=i.length;n<r;++n){const r=i[n];if(r.complete){continue}const o=t-r.start;let a=r.duration>0?o/r.duration:1;if(a>=1){r.complete=true;a=1}else{s=false}const l=r.easing(a);if(r.sourceCenter){const t=r.sourceCenter[0];const e=r.sourceCenter[1];const n=r.targetCenter[0];const i=r.targetCenter[1];this.nextCenter_=r.targetCenter;const s=t+l*(n-t);const o=e+l*(i-e);this.targetCenter_=[s,o]}if(r.sourceResolution&&r.targetResolution){const t=l===1?r.targetResolution:r.sourceResolution+l*(r.targetResolution-r.sourceResolution);if(r.anchor){const e=this.getViewportSize_(this.getRotation());const n=this.constraints_.resolution(t,0,e,true);this.targetCenter_=this.calculateCenterZoom(n,r.anchor)}this.nextResolution_=r.targetResolution;this.targetResolution_=t;this.applyTargetState_(true)}if(r.sourceRotation!==undefined&&r.targetRotation!==undefined){const t=l===1?q(r.targetRotation+Math.PI,2*Math.PI)-Math.PI:r.sourceRotation+l*(r.targetRotation-r.sourceRotation);if(r.anchor){const e=this.constraints_.rotation(t,true);this.targetCenter_=this.calculateCenterRotate(e,r.anchor)}this.nextRotation_=r.targetRotation;this.targetRotation_=t}this.applyTargetState_(true);e=true;if(!r.complete){break}}if(s){this.animations_[n]=null;this.setHint(st.ANIMATING,-1);this.nextCenter_=null;this.nextResolution_=NaN;this.nextRotation_=NaN;const t=i[0].callback;if(t){li(t,true)}}}this.animations_=this.animations_.filter(Boolean);if(e&&this.updateAnimationKey_===undefined){this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this))}}calculateCenterRotate(t,e){let n;const i=this.getCenterInternal();if(i!==undefined){n=[i[0]-e[0],i[1]-e[1]];me(n,t-this.getRotation());pe(n,e)}return n}calculateCenterZoom(t,e){let n;const i=this.getCenterInternal();const s=this.getResolution();if(i!==undefined&&s!==undefined){const r=e[0]-t*(e[0]-i[0])/s;const o=e[1]-t*(e[1]-i[1])/s;n=[r,o]}return n}getViewportSize_(t){const e=this.viewportSize_;if(t){const n=e[0];const i=e[1];return[Math.abs(n*Math.cos(t))+Math.abs(i*Math.sin(t)),Math.abs(n*Math.sin(t))+Math.abs(i*Math.cos(t))]}return e}setViewportSize(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100];if(!this.getAnimating()){this.resolveConstraints(0)}}getCenter(){const t=this.getCenterInternal();if(!t){return t}return Ke(t,this.getProjection())}getCenterInternal(){return this.get(rt.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(t){if(t!==undefined){t[0]=this.hints_[0];t[1]=this.hints_[1];return t}return this.hints_.slice()}calculateExtent(t){const e=this.calculateExtentInternal(t);return Xe(e,this.getProjection())}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();const e=this.getCenterInternal();W(e,"The view center is not defined");const n=this.getResolution();W(n!==undefined,"The view resolution is not defined");const i=this.getRotation();W(i!==undefined,"The view rotation is not defined");return ee(e,n,i,t)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))}setConstrainResolution(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))}getProjection(){return this.projection_}getResolution(){return this.get(rt.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,e){return this.getResolutionForExtentInternal(We(t,this.getProjection()),e)}getResolutionForExtentInternal(t,e){e=e||this.getViewportSizeMinusPadding_();const n=ae(t)/e[0];const i=ie(t)/e[1];return Math.max(n,i)}getResolutionForValueFunction(t){t=t||2;const e=this.getConstrainedResolution(this.maxResolution_);const n=this.minResolution_;const i=Math.log(e/n)/Math.log(t);return function(n){const s=e/Math.pow(t,n*i);return s}}getRotation(){return this.get(rt.ROTATION)}getValueForResolutionFunction(t){const e=Math.log(t||2);const n=this.getConstrainedResolution(this.maxResolution_);const i=this.minResolution_;const s=Math.log(n/i)/e;return function(t){const i=Math.log(n/t)/e/s;return i}}getViewportSizeMinusPadding_(t){let e=this.getViewportSize_(t);const n=this.padding_;if(n){e=[e[0]-n[1]-n[3],e[1]-n[0]-n[2]]}return e}getState(){const t=this.getProjection();const e=this.getResolution();const n=this.getRotation();let i=this.getCenterInternal();const s=this.padding_;if(s){const t=this.getViewportSizeMinusPadding_();i=fi(i,this.getViewportSize_(),[t[0]/2+s[3],t[1]/2+s[0]],e,n)}return{center:i.slice(0),projection:t!==undefined?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:n,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let t;const e=this.getResolution();if(e!==undefined){t=this.getZoomForResolution(e)}return t}getZoomForResolution(t){let e=this.minZoom_||0;let n,i;if(this.resolutions_){const s=d(this.resolutions_,t,1);e=s;n=this.resolutions_[s];if(s==this.resolutions_.length-1){i=2}else{i=n/this.resolutions_[s+1]}}else{n=this.maxResolution_;i=this.zoomFactor_}return e+Math.log(n/t)/Math.log(i)}getResolutionForZoom(t){if(this.resolutions_){if(this.resolutions_.length<=1){return 0}const e=Y(Math.floor(t),0,this.resolutions_.length-2);const n=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(n,Y(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}fit(t,e){let n;W(Array.isArray(t)||typeof t.getSimplifiedGeometry==="function","Invalid extent or geometry provided as `geometry`");if(Array.isArray(t)){W(!he(t),"Cannot fit empty extent provided as `geometry`");const e=We(t,this.getProjection());n=ri(e)}else if(t.getType()==="Circle"){const e=We(t.getExtent(),this.getProjection());n=ri(e);n.rotate(this.getRotation(),Qt(e))}else{{n=t}}this.fitInternal(n,e)}rotatedExtentForGeometry(t){const e=this.getRotation();const n=Math.cos(e);const i=Math.sin(-e);const s=t.getFlatCoordinates();const r=t.getStride();let o=+Infinity;let a=+Infinity;let l=-Infinity;let h=-Infinity;for(let t=0,e=s.length;t<e;t+=r){const e=s[t]*n-s[t+1]*i;const r=s[t]*i+s[t+1]*n;o=Math.min(o,e);a=Math.min(a,r);l=Math.max(l,e);h=Math.max(h,r)}return[o,a,l,h]}fitInternal(t,e){e=e||{};let n=e.size;if(!n){n=this.getViewportSizeMinusPadding_()}const i=e.padding!==undefined?e.padding:[0,0,0,0];const s=e.nearest!==undefined?e.nearest:false;let r;if(e.minResolution!==undefined){r=e.minResolution}else if(e.maxZoom!==undefined){r=this.getResolutionForZoom(e.maxZoom)}else{r=0}const o=this.rotatedExtentForGeometry(t);let a=this.getResolutionForExtentInternal(o,[n[0]-i[1]-i[3],n[1]-i[0]-i[2]]);a=isNaN(a)?r:Math.max(a,r);a=this.getConstrainedResolution(a,s?0:1);const l=this.getRotation();const h=Math.sin(l);const c=Math.cos(l);const u=Qt(o);u[0]+=(i[1]-i[3])/2*a;u[1]+=(i[0]-i[2])/2*a;const d=u[0]*c-u[1]*h;const f=u[1]*c+u[0]*h;const g=this.getConstrainedCenter([d,f],a);const p=e.callback?e.callback:y;if(e.duration!==undefined){this.animateInternal({resolution:a,center:g,duration:e.duration,easing:e.easing},p)}else{this.targetResolution_=a;this.targetCenter_=g;this.applyTargetState_(false,true);li(p,true)}}centerOn(t,e,n){this.centerOnInternal(je(t,this.getProjection()),e,n)}centerOnInternal(t,e,n){this.setCenterInternal(fi(t,e,n,this.getResolution(),this.getRotation()))}calculateCenterShift(t,e,n,i){let s;const r=this.padding_;if(r&&t){const o=this.getViewportSizeMinusPadding_(-n);const a=fi(t,i,[o[0]/2+r[3],o[1]/2+r[0]],e,n);s=[t[0]-a[0],t[1]-a[1]]}return s}isDef(){return!!this.getCenterInternal()&&this.getResolution()!==undefined}adjustCenter(t){const e=Ke(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])}adjustCenterInternal(t){const e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])}adjustResolution(t,e){e=e&&je(e,this.getProjection());this.adjustResolutionInternal(t,e)}adjustResolutionInternal(t,e){const n=this.getAnimating()||this.getInteracting();const i=this.getViewportSize_(this.getRotation());const s=this.constraints_.resolution(this.targetResolution_*t,0,i,n);if(e){this.targetCenter_=this.calculateCenterZoom(s,e)}this.targetResolution_*=t;this.applyTargetState_()}adjustZoom(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)}adjustRotation(t,e){if(e){e=je(e,this.getProjection())}this.adjustRotationInternal(t,e)}adjustRotationInternal(t,e){const n=this.getAnimating()||this.getInteracting();const i=this.constraints_.rotation(this.targetRotation_+t,n);if(e){this.targetCenter_=this.calculateCenterRotate(i,e)}this.targetRotation_+=t;this.applyTargetState_()}setCenter(t){this.setCenterInternal(t?je(t,this.getProjection()):t)}setCenterInternal(t){this.targetCenter_=t;this.applyTargetState_()}setHint(t,e){this.hints_[t]+=e;this.changed();return this.hints_[t]}setResolution(t){this.targetResolution_=t;this.applyTargetState_()}setRotation(t){this.targetRotation_=t;this.applyTargetState_()}setZoom(t){this.setResolution(this.getResolutionForZoom(t))}applyTargetState_(t,e){const n=this.getAnimating()||this.getInteracting()||e;const i=this.constraints_.rotation(this.targetRotation_,n);const s=this.getViewportSize_(i);const r=this.constraints_.resolution(this.targetResolution_,0,s,n);const o=this.constraints_.center(this.targetCenter_,r,s,n,this.calculateCenterShift(this.targetCenter_,r,i,s));if(this.get(rt.ROTATION)!==i){this.set(rt.ROTATION,i)}if(this.get(rt.RESOLUTION)!==r){this.set(rt.RESOLUTION,r);this.set("zoom",this.getZoom(),true)}if(!o||!this.get(rt.CENTER)||!_e(this.get(rt.CENTER),o)){this.set(rt.CENTER,o)}if(this.getAnimating()&&!t){this.cancelAnimations()}this.cancelAnchor_=undefined}resolveConstraints(t,e,n){t=t!==undefined?t:200;const i=e||0;const s=this.constraints_.rotation(this.targetRotation_);const r=this.getViewportSize_(s);const o=this.constraints_.resolution(this.targetResolution_,i,r);const a=this.constraints_.center(this.targetCenter_,o,r,false,this.calculateCenterShift(this.targetCenter_,o,s,r));if(t===0&&!this.cancelAnchor_){this.targetResolution_=o;this.targetRotation_=s;this.targetCenter_=a;this.applyTargetState_();return}n=n||(t===0?this.cancelAnchor_:undefined);this.cancelAnchor_=undefined;if(this.getResolution()!==o||this.getRotation()!==s||!this.getCenterInternal()||!_e(this.getCenterInternal(),a)){if(this.getAnimating()){this.cancelAnimations()}this.animateInternal({rotation:s,center:a,resolution:o,duration:t,easing:rn,anchor:n})}}beginInteraction(){this.resolveConstraints(0);this.setHint(st.INTERACTING,1)}endInteraction(t,e,n){n=n&&je(n,this.getProjection());this.endInteractionInternal(t,e,n)}endInteractionInternal(t,e,n){if(!this.getInteracting()){return}this.setHint(st.INTERACTING,-1);this.resolveConstraints(t,e,n)}getConstrainedCenter(t,e){const n=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),n)}getConstrainedZoom(t,e){const n=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(n,e))}getConstrainedResolution(t,e){e=e||0;const n=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,e,n)}}function li(t,e){setTimeout((function(){t(e)}),0)}function hi(t){if(t.extent!==undefined){const e=t.smoothExtentConstraint!==undefined?t.smoothExtentConstraint:true;return Ze(t.extent,t.constrainOnlyCenter,e)}const e=Ne(t.projection,"EPSG:3857");if(t.multiWorld!==true&&e.isGlobal()){const t=e.getExtent().slice();t[0]=-Infinity;t[2]=Infinity;return Ze(t,false,false)}return Ue}function ci(t){let e;let n;let i;const s=28;const r=2;let o=t.minZoom!==undefined?t.minZoom:oi;let a=t.maxZoom!==undefined?t.maxZoom:s;const l=t.zoomFactor!==undefined?t.zoomFactor:r;const h=t.multiWorld!==undefined?t.multiWorld:false;const c=t.smoothResolutionConstraint!==undefined?t.smoothResolutionConstraint:true;const u=t.showFullExtent!==undefined?t.showFullExtent:false;const d=Ne(t.projection,"EPSG:3857");const f=d.getExtent();let g=t.constrainOnlyCenter;let p=t.extent;if(!h&&!p&&d.isGlobal()){g=false;p=f}if(t.resolutions!==undefined){const s=t.resolutions;n=s[o];i=s[a]!==undefined?s[a]:s[s.length-1];if(t.constrainResolution){e=qe(s,c,!g&&p,u)}else{e=Je(n,i,c,!g&&p,u)}}else{const h=!f?360*lt.degrees/d.getMetersPerUnit():Math.max(ae(f),ie(f));const _=h/at/Math.pow(r,oi);const m=_/Math.pow(r,s-oi);n=t.maxResolution;if(n!==undefined){o=0}else{n=_/Math.pow(l,o)}i=t.minResolution;if(i===undefined){if(t.maxZoom!==undefined){if(t.maxResolution!==undefined){i=n/Math.pow(l,a)}else{i=_/Math.pow(l,a)}}else{i=m}}a=o+Math.floor(Math.log(n/i)/Math.log(l));i=n/Math.pow(l,a-o);if(t.constrainResolution){e=$e(l,n,i,c,!g&&p,u)}else{e=Je(n,i,c,!g&&p,u)}}return{constraint:e,maxResolution:n,minResolution:i,minZoom:o,zoomFactor:l}}function ui(t){const e=t.enableRotation!==undefined?t.enableRotation:true;if(e){const e=t.constrainRotation;if(e===undefined||e===true){return nn()}if(e===false){return tn}if(typeof e==="number"){return en(e)}return tn}return Qe}function di(t){if(t.sourceCenter&&t.targetCenter){if(!_e(t.sourceCenter,t.targetCenter)){return false}}if(t.sourceResolution!==t.targetResolution){return false}if(t.sourceRotation!==t.targetRotation){return false}return true}function fi(t,e,n,i,s){const r=Math.cos(-s);let o=Math.sin(-s);let a=t[0]*r-t[1]*o;let l=t[1]*r+t[0]*o;a+=(e[0]/2-n[0])*i;l+=(n[1]-e[1]/2)*i;o=-o;const h=a*r-l*o;const c=l*r+a*o;return[h,c]}var gi=ai;class pi extends nt{constructor(t){const e=Object.assign({},t);delete e.source;super(e);this.on;this.once;this.un;this.mapPrecomposeKey_=null;this.mapRenderKey_=null;this.sourceChangeKey_=null;this.renderer_=null;this.sourceReady_=false;this.rendered=false;if(t.render){this.render=t.render}if(t.map){this.setMap(t.map)}this.addChangeListener(X.SOURCE,this.handleSourcePropertyChange_);const n=t.source?t.source:null;this.setSource(n)}getLayersArray(t){t=t?t:[];t.push(this);return t}getLayerStatesArray(t){t=t?t:[];t.push(this.getLayerState());return t}getSource(){return this.get(X.SOURCE)||null}getRenderSource(){return this.getSource()}getSourceState(){const t=this.getSource();return!t?"undefined":t.getState()}handleSourceChange_(){this.changed();if(this.sourceReady_||this.getSource().getState()!=="ready"){return}this.sourceReady_=true;this.dispatchEvent("sourceready")}handleSourcePropertyChange_(){if(this.sourceChangeKey_){S(this.sourceChangeKey_);this.sourceChangeKey_=null}this.sourceReady_=false;const t=this.getSource();if(t){this.sourceChangeKey_=T(t,R.CHANGE,this.handleSourceChange_,this);if(t.getState()==="ready"){this.sourceReady_=true;setTimeout((()=>{this.dispatchEvent("sourceready")}),0)}}this.changed()}getFeatures(t){if(!this.renderer_){return Promise.resolve([])}return this.renderer_.getFeatures(t)}getData(t){if(!this.renderer_||!this.rendered){return null}return this.renderer_.getData(t)}isVisible(t){let e;const n=this.getMapInternal();if(!t&&n){t=n.getView()}if(t instanceof gi){e={viewState:t.getState(),extent:t.calculateExtent()}}else{e=t}if(!e.layerStatesArray&&n){e.layerStatesArray=n.getLayerGroup().getLayerStatesArray()}let i;if(e.layerStatesArray){i=e.layerStatesArray.find((t=>t.layer===this))}else{i=this.getLayerState()}const s=this.getExtent();return _i(i,e.viewState)&&(!s||le(s,e.extent))}getAttributions(t){if(!this.isVisible(t)){return[]}const e=this.getSource()?.getAttributions();if(!e){return[]}const n=t instanceof gi?t.getViewStateAndExtent():t;let i=e(n);if(!Array.isArray(i)){i=[i]}return i}render(t,e){const n=this.getRenderer();if(n.prepareFrame(t)){this.rendered=true;return n.renderFrame(t,e)}return null}unrender(){this.rendered=false}getDeclutter(){return undefined}renderDeclutter(t,e){}renderDeferred(t){const e=this.getRenderer();if(!e){return}e.renderDeferred(t)}setMapInternal(t){if(!t){this.unrender()}this.set(X.MAP,t)}getMapInternal(){return this.get(X.MAP)}setMap(t){if(this.mapPrecomposeKey_){S(this.mapPrecomposeKey_);this.mapPrecomposeKey_=null}if(!t){this.changed()}if(this.mapRenderKey_){S(this.mapRenderKey_);this.mapRenderKey_=null}if(t){this.mapPrecomposeKey_=T(t,it.PRECOMPOSE,(t=>{const e=t;const n=e.frameState.layerStatesArray;const i=this.getLayerState(false);W(!n.some((function(t){return t.layer===i.layer})),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both.");n.push(i)}));this.mapRenderKey_=T(this,R.CHANGE,t.render,t);this.changed()}}setSource(t){this.set(X.SOURCE,t)}getRenderer(){if(!this.renderer_){this.renderer_=this.createRenderer()}return this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}disposeInternal(){if(this.renderer_){this.renderer_.dispose();delete this.renderer_}this.setSource(null);super.disposeInternal()}}function _i(t,e){if(!t.visible){return false}const n=e.resolution;if(n<t.minResolution||n>=t.maxResolution){return false}const i=e.zoom;return i>t.minZoom&&i<=t.maxZoom}var mi=pi;function yi(t,e,n,i,s){Ei(t,e,n||0,i||t.length-1,s||xi)}function Ei(t,e,n,i,s){while(i>n){if(i-n>600){var r=i-n+1;var o=e-n+1;var a=Math.log(r);var l=.5*Math.exp(2*a/3);var h=.5*Math.sqrt(a*l*(r-l)/r)*(o-r/2<0?-1:1);var c=Math.max(n,Math.floor(e-o*l/r+h));var u=Math.min(i,Math.floor(e+(r-o)*l/r+h));Ei(t,e,c,u,s)}var d=t[e];var f=n;var g=i;vi(t,n,e);if(s(t[i],d)>0)vi(t,n,i);while(f<g){vi(t,f,g);f++;g--;while(s(t[f],d)<0)f++;while(s(t[g],d)>0)g--}if(s(t[n],d)===0)vi(t,n,g);else{g++;vi(t,g,i)}if(g<=e)n=g+1;if(e<=g)i=g-1}}function vi(t,e,n){var i=t[e];t[e]=t[n];t[n]=i}function xi(t,e){return t<e?-1:t>e?1:0}class wi{constructor(t=9){this._maxEntries=Math.max(4,t);this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4));this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const n=[];if(!Di(t,e))return n;const i=this.toBBox;const s=[];while(e){for(let r=0;r<e.children.length;r++){const o=e.children[r];const a=e.leaf?i(o):o;if(Di(t,a)){if(e.leaf)n.push(o);else if(Oi(t,a))this._all(o,n);else s.push(o)}}e=s.pop()}return n}collides(t){let e=this.data;if(!Di(t,e))return false;const n=[];while(e){for(let i=0;i<e.children.length;i++){const s=e.children[i];const r=e.leaf?this.toBBox(s):s;if(Di(t,r)){if(e.leaf||Oi(t,r))return true;n.push(s)}}e=n.pop()}return false}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let e=0;e<t.length;e++){this.insert(t[e])}return this}let e=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length){this.data=e}else if(this.data.height===e.height){this._splitRoot(this.data,e)}else{if(this.data.height<e.height){const t=this.data;this.data=e;e=t}this._insert(e,this.data.height-e.height-1,true)}return this}insert(t){if(t)this._insert(t,this.data.height-1);return this}clear(){this.data=Fi([]);return this}remove(t,e){if(!t)return this;let n=this.data;const i=this.toBBox(t);const s=[];const r=[];let o,a,l;while(n||s.length){if(!n){n=s.pop();a=s[s.length-1];o=r.pop();l=true}if(n.leaf){const i=Ci(t,n.children,e);if(i!==-1){n.children.splice(i,1);s.push(n);this._condense(s);return this}}if(!l&&!n.leaf&&Oi(n,i)){s.push(n);r.push(o);o=0;a=n;n=n.children[0]}else if(a){o++;n=a.children[o];l=false}else n=null}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){this.data=t;return this}_all(t,e){const n=[];while(t){if(t.leaf)e.push(...t.children);else n.push(...t.children);t=n.pop()}return e}_build(t,e,n,i){const s=n-e+1;let r=this._maxEntries;let o;if(s<=r){o=Fi(t.slice(e,n+1));bi(o,this.toBBox);return o}if(!i){i=Math.ceil(Math.log(s)/Math.log(r));r=Math.ceil(s/Math.pow(r,i-1))}o=Fi([]);o.leaf=false;o.height=i;const a=Math.ceil(s/r);const l=a*Math.ceil(Math.sqrt(r));Ni(t,e,n,l,this.compareMinX);for(let s=e;s<=n;s+=l){const e=Math.min(s+l-1,n);Ni(t,s,e,a,this.compareMinY);for(let n=s;n<=e;n+=a){const s=Math.min(n+a-1,e);o.children.push(this._build(t,n,s,i-1))}}bi(o,this.toBBox);return o}_chooseSubtree(t,e,n,i){while(true){i.push(e);if(e.leaf||i.length-1===n)break;let s=Infinity;let r=Infinity;let o;for(let n=0;n<e.children.length;n++){const i=e.children[n];const a=Mi(i);const l=Pi(t,i)-a;if(l<r){r=l;s=a<s?a:s;o=i}else if(l===r){if(a<s){s=a;o=i}}}e=o||e.children[0]}return e}_insert(t,e,n){const i=n?t:this.toBBox(t);const s=[];const r=this._chooseSubtree(i,this.data,e,s);r.children.push(t);Ti(r,i);while(e>=0){if(s[e].children.length>this._maxEntries){this._split(s,e);e--}else break}this._adjustParentBBoxes(i,s,e)}_split(t,e){const n=t[e];const i=n.children.length;const s=this._minEntries;this._chooseSplitAxis(n,s,i);const r=this._chooseSplitIndex(n,s,i);const o=Fi(n.children.splice(r,n.children.length-r));o.height=n.height;o.leaf=n.leaf;bi(n,this.toBBox);bi(o,this.toBBox);if(e)t[e-1].children.push(o);else this._splitRoot(n,o)}_splitRoot(t,e){this.data=Fi([t,e]);this.data.height=t.height+1;this.data.leaf=false;bi(this.data,this.toBBox)}_chooseSplitIndex(t,e,n){let i;let s=Infinity;let r=Infinity;for(let o=e;o<=n-e;o++){const e=Ri(t,0,o,this.toBBox);const a=Ri(t,o,n,this.toBBox);const l=Li(e,a);const h=Mi(e)+Mi(a);if(l<s){s=l;i=o;r=h<r?h:r}else if(l===s){if(h<r){r=h;i=o}}}return i||n-e}_chooseSplitAxis(t,e,n){const i=t.leaf?this.compareMinX:Ii;const s=t.leaf?this.compareMinY:Si;const r=this._allDistMargin(t,e,n,i);const o=this._allDistMargin(t,e,n,s);if(r<o)t.children.sort(i)}_allDistMargin(t,e,n,i){t.children.sort(i);const s=this.toBBox;const r=Ri(t,0,e,s);const o=Ri(t,n-e,n,s);let a=Ai(r)+Ai(o);for(let i=e;i<n-e;i++){const e=t.children[i];Ti(r,t.leaf?s(e):e);a+=Ai(r)}for(let i=n-e-1;i>=e;i--){const e=t.children[i];Ti(o,t.leaf?s(e):e);a+=Ai(o)}return a}_adjustParentBBoxes(t,e,n){for(let i=n;i>=0;i--){Ti(e[i],t)}}_condense(t){for(let e=t.length-1,n;e>=0;e--){if(t[e].children.length===0){if(e>0){n=t[e-1].children;n.splice(n.indexOf(t[e]),1)}else this.clear()}else bi(t[e],this.toBBox)}}}function Ci(t,e,n){if(!n)return e.indexOf(t);for(let i=0;i<e.length;i++){if(n(t,e[i]))return i}return-1}function bi(t,e){Ri(t,0,t.children.length,e,t)}function Ri(t,e,n,i,s){if(!s)s=Fi(null);s.minX=Infinity;s.minY=Infinity;s.maxX=-Infinity;s.maxY=-Infinity;for(let r=e;r<n;r++){const e=t.children[r];Ti(s,t.leaf?i(e):e)}return s}function Ti(t,e){t.minX=Math.min(t.minX,e.minX);t.minY=Math.min(t.minY,e.minY);t.maxX=Math.max(t.maxX,e.maxX);t.maxY=Math.max(t.maxY,e.maxY);return t}function Ii(t,e){return t.minX-e.minX}function Si(t,e){return t.minY-e.minY}function Mi(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function Ai(t){return t.maxX-t.minX+(t.maxY-t.minY)}function Pi(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function Li(t,e){const n=Math.max(t.minX,e.minX);const i=Math.max(t.minY,e.minY);const s=Math.min(t.maxX,e.maxX);const r=Math.min(t.maxY,e.maxY);return Math.max(0,s-n)*Math.max(0,r-i)}function Oi(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function Di(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function Fi(t){return{children:t,height:1,leaf:true,minX:Infinity,minY:Infinity,maxX:-Infinity,maxY:-Infinity}}function Ni(t,e,n,i,s){const r=[e,n];while(r.length){n=r.pop();e=r.pop();if(n-e<=i)continue;const o=e+Math.ceil((n-e)/i/2)*i;yi(t,o,e,n,s);r.push(e,o,o,n)}}var ki={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function zi(t){return t[0]>0&&t[1]>0}function Gi(t,e,n){if(n===undefined){n=[0,0]}n[0]=t[0]*e+.5|0;n[1]=t[1]*e+.5|0;return n}function Vi(t,e){if(Array.isArray(t)){return t}if(e===undefined){e=[t,t]}else{e[0]=t;e[1]=t}return e}class Ki{constructor(t){this.opacity_=t.opacity;this.rotateWithView_=t.rotateWithView;this.rotation_=t.rotation;this.scale_=t.scale;this.scaleArray_=Vi(t.scale);this.displacement_=t.displacement;this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new Ki({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return L()}getImage(t){return L()}getHitDetectionImage(){return L()}getPixelRatio(t){return 1}getImageState(){return L()}getImageSize(){return L()}getOrigin(){return L()}getSize(){return L()}setDisplacement(t){this.displacement_=t}setOpacity(t){this.opacity_=t}setRotateWithView(t){this.rotateWithView_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t;this.scaleArray_=Vi(t)}listenImageChange(t){L()}load(){L()}unlistenImageChange(t){L()}ready(){return Promise.resolve()}}var ji=Ki;var Xi={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};var Wi={name:"xyz",min:[0,0,0],channel:["X","Y","Z"],alias:["XYZ","ciexyz","cie1931"]};Wi.whitepoint={2:{A:[109.85,100,35.585],C:[98.074,100,118.232],D50:[96.422,100,82.521],D55:[95.682,100,92.149],D65:[95.045592705167,100,108.9057750759878],D75:[94.972,100,122.638],F2:[99.187,100,67.395],F7:[95.044,100,108.755],F11:[100.966,100,64.37],E:[100,100,100]},10:{A:[111.144,100,35.2],C:[97.285,100,116.145],D50:[96.72,100,81.427],D55:[95.799,100,90.926],D65:[94.811,100,107.304],D75:[94.416,100,120.641],F2:[103.28,100,69.026],F7:[95.792,100,107.687],F11:[103.866,100,65.627],E:[100,100,100]}};Wi.max=Wi.whitepoint[2].D65;Wi.rgb=function(t,e){e=e||Wi.whitepoint[2].E;var n=t[0]/e[0],i=t[1]/e[1],s=t[2]/e[2],r,o,a;r=n*3.240969941904521+i*-1.537383177570093+s*-.498610760293;o=n*-.96924363628087+i*1.87596750150772+s*.041555057407175;a=n*.055630079696993+i*-.20397695888897+s*1.056971514242878;r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:r=r*12.92;o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o=o*12.92;a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a=a*12.92;r=Math.min(Math.max(0,r),1);o=Math.min(Math.max(0,o),1);a=Math.min(Math.max(0,a),1);return[r*255,o*255,a*255]};Xi.xyz=function(t,e){var n=t[0]/255,i=t[1]/255,s=t[2]/255;n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92;s=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92;var r=n*.41239079926595+i*.35758433938387+s*.18048078840183;var o=n*.21263900587151+i*.71516867876775+s*.072192315360733;var a=n*.019330818715591+i*.11919477979462+s*.95053215224966;e=e||Wi.whitepoint[2].E;return[r*e[0],o*e[1],a*e[2]]};var Yi={name:"luv",min:[0,-134,-140],max:[100,224,122],channel:["lightness","u","v"],alias:["LUV","cieluv","cie1976"],xyz:function(t,e,n){var i,s,r,o,a,l,h,c,u,d,f,g,p;r=t[0],o=t[1],a=t[2];if(r===0)return[0,0,0];var _=.0011070564598794539;e=e||"D65";n=n||2;u=Wi.whitepoint[n][e][0];d=Wi.whitepoint[n][e][1];f=Wi.whitepoint[n][e][2];g=4*u/(u+15*d+3*f);p=9*d/(u+15*d+3*f);i=o/(13*r)+g||0;s=a/(13*r)+p||0;h=r>8?d*Math.pow((r+16)/116,3):d*r*_;l=h*9*i/(4*s)||0;c=h*(12-3*i-20*s)/(4*s)||0;return[l,h,c]}};Wi.luv=function(t,e,n){var i,s,r,o,a,l,h,c,u,d,f,g,p;var _=.008856451679035631;var m=903.2962962962961;e=e||"D65";n=n||2;u=Wi.whitepoint[n][e][0];d=Wi.whitepoint[n][e][1];f=Wi.whitepoint[n][e][2];g=4*u/(u+15*d+3*f);p=9*d/(u+15*d+3*f);l=t[0],h=t[1],c=t[2];i=4*l/(l+15*h+3*c)||0;s=9*h/(l+15*h+3*c)||0;var y=h/d;r=y<=_?m*y:116*Math.pow(y,1/3)-16;o=13*r*(i-g);a=13*r*(s-p);return[r,o,a]};var Zi={name:"lchuv",channel:["lightness","chroma","hue"],alias:["LCHuv","cielchuv"],min:[0,0,0],max:[100,100,360],luv:function(t){var e=t[0],n=t[1],i=t[2],s,r,o;o=i/360*2*Math.PI;s=n*Math.cos(o);r=n*Math.sin(o);return[e,s,r]},xyz:function(t){return Yi.xyz(Zi.luv(t))}};Yi.lchuv=function(t){var e=t[0],n=t[1],i=t[2];var s=Math.sqrt(n*n+i*i);var r=Math.atan2(i,n);var o=r*360/2/Math.PI;if(o<0){o+=360}return[e,s,o]};Wi.lchuv=function(t){return Yi.lchuv(Wi.luv(t))};var Ui={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};var Bi={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function Hi(t){var e,n=[],i=1,s;if(typeof t==="number"){return{space:"rgb",values:[t>>>16,(t&65280)>>>8,t&255],alpha:1}}if(typeof t==="number")return{space:"rgb",values:[t>>>16,(t&65280)>>>8,t&255],alpha:1};t=String(t).toLowerCase();if(Ui[t]){n=Ui[t].slice();s="rgb"}else if(t==="transparent"){i=0;s="rgb";n=[0,0,0]}else if(t[0]==="#"){var r=t.slice(1);var o=r.length;var a=o<=4;i=1;if(a){n=[parseInt(r[0]+r[0],16),parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16)];if(o===4){i=parseInt(r[3]+r[3],16)/255}}else{n=[parseInt(r[0]+r[1],16),parseInt(r[2]+r[3],16),parseInt(r[4]+r[5],16)];if(o===8){i=parseInt(r[6]+r[7],16)/255}}if(!n[0])n[0]=0;if(!n[1])n[1]=0;if(!n[2])n[2]=0;s="rgb"}else if(e=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(t)){var l=e[1];s=l.replace(/a$/,"");var h=s==="cmyk"?4:s==="gray"?1:3;n=e[2].trim().split(/\s*[,\/]\s*|\s+/);if(s==="color")s=n.shift();n=n.map((function(t,e){if(t[t.length-1]==="%"){t=parseFloat(t)/100;if(e===3)return t;if(s==="rgb")return t*255;if(s[0]==="h")return t*100;if(s[0]==="l"&&!e)return t*100;if(s==="lab")return t*125;if(s==="lch")return e<2?t*150:t*360;if(s[0]==="o"&&!e)return t;if(s==="oklab")return t*.4;if(s==="oklch")return e<2?t*.4:t*360;return t}if(s[e]==="h"||e===2&&s[s.length-1]==="h"){if(Bi[t]!==undefined)return Bi[t];if(t.endsWith("deg"))return parseFloat(t);if(t.endsWith("turn"))return parseFloat(t)*360;if(t.endsWith("grad"))return parseFloat(t)*360/400;if(t.endsWith("rad"))return parseFloat(t)*180/Math.PI}if(t==="none")return 0;return parseFloat(t)}));i=n.length>h?n.pop():1}else if(/[0-9](?:\s|\/|,)/.test(t)){n=t.match(/([0-9]+)/g).map((function(t){return parseFloat(t)}));s=t.match(/([a-z])/gi)?.join("")?.toLowerCase()||"rgb"}return{space:s,values:n,alpha:i}}var qi={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e=t[0]/360,n=t[1]/100,i=t[2]/100,s,r,o,a,l,h=0;if(n===0)return l=i*255,[l,l,l];r=i<.5?i*(1+n):i+n-i*n;s=2*i-r;a=[0,0,0];for(;h<3;){o=e+1/3*-(h-1);o<0?o++:o>1&&o--;l=6*o<1?s+(r-s)*6*o:2*o<1?r:3*o<2?s+(r-s)*(2/3-o)*6:s;a[h++]=l*255}return a}};Xi.hsl=function(t){var e=t[0]/255,n=t[1]/255,i=t[2]/255,s=Math.min(e,n,i),r=Math.max(e,n,i),o=r-s,a,l,h;if(r===s){a=0}else if(e===r){a=(n-i)/o}else if(n===r){a=2+(i-e)/o}else if(i===r){a=4+(e-n)/o}a=Math.min(a*60,360);if(a<0){a+=360}h=(s+r)/2;if(r===s){l=0}else if(h<=.5){l=o/(r+s)}else{l=o/(2-r-s)}return[a,l*100,h*100]};function $i(t){if(Array.isArray(t)&&t.raw)t=String.raw(...arguments);if(t instanceof Number)t=+t;var e;var n=Hi(t);if(!n.space)return[];const i=n.space[0]==="h"?qi.min:Xi.min;const s=n.space[0]==="h"?qi.max:Xi.max;e=Array(3);e[0]=Math.min(Math.max(n.values[0],i[0]),s[0]);e[1]=Math.min(Math.max(n.values[1],i[1]),s[1]);e[2]=Math.min(Math.max(n.values[2],i[2]),s[2]);if(n.space[0]==="h"){e=qi.rgb(e)}e.push(Math.min(Math.max(n.alpha,0),1));return e}function Ji(t){if(typeof t==="string"){return t}return ls(t)}const Qi=1024;const ts={};let es=0;function ns(t){if(t.length===4){return t}const e=t.slice();e[3]=1;return e}function is(t){const e=Wi.lchuv(Xi.xyz(t));e[3]=t[3];return e}function ss(t){const e=Wi.rgb(Zi.xyz(t));e[3]=t[3];return e}function rs(t){if(ts.hasOwnProperty(t)){return ts[t]}if(es>=Qi){let t=0;for(const e in ts){if((t++&3)===0){delete ts[e];--es}}}const e=$i(t);if(e.length!==4){throw new Error('failed to parse "'+t+'" as color')}for(const n of e){if(isNaN(n)){throw new Error('failed to parse "'+t+'" as color')}}as(e);ts[t]=e;++es;return e}function os(t){if(Array.isArray(t)){return t}return rs(t)}function as(t){t[0]=Y(t[0]+.5|0,0,255);t[1]=Y(t[1]+.5|0,0,255);t[2]=Y(t[2]+.5|0,0,255);t[3]=Y(t[3],0,1);return t}function ls(t){let e=t[0];if(e!=(e|0)){e=e+.5|0}let n=t[1];if(n!=(n|0)){n=n+.5|0}let i=t[2];if(i!=(i|0)){i=i+.5|0}const s=t[3]===undefined?1:Math.round(t[3]*1e3)/1e3;return"rgba("+e+","+n+","+i+","+s+")"}const hs=typeof navigator!=="undefined"&&typeof navigator.userAgent!=="undefined"?navigator.userAgent.toLowerCase():"";const cs=hs.includes("firefox");const us=hs.includes("safari")&&!hs.includes("chrom");us&&(hs.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(hs));const ds=hs.includes("webkit")&&!hs.includes("edge");const fs=hs.includes("macintosh");const gs=typeof devicePixelRatio!=="undefined"?devicePixelRatio:1;const ps=typeof WorkerGlobalScope!=="undefined"&&typeof OffscreenCanvas!=="undefined"&&self instanceof WorkerGlobalScope;const _s=typeof Image!=="undefined"&&Image.prototype.decode;const ms=function(){let t=false;try{const e=Object.defineProperty({},"passive",{get:function(){t=true}});window.addEventListener("_",null,e);window.removeEventListener("_",null,e)}catch(t){}return t}();function ys(t,e,n,i){let s;if(n&&n.length){s=n.shift()}else if(ps){s=new OffscreenCanvas(t||300,e||300)}else{s=document.createElement("canvas")}if(t){s.width=t}if(e){s.height=e}return s.getContext("2d",i)}let Es;function vs(){if(!Es){Es=ys(1,1)}return Es}function xs(t){const e=t.canvas;e.width=1;e.height=1;t.clearRect(0,0,1,1)}function ws(t){let e=t.offsetWidth;const n=getComputedStyle(t);e+=parseInt(n.marginLeft,10)+parseInt(n.marginRight,10);return e}function Cs(t){let e=t.offsetHeight;const n=getComputedStyle(t);e+=parseInt(n.marginTop,10)+parseInt(n.marginBottom,10);return e}function bs(t,e){const n=e.parentNode;if(n){n.replaceChild(t,e)}}function Rs(t){while(t.lastChild){t.lastChild.remove()}}function Ts(t,e){const n=t.childNodes;for(let i=0;true;++i){const s=n[i];const r=e[i];if(!s&&!r){break}if(s===r){continue}if(!s){t.appendChild(r);continue}if(!r){t.removeChild(s);--i;continue}t.insertBefore(r,s)}}function Is(t,e,n){const i=t;let s=true;let r=false;let o=false;const a=[I(i,R.LOAD,(function(){o=true;if(!r){e()}}))];if(i.src&&_s){r=true;i.decode().then((function(){if(s){e()}})).catch((function(t){if(s){if(o){e()}else{n()}}}))}else{a.push(I(i,R.ERROR,n))}return function t(){s=false;a.forEach(S)}}function Ss(t,e){return new Promise(((n,i)=>{function s(){o();n(t)}function r(){o();i(new Error("Image load error"))}function o(){t.removeEventListener("load",s);t.removeEventListener("error",r)}t.addEventListener("load",s);t.addEventListener("error",r);if(e){t.src=e}}))}function Ms(t,e){if(e){t.src=e}return t.src&&_s?new Promise(((e,n)=>t.decode().then((()=>e(t))).catch((i=>t.complete&&t.width?e(t):n(i))))):Ss(t)}class As{constructor(){this.cache_={};this.patternCache_={};this.cacheSize_=0;this.maxCacheSize_=32}clear(){this.cache_={};this.patternCache_={};this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let t=0;for(const e in this.cache_){const n=this.cache_[e];if((t++&3)===0&&!n.hasListener()){delete this.cache_[e];delete this.patternCache_[e];--this.cacheSize_}}}}get(t,e,n){const i=Ps(t,e,n);return i in this.cache_?this.cache_[i]:null}getPattern(t,e,n){const i=Ps(t,e,n);return i in this.patternCache_?this.patternCache_[i]:null}set(t,e,n,i,s){const r=Ps(t,e,n);const o=r in this.cache_;this.cache_[r]=i;if(s){if(i.getImageState()===ki.IDLE){i.load()}if(i.getImageState()===ki.LOADING){i.ready().then((()=>{this.patternCache_[r]=vs().createPattern(i.getImage(1),"repeat")}))}else{this.patternCache_[r]=vs().createPattern(i.getImage(1),"repeat")}}if(!o){++this.cacheSize_}}setSize(t){this.maxCacheSize_=t;this.expire()}}function Ps(t,e,n){const i=n?os(n):"null";return e+":"+t+":"+i}const Ls=new As;let Os=null;class Ds extends b{constructor(t,e,n,i,s){super();this.hitDetectionImage_=null;this.image_=t;this.crossOrigin_=n;this.canvas_={};this.color_=s;this.imageState_=i===undefined?ki.IDLE:i;this.size_=t&&t.width&&t.height?[t.width,t.height]:null;this.src_=e;this.tainted_;this.ready_=null}initializeImage_(){this.image_=new Image;if(this.crossOrigin_!==null){this.image_.crossOrigin=this.crossOrigin_}}isTainted_(){if(this.tainted_===undefined&&this.imageState_===ki.LOADED){if(!Os){Os=ys(1,1,undefined,{willReadFrequently:true})}Os.drawImage(this.image_,0,0);try{Os.getImageData(0,0,1,1);this.tainted_=false}catch(t){Os=null;this.tainted_=true}}return this.tainted_===true}dispatchChangeEvent_(){this.dispatchEvent(R.CHANGE)}handleImageError_(){this.imageState_=ki.ERROR;this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=ki.LOADED;this.size_=[this.image_.width,this.image_.height];this.dispatchChangeEvent_()}getImage(t){if(!this.image_){this.initializeImage_()}this.replaceColor_(t);return this.canvas_[t]?this.canvas_[t]:this.image_}getPixelRatio(t){this.replaceColor_(t);return this.canvas_[t]?t:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(!this.image_){this.initializeImage_()}if(!this.hitDetectionImage_){if(this.isTainted_()){const t=this.size_[0];const e=this.size_[1];const n=ys(t,e);n.fillRect(0,0,t,e);this.hitDetectionImage_=n.canvas}else{this.hitDetectionImage_=this.image_}}return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_!==ki.IDLE){return}if(!this.image_){this.initializeImage_()}this.imageState_=ki.LOADING;try{if(this.src_!==undefined){this.image_.src=this.src_}}catch(t){this.handleImageError_()}if(this.image_ instanceof HTMLImageElement){Ms(this.image_,this.src_).then((t=>{this.image_=t;this.handleImageLoad_()})).catch(this.handleImageError_.bind(this))}}replaceColor_(t){if(!this.color_||this.canvas_[t]||this.imageState_!==ki.LOADED){return}const e=this.image_;const n=document.createElement("canvas");n.width=Math.ceil(e.width*t);n.height=Math.ceil(e.height*t);const i=n.getContext("2d");i.scale(t,t);i.drawImage(e,0,0);i.globalCompositeOperation="multiply";i.fillStyle=Ji(this.color_);i.fillRect(0,0,n.width/t,n.height/t);i.globalCompositeOperation="destination-in";i.drawImage(e,0,0);this.canvas_[t]=n}ready(){if(!this.ready_){this.ready_=new Promise((t=>{if(this.imageState_===ki.LOADED||this.imageState_===ki.ERROR){t()}else{const e=()=>{if(this.imageState_===ki.LOADED||this.imageState_===ki.ERROR){this.removeEventListener(R.CHANGE,e);t()}};this.addEventListener(R.CHANGE,e)}}))}return this.ready_}}function Fs(t,e,n,i,s,r){let o=e===undefined?undefined:Ls.get(e,n,s);if(!o){o=new Ds(t,t&&"src"in t?t.src||undefined:e,n,i,s);Ls.set(e,n,s,o,r)}if(r&&o&&!Ls.getPattern(e,n,s)){Ls.set(e,n,s,o,r)}return o}function Ns(t){if(!t){return null}if(Array.isArray(t)){return ls(t)}if(typeof t==="object"&&"src"in t){return ks(t)}return t}function ks(t){if(!t.offset||!t.size){return Ls.getPattern(t.src,"anonymous",t.color)}const e=t.src+":"+t.offset;const n=Ls.getPattern(e,undefined,t.color);if(n){return n}const i=Ls.get(t.src,"anonymous",null);if(i.getImageState()!==ki.LOADED){return null}const s=ys(t.size[0],t.size[1]);s.drawImage(i.getImage(1),t.offset[0],t.offset[1],t.size[0],t.size[1],0,0,t.size[0],t.size[1]);Fs(s.canvas,e,undefined,ki.LOADED,t.color,true);return Ls.getPattern(e,undefined,t.color)}const zs="ol-hidden";const Gs="ol-selectable";const Vs="ol-unselectable";const Ks="ol-unsupported";const js="ol-control";const Xs="ol-collapsed";const Ws="#000";const Ys="round";const Zs="round";const Us=10;const Bs="#000";const Hs=1;const qs=new k;class $s extends ji{constructor(t){super({opacity:1,rotateWithView:t.rotateWithView!==undefined?t.rotateWithView:false,rotation:t.rotation!==undefined?t.rotation:0,scale:t.scale!==undefined?t.scale:1,displacement:t.displacement!==undefined?t.displacement:[0,0],declutterMode:t.declutterMode});this.canvases_;this.hitDetectionCanvas_=null;this.fill_=t.fill!==undefined?t.fill:null;this.origin_=[0,0];this.points_=t.points;this.radius=t.radius;this.radius2_=t.radius2;this.angle_=t.angle!==undefined?t.angle:0;this.stroke_=t.stroke!==undefined?t.stroke:null;this.size_;this.renderOptions_;this.imageState_=this.fill_&&this.fill_.loading()?ki.LOADING:ki.LOADED;if(this.imageState_===ki.LOADING){this.ready().then((()=>this.imageState_=ki.LOADED))}this.render()}clone(){const t=this.getScale();const e=new $s({fill:this.getFill()?this.getFill().clone():undefined,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():undefined,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});e.setOpacity(this.getOpacity());return e}getAnchor(){const t=this.size_;const e=this.getDisplacement();const n=this.getScaleArray();return[t[0]/2-e[0]/n[0],t[1]/2+e[1]/n[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(t){this.fill_=t;this.render()}getHitDetectionImage(){if(!this.hitDetectionCanvas_){this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)}return this.hitDetectionCanvas_}getImage(t){let e=this.canvases_[t];if(!e){const n=this.renderOptions_;const i=ys(n.size*t,n.size*t);this.draw_(n,i,t);e=i.canvas;this.canvases_[t]=e}return e}getPixelRatio(t){return t}getImageSize(){return this.size_}getImageState(){return this.imageState_}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t;this.render()}listenImageChange(t){}load(){}unlistenImageChange(t){}calculateLineJoinSize_(t,e,n){if(e===0||this.points_===Infinity||t!=="bevel"&&t!=="miter"){return e}let i=this.radius;let s=this.radius2_===undefined?i:this.radius2_;if(i<s){const t=i;i=s;s=t}const r=this.radius2_===undefined?this.points_:this.points_*2;const o=2*Math.PI/r;const a=s*Math.sin(o);const l=Math.sqrt(s*s-a*a);const h=i-l;const c=Math.sqrt(a*a+h*h);const u=c/a;if(t==="miter"&&u<=n){return u*e}const d=e/2/u;const f=e/2*(h/c);const g=Math.sqrt((i+d)*(i+d)+f*f);const p=g-i;if(this.radius2_===undefined||t==="bevel"){return p*2}const _=i*Math.sin(o);const m=Math.sqrt(i*i-_*_);const y=s-m;const E=Math.sqrt(_*_+y*y);const v=E/_;if(v<=n){const t=v*e/2-s-i;return 2*Math.max(p,t)}return p*2}createRenderOptions(){let t=Ys;let e=Zs;let n=0;let i=null;let s=0;let r;let o=0;if(this.stroke_){r=Ns(this.stroke_.getColor()??Bs);o=this.stroke_.getWidth()??Hs;i=this.stroke_.getLineDash();s=this.stroke_.getLineDashOffset()??0;e=this.stroke_.getLineJoin()??Zs;t=this.stroke_.getLineCap()??Ys;n=this.stroke_.getMiterLimit()??Us}const a=this.calculateLineJoinSize_(e,o,n);const l=Math.max(this.radius,this.radius2_||0);const h=Math.ceil(2*l+a);return{strokeStyle:r,strokeWidth:o,size:h,lineCap:t,lineDash:i,lineDashOffset:s,lineJoin:e,miterLimit:n}}render(){this.renderOptions_=this.createRenderOptions();const t=this.renderOptions_.size;this.canvases_={};this.hitDetectionCanvas_=null;this.size_=[t,t]}draw_(t,e,n){e.scale(n,n);e.translate(t.size/2,t.size/2);this.createPath_(e);if(this.fill_){let t=this.fill_.getColor();if(t===null){t=Ws}e.fillStyle=Ns(t);e.fill()}if(t.strokeStyle){e.strokeStyle=t.strokeStyle;e.lineWidth=t.strokeWidth;if(t.lineDash){e.setLineDash(t.lineDash);e.lineDashOffset=t.lineDashOffset}e.lineCap=t.lineCap;e.lineJoin=t.lineJoin;e.miterLimit=t.miterLimit;e.stroke()}}createHitDetectionCanvas_(t){let e;if(this.fill_){let n=this.fill_.getColor();let i=0;if(typeof n==="string"){n=os(n)}if(n===null){i=1}else if(Array.isArray(n)){i=n.length===4?n[3]:1}if(i===0){e=ys(t.size,t.size);this.drawHitDetectionCanvas_(t,e)}}return e?e.canvas:this.getImage(1)}createPath_(t){let e=this.points_;const n=this.radius;if(e===Infinity){t.arc(0,0,n,0,2*Math.PI)}else{const i=this.radius2_===undefined?n:this.radius2_;if(this.radius2_!==undefined){e*=2}const s=this.angle_-Math.PI/2;const r=2*Math.PI/e;for(let o=0;o<e;o++){const e=s+o*r;const a=o%2===0?n:i;t.lineTo(a*Math.cos(e),a*Math.sin(e))}t.closePath()}}drawHitDetectionCanvas_(t,e){e.translate(t.size/2,t.size/2);this.createPath_(e);e.fillStyle=Ws;e.fill();if(t.strokeStyle){e.strokeStyle=t.strokeStyle;e.lineWidth=t.strokeWidth;if(t.lineDash){e.setLineDash(t.lineDash);e.lineDashOffset=t.lineDashOffset}e.lineJoin=t.lineJoin;e.miterLimit=t.miterLimit;e.stroke()}}ready(){return this.fill_?this.fill_.ready():Promise.resolve()}}var Js=$s;class Qs extends Js{constructor(t){t=t?t:{radius:5};super({points:Infinity,fill:t.fill,radius:t.radius,stroke:t.stroke,scale:t.scale!==undefined?t.scale:1,rotation:t.rotation!==undefined?t.rotation:0,rotateWithView:t.rotateWithView!==undefined?t.rotateWithView:false,displacement:t.displacement!==undefined?t.displacement:[0,0],declutterMode:t.declutterMode})}clone(){const t=this.getScale();const e=new Qs({fill:this.getFill()?this.getFill().clone():undefined,stroke:this.getStroke()?this.getStroke().clone():undefined,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});e.setOpacity(this.getOpacity());return e}setRadius(t){this.radius=t;this.render()}}var tr=Qs;class er{constructor(t){t=t||{};this.patternImage_=null;this.color_=null;if(t.color!==undefined){this.setColor(t.color)}}clone(){const t=this.getColor();return new er({color:Array.isArray(t)?t.slice():t||undefined})}getColor(){return this.color_}setColor(t){if(t!==null&&typeof t==="object"&&"src"in t){const e=Fs(null,t.src,"anonymous",undefined,t.offset?null:t.color?t.color:null,!(t.offset&&t.size));e.ready().then((()=>{this.patternImage_=null}));if(e.getImageState()===ki.IDLE){e.load()}if(e.getImageState()===ki.LOADING){this.patternImage_=e}}this.color_=t}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}var nr=er;class ir{constructor(t){t=t||{};this.color_=t.color!==undefined?t.color:null;this.lineCap_=t.lineCap;this.lineDash_=t.lineDash!==undefined?t.lineDash:null;this.lineDashOffset_=t.lineDashOffset;this.lineJoin_=t.lineJoin;this.miterLimit_=t.miterLimit;this.width_=t.width}clone(){const t=this.getColor();return new ir({color:Array.isArray(t)?t.slice():t||undefined,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():undefined,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(t){this.color_=t}setLineCap(t){this.lineCap_=t}setLineDash(t){this.lineDash_=t}setLineDashOffset(t){this.lineDashOffset_=t}setLineJoin(t){this.lineJoin_=t}setMiterLimit(t){this.miterLimit_=t}setWidth(t){this.width_=t}}var sr=ir;class rr{constructor(t){t=t||{};this.geometry_=null;this.geometryFunction_=hr;if(t.geometry!==undefined){this.setGeometry(t.geometry)}this.fill_=t.fill!==undefined?t.fill:null;this.image_=t.image!==undefined?t.image:null;this.renderer_=t.renderer!==undefined?t.renderer:null;this.hitDetectionRenderer_=t.hitDetectionRenderer!==undefined?t.hitDetectionRenderer:null;this.stroke_=t.stroke!==undefined?t.stroke:null;this.text_=t.text!==undefined?t.text:null;this.zIndex_=t.zIndex}clone(){let t=this.getGeometry();if(t&&typeof t==="object"){t=t.clone()}return new rr({geometry:t??undefined,fill:this.getFill()?this.getFill().clone():undefined,image:this.getImage()?this.getImage().clone():undefined,renderer:this.getRenderer()??undefined,stroke:this.getStroke()?this.getStroke().clone():undefined,text:this.getText()?this.getText().clone():undefined,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(t){this.renderer_=t}setHitDetectionRenderer(t){this.hitDetectionRenderer_=t}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(t){this.fill_=t}getImage(){return this.image_}setImage(t){this.image_=t}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t}getText(){return this.text_}setText(t){this.text_=t}getZIndex(){return this.zIndex_}setGeometry(t){if(typeof t==="function"){this.geometryFunction_=t}else if(typeof t==="string"){this.geometryFunction_=function(e){return e.get(t)}}else if(!t){this.geometryFunction_=hr}else if(t!==undefined){this.geometryFunction_=function(){return t}}this.geometry_=t}setZIndex(t){this.zIndex_=t}}function or(t){let e;if(typeof t==="function"){e=t}else{let n;if(Array.isArray(t)){n=t}else{W(typeof t.getZIndex==="function","Expected an `Style` or an array of `Style`");const e=t;n=[e]}e=function(){return n}}return e}let ar=null;function lr(t,e){if(!ar){const t=new nr({color:"rgba(255,255,255,0.4)"});const e=new sr({color:"#3399CC",width:1.25});ar=[new rr({image:new tr({fill:t,stroke:e,radius:5}),fill:t,stroke:e})]}return ar}function hr(t){return t.getGeometry()}var cr=rr;function ur(t,e,n,i){if(n!==undefined&&i!==undefined){return[n/t,i/e]}if(n!==undefined){return n/t}if(i!==undefined){return i/e}return 1}class dr extends ji{constructor(t){t=t||{};const e=t.opacity!==undefined?t.opacity:1;const n=t.rotation!==undefined?t.rotation:0;const i=t.scale!==undefined?t.scale:1;const s=t.rotateWithView!==undefined?t.rotateWithView:false;super({opacity:e,rotation:n,scale:i,displacement:t.displacement!==undefined?t.displacement:[0,0],rotateWithView:s,declutterMode:t.declutterMode});this.anchor_=t.anchor!==undefined?t.anchor:[.5,.5];this.normalizedAnchor_=null;this.anchorOrigin_=t.anchorOrigin!==undefined?t.anchorOrigin:"top-left";this.anchorXUnits_=t.anchorXUnits!==undefined?t.anchorXUnits:"fraction";this.anchorYUnits_=t.anchorYUnits!==undefined?t.anchorYUnits:"fraction";this.crossOrigin_=t.crossOrigin!==undefined?t.crossOrigin:null;const r=t.img!==undefined?t.img:null;let o=t.src;W(!(o!==undefined&&r),"`image` and `src` cannot be provided at the same time");if((o===undefined||o.length===0)&&r){o=r.src||D(r)}W(o!==undefined&&o.length>0,"A defined and non-empty `src` or `image` must be provided");W(!((t.width!==undefined||t.height!==undefined)&&t.scale!==undefined),"`width` or `height` cannot be provided together with `scale`");let a;if(t.src!==undefined){a=ki.IDLE}else if(r!==undefined){if("complete"in r){if(r.complete){a=r.src?ki.LOADED:ki.IDLE}else{a=ki.LOADING}}else{a=ki.LOADED}}this.color_=t.color!==undefined?os(t.color):null;this.iconImage_=Fs(r,o,this.crossOrigin_,a,this.color_);this.offset_=t.offset!==undefined?t.offset:[0,0];this.offsetOrigin_=t.offsetOrigin!==undefined?t.offsetOrigin:"top-left";this.origin_=null;this.size_=t.size!==undefined?t.size:null;this.initialOptions_;if(t.width!==undefined||t.height!==undefined){let e,n;if(t.size){[e,n]=t.size}else{const i=this.getImage(1);if(i.width&&i.height){e=i.width;n=i.height}else if(i instanceof HTMLImageElement){this.initialOptions_=t;const e=()=>{this.unlistenImageChange(e);if(!this.initialOptions_){return}const n=this.iconImage_.getSize();this.setScale(ur(n[0],n[1],t.width,t.height))};this.listenImageChange(e);return}}if(e!==undefined){this.setScale(ur(e,n,t.width,t.height))}}}clone(){let t,e,n;if(this.initialOptions_){e=this.initialOptions_.width;n=this.initialOptions_.height}else{t=this.getScale();t=Array.isArray(t)?t.slice():t}return new dr({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||undefined,crossOrigin:this.crossOrigin_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:t,width:e,height:n,size:this.size_!==null?this.size_.slice():undefined,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let t=this.normalizedAnchor_;if(!t){t=this.anchor_;const e=this.getSize();if(this.anchorXUnits_=="fraction"||this.anchorYUnits_=="fraction"){if(!e){return null}t=this.anchor_.slice();if(this.anchorXUnits_=="fraction"){t[0]*=e[0]}if(this.anchorYUnits_=="fraction"){t[1]*=e[1]}}if(this.anchorOrigin_!="top-left"){if(!e){return null}if(t===this.anchor_){t=this.anchor_.slice()}if(this.anchorOrigin_=="top-right"||this.anchorOrigin_=="bottom-right"){t[0]=-t[0]+e[0]}if(this.anchorOrigin_=="bottom-left"||this.anchorOrigin_=="bottom-right"){t[1]=-t[1]+e[1]}}this.normalizedAnchor_=t}const e=this.getDisplacement();const n=this.getScaleArray();return[t[0]-e[0]/n[0],t[1]+e[1]/n[1]]}setAnchor(t){this.anchor_=t;this.normalizedAnchor_=null}getColor(){return this.color_}getImage(t){return this.iconImage_.getImage(t)}getPixelRatio(t){return this.iconImage_.getPixelRatio(t)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_){return this.origin_}let t=this.offset_;if(this.offsetOrigin_!="top-left"){const e=this.getSize();const n=this.iconImage_.getSize();if(!e||!n){return null}t=t.slice();if(this.offsetOrigin_=="top-right"||this.offsetOrigin_=="bottom-right"){t[0]=n[0]-e[0]-t[0]}if(this.offsetOrigin_=="bottom-left"||this.offsetOrigin_=="bottom-right"){t[1]=n[1]-e[1]-t[1]}}this.origin_=t;return this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return!this.size_?this.iconImage_.getSize():this.size_}getWidth(){const t=this.getScaleArray();if(this.size_){return this.size_[0]*t[0]}if(this.iconImage_.getImageState()==ki.LOADED){return this.iconImage_.getSize()[0]*t[0]}return undefined}getHeight(){const t=this.getScaleArray();if(this.size_){return this.size_[1]*t[1]}if(this.iconImage_.getImageState()==ki.LOADED){return this.iconImage_.getSize()[1]*t[1]}return undefined}setScale(t){delete this.initialOptions_;super.setScale(t)}listenImageChange(t){this.iconImage_.addEventListener(R.CHANGE,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(R.CHANGE,t)}ready(){return this.iconImage_.ready()}}var fr=dr;const gr="#333";class pr{constructor(t){t=t||{};this.font_=t.font;this.rotation_=t.rotation;this.rotateWithView_=t.rotateWithView;this.scale_=t.scale;this.scaleArray_=Vi(t.scale!==undefined?t.scale:1);this.text_=t.text;this.textAlign_=t.textAlign;this.justify_=t.justify;this.repeat_=t.repeat;this.textBaseline_=t.textBaseline;this.fill_=t.fill!==undefined?t.fill:new nr({color:gr});this.maxAngle_=t.maxAngle!==undefined?t.maxAngle:Math.PI/4;this.placement_=t.placement!==undefined?t.placement:"point";this.overflow_=!!t.overflow;this.stroke_=t.stroke!==undefined?t.stroke:null;this.offsetX_=t.offsetX!==undefined?t.offsetX:0;this.offsetY_=t.offsetY!==undefined?t.offsetY:0;this.backgroundFill_=t.backgroundFill?t.backgroundFill:null;this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null;this.padding_=t.padding===undefined?null:t.padding;this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new pr({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():undefined,stroke:this.getStroke()?this.getStroke().clone():undefined,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():undefined,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():undefined,padding:this.getPadding()||undefined,declutterMode:this.getDeclutterMode()})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getRepeat(){return this.repeat_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getJustify(){return this.justify_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}getDeclutterMode(){return this.declutterMode_}setOverflow(t){this.overflow_=t}setFont(t){this.font_=t}setMaxAngle(t){this.maxAngle_=t}setOffsetX(t){this.offsetX_=t}setOffsetY(t){this.offsetY_=t}setPlacement(t){this.placement_=t}setRepeat(t){this.repeat_=t}setRotateWithView(t){this.rotateWithView_=t}setFill(t){this.fill_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t;this.scaleArray_=Vi(t!==undefined?t:1)}setStroke(t){this.stroke_=t}setText(t){this.text_=t}setTextAlign(t){this.textAlign_=t}setJustify(t){this.justify_=t}setTextBaseline(t){this.textBaseline_=t}setBackgroundFill(t){this.backgroundFill_=t}setBackgroundStroke(t){this.backgroundStroke_=t}setPadding(t){this.padding_=t}}var _r=pr;let mr=0;const yr=1<<mr++;const Er=1<<mr++;const vr=1<<mr++;const xr=1<<mr++;const wr=1<<mr++;const Cr=1<<mr++;const br=Math.pow(2,mr)-1;const Rr={[yr]:"boolean",[Er]:"number",[vr]:"string",[xr]:"color",[wr]:"number[]",[Cr]:"size"};const Tr=Object.keys(Rr).map(Number).sort(u);function Ir(t){return t in Rr}function Sr(t){const e=[];for(const n of Tr){if(Mr(t,n)){e.push(Rr[n])}}if(e.length===0){return"untyped"}if(e.length<3){return e.join(" or ")}return e.slice(0,-1).join(", ")+", or "+e[e.length-1]}function Mr(t,e){return(t&e)===e}function Ar(t,e){return t===e}class Pr{constructor(t,e){if(!Ir(t)){throw new Error(`literal expressions must have a specific type, got ${Sr(t)}`)}this.type=t;this.value=e}}class Lr{constructor(t,e,...n){this.type=t;this.operator=e;this.args=n}}function Or(){return{variables:new Set,properties:new Set,featureId:false,geometryType:false}}function Dr(t,e,n){switch(typeof t){case"boolean":{if(Ar(e,vr)){return new Pr(vr,t?"true":"false")}if(!Mr(e,yr)){throw new Error(`got a boolean, but expected ${Sr(e)}`)}return new Pr(yr,t)}case"number":{if(Ar(e,Cr)){return new Pr(Cr,Vi(t))}if(Ar(e,yr)){return new Pr(yr,!!t)}if(Ar(e,vr)){return new Pr(vr,t.toString())}if(!Mr(e,Er)){throw new Error(`got a number, but expected ${Sr(e)}`)}return new Pr(Er,t)}case"string":{if(Ar(e,xr)){return new Pr(xr,rs(t))}if(Ar(e,yr)){return new Pr(yr,!!t)}if(!Mr(e,vr)){throw new Error(`got a string, but expected ${Sr(e)}`)}return new Pr(vr,t)}}if(!Array.isArray(t)){throw new Error("expression must be an array or a primitive value")}if(t.length===0){throw new Error("empty expression")}if(typeof t[0]==="string"){return Qr(t,e,n)}for(const e of t){if(typeof e!=="number"){throw new Error("expected an array of numbers")}}if(Ar(e,Cr)){if(t.length!==2){throw new Error(`expected an array of two values for a size, got ${t.length}`)}return new Pr(Cr,t)}if(Ar(e,xr)){if(t.length===3){return new Pr(xr,[...t,1])}if(t.length===4){return new Pr(xr,t)}throw new Error(`expected an array of 3 or 4 values for a color, got ${t.length}`)}if(!Mr(e,wr)){throw new Error(`got an array of numbers, but expected ${Sr(e)}`)}return new Pr(wr,t)}const Fr={Get:"get",Var:"var",Concat:"concat",GeometryType:"geometry-type",Any:"any",All:"all",Not:"!",Resolution:"resolution",Zoom:"zoom",Time:"time",Equal:"==",NotEqual:"!=",GreaterThan:">",GreaterThanOrEqualTo:">=",LessThan:"<",LessThanOrEqualTo:"<=",Multiply:"*",Divide:"/",Add:"+",Subtract:"-",Clamp:"clamp",Mod:"%",Pow:"^",Abs:"abs",Floor:"floor",Ceil:"ceil",Round:"round",Sin:"sin",Cos:"cos",Atan:"atan",Sqrt:"sqrt",Match:"match",Between:"between",Interpolate:"interpolate",Coalesce:"coalesce",Case:"case",In:"in",Number:"number",String:"string",Array:"array",Color:"color",Id:"id",Band:"band",Palette:"palette",ToString:"to-string"};const Nr={[Fr.Get]:Jr(jr(1,Infinity),kr),[Fr.Var]:Jr(jr(1,1),zr),[Fr.Id]:Jr(Gr,Kr),[Fr.Concat]:Jr(jr(2,Infinity),Wr(vr)),[Fr.GeometryType]:Jr(Vr,Kr),[Fr.Resolution]:Jr(Kr),[Fr.Zoom]:Jr(Kr),[Fr.Time]:Jr(Kr),[Fr.Any]:Jr(jr(2,Infinity),Wr(yr)),[Fr.All]:Jr(jr(2,Infinity),Wr(yr)),[Fr.Not]:Jr(jr(1,1),Wr(yr)),[Fr.Equal]:Jr(jr(2,2),Wr(br)),[Fr.NotEqual]:Jr(jr(2,2),Wr(br)),[Fr.GreaterThan]:Jr(jr(2,2),Wr(Er)),[Fr.GreaterThanOrEqualTo]:Jr(jr(2,2),Wr(Er)),[Fr.LessThan]:Jr(jr(2,2),Wr(Er)),[Fr.LessThanOrEqualTo]:Jr(jr(2,2),Wr(Er)),[Fr.Multiply]:Jr(jr(2,Infinity),Xr),[Fr.Coalesce]:Jr(jr(2,Infinity),Xr),[Fr.Divide]:Jr(jr(2,2),Wr(Er)),[Fr.Add]:Jr(jr(2,Infinity),Wr(Er)),[Fr.Subtract]:Jr(jr(2,2),Wr(Er)),[Fr.Clamp]:Jr(jr(3,3),Wr(Er)),[Fr.Mod]:Jr(jr(2,2),Wr(Er)),[Fr.Pow]:Jr(jr(2,2),Wr(Er)),[Fr.Abs]:Jr(jr(1,1),Wr(Er)),[Fr.Floor]:Jr(jr(1,1),Wr(Er)),[Fr.Ceil]:Jr(jr(1,1),Wr(Er)),[Fr.Round]:Jr(jr(1,1),Wr(Er)),[Fr.Sin]:Jr(jr(1,1),Wr(Er)),[Fr.Cos]:Jr(jr(1,1),Wr(Er)),[Fr.Atan]:Jr(jr(1,2),Wr(Er)),[Fr.Sqrt]:Jr(jr(1,1),Wr(Er)),[Fr.Match]:Jr(jr(4,Infinity),Zr,Ur),[Fr.Between]:Jr(jr(3,3),Wr(Er)),[Fr.Interpolate]:Jr(jr(6,Infinity),Zr,Br),[Fr.Case]:Jr(jr(3,Infinity),Yr,Hr),[Fr.In]:Jr(jr(2,2),qr),[Fr.Number]:Jr(jr(1,Infinity),Wr(br)),[Fr.String]:Jr(jr(1,Infinity),Wr(br)),[Fr.Array]:Jr(jr(1,Infinity),Wr(Er)),[Fr.Color]:Jr(jr(1,4),Wr(Er)),[Fr.Band]:Jr(jr(1,3),Wr(Er)),[Fr.Palette]:Jr(jr(2,2),$r),[Fr.ToString]:Jr(jr(1,1),Wr(yr|Er|vr|xr))};function kr(t,e,n){const i=t.length-1;const s=new Array(i);for(let e=0;e<i;++e){const i=t[e+1];switch(typeof i){case"number":{s[e]=new Pr(Er,i);break}case"string":{s[e]=new Pr(vr,i);break}default:{throw new Error(`expected a string key or numeric array index for a get operation, got ${i}`)}}if(e===0){n.properties.add(String(i))}}return s}function zr(t,e,n){const i=t[1];if(typeof i!=="string"){throw new Error("expected a string argument for var operation")}n.variables.add(i);return[new Pr(vr,i)]}function Gr(t,e,n){n.featureId=true}function Vr(t,e,n){n.geometryType=true}function Kr(t,e,n){const i=t[0];if(t.length!==1){throw new Error(`expected no arguments for ${i} operation`)}return[]}function jr(t,e){return function(n,i,s){const r=n[0];const o=n.length-1;if(t===e){if(o!==t){const e=t===1?"":"s";throw new Error(`expected ${t} argument${e} for ${r}, got ${o}`)}}else if(o<t||o>e){const n=e===Infinity?`${t} or more`:`${t} to ${e}`;throw new Error(`expected ${n} arguments for ${r}, got ${o}`)}}}function Xr(t,e,n){const i=t.length-1;const s=new Array(i);for(let r=0;r<i;++r){const i=Dr(t[r+1],e,n);s[r]=i}return s}function Wr(t){return function(e,n,i){const s=e.length-1;const r=new Array(s);for(let n=0;n<s;++n){const s=Dr(e[n+1],t,i);r[n]=s}return r}}function Yr(t,e,n){const i=t[0];const s=t.length-1;if(s%2===0){throw new Error(`expected an odd number of arguments for ${i}, got ${s} instead`)}}function Zr(t,e,n){const i=t[0];const s=t.length-1;if(s%2===1){throw new Error(`expected an even number of arguments for operation ${i}, got ${s} instead`)}}function Ur(t,e,n){const i=t.length-1;const s=vr|Er|yr;const r=Dr(t[1],s,n);const o=Dr(t[t.length-1],e,n);const a=new Array(i-2);for(let e=0;e<i-2;e+=2){try{const i=Dr(t[e+2],r.type,n);a[e]=i}catch(t){throw new Error(`failed to parse argument ${e+1} of match expression: ${t.message}`)}try{const i=Dr(t[e+3],o.type,n);a[e+1]=i}catch(t){throw new Error(`failed to parse argument ${e+2} of match expression: ${t.message}`)}}return[r,...a,o]}function Br(t,e,n){const i=t[1];let s;switch(i[0]){case"linear":s=1;break;case"exponential":const t=i[1];if(typeof t!=="number"||t<=0){throw new Error(`expected a number base for exponential interpolation`+`, got ${JSON.stringify(t)} instead`)}s=t;break;default:throw new Error(`invalid interpolation type: ${JSON.stringify(i)}`)}const r=new Pr(Er,s);let o;try{o=Dr(t[2],Er,n)}catch(t){throw new Error(`failed to parse argument 1 in interpolate expression: ${t.message}`)}const a=new Array(t.length-3);for(let i=0;i<a.length;i+=2){try{const e=Dr(t[i+3],Er,n);a[i]=e}catch(t){throw new Error(`failed to parse argument ${i+2} for interpolate expression: ${t.message}`)}try{const s=Dr(t[i+4],e,n);a[i+1]=s}catch(t){throw new Error(`failed to parse argument ${i+3} for interpolate expression: ${t.message}`)}}return[r,o,...a]}function Hr(t,e,n){const i=Dr(t[t.length-1],e,n);const s=new Array(t.length-1);for(let e=0;e<s.length-1;e+=2){try{const i=Dr(t[e+1],yr,n);s[e]=i}catch(t){throw new Error(`failed to parse argument ${e} of case expression: ${t.message}`)}try{const r=Dr(t[e+2],i.type,n);s[e+1]=r}catch(t){throw new Error(`failed to parse argument ${e+1} of case expression: ${t.message}`)}}s[s.length-1]=i;return s}function qr(t,e,n){let i=t[2];if(!Array.isArray(i)){throw new Error(`the second argument for the "in" operator must be an array`)}let s;if(typeof i[0]==="string"){if(i[0]!=="literal"){throw new Error(`for the "in" operator, a string array should be wrapped in a "literal" operator to disambiguate from expressions`)}if(!Array.isArray(i[1])){throw new Error(`failed to parse "in" expression: the literal operator must be followed by an array`)}i=i[1];s=vr}else{s=Er}const r=new Array(i.length);for(let t=0;t<r.length;t++){try{const e=Dr(i[t],s,n);r[t]=e}catch(e){throw new Error(`failed to parse haystack item ${t} for "in" expression: ${e.message}`)}}const o=Dr(t[1],s,n);return[o,...r]}function $r(t,e,n){let i;try{i=Dr(t[1],Er,n)}catch(t){throw new Error(`failed to parse first argument in palette expression: ${t.message}`)}const s=t[2];if(!Array.isArray(s)){throw new Error("the second argument of palette must be an array")}const r=new Array(s.length);for(let t=0;t<r.length;t++){let e;try{e=Dr(s[t],xr,n)}catch(e){throw new Error(`failed to parse color at index ${t} in palette expression: ${e.message}`)}if(!(e instanceof Pr)){throw new Error(`the palette color at index ${t} must be a literal value`)}r[t]=e}return[i,...r]}function Jr(...t){return function(e,n,i){const s=e[0];let r;for(let s=0;s<t.length;s++){const o=t[s](e,n,i);if(s==t.length-1){if(!o){throw new Error("expected last argument validator to return the parsed args")}r=o}}return new Lr(n,s,...r)}}function Qr(t,e,n){const i=t[0];const s=Nr[i];if(!s){throw new Error(`unknown operator: ${i}`)}return s(t,e,n)}function to(t){if(!t){return""}const e=t.getType();switch(e){case"Point":case"LineString":case"Polygon":return e;case"MultiPoint":case"MultiLineString":case"MultiPolygon":return e.substring(5);case"Circle":return"Polygon";case"GeometryCollection":return to(t.getGeometries()[0]);default:return""}}function eo(){return{variables:{},properties:{},resolution:NaN,featureId:null,geometryType:""}}function no(t,e,n){const i=Dr(t,e,n);return io(i)}function io(t,e){if(t instanceof Pr){if(t.type===xr&&typeof t.value==="string"){const e=rs(t.value);return function(){return e}}return function(){return t.value}}const n=t.operator;switch(n){case Fr.Number:case Fr.String:case Fr.Coalesce:{return so(t)}case Fr.Get:case Fr.Var:{return ro(t)}case Fr.Id:{return t=>t.featureId}case Fr.GeometryType:{return t=>t.geometryType}case Fr.Concat:{const e=t.args.map((t=>io(t)));return t=>"".concat(...e.map((e=>e(t).toString())))}case Fr.Resolution:{return t=>t.resolution}case Fr.Any:case Fr.All:case Fr.Between:case Fr.In:case Fr.Not:{return ao(t)}case Fr.Equal:case Fr.NotEqual:case Fr.LessThan:case Fr.LessThanOrEqualTo:case Fr.GreaterThan:case Fr.GreaterThanOrEqualTo:{return oo(t)}case Fr.Multiply:case Fr.Divide:case Fr.Add:case Fr.Subtract:case Fr.Clamp:case Fr.Mod:case Fr.Pow:case Fr.Abs:case Fr.Floor:case Fr.Ceil:case Fr.Round:case Fr.Sin:case Fr.Cos:case Fr.Atan:case Fr.Sqrt:{return lo(t)}case Fr.Case:{return ho(t)}case Fr.Match:{return co(t)}case Fr.Interpolate:{return uo(t)}case Fr.ToString:{return fo(t)}default:{throw new Error(`Unsupported operator ${n}`)}}}function so(t,e){const n=t.operator;const i=t.args.length;const s=new Array(i);for(let e=0;e<i;++e){s[e]=io(t.args[e])}switch(n){case Fr.Coalesce:{return t=>{for(let e=0;e<i;++e){const n=s[e](t);if(typeof n!=="undefined"&&n!==null){return n}}throw new Error("Expected one of the values to be non-null")}}case Fr.Number:case Fr.String:{return t=>{for(let e=0;e<i;++e){const i=s[e](t);if(typeof i===n){return i}}throw new Error(`Expected one of the values to be a ${n}`)}}default:{throw new Error(`Unsupported assertion operator ${n}`)}}}function ro(t,e){const n=t.args[0];const i=n.value;switch(t.operator){case Fr.Get:{return e=>{const n=t.args;let s=e.properties[i];for(let t=1,e=n.length;t<e;++t){const e=n[t];const i=e.value;s=s[i]}return s}}case Fr.Var:{return t=>t.variables[i]}default:{throw new Error(`Unsupported accessor operator ${t.operator}`)}}}function oo(t,e){const n=t.operator;const i=io(t.args[0]);const s=io(t.args[1]);switch(n){case Fr.Equal:{return t=>i(t)===s(t)}case Fr.NotEqual:{return t=>i(t)!==s(t)}case Fr.LessThan:{return t=>i(t)<s(t)}case Fr.LessThanOrEqualTo:{return t=>i(t)<=s(t)}case Fr.GreaterThan:{return t=>i(t)>s(t)}case Fr.GreaterThanOrEqualTo:{return t=>i(t)>=s(t)}default:{throw new Error(`Unsupported comparison operator ${n}`)}}}function ao(t,e){const n=t.operator;const i=t.args.length;const s=new Array(i);for(let e=0;e<i;++e){s[e]=io(t.args[e])}switch(n){case Fr.Any:{return t=>{for(let e=0;e<i;++e){if(s[e](t)){return true}}return false}}case Fr.All:{return t=>{for(let e=0;e<i;++e){if(!s[e](t)){return false}}return true}}case Fr.Between:{return t=>{const e=s[0](t);const n=s[1](t);const i=s[2](t);return e>=n&&e<=i}}case Fr.In:{return t=>{const e=s[0](t);for(let n=1;n<i;++n){if(e===s[n](t)){return true}}return false}}case Fr.Not:{return t=>!s[0](t)}default:{throw new Error(`Unsupported logical operator ${n}`)}}}function lo(t,e){const n=t.operator;const i=t.args.length;const s=new Array(i);for(let e=0;e<i;++e){s[e]=io(t.args[e])}switch(n){case Fr.Multiply:{return t=>{let e=1;for(let n=0;n<i;++n){e*=s[n](t)}return e}}case Fr.Divide:{return t=>s[0](t)/s[1](t)}case Fr.Add:{return t=>{let e=0;for(let n=0;n<i;++n){e+=s[n](t)}return e}}case Fr.Subtract:{return t=>s[0](t)-s[1](t)}case Fr.Clamp:{return t=>{const e=s[0](t);const n=s[1](t);if(e<n){return n}const i=s[2](t);if(e>i){return i}return e}}case Fr.Mod:{return t=>s[0](t)%s[1](t)}case Fr.Pow:{return t=>Math.pow(s[0](t),s[1](t))}case Fr.Abs:{return t=>Math.abs(s[0](t))}case Fr.Floor:{return t=>Math.floor(s[0](t))}case Fr.Ceil:{return t=>Math.ceil(s[0](t))}case Fr.Round:{return t=>Math.round(s[0](t))}case Fr.Sin:{return t=>Math.sin(s[0](t))}case Fr.Cos:{return t=>Math.cos(s[0](t))}case Fr.Atan:{if(i===2){return t=>Math.atan2(s[0](t),s[1](t))}return t=>Math.atan(s[0](t))}case Fr.Sqrt:{return t=>Math.sqrt(s[0](t))}default:{throw new Error(`Unsupported numeric operator ${n}`)}}}function ho(t,e){const n=t.args.length;const i=new Array(n);for(let e=0;e<n;++e){i[e]=io(t.args[e])}return t=>{for(let e=0;e<n-1;e+=2){const n=i[e](t);if(n){return i[e+1](t)}}return i[n-1](t)}}function co(t,e){const n=t.args.length;const i=new Array(n);for(let e=0;e<n;++e){i[e]=io(t.args[e])}return t=>{const e=i[0](t);for(let s=1;s<n;s+=2){if(e===i[s](t)){return i[s+1](t)}}return i[n-1](t)}}function uo(t,e){const n=t.args.length;const i=new Array(n);for(let e=0;e<n;++e){i[e]=io(t.args[e])}return t=>{const e=i[0](t);const s=i[1](t);let r;let o;for(let a=2;a<n;a+=2){const n=i[a](t);let l=i[a+1](t);const h=Array.isArray(l);if(h){l=ns(l)}if(n>=s){if(a===2){return l}if(h){return po(e,s,r,o,n,l)}return go(e,s,r,o,n,l)}r=n;o=l}return o}}function fo(t,e){const n=t.operator;const i=t.args.length;const s=new Array(i);for(let e=0;e<i;++e){s[e]=io(t.args[e])}switch(n){case Fr.ToString:{return e=>{const n=s[0](e);if(t.args[0].type===xr){return ls(n)}return n.toString()}}default:{throw new Error(`Unsupported convert operator ${n}`)}}}function go(t,e,n,i,s,r){const o=s-n;if(o===0){return i}const a=e-n;const l=t===1?a/o:(Math.pow(t,a)-1)/(Math.pow(t,o)-1);return i+l*(r-i)}function po(t,e,n,i,s,r){const o=s-n;if(o===0){return i}const a=is(i);const l=is(r);let h=l[2]-a[2];if(h>180){h-=360}else if(h<-180){h+=360}const c=[go(t,e,n,a[0],s,l[0]),go(t,e,n,a[1],s,l[1]),a[2]+go(t,e,n,0,s,h),go(t,e,n,i[3],s,r[3])];return as(ss(c))}function _o(t){return true}function mo(t){const e=Or();const n=Eo(t,e);const i=eo();return function(t,s){i.properties=t.getPropertiesInternal();i.resolution=s;if(e.featureId){const e=t.getId();if(e!==undefined){i.featureId=e}else{i.featureId=null}}if(e.geometryType){i.geometryType=to(t.getGeometry())}return n(i)}}function yo(t){const e=Or();const n=t.length;const i=new Array(n);for(let s=0;s<n;++s){i[s]=vo(t[s],e)}const s=eo();const r=new Array(n);return function(t,o){s.properties=t.getPropertiesInternal();s.resolution=o;if(e.featureId){const e=t.getId();if(e!==undefined){s.featureId=e}else{s.featureId=null}}let a=0;for(let t=0;t<n;++t){const e=i[t](s);if(e){r[a]=e;a+=1}}r.length=a;return r}}function Eo(t,e){const n=t.length;const i=new Array(n);for(let s=0;s<n;++s){const n=t[s];const r="filter"in n?no(n.filter,yr,e):_o;let o;if(Array.isArray(n.style)){const t=n.style.length;o=new Array(t);for(let i=0;i<t;++i){o[i]=vo(n.style[i],e)}}else{o=[vo(n.style,e)]}i[s]={filter:r,styles:o}}return function(e){const s=[];let r=false;for(let o=0;o<n;++o){const n=i[o].filter;if(!n(e)){continue}if(t[o].else&&r){continue}r=true;for(const t of i[o].styles){const n=t(e);if(!n){continue}s.push(n)}}return s}}function vo(t,e){const n=xo(t,"",e);const i=wo(t,"",e);const s=Co(t,e);const r=bo(t,e);const o=So(t,"z-index",e);if(!n&&!i&&!s&&!r&&!w(t)){throw new Error("No fill, stroke, point, or text symbolizer properties in style: "+JSON.stringify(t))}const a=new cr;return function(t){let e=true;if(n){const i=n(t);if(i){e=false}a.setFill(i)}if(i){const n=i(t);if(n){e=false}a.setStroke(n)}if(s){const n=s(t);if(n){e=false}a.setText(n)}if(r){const n=r(t);if(n){e=false}a.setImage(n)}if(o){a.setZIndex(o(t))}if(e){return null}return a}}function xo(t,e,n){let i;if(e+"fill-pattern-src"in t){i=Ao(t,e+"fill-",n)}else{if(t[e+"fill-color"]==="none"){return t=>null}i=Lo(t,e+"fill-color",n)}if(!i){return null}const s=new nr;return function(t){const e=i(t);if(e==="none"){return null}s.setColor(e);return s}}function wo(t,e,n){const i=So(t,e+"stroke-width",n);const s=Lo(t,e+"stroke-color",n);if(!i&&!s){return null}const r=Mo(t,e+"stroke-line-cap",n);const o=Mo(t,e+"stroke-line-join",n);const a=Oo(t,e+"stroke-line-dash",n);const l=So(t,e+"stroke-line-dash-offset",n);const h=So(t,e+"stroke-miter-limit",n);const c=new sr;return function(t){if(s){const e=s(t);if(e==="none"){return null}c.setColor(e)}if(i){c.setWidth(i(t))}if(r){const e=r(t);if(e!=="butt"&&e!=="round"&&e!=="square"){throw new Error("Expected butt, round, or square line cap")}c.setLineCap(e)}if(o){const e=o(t);if(e!=="bevel"&&e!=="round"&&e!=="miter"){throw new Error("Expected bevel, round, or miter line join")}c.setLineJoin(e)}if(a){c.setLineDash(a(t))}if(l){c.setLineDashOffset(l(t))}if(h){c.setMiterLimit(h(t))}return c}}function Co(t,e){const n="text-";const i=Mo(t,n+"value",e);if(!i){return null}const s=xo(t,n,e);const r=xo(t,n+"background-",e);const o=wo(t,n,e);const a=wo(t,n+"background-",e);const l=Mo(t,n+"font",e);const h=So(t,n+"max-angle",e);const c=So(t,n+"offset-x",e);const u=So(t,n+"offset-y",e);const d=Po(t,n+"overflow",e);const f=Mo(t,n+"placement",e);const g=So(t,n+"repeat",e);const p=No(t,n+"scale",e);const _=Po(t,n+"rotate-with-view",e);const m=So(t,n+"rotation",e);const y=Mo(t,n+"align",e);const E=Mo(t,n+"justify",e);const v=Mo(t,n+"baseline",e);const x=Oo(t,n+"padding",e);const w=Xo(t,n+"declutter-mode");const C=new _r({declutterMode:w});return function(t){C.setText(i(t));if(s){C.setFill(s(t))}if(r){C.setBackgroundFill(r(t))}if(o){C.setStroke(o(t))}if(a){C.setBackgroundStroke(a(t))}if(l){C.setFont(l(t))}if(h){C.setMaxAngle(h(t))}if(c){C.setOffsetX(c(t))}if(u){C.setOffsetY(u(t))}if(d){C.setOverflow(d(t))}if(f){const e=f(t);if(e!=="point"&&e!=="line"){throw new Error("Expected point or line for text-placement")}C.setPlacement(e)}if(g){C.setRepeat(g(t))}if(p){C.setScale(p(t))}if(_){C.setRotateWithView(_(t))}if(m){C.setRotation(m(t))}if(y){const e=y(t);if(e!=="left"&&e!=="center"&&e!=="right"&&e!=="end"&&e!=="start"){throw new Error("Expected left, right, center, start, or end for text-align")}C.setTextAlign(e)}if(E){const e=E(t);if(e!=="left"&&e!=="right"&&e!=="center"){throw new Error("Expected left, right, or center for text-justify")}C.setJustify(e)}if(v){const e=v(t);if(e!=="bottom"&&e!=="top"&&e!=="middle"&&e!=="alphabetic"&&e!=="hanging"){throw new Error("Expected bottom, top, middle, alphabetic, or hanging for text-baseline")}C.setTextBaseline(e)}if(x){C.setPadding(x(t))}return C}}function bo(t,e){if("icon-src"in t){return Ro(t,e)}if("shape-points"in t){return To(t,e)}if("circle-radius"in t){return Io(t,e)}return null}function Ro(t,e){const n="icon-";const i=n+"src";const s=Zo(t[i],i);const r=Do(t,n+"anchor",e);const o=No(t,n+"scale",e);const a=So(t,n+"opacity",e);const l=Do(t,n+"displacement",e);const h=So(t,n+"rotation",e);const c=Po(t,n+"rotate-with-view",e);const u=Vo(t,n+"anchor-origin");const d=Ko(t,n+"anchor-x-units");const f=Ko(t,n+"anchor-y-units");const g=Wo(t,n+"color");const p=Go(t,n+"cross-origin");const _=jo(t,n+"offset");const m=Vo(t,n+"offset-origin");const y=ko(t,n+"width");const E=ko(t,n+"height");const v=zo(t,n+"size");const x=Xo(t,n+"declutter-mode");const w=new fr({src:s,anchorOrigin:u,anchorXUnits:d,anchorYUnits:f,color:g,crossOrigin:p,offset:_,offsetOrigin:m,height:E,width:y,size:v,declutterMode:x});return function(t){if(a){w.setOpacity(a(t))}if(l){w.setDisplacement(l(t))}if(h){w.setRotation(h(t))}if(c){w.setRotateWithView(c(t))}if(o){w.setScale(o(t))}if(r){w.setAnchor(r(t))}return w}}function To(t,e){const n="shape-";const i=n+"points";const s=n+"radius";const r=Uo(t[i],i);const o=Uo(t[s],s);const a=xo(t,n,e);const l=wo(t,n,e);const h=No(t,n+"scale",e);const c=Do(t,n+"displacement",e);const u=So(t,n+"rotation",e);const d=Po(t,n+"rotate-with-view",e);const f=ko(t,n+"radius2");const g=ko(t,n+"angle");const p=Xo(t,n+"declutter-mode");const _=new Js({points:r,radius:o,radius2:f,angle:g,declutterMode:p});return function(t){if(a){_.setFill(a(t))}if(l){_.setStroke(l(t))}if(c){_.setDisplacement(c(t))}if(u){_.setRotation(u(t))}if(d){_.setRotateWithView(d(t))}if(h){_.setScale(h(t))}return _}}function Io(t,e){const n="circle-";const i=xo(t,n,e);const s=wo(t,n,e);const r=So(t,n+"radius",e);const o=No(t,n+"scale",e);const a=Do(t,n+"displacement",e);const l=So(t,n+"rotation",e);const h=Po(t,n+"rotate-with-view",e);const c=Xo(t,n+"declutter-mode");const u=new tr({radius:5,declutterMode:c});return function(t){if(r){u.setRadius(r(t))}if(i){u.setFill(i(t))}if(s){u.setStroke(s(t))}if(a){u.setDisplacement(a(t))}if(l){u.setRotation(l(t))}if(h){u.setRotateWithView(h(t))}if(o){u.setScale(o(t))}return u}}function So(t,e,n){if(!(e in t)){return undefined}const i=no(t[e],Er,n);return function(t){return Uo(i(t),e)}}function Mo(t,e,n){if(!(e in t)){return null}const i=no(t[e],vr,n);return function(t){return Zo(i(t),e)}}function Ao(t,e,n){const i=Mo(t,e+"pattern-src",n);const s=Fo(t,e+"pattern-offset",n);const r=Fo(t,e+"pattern-size",n);const o=Lo(t,e+"color",n);return function(t){return{src:i(t),offset:s&&s(t),size:r&&r(t),color:o&&o(t)}}}function Po(t,e,n){if(!(e in t)){return null}const i=no(t[e],yr,n);return function(t){const n=i(t);if(typeof n!=="boolean"){throw new Error(`Expected a boolean for ${e}`)}return n}}function Lo(t,e,n){if(!(e in t)){return null}const i=no(t[e],xr,n);return function(t){return Bo(i(t),e)}}function Oo(t,e,n){if(!(e in t)){return null}const i=no(t[e],wr,n);return function(t){return Yo(i(t),e)}}function Do(t,e,n){if(!(e in t)){return null}const i=no(t[e],wr,n);return function(t){const n=Yo(i(t),e);if(n.length!==2){throw new Error(`Expected two numbers for ${e}`)}return n}}function Fo(t,e,n){if(!(e in t)){return null}const i=no(t[e],wr,n);return function(t){return Ho(i(t),e)}}function No(t,e,n){if(!(e in t)){return null}const i=no(t[e],wr|Er,n);return function(t){return qo(i(t),e)}}function ko(t,e){const n=t[e];if(n===undefined){return undefined}if(typeof n!=="number"){throw new Error(`Expected a number for ${e}`)}return n}function zo(t,e){const n=t[e];if(n===undefined){return undefined}if(typeof n==="number"){return Vi(n)}if(!Array.isArray(n)){throw new Error(`Expected a number or size array for ${e}`)}if(n.length!==2||typeof n[0]!=="number"||typeof n[1]!=="number"){throw new Error(`Expected a number or size array for ${e}`)}return n}function Go(t,e){const n=t[e];if(n===undefined){return undefined}if(typeof n!=="string"){throw new Error(`Expected a string for ${e}`)}return n}function Vo(t,e){const n=t[e];if(n===undefined){return undefined}if(n!=="bottom-left"&&n!=="bottom-right"&&n!=="top-left"&&n!=="top-right"){throw new Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${e}`)}return n}function Ko(t,e){const n=t[e];if(n===undefined){return undefined}if(n!=="pixels"&&n!=="fraction"){throw new Error(`Expected pixels or fraction for ${e}`)}return n}function jo(t,e){const n=t[e];if(n===undefined){return undefined}return Yo(n,e)}function Xo(t,e){const n=t[e];if(n===undefined){return undefined}if(typeof n!=="string"){throw new Error(`Expected a string for ${e}`)}if(n!=="declutter"&&n!=="obstacle"&&n!=="none"){throw new Error(`Expected declutter, obstacle, or none for ${e}`)}return n}function Wo(t,e){const n=t[e];if(n===undefined){return undefined}return Bo(n,e)}function Yo(t,e){if(!Array.isArray(t)){throw new Error(`Expected an array for ${e}`)}const n=t.length;for(let i=0;i<n;++i){if(typeof t[i]!=="number"){throw new Error(`Expected an array of numbers for ${e}`)}}return t}function Zo(t,e){if(typeof t!=="string"){throw new Error(`Expected a string for ${e}`)}return t}function Uo(t,e){if(typeof t!=="number"){throw new Error(`Expected a number for ${e}`)}return t}function Bo(t,e){if(typeof t==="string"){return t}const n=Yo(t,e);const i=n.length;if(i<3||i>4){throw new Error(`Expected a color with 3 or 4 values for ${e}`)}return n}function Ho(t,e){const n=Yo(t,e);if(n.length!==2){throw new Error(`Expected an array of two numbers for ${e}`)}return n}function qo(t,e){if(typeof t==="number"){return t}return Ho(t,e)}const $o={RENDER_ORDER:"renderOrder"};class Jo extends mi{constructor(t){t=t?t:{};const e=Object.assign({},t);delete e.style;delete e.renderBuffer;delete e.updateWhileAnimating;delete e.updateWhileInteracting;super(e);this.declutter_=t.declutter?String(t.declutter):undefined;this.renderBuffer_=t.renderBuffer!==undefined?t.renderBuffer:100;this.style_=null;this.styleFunction_=undefined;this.setStyle(t.style);this.updateWhileAnimating_=t.updateWhileAnimating!==undefined?t.updateWhileAnimating:false;this.updateWhileInteracting_=t.updateWhileInteracting!==undefined?t.updateWhileInteracting:false}getDeclutter(){return this.declutter_}getFeatures(t){return super.getFeatures(t)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get($o.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(t,e){const n=this.getDeclutter();if(n in t.declutter===false){t.declutter[n]=new wi(9)}this.getRenderer().renderDeclutter(t,e)}setRenderOrder(t){this.set($o.RENDER_ORDER,t)}setStyle(t){this.style_=t===undefined?lr:t;const e=Qo(t);this.styleFunction_=t===null?undefined:or(e);this.changed()}}function Qo(t){if(t===undefined){return lr}if(!t){return null}if(typeof t==="function"){return t}if(t instanceof cr){return t}if(!Array.isArray(t)){return yo([t])}if(t.length===0){return[]}const e=t.length;const n=t[0];if(n instanceof cr){const n=new Array(e);for(let i=0;i<e;++i){const e=t[i];if(!(e instanceof cr)){throw new Error("Expected a list of style instances")}n[i]=e}return n}if("style"in n){const n=new Array(e);for(let i=0;i<e;++i){const e=t[i];if(!("style"in e)){throw new Error("Expected a list of rules with a style property")}n[i]=e}return mo(n)}const i=t;return yo(i)}var ta=Jo;class ea extends c{constructor(t){super();this.map_=t}dispatchRenderEvent(t,e){L()}calculateMatrices2D(t){const e=t.viewState;const n=t.coordinateToPixelTransform;const i=t.pixelToCoordinateTransform;cn(n,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]);un(i,n)}forEachFeatureAtCoordinate(t,e,n,i,s,r,o,a){let l;const h=e.viewState;function c(t,e,n,i){return s.call(r,e,t?n:null,i)}const u=h.projection;const d=Ee(t.slice(),u);const f=[[0,0]];if(u.canWrapX()&&i){const t=u.getExtent();const e=ae(t);f.push([-e,0],[e,0])}const g=e.layerStatesArray;const p=g.length;const _=[];const m=[];for(let i=0;i<f.length;i++){for(let s=p-1;s>=0;--s){const r=g[s];const u=r.layer;if(u.hasRenderer()&&_i(r,h)&&o.call(a,u)){const s=u.getRenderer();const o=u.getSource();if(s&&o){const a=o.getWrapX()?d:t;const h=c.bind(null,r.managed);m[0]=a[0]+f[i][0];m[1]=a[1]+f[i][1];l=s.forEachFeatureAtCoordinate(m,e,n,h,_)}if(l){return l}}}}if(_.length===0){return undefined}const y=1/_.length;_.forEach(((t,e)=>t.distanceSq+=e*y));_.sort(((t,e)=>t.distanceSq-e.distanceSq));_.some((t=>l=t.callback(t.feature,t.layer,t.geometry)));return l}hasFeatureAtCoordinate(t,e,n,i,s,r){const o=this.forEachFeatureAtCoordinate(t,e,n,i,_,this,s,r);return o!==undefined}getMap(){return this.map_}renderFrame(t){L()}scheduleExpireIconCache(t){if(Ls.canExpireCache()){t.postRenderFunctions.push(na)}}}function na(t,e){Ls.expire()}var ia=ea;class sa extends a{constructor(t,e,n,i){super(t);this.inversePixelTransform=e;this.frameState=n;this.context=i}}var ra=sa;class oa extends ia{constructor(t){super(t);this.fontChangeListenerKey_=T(qs,l.PROPERTYCHANGE,t.redrawText.bind(t));this.element_=document.createElement("div");const e=this.element_.style;e.position="absolute";e.width="100%";e.height="100%";e.zIndex="0";this.element_.className=Vs+" ol-layers";const n=t.getViewport();n.insertBefore(this.element_,n.firstChild||null);this.children_=[];this.renderedVisible_=true}dispatchRenderEvent(t,e){const n=this.getMap();if(n.hasListener(t)){const i=new ra(t,undefined,e);n.dispatchEvent(i)}}disposeInternal(){S(this.fontChangeListenerKey_);this.element_.remove();super.disposeInternal()}renderFrame(t){if(!t){if(this.renderedVisible_){this.element_.style.display="none";this.renderedVisible_=false}return}this.calculateMatrices2D(t);this.dispatchRenderEvent(it.PRECOMPOSE,t);const e=t.layerStatesArray.sort(((t,e)=>t.zIndex-e.zIndex));const n=e.some((t=>t.layer instanceof ta&&t.layer.getDeclutter()));if(n){t.declutter={}}const i=t.viewState;this.children_.length=0;const s=[];let r=null;for(let n=0,o=e.length;n<o;++n){const o=e[n];t.layerIndex=n;const a=o.layer;const l=a.getSourceState();if(!_i(o,i)||l!="ready"&&l!="undefined"){a.unrender();continue}const h=a.render(t,r);if(!h){continue}if(h!==r){this.children_.push(h);r=h}s.push(o)}this.declutter(t,s);Ts(this.element_,this.children_);this.dispatchRenderEvent(it.POSTCOMPOSE,t);if(!this.renderedVisible_){this.element_.style.display="";this.renderedVisible_=true}this.scheduleExpireIconCache(t)}declutter(t,e){if(!t.declutter){return}for(let n=e.length-1;n>=0;--n){const i=e[n];const s=i.layer;if(s.getDeclutter()){s.renderDeclutter(t,i)}}e.forEach((e=>e.layer.renderDeferred(t)))}}var aa=oa;class la extends a{constructor(t,e){super(t);this.layer=e}}const ha={LAYERS:"layers"};class ca extends nt{constructor(t){t=t||{};const e=Object.assign({},t);delete e.layers;let n=t.layers;super(e);this.on;this.once;this.un;this.layersListenerKeys_=[];this.listenerKeys_={};this.addChangeListener(ha.LAYERS,this.handleLayersChanged_);if(n){if(Array.isArray(n)){n=new j(n.slice(),{unique:true})}else{W(typeof n.getArray==="function","Expected `layers` to be an array or a `Collection`")}}else{n=new j(undefined,{unique:true})}this.setLayers(n)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(S);this.layersListenerKeys_.length=0;const t=this.getLayers();this.layersListenerKeys_.push(T(t,z.ADD,this.handleLayersAdd_,this),T(t,z.REMOVE,this.handleLayersRemove_,this));for(const t in this.listenerKeys_){this.listenerKeys_[t].forEach(S)}x(this.listenerKeys_);const e=t.getArray();for(let t=0,n=e.length;t<n;t++){const n=e[t];this.registerLayerListeners_(n);this.dispatchEvent(new la("addlayer",n))}this.changed()}registerLayerListeners_(t){const e=[T(t,l.PROPERTYCHANGE,this.handleLayerChange_,this),T(t,R.CHANGE,this.handleLayerChange_,this)];if(t instanceof ca){e.push(T(t,"addlayer",this.handleLayerGroupAdd_,this),T(t,"removelayer",this.handleLayerGroupRemove_,this))}this.listenerKeys_[D(t)]=e}handleLayerGroupAdd_(t){this.dispatchEvent(new la("addlayer",t.layer))}handleLayerGroupRemove_(t){this.dispatchEvent(new la("removelayer",t.layer))}handleLayersAdd_(t){const e=t.element;this.registerLayerListeners_(e);this.dispatchEvent(new la("addlayer",e));this.changed()}handleLayersRemove_(t){const e=t.element;const n=D(e);this.listenerKeys_[n].forEach(S);delete this.listenerKeys_[n];this.dispatchEvent(new la("removelayer",e));this.changed()}getLayers(){return this.get(ha.LAYERS)}setLayers(t){const e=this.getLayers();if(e){const t=e.getArray();for(let e=0,n=t.length;e<n;++e){this.dispatchEvent(new la("removelayer",t[e]))}}this.set(ha.LAYERS,t)}getLayersArray(t){t=t!==undefined?t:[];this.getLayers().forEach((function(e){e.getLayersArray(t)}));return t}getLayerStatesArray(t){const e=t!==undefined?t:[];const n=e.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(e)}));const i=this.getLayerState();let s=i.zIndex;if(!t&&i.zIndex===undefined){s=0}for(let t=n,r=e.length;t<r;t++){const n=e[t];n.opacity*=i.opacity;n.visible=n.visible&&i.visible;n.maxResolution=Math.min(n.maxResolution,i.maxResolution);n.minResolution=Math.max(n.minResolution,i.minResolution);n.minZoom=Math.max(n.minZoom,i.minZoom);n.maxZoom=Math.min(n.maxZoom,i.maxZoom);if(i.extent!==undefined){if(n.extent!==undefined){n.extent=se(n.extent,i.extent)}else{n.extent=i.extent}}if(n.zIndex===undefined){n.zIndex=s}}return e}getSourceState(){return"ready"}}var ua=ca;class da extends a{constructor(t,e,n){super(t);this.map=e;this.frameState=n!==undefined?n:null}}var fa=da;class ga extends fa{constructor(t,e,n,i,s,r){super(t,e,s);this.originalEvent=n;this.pixel_=null;this.coordinate_=null;this.dragging=i!==undefined?i:false;this.activePointers=r}get pixel(){if(!this.pixel_){this.pixel_=this.map.getEventPixel(this.originalEvent)}return this.pixel_}set pixel(t){this.pixel_=t}get coordinate(){if(!this.coordinate_){this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)}return this.coordinate_}set coordinate(t){this.coordinate_=t}preventDefault(){super.preventDefault();if("preventDefault"in this.originalEvent){this.originalEvent.preventDefault()}}stopPropagation(){super.stopPropagation();if("stopPropagation"in this.originalEvent){this.originalEvent.stopPropagation()}}}var pa=ga;var _a={SINGLECLICK:"singleclick",CLICK:R.CLICK,DBLCLICK:R.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};var ma={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};class ya extends b{constructor(t,e){super(t);this.map_=t;this.clickTimeoutId_;this.emulateClicks_=false;this.dragging_=false;this.dragListenerKeys_=[];this.moveTolerance_=e===undefined?1:e;this.down_=null;const n=this.map_.getViewport();this.activePointers_=[];this.trackedTouches_={};this.element_=n;this.pointerdownListenerKey_=T(n,ma.POINTERDOWN,this.handlePointerDown_,this);this.originalPointerMoveEvent_;this.relayedListenerKey_=T(n,ma.POINTERMOVE,this.relayMoveEvent_,this);this.boundHandleTouchMove_=this.handleTouchMove_.bind(this);this.element_.addEventListener(R.TOUCHMOVE,this.boundHandleTouchMove_,ms?{passive:false}:false)}emulateClick_(t){let e=new pa(_a.CLICK,this.map_,t);this.dispatchEvent(e);if(this.clickTimeoutId_!==undefined){clearTimeout(this.clickTimeoutId_);this.clickTimeoutId_=undefined;e=new pa(_a.DBLCLICK,this.map_,t);this.dispatchEvent(e)}else{this.clickTimeoutId_=setTimeout((()=>{this.clickTimeoutId_=undefined;const e=new pa(_a.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}),250)}}updateActivePointers_(t){const e=t;const n=e.pointerId;if(e.type==_a.POINTERUP||e.type==_a.POINTERCANCEL){delete this.trackedTouches_[n];for(const t in this.trackedTouches_){if(this.trackedTouches_[t].target!==e.target){delete this.trackedTouches_[t];break}}}else if(e.type==_a.POINTERDOWN||e.type==_a.POINTERMOVE){this.trackedTouches_[n]=e}this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(t){this.updateActivePointers_(t);const e=new pa(_a.POINTERUP,this.map_,t,undefined,undefined,this.activePointers_);this.dispatchEvent(e);if(this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)){this.emulateClick_(this.down_)}if(this.activePointers_.length===0){this.dragListenerKeys_.forEach(S);this.dragListenerKeys_.length=0;this.dragging_=false;this.down_=null}}isMouseActionButton_(t){return t.button===0}handlePointerDown_(t){this.emulateClicks_=this.activePointers_.length===0;this.updateActivePointers_(t);const e=new pa(_a.POINTERDOWN,this.map_,t,undefined,undefined,this.activePointers_);this.dispatchEvent(e);this.down_=new PointerEvent(t.type,t);Object.defineProperty(this.down_,"target",{writable:false,value:t.target});if(this.dragListenerKeys_.length===0){const t=this.map_.getOwnerDocument();this.dragListenerKeys_.push(T(t,_a.POINTERMOVE,this.handlePointerMove_,this),T(t,_a.POINTERUP,this.handlePointerUp_,this),T(this.element_,_a.POINTERCANCEL,this.handlePointerUp_,this));if(this.element_.getRootNode&&this.element_.getRootNode()!==t){this.dragListenerKeys_.push(T(this.element_.getRootNode(),_a.POINTERUP,this.handlePointerUp_,this))}}}handlePointerMove_(t){if(this.isMoving_(t)){this.updateActivePointers_(t);this.dragging_=true;const e=new pa(_a.POINTERDRAG,this.map_,t,this.dragging_,undefined,this.activePointers_);this.dispatchEvent(e)}}relayMoveEvent_(t){this.originalPointerMoveEvent_=t;const e=!!(this.down_&&this.isMoving_(t));this.dispatchEvent(new pa(_a.POINTERMOVE,this.map_,t,e))}handleTouchMove_(t){const e=this.originalPointerMoveEvent_;if((!e||e.defaultPrevented)&&(typeof t.cancelable!=="boolean"||t.cancelable===true)){t.preventDefault()}}isMoving_(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){if(this.relayedListenerKey_){S(this.relayedListenerKey_);this.relayedListenerKey_=null}this.element_.removeEventListener(R.TOUCHMOVE,this.boundHandleTouchMove_);if(this.pointerdownListenerKey_){S(this.pointerdownListenerKey_);this.pointerdownListenerKey_=null}this.dragListenerKeys_.forEach(S);this.dragListenerKeys_.length=0;this.element_=null;super.disposeInternal()}}var Ea=ya;var va={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"};var xa={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};const wa=Infinity;class Ca{constructor(t,e){this.priorityFunction_=t;this.keyFunction_=e;this.elements_=[];this.priorities_=[];this.queuedElements_={}}clear(){this.elements_.length=0;this.priorities_.length=0;x(this.queuedElements_)}dequeue(){const t=this.elements_;const e=this.priorities_;const n=t[0];if(t.length==1){t.length=0;e.length=0}else{t[0]=t.pop();e[0]=e.pop();this.siftUp_(0)}const i=this.keyFunction_(n);delete this.queuedElements_[i];return n}enqueue(t){W(!(this.keyFunction_(t)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");const e=this.priorityFunction_(t);if(e!=wa){this.elements_.push(t);this.priorities_.push(e);this.queuedElements_[this.keyFunction_(t)]=true;this.siftDown_(0,this.elements_.length-1);return true}return false}getCount(){return this.elements_.length}getLeftChildIndex_(t){return t*2+1}getRightChildIndex_(t){return t*2+2}getParentIndex_(t){return t-1>>1}heapify_(){let t;for(t=(this.elements_.length>>1)-1;t>=0;t--){this.siftUp_(t)}}isEmpty(){return this.elements_.length===0}isKeyQueued(t){return t in this.queuedElements_}isQueued(t){return this.isKeyQueued(this.keyFunction_(t))}siftUp_(t){const e=this.elements_;const n=this.priorities_;const i=e.length;const s=e[t];const r=n[t];const o=t;while(t<i>>1){const s=this.getLeftChildIndex_(t);const r=this.getRightChildIndex_(t);const o=r<i&&n[r]<n[s]?r:s;e[t]=e[o];n[t]=n[o];t=o}e[t]=s;n[t]=r;this.siftDown_(o,t)}siftDown_(t,e){const n=this.elements_;const i=this.priorities_;const s=n[e];const r=i[e];while(e>t){const t=this.getParentIndex_(e);if(i[t]>r){n[e]=n[t];i[e]=i[t];e=t}else{break}}n[e]=s;i[e]=r}reprioritize(){const t=this.priorityFunction_;const e=this.elements_;const n=this.priorities_;let i=0;const s=e.length;let r,o,a;for(o=0;o<s;++o){r=e[o];a=t(r);if(a==wa){delete this.queuedElements_[this.keyFunction_(r)]}else{n[i]=a;e[i++]=r}}e.length=i;n.length=i;this.heapify_()}}var ba=Ca;var Ra={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};class Ta extends ba{constructor(t,e){super((function(e){return t.apply(null,e)}),(function(t){return t[0].getKey()}));this.boundHandleTileChange_=this.handleTileChange.bind(this);this.tileChangeCallback_=e;this.tilesLoading_=0;this.tilesLoadingKeys_={}}enqueue(t){const e=super.enqueue(t);if(e){const e=t[0];e.addEventListener(R.CHANGE,this.boundHandleTileChange_)}return e}getTilesLoading(){return this.tilesLoading_}handleTileChange(t){const e=t.target;const n=e.getState();if(n===Ra.LOADED||n===Ra.ERROR||n===Ra.EMPTY){if(n!==Ra.ERROR){e.removeEventListener(R.CHANGE,this.boundHandleTileChange_)}const t=e.getKey();if(t in this.tilesLoadingKeys_){delete this.tilesLoadingKeys_[t];--this.tilesLoading_}this.tileChangeCallback_()}}loadMoreTiles(t,e){let n=0;while(this.tilesLoading_<t&&n<e&&this.getCount()>0){const t=this.dequeue()[0];const e=t.getKey();const i=t.getState();if(i===Ra.IDLE&&!(e in this.tilesLoadingKeys_)){this.tilesLoadingKeys_[e]=true;++this.tilesLoading_;++n;t.load()}}}}var Ia=Ta;function Sa(t,e,n,i,s){if(!t||!(n in t.wantedTiles)){return wa}if(!t.wantedTiles[n][e.getKey()]){return wa}const r=t.viewState.center;const o=i[0]-r[0];const a=i[1]-r[1];return 65536*Math.log(s)+Math.sqrt(o*o+a*a)/s}class Ma extends k{constructor(t){super();const e=t.element;if(e&&!t.target&&!e.style.pointerEvents){e.style.pointerEvents="auto"}this.element=e?e:null;this.target_=null;this.map_=null;this.listenerKeys=[];if(t.render){this.render=t.render}if(t.target){this.setTarget(t.target)}}disposeInternal(){this.element?.remove();super.disposeInternal()}getMap(){return this.map_}setMap(t){if(this.map_){this.element?.remove()}for(let t=0,e=this.listenerKeys.length;t<e;++t){S(this.listenerKeys[t])}this.listenerKeys.length=0;this.map_=t;if(t){const e=this.target_??t.getOverlayContainerStopEvent();e.appendChild(this.element);if(this.render!==y){this.listenerKeys.push(T(t,va.POSTRENDER,this.render,this))}t.render()}}render(t){}setTarget(t){this.target_=typeof t==="string"?document.getElementById(t):t}}var Aa=Ma;class Pa extends Aa{constructor(t){t=t?t:{};super({element:document.createElement("div"),render:t.render,target:t.target});this.ulElement_=document.createElement("ul");this.collapsed_=t.collapsed!==undefined?t.collapsed:true;this.userCollapsed_=this.collapsed_;this.overrideCollapsible_=t.collapsible!==undefined;this.collapsible_=t.collapsible!==undefined?t.collapsible:true;if(!this.collapsible_){this.collapsed_=false}const e=t.className!==undefined?t.className:"ol-attribution";const n=t.tipLabel!==undefined?t.tipLabel:"Attributions";const i=t.expandClassName!==undefined?t.expandClassName:e+"-expand";const s=t.collapseLabel!==undefined?t.collapseLabel:"›";const r=t.collapseClassName!==undefined?t.collapseClassName:e+"-collapse";if(typeof s==="string"){this.collapseLabel_=document.createElement("span");this.collapseLabel_.textContent=s;this.collapseLabel_.className=r}else{this.collapseLabel_=s}const o=t.label!==undefined?t.label:"i";if(typeof o==="string"){this.label_=document.createElement("span");this.label_.textContent=o;this.label_.className=i}else{this.label_=o}const a=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;this.toggleButton_=document.createElement("button");this.toggleButton_.setAttribute("type","button");this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_));this.toggleButton_.title=n;this.toggleButton_.appendChild(a);this.toggleButton_.addEventListener(R.CLICK,this.handleClick_.bind(this),false);const l=e+" "+Vs+" "+js+(this.collapsed_&&this.collapsible_?" "+Xs:"")+(this.collapsible_?"":" ol-uncollapsible");const h=this.element;h.className=l;h.appendChild(this.toggleButton_);h.appendChild(this.ulElement_);this.renderedAttributions_=[];this.renderedVisible_=true}collectSourceAttributions_(t){const e=this.getMap().getAllLayers();const n=Array.from(new Set(e.flatMap((e=>e.getAttributions(t)))));if(!this.overrideCollapsible_){const t=!e.some((t=>t.getSource()?.getAttributionsCollapsible()===false));this.setCollapsible(t)}return n}async updateElement_(t){if(!t){if(this.renderedVisible_){this.element.style.display="none";this.renderedVisible_=false}return}const e=await Promise.all(this.collectSourceAttributions_(t).map((t=>v((()=>t)))));const n=e.length>0;if(this.renderedVisible_!=n){this.element.style.display=n?"":"none";this.renderedVisible_=n}if(g(e,this.renderedAttributions_)){return}Rs(this.ulElement_);for(let t=0,n=e.length;t<n;++t){const n=document.createElement("li");n.innerHTML=e[t];this.ulElement_.appendChild(n)}this.renderedAttributions_=e}handleClick_(t){t.preventDefault();this.handleToggle_();this.userCollapsed_=this.collapsed_}handleToggle_(){this.element.classList.toggle(Xs);if(this.collapsed_){bs(this.collapseLabel_,this.label_)}else{bs(this.label_,this.collapseLabel_)}this.collapsed_=!this.collapsed_;this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))}getCollapsible(){return this.collapsible_}setCollapsible(t){if(this.collapsible_===t){return}this.collapsible_=t;this.element.classList.toggle("ol-uncollapsible");if(this.userCollapsed_){this.handleToggle_()}}setCollapsed(t){this.userCollapsed_=t;if(!this.collapsible_||this.collapsed_===t){return}this.handleToggle_()}getCollapsed(){return this.collapsed_}render(t){this.updateElement_(t.frameState)}}var La=Pa;class Oa extends Aa{constructor(t){t=t?t:{};super({element:document.createElement("div"),render:t.render,target:t.target});const e=t.className!==undefined?t.className:"ol-rotate";const n=t.label!==undefined?t.label:"⇧";const i=t.compassClassName!==undefined?t.compassClassName:"ol-compass";this.label_=null;if(typeof n==="string"){this.label_=document.createElement("span");this.label_.className=i;this.label_.textContent=n}else{this.label_=n;this.label_.classList.add(i)}const s=t.tipLabel?t.tipLabel:"Reset rotation";const r=document.createElement("button");r.className=e+"-reset";r.setAttribute("type","button");r.title=s;r.appendChild(this.label_);r.addEventListener(R.CLICK,this.handleClick_.bind(this),false);const o=e+" "+Vs+" "+js;const a=this.element;a.className=o;a.appendChild(r);this.callResetNorth_=t.resetNorth?t.resetNorth:undefined;this.duration_=t.duration!==undefined?t.duration:250;this.autoHide_=t.autoHide!==undefined?t.autoHide:true;this.rotation_=undefined;if(this.autoHide_){this.element.classList.add(zs)}}handleClick_(t){t.preventDefault();if(this.callResetNorth_!==undefined){this.callResetNorth_()}else{this.resetNorth_()}}resetNorth_(){const t=this.getMap();const e=t.getView();if(!e){return}const n=e.getRotation();if(n!==undefined){if(this.duration_>0&&n%(2*Math.PI)!==0){e.animate({rotation:0,duration:this.duration_,easing:rn})}else{e.setRotation(0)}}}render(t){const e=t.frameState;if(!e){return}const n=e.viewState.rotation;if(n!=this.rotation_){const t="rotate("+n+"rad)";if(this.autoHide_){const t=this.element.classList.contains(zs);if(!t&&n===0){this.element.classList.add(zs)}else if(t&&n!==0){this.element.classList.remove(zs)}}this.label_.style.transform=t}this.rotation_=n}}var Da=Oa;class Fa extends Aa{constructor(t){t=t?t:{};super({element:document.createElement("div"),target:t.target});const e=t.className!==undefined?t.className:"ol-zoom";const n=t.delta!==undefined?t.delta:1;const i=t.zoomInClassName!==undefined?t.zoomInClassName:e+"-in";const s=t.zoomOutClassName!==undefined?t.zoomOutClassName:e+"-out";const r=t.zoomInLabel!==undefined?t.zoomInLabel:"+";const o=t.zoomOutLabel!==undefined?t.zoomOutLabel:"–";const a=t.zoomInTipLabel!==undefined?t.zoomInTipLabel:"Zoom in";const l=t.zoomOutTipLabel!==undefined?t.zoomOutTipLabel:"Zoom out";const h=document.createElement("button");h.className=i;h.setAttribute("type","button");h.title=a;h.appendChild(typeof r==="string"?document.createTextNode(r):r);h.addEventListener(R.CLICK,this.handleClick_.bind(this,n),false);const c=document.createElement("button");c.className=s;c.setAttribute("type","button");c.title=l;c.appendChild(typeof o==="string"?document.createTextNode(o):o);c.addEventListener(R.CLICK,this.handleClick_.bind(this,-n),false);const u=e+" "+Vs+" "+js;const d=this.element;d.className=u;d.appendChild(h);d.appendChild(c);this.duration_=t.duration!==undefined?t.duration:250}handleClick_(t,e){e.preventDefault();this.zoomByDelta_(t)}zoomByDelta_(t){const e=this.getMap();const n=e.getView();if(!n){return}const i=n.getZoom();if(i!==undefined){const e=n.getConstrainedZoom(i+t);if(this.duration_>0){if(n.getAnimating()){n.cancelAnimations()}n.animate({zoom:e,duration:this.duration_,easing:rn})}else{n.setZoom(e)}}}}var Na=Fa;function ka(t){t=t?t:{};const e=new j;const n=t.zoom!==undefined?t.zoom:true;if(n){e.push(new Na(t.zoomOptions))}const i=t.rotate!==undefined?t.rotate:true;if(i){e.push(new Da(t.rotateOptions))}const s=t.attribution!==undefined?t.attribution:true;if(s){e.push(new La(t.attributionOptions))}return e}var za={ACTIVE:"active"};class Ga extends k{constructor(t){super();this.on;this.once;this.un;if(t&&t.handleEvent){this.handleEvent=t.handleEvent}this.map_=null;this.setActive(true)}getActive(){return this.get(za.ACTIVE)}getMap(){return this.map_}handleEvent(t){return true}setActive(t){this.set(za.ACTIVE,t)}setMap(t){this.map_=t}}function Va(t,e,n){const i=t.getCenterInternal();if(i){const s=[i[0]+e[0],i[1]+e[1]];t.animateInternal({duration:n!==undefined?n:250,easing:an,center:t.getConstrainedCenter(s)})}}function Ka(t,e,n,i){const s=t.getZoom();if(s===undefined){return}const r=t.getConstrainedZoom(s+e);const o=t.getResolutionForZoom(r);if(t.getAnimating()){t.cancelAnimations()}t.animate({resolution:o,anchor:n,duration:i!==undefined?i:250,easing:rn})}var ja=Ga;class Xa extends ja{constructor(t){super();t=t?t:{};this.delta_=t.delta?t.delta:1;this.duration_=t.duration!==undefined?t.duration:250}handleEvent(t){let e=false;if(t.type==_a.DBLCLICK){const n=t.originalEvent;const i=t.map;const s=t.coordinate;const r=n.shiftKey?-this.delta_:this.delta_;const o=i.getView();Ka(o,r,s,this.duration_);n.preventDefault();e=true}return!e}}var Wa=Xa;class Ya extends ja{constructor(t){t=t?t:{};super(t);if(t.handleDownEvent){this.handleDownEvent=t.handleDownEvent}if(t.handleDragEvent){this.handleDragEvent=t.handleDragEvent}if(t.handleMoveEvent){this.handleMoveEvent=t.handleMoveEvent}if(t.handleUpEvent){this.handleUpEvent=t.handleUpEvent}if(t.stopDown){this.stopDown=t.stopDown}this.handlingDownUpSequence=false;this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(t){return false}handleDragEvent(t){}handleEvent(t){if(!t.originalEvent){return true}let e=false;this.updateTrackedPointers_(t);if(this.handlingDownUpSequence){if(t.type==_a.POINTERDRAG){this.handleDragEvent(t);t.originalEvent.preventDefault()}else if(t.type==_a.POINTERUP){const e=this.handleUpEvent(t);this.handlingDownUpSequence=e&&this.targetPointers.length>0}}else{if(t.type==_a.POINTERDOWN){const n=this.handleDownEvent(t);this.handlingDownUpSequence=n;e=this.stopDown(n)}else if(t.type==_a.POINTERMOVE){this.handleMoveEvent(t)}}return!e}handleMoveEvent(t){}handleUpEvent(t){return false}stopDown(t){return t}updateTrackedPointers_(t){if(t.activePointers){this.targetPointers=t.activePointers}}}function Za(t){const e=t.length;let n=0;let i=0;for(let s=0;s<e;s++){n+=t[s].clientX;i+=t[s].clientY}return{clientX:n/e,clientY:i/e}}var Ua=Ya;function Ba(t){const e=arguments;return function(t){let n=true;for(let i=0,s=e.length;i<s;++i){n=n&&e[i](t);if(!n){break}}return n}}const Ha=function(t){const e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey};const qa=function(t){const e=t.map.getTargetElement();const n=t.map.getOwnerDocument().activeElement;return e.contains(n)};const $a=function(t){return t.map.getTargetElement().hasAttribute("tabindex")?qa(t):true};const Ja=_;const Qa=function(t){const e=t.originalEvent;return e.button==0&&!(ds&&fs&&e.ctrlKey)};const tl=function(t){const e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey};const el=function(t){const e=t.originalEvent;return fs?e.metaKey:e.ctrlKey};const nl=function(t){const e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey};const il=function(t){const e=t.originalEvent;const n=e.target.tagName;return n!=="INPUT"&&n!=="SELECT"&&n!=="TEXTAREA"&&!e.target.isContentEditable};const sl=function(t){const e=t.originalEvent;W(e!==undefined,"mapBrowserEvent must originate from a pointer event");return e.pointerType=="mouse"};const rl=function(t){const e=t.originalEvent;W(e!==undefined,"mapBrowserEvent must originate from a pointer event");return e.isPrimary&&e.button===0};class ol extends Ua{constructor(t){super({stopDown:m});t=t?t:{};this.kinetic_=t.kinetic;this.lastCentroid=null;this.lastPointersCount_;this.panning_=false;const e=t.condition?t.condition:Ba(tl,rl);this.condition_=t.onFocusOnly?Ba($a,e):e;this.noKinetic_=false}handleDragEvent(t){const e=t.map;if(!this.panning_){this.panning_=true;e.getView().beginInteraction()}const n=this.targetPointers;const i=e.getEventPixel(Za(n));if(n.length==this.lastPointersCount_){if(this.kinetic_){this.kinetic_.update(i[0],i[1])}if(this.lastCentroid){const e=[this.lastCentroid[0]-i[0],i[1]-this.lastCentroid[1]];const n=t.map;const s=n.getView();ye(e,s.getResolution());me(e,s.getRotation());s.adjustCenterInternal(e)}}else if(this.kinetic_){this.kinetic_.begin()}this.lastCentroid=i;this.lastPointersCount_=n.length;t.originalEvent.preventDefault()}handleUpEvent(t){const e=t.map;const n=e.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){const t=this.kinetic_.getDistance();const i=this.kinetic_.getAngle();const s=n.getCenterInternal();const r=e.getPixelFromCoordinateInternal(s);const o=e.getCoordinateFromPixelInternal([r[0]-t*Math.cos(i),r[1]-t*Math.sin(i)]);n.animateInternal({center:n.getConstrainedCenter(o),duration:500,easing:rn})}if(this.panning_){this.panning_=false;n.endInteraction()}return false}if(this.kinetic_){this.kinetic_.begin()}this.lastCentroid=null;return true}handleDownEvent(t){if(this.targetPointers.length>0&&this.condition_(t)){const e=t.map;const n=e.getView();this.lastCentroid=null;if(n.getAnimating()){n.cancelAnimations()}if(this.kinetic_){this.kinetic_.begin()}this.noKinetic_=this.targetPointers.length>1;return true}return false}}var al=ol;class ll extends Ua{constructor(t){t=t?t:{};super({stopDown:m});this.condition_=t.condition?t.condition:Ha;this.lastAngle_=undefined;this.duration_=t.duration!==undefined?t.duration:250}handleDragEvent(t){if(!sl(t)){return}const e=t.map;const n=e.getView();if(n.getConstraints().rotation===Qe){return}const i=e.getSize();const s=t.pixel;const r=Math.atan2(i[1]/2-s[1],s[0]-i[0]/2);if(this.lastAngle_!==undefined){const t=r-this.lastAngle_;n.adjustRotationInternal(-t)}this.lastAngle_=r}handleUpEvent(t){if(!sl(t)){return true}const e=t.map;const n=e.getView();n.endInteraction(this.duration_);return false}handleDownEvent(t){if(!sl(t)){return false}if(Qa(t)&&this.condition_(t)){const e=t.map;e.getView().beginInteraction();this.lastAngle_=undefined;return true}return false}}var hl=ll;class cl extends c{constructor(t){super();this.geometry_=null;this.element_=document.createElement("div");this.element_.style.position="absolute";this.element_.style.pointerEvents="auto";this.element_.className="ol-box "+t;this.map_=null;this.startPixel_=null;this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){const t=this.startPixel_;const e=this.endPixel_;const n="px";const i=this.element_.style;i.left=Math.min(t[0],e[0])+n;i.top=Math.min(t[1],e[1])+n;i.width=Math.abs(e[0]-t[0])+n;i.height=Math.abs(e[1]-t[1])+n}setMap(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);const t=this.element_.style;t.left="inherit";t.top="inherit";t.width="inherit";t.height="inherit"}this.map_=t;if(this.map_){this.map_.getOverlayContainer().appendChild(this.element_)}}setPixels(t,e){this.startPixel_=t;this.endPixel_=e;this.createOrUpdateGeometry();this.render_()}createOrUpdateGeometry(){if(!this.map_){return}const t=this.startPixel_;const e=this.endPixel_;const n=[t,[t[0],e[1]],e,[e[0],t[1]]];const i=n.map(this.map_.getCoordinateFromPixelInternal,this.map_);i[4]=i[0].slice();if(!this.geometry_){this.geometry_=new si([i])}else{this.geometry_.setCoordinates([i])}}getGeometry(){return this.geometry_}}var ul=cl;const dl={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"};class fl extends a{constructor(t,e,n){super(t);this.coordinate=e;this.mapBrowserEvent=n}}class gl extends Ua{constructor(t){super();this.on;this.once;this.un;t=t?t:{};this.box_=new ul(t.className||"ol-dragbox");this.minArea_=t.minArea!==undefined?t.minArea:64;if(t.onBoxEnd){this.onBoxEnd=t.onBoxEnd}this.startPixel_=null;this.condition_=t.condition?t.condition:Qa;this.boxEndCondition_=t.boxEndCondition?t.boxEndCondition:this.defaultBoxEndCondition}defaultBoxEndCondition(t,e,n){const i=n[0]-e[0];const s=n[1]-e[1];return i*i+s*s>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(t){if(!this.startPixel_){return}this.box_.setPixels(this.startPixel_,t.pixel);this.dispatchEvent(new fl(dl.BOXDRAG,t.coordinate,t))}handleUpEvent(t){if(!this.startPixel_){return false}this.box_.setMap(null);const e=this.boxEndCondition_(t,this.startPixel_,t.pixel);if(e){this.onBoxEnd(t)}this.dispatchEvent(new fl(e?dl.BOXEND:dl.BOXCANCEL,t.coordinate,t));return false}handleDownEvent(t){if(this.condition_(t)){this.startPixel_=t.pixel;this.box_.setMap(t.map);this.box_.setPixels(this.startPixel_,this.startPixel_);this.dispatchEvent(new fl(dl.BOXSTART,t.coordinate,t));return true}return false}onBoxEnd(t){}setActive(t){if(!t){this.box_.setMap(null);if(this.startPixel_){this.dispatchEvent(new fl(dl.BOXCANCEL,this.startPixel_,null));this.startPixel_=null}}super.setActive(t)}}var pl=gl;class _l extends pl{constructor(t){t=t?t:{};const e=t.condition?t.condition:nl;super({condition:e,className:t.className||"ol-dragzoom",minArea:t.minArea});this.duration_=t.duration!==undefined?t.duration:200;this.out_=t.out!==undefined?t.out:false}onBoxEnd(t){const e=this.getMap();const n=e.getView();let i=this.getGeometry();if(this.out_){const t=n.rotatedExtentForGeometry(i);const e=n.getResolutionForExtentInternal(t);const s=n.getResolution()/e;i=i.clone();i.scale(s*s)}n.fitInternal(i,{duration:this.duration_,easing:rn})}}var ml=_l;var yl={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"};class El extends ja{constructor(t){super();t=t||{};this.defaultCondition_=function(t){return tl(t)&&il(t)};this.condition_=t.condition!==undefined?t.condition:this.defaultCondition_;this.duration_=t.duration!==undefined?t.duration:100;this.pixelDelta_=t.pixelDelta!==undefined?t.pixelDelta:128}handleEvent(t){let e=false;if(t.type==R.KEYDOWN){const n=t.originalEvent;const i=n.key;if(this.condition_(t)&&(i==yl.DOWN||i==yl.LEFT||i==yl.RIGHT||i==yl.UP)){const s=t.map;const r=s.getView();const o=r.getResolution()*this.pixelDelta_;let a=0,l=0;if(i==yl.DOWN){l=-o}else if(i==yl.LEFT){a=-o}else if(i==yl.RIGHT){a=o}else{l=o}const h=[a,l];me(h,r.getRotation());Va(r,h,this.duration_);n.preventDefault();e=true}}return!e}}var vl=El;class xl extends ja{constructor(t){super();t=t?t:{};this.condition_=t.condition?t.condition:function(t){return!el(t)&&il(t)};this.delta_=t.delta?t.delta:1;this.duration_=t.duration!==undefined?t.duration:100}handleEvent(t){let e=false;if(t.type==R.KEYDOWN||t.type==R.KEYPRESS){const n=t.originalEvent;const i=n.key;if(this.condition_(t)&&(i==="+"||i==="-")){const s=t.map;const r=i==="+"?this.delta_:-this.delta_;const o=s.getView();Ka(o,r,undefined,this.duration_);n.preventDefault();e=true}}return!e}}var wl=xl;class Cl{constructor(t,e,n){this.decay_=t;this.minVelocity_=e;this.delay_=n;this.points_=[];this.angle_=0;this.initialVelocity_=0}begin(){this.points_.length=0;this.angle_=0;this.initialVelocity_=0}update(t,e){this.points_.push(t,e,Date.now())}end(){if(this.points_.length<6){return false}const t=Date.now()-this.delay_;const e=this.points_.length-3;if(this.points_[e+2]<t){return false}let n=e-3;while(n>0&&this.points_[n+2]>t){n-=3}const i=this.points_[e+2]-this.points_[n+2];if(i<1e3/60){return false}const s=this.points_[e]-this.points_[n];const r=this.points_[e+1]-this.points_[n+1];this.angle_=Math.atan2(r,s);this.initialVelocity_=Math.sqrt(s*s+r*r)/i;return this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}}var bl=Cl;class Rl extends ja{constructor(t){t=t?t:{};super(t);this.totalDelta_=0;this.lastDelta_=0;this.maxDelta_=t.maxDelta!==undefined?t.maxDelta:1;this.duration_=t.duration!==undefined?t.duration:250;this.timeout_=t.timeout!==undefined?t.timeout:80;this.useAnchor_=t.useAnchor!==undefined?t.useAnchor:true;this.constrainResolution_=t.constrainResolution!==undefined?t.constrainResolution:false;const e=t.condition?t.condition:Ja;this.condition_=t.onFocusOnly?Ba($a,e):e;this.lastAnchor_=null;this.startTime_=undefined;this.timeoutId_;this.mode_=undefined;this.trackpadEventGap_=400;this.trackpadTimeoutId_;this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=undefined;const t=this.getMap();if(!t){return}const e=t.getView();e.endInteraction(undefined,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)}handleEvent(t){if(!this.condition_(t)){return true}const e=t.type;if(e!==R.WHEEL){return true}const n=t.map;const i=t.originalEvent;i.preventDefault();if(this.useAnchor_){this.lastAnchor_=t.coordinate}let s;if(t.type==R.WHEEL){s=i.deltaY;if(cs&&i.deltaMode===WheelEvent.DOM_DELTA_PIXEL){s/=gs}if(i.deltaMode===WheelEvent.DOM_DELTA_LINE){s*=40}}if(s===0){return false}this.lastDelta_=s;const r=Date.now();if(this.startTime_===undefined){this.startTime_=r}if(!this.mode_||r-this.startTime_>this.trackpadEventGap_){this.mode_=Math.abs(s)<4?"trackpad":"wheel"}const o=n.getView();if(this.mode_==="trackpad"&&!(o.getConstrainResolution()||this.constrainResolution_)){if(this.trackpadTimeoutId_){clearTimeout(this.trackpadTimeoutId_)}else{if(o.getAnimating()){o.cancelAnimations()}o.beginInteraction()}this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_);o.adjustZoom(-s/this.deltaPerZoom_,this.lastAnchor_);this.startTime_=r;return false}this.totalDelta_+=s;const a=Math.max(this.timeout_-(r-this.startTime_),0);clearTimeout(this.timeoutId_);this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,n),a);return false}handleWheelZoom_(t){const e=t.getView();if(e.getAnimating()){e.cancelAnimations()}let n=-Y(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;if(e.getConstrainResolution()||this.constrainResolution_){n=n?n>0?1:-1:0}Ka(e,n,this.lastAnchor_,this.duration_);this.mode_=undefined;this.totalDelta_=0;this.lastAnchor_=null;this.startTime_=undefined;this.timeoutId_=undefined}setMouseAnchor(t){this.useAnchor_=t;if(!t){this.lastAnchor_=null}}}var Tl=Rl;class Il extends Ua{constructor(t){t=t?t:{};const e=t;if(!e.stopDown){e.stopDown=m}super(e);this.anchor_=null;this.lastAngle_=undefined;this.rotating_=false;this.rotationDelta_=0;this.threshold_=t.threshold!==undefined?t.threshold:.3;this.duration_=t.duration!==undefined?t.duration:250}handleDragEvent(t){let e=0;const n=this.targetPointers[0];const i=this.targetPointers[1];const s=Math.atan2(i.clientY-n.clientY,i.clientX-n.clientX);if(this.lastAngle_!==undefined){const t=s-this.lastAngle_;this.rotationDelta_+=t;if(!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_){this.rotating_=true}e=t}this.lastAngle_=s;const r=t.map;const o=r.getView();if(o.getConstraints().rotation===Qe){return}this.anchor_=r.getCoordinateFromPixelInternal(r.getEventPixel(Za(this.targetPointers)));if(this.rotating_){r.render();o.adjustRotationInternal(e,this.anchor_)}}handleUpEvent(t){if(this.targetPointers.length<2){const e=t.map;const n=e.getView();n.endInteraction(this.duration_);return false}return true}handleDownEvent(t){if(this.targetPointers.length>=2){const e=t.map;this.anchor_=null;this.lastAngle_=undefined;this.rotating_=false;this.rotationDelta_=0;if(!this.handlingDownUpSequence){e.getView().beginInteraction()}return true}return false}}var Sl=Il;class Ml extends Ua{constructor(t){t=t?t:{};const e=t;if(!e.stopDown){e.stopDown=m}super(e);this.anchor_=null;this.duration_=t.duration!==undefined?t.duration:400;this.lastDistance_=undefined;this.lastScaleDelta_=1}handleDragEvent(t){let e=1;const n=this.targetPointers[0];const i=this.targetPointers[1];const s=n.clientX-i.clientX;const r=n.clientY-i.clientY;const o=Math.sqrt(s*s+r*r);if(this.lastDistance_!==undefined){e=this.lastDistance_/o}this.lastDistance_=o;const a=t.map;const l=a.getView();if(e!=1){this.lastScaleDelta_=e}this.anchor_=a.getCoordinateFromPixelInternal(a.getEventPixel(Za(this.targetPointers)));a.render();l.adjustResolutionInternal(e,this.anchor_)}handleUpEvent(t){if(this.targetPointers.length<2){const e=t.map;const n=e.getView();const i=this.lastScaleDelta_>1?1:-1;n.endInteraction(this.duration_,i);return false}return true}handleDownEvent(t){if(this.targetPointers.length>=2){const e=t.map;this.anchor_=null;this.lastDistance_=undefined;this.lastScaleDelta_=1;if(!this.handlingDownUpSequence){e.getView().beginInteraction()}return true}return false}}var Al=Ml;function Pl(t){t=t?t:{};const e=new j;const n=new bl(-.005,.05,100);const i=t.altShiftDragRotate!==undefined?t.altShiftDragRotate:true;if(i){e.push(new hl)}const s=t.doubleClickZoom!==undefined?t.doubleClickZoom:true;if(s){e.push(new Wa({delta:t.zoomDelta,duration:t.zoomDuration}))}const r=t.dragPan!==undefined?t.dragPan:true;if(r){e.push(new al({onFocusOnly:t.onFocusOnly,kinetic:n}))}const o=t.pinchRotate!==undefined?t.pinchRotate:true;if(o){e.push(new Sl)}const a=t.pinchZoom!==undefined?t.pinchZoom:true;if(a){e.push(new Al({duration:t.zoomDuration}))}const l=t.keyboard!==undefined?t.keyboard:true;if(l){e.push(new vl);e.push(new wl({delta:t.zoomDelta,duration:t.zoomDuration}))}const h=t.mouseWheelZoom!==undefined?t.mouseWheelZoom:true;if(h){e.push(new Tl({onFocusOnly:t.onFocusOnly,duration:t.zoomDuration}))}const c=t.shiftDragZoom!==undefined?t.shiftDragZoom:true;if(c){e.push(new ml({duration:t.zoomDuration}))}return e}function Ll(t){if(t instanceof mi){t.setMapInternal(null);return}if(t instanceof ua){t.getLayers().forEach(Ll)}}function Ol(t,e){if(t instanceof mi){t.setMapInternal(e);return}if(t instanceof ua){const n=t.getLayers().getArray();for(let t=0,i=n.length;t<i;++t){Ol(n[t],e)}}}class Dl extends k{constructor(t){super();t=t||{};this.on;this.once;this.un;const e=Fl(t);this.renderComplete_=false;this.loaded_=true;this.boundHandleBrowserEvent_=this.handleBrowserEvent.bind(this);this.maxTilesLoading_=t.maxTilesLoading!==undefined?t.maxTilesLoading:16;this.pixelRatio_=t.pixelRatio!==undefined?t.pixelRatio:gs;this.postRenderTimeoutHandle_;this.animationDelayKey_;this.animationDelay_=this.animationDelay_.bind(this);this.coordinateToPixelTransform_=ln();this.pixelToCoordinateTransform_=ln();this.frameIndex_=0;this.frameState_=null;this.previousExtent_=null;this.viewPropertyListenerKey_=null;this.viewChangeListenerKey_=null;this.layerGroupPropertyListenerKeys_=null;this.viewport_=document.createElement("div");this.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":"");this.viewport_.style.position="relative";this.viewport_.style.overflow="hidden";this.viewport_.style.width="100%";this.viewport_.style.height="100%";this.overlayContainer_=document.createElement("div");this.overlayContainer_.style.position="absolute";this.overlayContainer_.style.zIndex="0";this.overlayContainer_.style.width="100%";this.overlayContainer_.style.height="100%";this.overlayContainer_.style.pointerEvents="none";this.overlayContainer_.className="ol-overlaycontainer";this.viewport_.appendChild(this.overlayContainer_);this.overlayContainerStopEvent_=document.createElement("div");this.overlayContainerStopEvent_.style.position="absolute";this.overlayContainerStopEvent_.style.zIndex="0";this.overlayContainerStopEvent_.style.width="100%";this.overlayContainerStopEvent_.style.height="100%";this.overlayContainerStopEvent_.style.pointerEvents="none";this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent";this.viewport_.appendChild(this.overlayContainerStopEvent_);this.mapBrowserEventHandler_=null;this.moveTolerance_=t.moveTolerance;this.keyboardEventTarget_=e.keyboardEventTarget;this.targetChangeHandlerKeys_=null;this.targetElement_=null;this.resizeObserver_=new ResizeObserver((()=>this.updateSize()));this.controls=e.controls||ka();this.interactions=e.interactions||Pl({onFocusOnly:true});this.overlays_=e.overlays;this.overlayIdIndex_={};this.renderer_=null;this.postRenderFunctions_=[];this.tileQueue_=new Ia(this.getTilePriority.bind(this),this.handleTileChange_.bind(this));this.addChangeListener(xa.LAYERGROUP,this.handleLayerGroupChanged_);this.addChangeListener(xa.VIEW,this.handleViewChanged_);this.addChangeListener(xa.SIZE,this.handleSizeChanged_);this.addChangeListener(xa.TARGET,this.handleTargetChanged_);this.setProperties(e.values);const n=this;if(t.view&&!(t.view instanceof gi)){t.view.then((function(t){n.setView(new gi(t))}))}this.controls.addEventListener(z.ADD,(t=>{t.element.setMap(this)}));this.controls.addEventListener(z.REMOVE,(t=>{t.element.setMap(null)}));this.interactions.addEventListener(z.ADD,(t=>{t.element.setMap(this)}));this.interactions.addEventListener(z.REMOVE,(t=>{t.element.setMap(null)}));this.overlays_.addEventListener(z.ADD,(t=>{this.addOverlayInternal_(t.element)}));this.overlays_.addEventListener(z.REMOVE,(t=>{const e=t.element.getId();if(e!==undefined){delete this.overlayIdIndex_[e.toString()]}t.element.setMap(null)}));this.controls.forEach((t=>{t.setMap(this)}));this.interactions.forEach((t=>{t.setMap(this)}));this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(t){this.getControls().push(t)}addInteraction(t){this.getInteractions().push(t)}addLayer(t){const e=this.getLayerGroup().getLayers();e.push(t)}handleLayerAdd_(t){Ol(t.layer,this)}addOverlay(t){this.getOverlays().push(t)}addOverlayInternal_(t){const e=t.getId();if(e!==undefined){this.overlayIdIndex_[e.toString()]=t}t.setMap(this)}disposeInternal(){this.controls.clear();this.interactions.clear();this.overlays_.clear();this.resizeObserver_.disconnect();this.setTarget(null);super.disposeInternal()}forEachFeatureAtPixel(t,e,n){if(!this.frameState_||!this.renderer_){return}const i=this.getCoordinateFromPixelInternal(t);n=n!==undefined?n:{};const s=n.hitTolerance!==undefined?n.hitTolerance:0;const r=n.layerFilter!==undefined?n.layerFilter:_;const o=n.checkWrapped!==false;return this.renderer_.forEachFeatureAtCoordinate(i,this.frameState_,s,o,e,null,r,null)}getFeaturesAtPixel(t,e){const n=[];this.forEachFeatureAtPixel(t,(function(t){n.push(t)}),e);return n}getAllLayers(){const t=[];function e(n){n.forEach((function(n){if(n instanceof ua){e(n.getLayers())}else{t.push(n)}}))}e(this.getLayers());return t}hasFeatureAtPixel(t,e){if(!this.frameState_||!this.renderer_){return false}const n=this.getCoordinateFromPixelInternal(t);e=e!==undefined?e:{};const i=e.layerFilter!==undefined?e.layerFilter:_;const s=e.hitTolerance!==undefined?e.hitTolerance:0;const r=e.checkWrapped!==false;return this.renderer_.hasFeatureAtCoordinate(n,this.frameState_,s,r,i,null)}getEventCoordinate(t){return this.getCoordinateFromPixel(this.getEventPixel(t))}getEventCoordinateInternal(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))}getEventPixel(t){const e=this.viewport_;const n=e.getBoundingClientRect();const i=this.getSize();const s=n.width/i[0];const r=n.height/i[1];const o="changedTouches"in t?t.changedTouches[0]:t;return[(o.clientX-n.left)/s,(o.clientY-n.top)/r]}getTarget(){return this.get(xa.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(t){return Ke(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())}getCoordinateFromPixelInternal(t){const e=this.frameState_;if(!e){return null}return hn(e.pixelToCoordinateTransform,t.slice())}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(t){const e=this.overlayIdIndex_[t.toString()];return e!==undefined?e:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(xa.LAYERGROUP)}setLayers(t){const e=this.getLayerGroup();if(t instanceof j){e.setLayers(t);return}const n=e.getLayers();n.clear();n.extend(t)}getLayers(){const t=this.getLayerGroup().getLayers();return t}getLoadingOrNotReady(){const t=this.getLayerGroup().getLayerStatesArray();for(let e=0,n=t.length;e<n;++e){const n=t[e];if(!n.visible){continue}const i=n.layer.getRenderer();if(i&&!i.ready){return true}const s=n.layer.getSource();if(s&&s.loading){return true}}return false}getPixelFromCoordinate(t){const e=je(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)}getPixelFromCoordinateInternal(t){const e=this.frameState_;if(!e){return null}return hn(e.coordinateToPixelTransform,t.slice(0,2))}getRenderer(){return this.renderer_}getSize(){return this.get(xa.SIZE)}getView(){return this.get(xa.VIEW)}getViewport(){return this.viewport_}getOverlayContainer(){return this.overlayContainer_}getOverlayContainerStopEvent(){return this.overlayContainerStopEvent_}getOwnerDocument(){const t=this.getTargetElement();return t?t.ownerDocument:document}getTilePriority(t,e,n,i){return Sa(this.frameState_,t,e,n,i)}handleBrowserEvent(t,e){e=e||t.type;const n=new pa(e,this,t);this.handleMapBrowserEvent(n)}handleMapBrowserEvent(t){if(!this.frameState_){return}const e=t.originalEvent;const n=e.type;if(n===ma.POINTERDOWN||n===R.WHEEL||n===R.KEYDOWN){const t=this.getOwnerDocument();const n=this.viewport_.getRootNode?this.viewport_.getRootNode():t;const i=e.target;if(this.overlayContainerStopEvent_.contains(i)||!(n===t?t.documentElement:n).contains(i)){return}}t.frameState=this.frameState_;if(this.dispatchEvent(t)!==false){const e=this.getInteractions().getArray().slice();for(let n=e.length-1;n>=0;n--){const i=e[n];if(i.getMap()!==this||!i.getActive()||!this.getTargetElement()){continue}const s=i.handleEvent(t);if(!s||t.propagationStopped){break}}}}handlePostRender(){const t=this.frameState_;const e=this.tileQueue_;if(!e.isEmpty()){let n=this.maxTilesLoading_;let i=n;if(t){const e=t.viewHints;if(e[st.ANIMATING]||e[st.INTERACTING]){const e=Date.now()-t.time>8;n=e?0:8;i=e?0:2}}if(e.getTilesLoading()<n){e.reprioritize();e.loadMoreTiles(n,i)}}if(t&&this.renderer_&&!t.animate){if(this.renderComplete_){if(this.hasListener(it.RENDERCOMPLETE)){this.renderer_.dispatchRenderEvent(it.RENDERCOMPLETE,t)}if(this.loaded_===false){this.loaded_=true;this.dispatchEvent(new fa(va.LOADEND,this,t))}}else if(this.loaded_===true){this.loaded_=false;this.dispatchEvent(new fa(va.LOADSTART,this,t))}}const n=this.postRenderFunctions_;for(let e=0,i=n.length;e<i;++e){n[e](this,t)}n.length=0}handleSizeChanged_(){if(this.getView()&&!this.getView().getAnimating()){this.getView().resolveConstraints(0)}this.render()}handleTargetChanged_(){if(this.mapBrowserEventHandler_){for(let t=0,e=this.targetChangeHandlerKeys_.length;t<e;++t){S(this.targetChangeHandlerKeys_[t])}this.targetChangeHandlerKeys_=null;this.viewport_.removeEventListener(R.CONTEXTMENU,this.boundHandleBrowserEvent_);this.viewport_.removeEventListener(R.WHEEL,this.boundHandleBrowserEvent_);this.mapBrowserEventHandler_.dispose();this.mapBrowserEventHandler_=null;this.viewport_.remove()}if(this.targetElement_){this.resizeObserver_.unobserve(this.targetElement_);const t=this.targetElement_.getRootNode();if(t instanceof ShadowRoot){this.resizeObserver_.unobserve(t.host)}this.setSize(undefined)}const t=this.getTarget();const e=typeof t==="string"?document.getElementById(t):t;this.targetElement_=e;if(!e){if(this.renderer_){clearTimeout(this.postRenderTimeoutHandle_);this.postRenderTimeoutHandle_=undefined;this.postRenderFunctions_.length=0;this.renderer_.dispose();this.renderer_=null}if(this.animationDelayKey_){cancelAnimationFrame(this.animationDelayKey_);this.animationDelayKey_=undefined}}else{e.appendChild(this.viewport_);if(!this.renderer_){this.renderer_=new aa(this)}this.mapBrowserEventHandler_=new Ea(this,this.moveTolerance_);for(const t in _a){this.mapBrowserEventHandler_.addEventListener(_a[t],this.handleMapBrowserEvent.bind(this))}this.viewport_.addEventListener(R.CONTEXTMENU,this.boundHandleBrowserEvent_,false);this.viewport_.addEventListener(R.WHEEL,this.boundHandleBrowserEvent_,ms?{passive:false}:false);const t=!this.keyboardEventTarget_?e:this.keyboardEventTarget_;this.targetChangeHandlerKeys_=[T(t,R.KEYDOWN,this.handleBrowserEvent,this),T(t,R.KEYPRESS,this.handleBrowserEvent,this)];const n=e.getRootNode();if(n instanceof ShadowRoot){this.resizeObserver_.observe(n.host)}this.resizeObserver_.observe(e)}this.updateSize()}handleTileChange_(){this.render()}handleViewPropertyChanged_(){this.render()}handleViewChanged_(){if(this.viewPropertyListenerKey_){S(this.viewPropertyListenerKey_);this.viewPropertyListenerKey_=null}if(this.viewChangeListenerKey_){S(this.viewChangeListenerKey_);this.viewChangeListenerKey_=null}const t=this.getView();if(t){this.updateViewportSize_(this.getSize());this.viewPropertyListenerKey_=T(t,l.PROPERTYCHANGE,this.handleViewPropertyChanged_,this);this.viewChangeListenerKey_=T(t,R.CHANGE,this.handleViewPropertyChanged_,this);t.resolveConstraints(0)}this.render()}handleLayerGroupChanged_(){if(this.layerGroupPropertyListenerKeys_){this.layerGroupPropertyListenerKeys_.forEach(S);this.layerGroupPropertyListenerKeys_=null}const t=this.getLayerGroup();if(t){this.handleLayerAdd_(new la("addlayer",t));this.layerGroupPropertyListenerKeys_=[T(t,l.PROPERTYCHANGE,this.render,this),T(t,R.CHANGE,this.render,this),T(t,"addlayer",this.handleLayerAdd_,this),T(t,"removelayer",this.handleLayerRemove_,this)]}this.render()}isRendered(){return!!this.frameState_}animationDelay_(){this.animationDelayKey_=undefined;this.renderFrame_(Date.now())}renderSync(){if(this.animationDelayKey_){cancelAnimationFrame(this.animationDelayKey_)}this.animationDelay_()}redrawText(){const t=this.getLayerGroup().getLayerStatesArray();for(let e=0,n=t.length;e<n;++e){const n=t[e].layer;if(n.hasRenderer()){n.getRenderer().handleFontsChanged()}}}render(){if(this.renderer_&&this.animationDelayKey_===undefined){this.animationDelayKey_=requestAnimationFrame(this.animationDelay_)}}removeControl(t){return this.getControls().remove(t)}removeInteraction(t){return this.getInteractions().remove(t)}removeLayer(t){const e=this.getLayerGroup().getLayers();return e.remove(t)}handleLayerRemove_(t){Ll(t.layer)}removeOverlay(t){return this.getOverlays().remove(t)}renderFrame_(t){const e=this.getSize();const n=this.getView();const i=this.frameState_;let s=null;if(e!==undefined&&zi(e)&&n&&n.isDef()){const i=n.getHints(this.frameState_?this.frameState_.viewHints:undefined);const r=n.getState();s={animate:false,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutter:null,extent:ee(r.center,r.resolution,r.rotation,e),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:e,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:r,viewHints:i,wantedTiles:{},mapId:D(this),renderTargets:{}};if(r.nextCenter&&r.nextResolution){const t=isNaN(r.nextRotation)?r.rotation:r.nextRotation;s.nextExtent=ee(r.nextCenter,r.nextResolution,t,e)}}this.frameState_=s;this.renderer_.renderFrame(s);if(s){if(s.animate){this.render()}Array.prototype.push.apply(this.postRenderFunctions_,s.postRenderFunctions);if(i){const t=!this.previousExtent_||!he(this.previousExtent_)&&!Wt(s.extent,this.previousExtent_);if(t){this.dispatchEvent(new fa(va.MOVESTART,this,i));this.previousExtent_=Kt(this.previousExtent_)}}const t=this.previousExtent_&&!s.viewHints[st.ANIMATING]&&!s.viewHints[st.INTERACTING]&&!Wt(s.extent,this.previousExtent_);if(t){this.dispatchEvent(new fa(va.MOVEEND,this,s));Ot(s.extent,this.previousExtent_)}}this.dispatchEvent(new fa(va.POSTRENDER,this,s));this.renderComplete_=(this.hasListener(va.LOADSTART)||this.hasListener(va.LOADEND)||this.hasListener(it.RENDERCOMPLETE))&&!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady();if(!this.postRenderTimeoutHandle_){this.postRenderTimeoutHandle_=setTimeout((()=>{this.postRenderTimeoutHandle_=undefined;this.handlePostRender()}),0)}}setLayerGroup(t){const e=this.getLayerGroup();if(e){this.handleLayerRemove_(new la("removelayer",e))}this.set(xa.LAYERGROUP,t)}setSize(t){this.set(xa.SIZE,t)}setTarget(t){this.set(xa.TARGET,t)}setView(t){if(!t||t instanceof gi){this.set(xa.VIEW,t);return}this.set(xa.VIEW,new gi);const e=this;t.then((function(t){e.setView(new gi(t))}))}updateSize(){const t=this.getTargetElement();let e=undefined;if(t){const n=getComputedStyle(t);const i=t.offsetWidth-parseFloat(n["borderLeftWidth"])-parseFloat(n["paddingLeft"])-parseFloat(n["paddingRight"])-parseFloat(n["borderRightWidth"]);const s=t.offsetHeight-parseFloat(n["borderTopWidth"])-parseFloat(n["paddingTop"])-parseFloat(n["paddingBottom"])-parseFloat(n["borderBottomWidth"]);if(!isNaN(i)&&!isNaN(s)){e=[Math.max(0,i),Math.max(0,s)];if(!zi(e)&&!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)){Re("No map visible because the map container's width or height are 0.")}}}const n=this.getSize();if(e&&(!n||!g(e,n))){this.setSize(e);this.updateViewportSize_(e)}}updateViewportSize_(t){const e=this.getView();if(e){e.setViewportSize(t)}}}function Fl(t){let e=null;if(t.keyboardEventTarget!==undefined){e=typeof t.keyboardEventTarget==="string"?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget}const n={};const i=t.layers&&typeof t.layers.getLayers==="function"?t.layers:new ua({layers:t.layers});n[xa.LAYERGROUP]=i;n[xa.TARGET]=t.target;n[xa.VIEW]=t.view instanceof gi?t.view:new gi;let s;if(t.controls!==undefined){if(Array.isArray(t.controls)){s=new j(t.controls.slice())}else{W(typeof t.controls.getArray==="function","Expected `controls` to be an array or an `ol/Collection.js`");s=t.controls}}let r;if(t.interactions!==undefined){if(Array.isArray(t.interactions)){r=new j(t.interactions.slice())}else{W(typeof t.interactions.getArray==="function","Expected `interactions` to be an array or an `ol/Collection.js`");r=t.interactions}}let o;if(t.overlays!==undefined){if(Array.isArray(t.overlays)){o=new j(t.overlays.slice())}else{W(typeof t.overlays.getArray==="function","Expected `overlays` to be an array or an `ol/Collection.js`");o=t.overlays}}else{o=new j}return{controls:s,interactions:r,keyboardEventTarget:e,overlays:o,values:n}}var Nl=Dl;var kl={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class zl extends mi{constructor(t){t=t?t:{};const e=Object.assign({},t);const n=t.cacheSize;delete t.cacheSize;delete e.preload;delete e.useInterimTilesOnError;super(e);this.on;this.once;this.un;this.cacheSize_=n;this.setPreload(t.preload!==undefined?t.preload:0);this.setUseInterimTilesOnError(t.useInterimTilesOnError!==undefined?t.useInterimTilesOnError:true)}getCacheSize(){return this.cacheSize_}getPreload(){return this.get(kl.PRELOAD)}setPreload(t){this.set(kl.PRELOAD,t)}getUseInterimTilesOnError(){return this.get(kl.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(t){this.set(kl.USE_INTERIM_TILES_ON_ERROR,t)}getData(t){return super.getData(t)}}var Gl=zl;const Vl=5;class Kl extends P{constructor(t){super();this.ready=true;this.boundHandleImageChange_=this.handleImageChange_.bind(this);this.layer_=t;this.staleKeys_=new Array;this.maxStaleKeys=Vl}getStaleKeys(){return this.staleKeys_}prependStaleKey(t){this.staleKeys_.unshift(t);if(this.staleKeys_.length>this.maxStaleKeys){this.staleKeys_.length=this.maxStaleKeys}}getFeatures(t){return L()}getData(t){return null}prepareFrame(t){return L()}renderFrame(t,e){return L()}forEachFeatureAtCoordinate(t,e,n,i,s){return undefined}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){const e=t.target;if(e.getState()===ki.LOADED||e.getState()===ki.ERROR){this.renderIfReadyAndVisible()}}loadImage(t){let e=t.getState();if(e!=ki.LOADED&&e!=ki.ERROR){t.addEventListener(R.CHANGE,this.boundHandleImageChange_)}if(e==ki.IDLE){t.load();e=t.getState()}return e==ki.LOADED}renderIfReadyAndVisible(){const t=this.getLayer();if(t&&t.getVisible()&&t.getSourceState()==="ready"){t.changed()}}renderDeferred(t){}disposeInternal(){delete this.layer_;super.disposeInternal()}}var jl=Kl;class Xl{constructor(){this.instructions_=[];this.zIndex=0;this.offset_=0;this.context_=new Proxy(vs(),{get:(t,e)=>{if(typeof vs()[e]!=="function"){return undefined}if(!this.instructions_[this.zIndex+this.offset_]){this.instructions_[this.zIndex+this.offset_]=[]}this.instructions_[this.zIndex+this.offset_].push(e);return this.pushMethodArgs_},set:(t,e,n)=>{if(!this.instructions_[this.zIndex+this.offset_]){this.instructions_[this.zIndex+this.offset_]=[]}this.instructions_[this.zIndex+this.offset_].push(e,n);return true}})}pushMethodArgs_=(...t)=>{this.instructions_[this.zIndex+this.offset_].push(t);return this};pushFunction(t){this.instructions_[this.zIndex+this.offset_].push(t)}getContext(){return this.context_}draw(t){this.instructions_.forEach((e=>{for(let n=0,i=e.length;n<i;++n){const i=e[n];if(typeof i==="function"){i(t);continue}const s=e[++n];if(typeof t[i]==="function"){t[i](...s)}else{if(typeof s==="function"){t[i]=s(t);continue}t[i]=s}}}))}clear(){this.instructions_.length=0;this.zIndex=0;this.offset_=0}offset(){this.offset_=this.instructions_.length;this.zIndex=0}}var Wl=Xl;let Yl=null;function Zl(){Yl=ys(1,1,undefined,{willReadFrequently:true})}class Ul extends jl{constructor(t){super(t);this.container=null;this.renderedResolution;this.tempTransform=ln();this.pixelTransform=ln();this.inversePixelTransform=ln();this.context=null;this.deferredContext_=null;this.containerReused=false;this.frameState=null}getImageData(t,e,n){if(!Yl){Zl()}Yl.clearRect(0,0,1,1);let i;try{Yl.drawImage(t,e,n,1,1,0,0,1,1);i=Yl.getImageData(0,0,1,1).data}catch(t){Yl=null;return null}return i}getBackground(t){const e=this.getLayer();let n=e.getBackground();if(typeof n==="function"){n=n(t.viewState.resolution)}return n||undefined}useContainer(t,e,n){const i=this.getLayer().getClassName();let s,r;if(t&&t.className===i&&(!n||t&&t.style.backgroundColor&&g(os(t.style.backgroundColor),os(n)))){const e=t.firstElementChild;if(e instanceof HTMLCanvasElement){r=e.getContext("2d")}}if(r&&r.canvas.style.transform===e){this.container=t;this.context=r;this.containerReused=true}else if(this.containerReused){this.container=null;this.context=null;this.containerReused=false}else if(this.container){this.container.style.backgroundColor=null}if(!this.container){s=document.createElement("div");s.className=i;let t=s.style;t.position="absolute";t.width="100%";t.height="100%";r=ys();const e=r.canvas;s.appendChild(e);t=e.style;t.position="absolute";t.left="0";t.transformOrigin="top left";this.container=s;this.context=r}if(!this.containerReused&&n&&!this.container.style.backgroundColor){this.container.style.backgroundColor=n}}clipUnrotated(t,e,n){const i=re(n);const s=oe(n);const r=Jt(n);const o=$t(n);hn(e.coordinateToPixelTransform,i);hn(e.coordinateToPixelTransform,s);hn(e.coordinateToPixelTransform,r);hn(e.coordinateToPixelTransform,o);const a=this.inversePixelTransform;hn(a,i);hn(a,s);hn(a,r);hn(a,o);t.save();t.beginPath();t.moveTo(Math.round(i[0]),Math.round(i[1]));t.lineTo(Math.round(s[0]),Math.round(s[1]));t.lineTo(Math.round(r[0]),Math.round(r[1]));t.lineTo(Math.round(o[0]),Math.round(o[1]));t.clip()}prepareContainer(t,e){const n=t.extent;const i=t.viewState.resolution;const s=t.viewState.rotation;const r=t.pixelRatio;const o=Math.round(ae(n)/i*r);const a=Math.round(ie(n)/i*r);cn(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/r,1/r,s,-o/2,-a/2);un(this.inversePixelTransform,this.pixelTransform);const l=gn(this.pixelTransform);this.useContainer(e,l,this.getBackground(t));if(!this.containerReused){const t=this.context.canvas;if(t.width!=o||t.height!=a){t.width=o;t.height=a}else{this.context.clearRect(0,0,o,a)}if(l!==t.style.transform){t.style.transform=l}}}dispatchRenderEvent_(t,e,n){const i=this.getLayer();if(i.hasListener(t)){const s=new ra(t,this.inversePixelTransform,n,e);i.dispatchEvent(s)}}preRender(t,e){this.frameState=e;if(e.declutter){return}this.dispatchRenderEvent_(it.PRERENDER,t,e)}postRender(t,e){if(e.declutter){return}this.dispatchRenderEvent_(it.POSTRENDER,t,e)}renderDeferredInternal(t){}getRenderContext(t){if(t.declutter&&!this.deferredContext_){this.deferredContext_=new Wl}return t.declutter?this.deferredContext_.getContext():this.context}renderDeferred(t){if(!t.declutter){return}this.dispatchRenderEvent_(it.PRERENDER,this.context,t);if(t.declutter&&this.deferredContext_){this.deferredContext_.draw(this.context);this.deferredContext_.clear()}this.renderDeferredInternal(t);this.dispatchRenderEvent_(it.POSTRENDER,this.context,t)}getRenderTransform(t,e,n,i,s,r,o){const a=s/2;const l=r/2;const h=i/e;const c=-h;const u=-t[0]+o;const d=-t[1];return cn(this.tempTransform,a,l,h,c,-n,u,d)}disposeInternal(){delete this.frameState;super.disposeInternal()}}var Bl=Ul;class Hl extends b{constructor(t,e,n){super();n=n?n:{};this.tileCoord=t;this.state=e;this.key="";this.transition_=n.transition===undefined?250:n.transition;this.transitionStarts_={};this.interpolate=!!n.interpolate}changed(){this.dispatchEvent(R.CHANGE)}release(){if(this.state===Ra.ERROR){this.setState(Ra.EMPTY)}}getKey(){return this.key+"/"+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(t){if(this.state!==Ra.ERROR&&this.state>t){throw new Error("Tile load sequence violation")}this.state=t;this.changed()}load(){L()}getAlpha(t,e){if(!this.transition_){return 1}let n=this.transitionStarts_[t];if(!n){n=e;this.transitionStarts_[t]=n}else if(n===-1){return 1}const i=e-n+1e3/60;if(i>=this.transition_){return 1}return sn(i/this.transition_)}inTransition(t){if(!this.transition_){return false}return this.transitionStarts_[t]!==-1}endTransition(t){if(this.transition_){this.transitionStarts_[t]=-1}}}var ql=Hl;function $l(t){return t instanceof Image||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageBitmap?t:null}function Jl(t){return t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Float32Array||t instanceof DataView?t:null}const Ql=new Error("disposed");let th=null;function eh(t){if(!th){th=ys(t.width,t.height,undefined,{willReadFrequently:true})}const e=th.canvas;const n=t.width;if(e.width!==n){e.width=n}const i=t.height;if(e.height!==i){e.height=i}th.clearRect(0,0,n,i);th.drawImage(t,0,0);return th.getImageData(0,0,n,i).data}const nh=[256,256];class ih extends ql{constructor(t){const e=Ra.IDLE;super(t.tileCoord,e,{transition:t.transition,interpolate:t.interpolate});this.loader_=t.loader;this.data_=null;this.error_=null;this.size_=t.size||null;this.controller_=t.controller||null}getSize(){if(this.size_){return this.size_}const t=$l(this.data_);if(t){return[t.width,t.height]}return nh}getData(){return this.data_}getError(){return this.error_}load(){if(this.state!==Ra.IDLE&&this.state!==Ra.ERROR){return}this.state=Ra.LOADING;this.changed();const t=this;this.loader_().then((function(e){t.data_=e;t.state=Ra.LOADED;t.changed()})).catch((function(e){t.error_=e;t.state=Ra.ERROR;t.changed()}))}disposeInternal(){if(this.controller_){this.controller_.abort(Ql);this.controller_=null}super.disposeInternal()}}var sh=ih;class rh extends ql{constructor(t,e,n,i,s,r){super(t,e,r);this.crossOrigin_=i;this.src_=n;this.key=n;this.image_=new Image;if(i!==null){this.image_.crossOrigin=i}this.unlisten_=null;this.tileLoadFunction_=s}getImage(){return this.image_}setImage(t){this.image_=t;this.state=Ra.LOADED;this.unlistenImage_();this.changed()}handleImageError_(){this.state=Ra.ERROR;this.unlistenImage_();this.image_=oh();this.changed()}handleImageLoad_(){const t=this.image_;if(t.naturalWidth&&t.naturalHeight){this.state=Ra.LOADED}else{this.state=Ra.EMPTY}this.unlistenImage_();this.changed()}load(){if(this.state==Ra.ERROR){this.state=Ra.IDLE;this.image_=new Image;if(this.crossOrigin_!==null){this.image_.crossOrigin=this.crossOrigin_}}if(this.state==Ra.IDLE){this.state=Ra.LOADING;this.changed();this.tileLoadFunction_(this,this.src_);this.unlisten_=Is(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}}unlistenImage_(){if(this.unlisten_){this.unlisten_();this.unlisten_=null}}}function oh(){const t=ys(1,1);t.fillStyle="rgba(0,0,0,0)";t.fillRect(0,0,1,1);return t.canvas}var ah=rh;class lh{constructor(t){this.highWaterMark=t!==undefined?t:2048;this.count_=0;this.entries_={};this.oldest_=null;this.newest_=null}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(t){while(this.canExpireCache()){this.pop()}}clear(){this.count_=0;this.entries_={};this.oldest_=null;this.newest_=null}containsKey(t){return this.entries_.hasOwnProperty(t)}forEach(t){let e=this.oldest_;while(e){t(e.value_,e.key_,this);e=e.newer}}get(t,e){const n=this.entries_[t];W(n!==undefined,"Tried to get a value for a key that does not exist in the cache");if(n===this.newest_){return n.value_}if(n===this.oldest_){this.oldest_=this.oldest_.newer;this.oldest_.older=null}else{n.newer.older=n.older;n.older.newer=n.newer}n.newer=null;n.older=this.newest_;this.newest_.newer=n;this.newest_=n;return n.value_}remove(t){const e=this.entries_[t];W(e!==undefined,"Tried to get a value for a key that does not exist in the cache");if(e===this.newest_){this.newest_=e.older;if(this.newest_){this.newest_.newer=null}}else if(e===this.oldest_){this.oldest_=e.newer;if(this.oldest_){this.oldest_.older=null}}else{e.newer.older=e.older;e.older.newer=e.newer}delete this.entries_[t];--this.count_;return e.value_}getCount(){return this.count_}getKeys(){const t=new Array(this.count_);let e=0;let n;for(n=this.newest_;n;n=n.older){t[e++]=n.key_}return t}getValues(){const t=new Array(this.count_);let e=0;let n;for(n=this.newest_;n;n=n.older){t[e++]=n.value_}return t}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(t){return this.entries_[t]?.value_}pop(){const t=this.oldest_;delete this.entries_[t.key_];if(t.newer){t.newer.older=null}this.oldest_=t.newer;if(!this.oldest_){this.newest_=null}--this.count_;return t.value_}replace(t,e){this.get(t);this.entries_[t].value_=e}set(t,e){W(!(t in this.entries_),"Tried to set a value for a key that is used already");const n={key_:t,newer:null,older:this.newest_,value_:e};if(!this.newest_){this.oldest_=n}else{this.newest_.newer=n}this.newest_=n;this.entries_[t]=n;++this.count_}setSize(t){this.highWaterMark=t}}var hh=lh;const ch=.5;const uh=10;const dh=.25;class fh{constructor(t,e,n,i,s,r){this.sourceProj_=t;this.targetProj_=e;let o={};const a=Ge(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){const e=t[0]+"/"+t[1];if(!o[e]){o[e]=a(t)}return o[e]};this.maxSourceExtent_=i;this.errorThresholdSquared_=s*s;this.triangles_=[];this.wrapsXInSource_=false;this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!i&&!!this.sourceProj_.getExtent()&&ae(i)>=ae(this.sourceProj_.getExtent());this.sourceWorldWidth_=this.sourceProj_.getExtent()?ae(this.sourceProj_.getExtent()):null;this.targetWorldWidth_=this.targetProj_.getExtent()?ae(this.targetProj_.getExtent()):null;const l=re(n);const h=oe(n);const c=Jt(n);const u=$t(n);const d=this.transformInv_(l);const f=this.transformInv_(h);const g=this.transformInv_(c);const p=this.transformInv_(u);const _=uh+(r?Math.max(0,Math.ceil(Math.log2(qt(n)/(r*r*256*256)))):0);this.addQuad_(l,h,c,u,d,f,g,p,_);if(this.wrapsXInSource_){let t=Infinity;this.triangles_.forEach((function(e,n,i){t=Math.min(t,e.source[0][0],e.source[1][0],e.source[2][0])}));this.triangles_.forEach((e=>{if(Math.max(e.source[0][0],e.source[1][0],e.source[2][0])-t>this.sourceWorldWidth_/2){const n=[[e.source[0][0],e.source[0][1]],[e.source[1][0],e.source[1][1]],[e.source[2][0],e.source[2][1]]];if(n[0][0]-t>this.sourceWorldWidth_/2){n[0][0]-=this.sourceWorldWidth_}if(n[1][0]-t>this.sourceWorldWidth_/2){n[1][0]-=this.sourceWorldWidth_}if(n[2][0]-t>this.sourceWorldWidth_/2){n[2][0]-=this.sourceWorldWidth_}const i=Math.min(n[0][0],n[1][0],n[2][0]);const s=Math.max(n[0][0],n[1][0],n[2][0]);if(s-i<this.sourceWorldWidth_/2){e.source=n}}}))}o={}}addTriangle_(t,e,n,i,s,r){this.triangles_.push({source:[i,s,r],target:[t,e,n]})}addQuad_(t,e,n,i,s,r,o,a,l){const h=Lt([s,r,o,a]);const c=this.sourceWorldWidth_?ae(h)/this.sourceWorldWidth_:null;const u=this.sourceWorldWidth_;const d=this.sourceProj_.canWrapX()&&c>.5&&c<1;let f=false;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const s=Lt([t,e,n,i]);const r=ae(s)/this.targetWorldWidth_;f=r>dh||f}if(!d&&this.sourceProj_.isGlobal()&&c){f=c>dh||f}}if(!f&&this.maxSourceExtent_){if(isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3])){if(!le(h,this.maxSourceExtent_)){return}}}let g=0;if(!f){if(!isFinite(s[0])||!isFinite(s[1])||!isFinite(r[0])||!isFinite(r[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])){if(l>0){f=true}else{g=(!isFinite(s[0])||!isFinite(s[1])?8:0)+(!isFinite(r[0])||!isFinite(r[1])?4:0)+(!isFinite(o[0])||!isFinite(o[1])?2:0)+(!isFinite(a[0])||!isFinite(a[1])?1:0);if(g!=1&&g!=2&&g!=4&&g!=8){return}}}}if(l>0){if(!f){const e=[(t[0]+n[0])/2,(t[1]+n[1])/2];const i=this.transformInv_(e);let r;if(d){const t=(q(s[0],u)+q(o[0],u))/2;r=t-q(i[0],u)}else{r=(s[0]+o[0])/2-i[0]}const a=(s[1]+o[1])/2-i[1];const l=r*r+a*a;f=l>this.errorThresholdSquared_}if(f){if(Math.abs(t[0]-n[0])<=Math.abs(t[1]-n[1])){const h=[(e[0]+n[0])/2,(e[1]+n[1])/2];const c=this.transformInv_(h);const u=[(i[0]+t[0])/2,(i[1]+t[1])/2];const d=this.transformInv_(u);this.addQuad_(t,e,h,u,s,r,c,d,l-1);this.addQuad_(u,h,n,i,d,c,o,a,l-1)}else{const h=[(t[0]+e[0])/2,(t[1]+e[1])/2];const c=this.transformInv_(h);const u=[(n[0]+i[0])/2,(n[1]+i[1])/2];const d=this.transformInv_(u);this.addQuad_(t,h,u,i,s,c,d,a,l-1);this.addQuad_(h,e,n,u,c,r,o,d,l-1)}return}}if(d){if(!this.canWrapXInSource_){return}this.wrapsXInSource_=true}if((g&11)==0){this.addTriangle_(t,n,i,s,o,a)}if((g&14)==0){this.addTriangle_(t,n,e,s,o,r)}if(g){if((g&13)==0){this.addTriangle_(e,i,t,r,a,s)}if((g&7)==0){this.addTriangle_(e,i,n,r,a,o)}}}calculateSourceExtent(){const t=Gt();this.triangles_.forEach((function(e,n,i){const s=e.source;Zt(t,s[0]);Zt(t,s[1]);Zt(t,s[2])}));return t}getTriangles(){return this.triangles_}}var gh=fh;let ph;const _h=[];function mh(t,e,n,i,s){t.beginPath();t.moveTo(0,0);t.lineTo(e,n);t.lineTo(i,s);t.closePath();t.save();t.clip();t.fillRect(0,0,Math.max(e,i)+1,Math.max(n,s));t.restore()}function yh(t,e){return Math.abs(t[e*4]-210)>2||Math.abs(t[e*4+3]-.75*255)>2}function Eh(){if(ph===undefined){const t=ys(6,6,_h);t.globalCompositeOperation="lighter";t.fillStyle="rgba(210, 0, 0, 0.75)";mh(t,4,5,4,0);mh(t,4,5,0,5);const e=t.getImageData(0,0,3,3).data;ph=yh(e,0)||yh(e,4)||yh(e,8);xs(t);_h.push(t.canvas)}return ph}function vh(t,e,n,i){const s=Ve(n,e,t);let r=Oe(e,i,n);const o=e.getMetersPerUnit();if(o!==undefined){r*=o}const a=t.getMetersPerUnit();if(a!==undefined){r/=a}const l=t.getExtent();if(!l||Ft(l,s)){const e=Oe(t,r,s)/r;if(isFinite(e)&&e>0){r/=e}}return r}function xh(t,e,n,i){const s=Qt(n);let r=vh(t,e,s,i);if(!isFinite(r)||r<=0){Ht(n,(function(n){r=vh(t,e,n,i);return isFinite(r)&&r>0}))}return r}function wh(t,e,n,i,s,r,o,a,l,h,c,u,d,f){const g=ys(Math.round(n*t),Math.round(n*e),_h);if(!u){g.imageSmoothingEnabled=false}if(l.length===0){return g.canvas}g.scale(n,n);function p(t){return Math.round(t*n)/n}g.globalCompositeOperation="lighter";const _=Gt();l.forEach((function(t,e,n){Yt(_,t.extent)}));let m;const y=n/i;const E=(u?1:1+Math.pow(2,-24))/y;if(!d||l.length!==1||h!==0){m=ys(Math.round(ae(_)*y),Math.round(ie(_)*y),_h);if(!u){m.imageSmoothingEnabled=false}if(s&&f){const t=(s[0]-_[0])*y;const e=-(s[3]-_[3])*y;const n=ae(s)*y;const i=ie(s)*y;m.rect(t,e,n,i);m.clip()}l.forEach((function(t,e,n){if(t.image.width>0&&t.image.height>0){if(t.clipExtent){m.save();const e=(t.clipExtent[0]-_[0])*y;const n=-(t.clipExtent[3]-_[3])*y;const i=ae(t.clipExtent)*y;const s=ie(t.clipExtent)*y;m.rect(u?e:Math.round(e),u?n:Math.round(n),u?i:Math.round(e+i)-Math.round(e),u?s:Math.round(n+s)-Math.round(n));m.clip()}const e=(t.extent[0]-_[0])*y;const n=-(t.extent[3]-_[3])*y;const i=ae(t.extent)*y;const s=ie(t.extent)*y;m.drawImage(t.image,h,h,t.image.width-2*h,t.image.height-2*h,u?e:Math.round(e),u?n:Math.round(n),u?i:Math.round(e+i)-Math.round(e),u?s:Math.round(n+s)-Math.round(n));if(t.clipExtent){m.restore()}}}))}const v=re(o);a.getTriangles().forEach((function(t,e,n){const i=t.source;const s=t.target;let o=i[0][0],a=i[0][1];let h=i[1][0],c=i[1][1];let d=i[2][0],f=i[2][1];const y=p((s[0][0]-v[0])/r);const x=p(-(s[0][1]-v[1])/r);const w=p((s[1][0]-v[0])/r);const C=p(-(s[1][1]-v[1])/r);const b=p((s[2][0]-v[0])/r);const R=p(-(s[2][1]-v[1])/r);const T=o;const I=a;o=0;a=0;h-=T;c-=I;d-=T;f-=I;const S=[[h,c,0,0,w-y],[d,f,0,0,b-y],[0,0,h,c,C-x],[0,0,d,f,R-x]];const M=B(S);if(!M){return}g.save();g.beginPath();if(Eh()||!u){g.moveTo(w,C);const t=4;const e=y-w;const n=x-C;for(let i=0;i<t;i++){g.lineTo(w+p((i+1)*e/t),C+p(i*n/(t-1)));if(i!=t-1){g.lineTo(w+p((i+1)*e/t),C+p((i+1)*n/(t-1)))}}g.lineTo(b,R)}else{g.moveTo(w,C);g.lineTo(y,x);g.lineTo(b,R)}g.clip();g.transform(M[0],M[2],M[1],M[3],y,x);g.translate(_[0]-T,_[3]-I);let A;if(m){A=m.canvas;g.scale(E,-E)}else{const t=l[0];const e=t.extent;A=t.image;g.scale(ae(e)/A.width,-ie(e)/A.height)}g.drawImage(A,0,0);g.restore()}));if(m){xs(m);_h.push(m.canvas)}if(c){g.save();g.globalCompositeOperation="source-over";g.strokeStyle="black";g.lineWidth=1;a.getTriangles().forEach((function(t,e,n){const i=t.target;const s=(i[0][0]-v[0])/r;const o=-(i[0][1]-v[1])/r;const a=(i[1][0]-v[0])/r;const l=-(i[1][1]-v[1])/r;const h=(i[2][0]-v[0])/r;const c=-(i[2][1]-v[1])/r;g.beginPath();g.moveTo(a,l);g.lineTo(s,o);g.lineTo(h,c);g.closePath();g.stroke()}));g.restore()}return g.canvas}class Ch extends sh{constructor(t){super({tileCoord:t.tileCoord,loader:()=>Promise.resolve(new Uint8ClampedArray(4)),interpolate:t.interpolate,transition:t.transition});this.pixelRatio_=t.pixelRatio;this.gutter_=t.gutter;this.reprojData_=null;this.reprojError_=null;this.reprojSize_=undefined;this.sourceTileGrid_=t.sourceTileGrid;this.targetTileGrid_=t.targetTileGrid;this.wrappedTileCoord_=t.wrappedTileCoord||t.tileCoord;this.sourceTiles_=[];this.sourcesListenerKeys_=null;this.sourceZ_=0;const e=t.sourceProj;const n=e.getExtent();const i=t.sourceTileGrid.getExtent();this.clipExtent_=e.canWrapX()?i?se(n,i):n:i;const s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);const r=this.targetTileGrid_.getExtent();let o=this.sourceTileGrid_.getExtent();const a=r?se(s,r):s;if(qt(a)===0){this.state=Ra.EMPTY;return}if(n){if(!o){o=n}else{o=se(o,n)}}const l=this.targetTileGrid_.getResolution(this.wrappedTileCoord_[0]);const h=t.targetProj;const c=xh(e,h,a,l);if(!isFinite(c)||c<=0){this.state=Ra.EMPTY;return}const u=t.errorThreshold!==undefined?t.errorThreshold:ch;this.triangulation_=new gh(e,h,a,o,c*u,l);if(this.triangulation_.getTriangles().length===0){this.state=Ra.EMPTY;return}this.sourceZ_=this.sourceTileGrid_.getZForResolution(c);let d=this.triangulation_.calculateSourceExtent();if(o){if(e.canWrapX()){d[1]=Y(d[1],o[1],o[3]);d[3]=Y(d[3],o[1],o[3])}else{d=se(d,o)}}if(!qt(d)){this.state=Ra.EMPTY}else{let i=0;let s=0;if(e.canWrapX()){i=ae(n);s=Math.floor((d[0]-n[0])/i)}const r=ge(d.slice(),e,true);r.forEach((e=>{const n=this.sourceTileGrid_.getTileRangeForExtentAndZ(e,this.sourceZ_);const r=t.getTileFunction;for(let t=n.minX;t<=n.maxX;t++){for(let e=n.minY;e<=n.maxY;e++){const n=r(this.sourceZ_,t,e,this.pixelRatio_);if(n){const t=s*i;this.sourceTiles_.push({tile:n,offset:t})}}}++s}));if(this.sourceTiles_.length===0){this.state=Ra.EMPTY}}}getSize(){return this.reprojSize_}getData(){return this.reprojData_}getError(){return this.reprojError_}reproject_(){const t=[];let e=false;this.sourceTiles_.forEach((n=>{const i=n.tile;if(!i||i.getState()!==Ra.LOADED){return}const s=i.getSize();const r=this.gutter_;let o;const a=Jl(i.getData());if(a){o=a}else{e=true;o=eh($l(i.getData()))}const l=[s[0]+2*r,s[1]+2*r];const h=o instanceof Float32Array;const c=l[0]*l[1];const u=h?Float32Array:Uint8ClampedArray;const d=new u(o.buffer);const f=u.BYTES_PER_ELEMENT;const g=f*d.length/c;const p=d.byteLength/l[1];const _=Math.floor(p/f/l[0]);const m=c*_;let y=d;if(d.length!==m){y=new u(m);let t=0;let e=0;const n=l[0]*_;for(let i=0;i<l[1];++i){for(let i=0;i<n;++i){y[t++]=d[e+i]}e+=p/f}}const E=this.sourceTileGrid_.getTileCoordExtent(i.tileCoord);E[0]+=n.offset;E[2]+=n.offset;const v=this.clipExtent_?.slice();if(v){v[0]+=n.offset;v[2]+=n.offset}t.push({extent:E,clipExtent:v,data:new Uint8ClampedArray(y.buffer),dataType:u,bytesPerPixel:g,pixelSize:l})}));this.sourceTiles_.length=0;if(t.length===0){this.state=Ra.ERROR;this.changed();return}const n=this.wrappedTileCoord_[0];const i=this.targetTileGrid_.getTileSize(n);const s=typeof i==="number"?i:i[0];const r=typeof i==="number"?i:i[1];const o=this.targetTileGrid_.getResolution(n);const a=this.sourceTileGrid_.getResolution(this.sourceZ_);const l=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);let h,c;const u=t[0].bytesPerPixel;const d=Math.ceil(u/3);for(let e=d-1;e>=0;--e){const n=[];for(let i=0,s=t.length;i<s;++i){const s=t[i];const r=s.data;const o=s.pixelSize;const a=o[0];const l=o[1];const h=ys(a,l,_h);const c=h.createImageData(a,l);const d=c.data;let f=e*3;for(let t=0,e=d.length;t<e;t+=4){d[t]=r[f];d[t+1]=r[f+1];d[t+2]=r[f+2];d[t+3]=255;f+=u}h.putImageData(c,0,0);n.push({extent:s.extent,clipExtent:s.clipExtent,image:h.canvas})}const i=wh(s,r,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,l,this.triangulation_,n,this.gutter_,false,false,false);for(let t=0,e=n.length;t<e;++t){const e=n[t].image;const i=e.getContext("2d");xs(i);_h.push(i.canvas)}const d=i.getContext("2d");const f=d.getImageData(0,0,i.width,i.height);xs(d);_h.push(i);if(!h){c=new Uint8ClampedArray(u*f.width*f.height);h=new t[0].dataType(c.buffer)}const g=f.data;let p=e*3;for(let t=0,e=g.length;t<e;t+=4){if(g[t+3]===255){c[p]=g[t];c[p+1]=g[t+1];c[p+2]=g[t+2]}else{c[p]=0;c[p+1]=0;c[p+2]=0}p+=u}}if(e){const t=ys(s,r);const e=new ImageData(h,s);t.putImageData(e,0,0);this.reprojData_=t.canvas}else{this.reprojData_=h}this.reprojSize_=[Math.round(s*this.pixelRatio_),Math.round(r*this.pixelRatio_)];this.state=Ra.LOADED;this.changed()}load(){if(this.state!==Ra.IDLE&&this.state!==Ra.ERROR){return}this.state=Ra.LOADING;this.changed();let t=0;this.sourcesListenerKeys_=[];this.sourceTiles_.forEach((({tile:e})=>{const n=e.getState();if(n!==Ra.IDLE&&n!==Ra.LOADING){return}t++;const i=T(e,R.CHANGE,(()=>{const n=e.getState();if(n==Ra.LOADED||n==Ra.ERROR||n==Ra.EMPTY){S(i);t--;if(t===0){this.unlistenSources_();this.reproject_()}}}));this.sourcesListenerKeys_.push(i)}));if(t===0){setTimeout(this.reproject_.bind(this),0)}else{this.sourceTiles_.forEach((function({tile:t}){const e=t.getState();if(e==Ra.IDLE){t.load()}}))}}unlistenSources_(){this.sourcesListenerKeys_.forEach(S);this.sourcesListenerKeys_=null}}var bh=Ch;class Rh extends ql{constructor(t,e,n,i,s,r,o,a,l,h,c,u){super(s,Ra.IDLE,u);this.renderEdges_=c!==undefined?c:false;this.pixelRatio_=o;this.gutter_=a;this.canvas_=null;this.sourceTileGrid_=e;this.targetTileGrid_=i;this.wrappedTileCoord_=r?r:s;this.sourceTiles_=[];this.sourcesListenerKeys_=null;this.sourceZ_=0;this.clipExtent_=t.canWrapX()?t.getExtent():undefined;const d=i.getTileCoordExtent(this.wrappedTileCoord_);const f=this.targetTileGrid_.getExtent();let g=this.sourceTileGrid_.getExtent();const p=f?se(d,f):d;if(qt(p)===0){this.state=Ra.EMPTY;return}const _=t.getExtent();if(_){if(!g){g=_}else{g=se(g,_)}}const m=i.getResolution(this.wrappedTileCoord_[0]);const y=xh(t,n,p,m);if(!isFinite(y)||y<=0){this.state=Ra.EMPTY;return}const E=h!==undefined?h:ch;this.triangulation_=new gh(t,n,p,g,y*E,m);if(this.triangulation_.getTriangles().length===0){this.state=Ra.EMPTY;return}this.sourceZ_=e.getZForResolution(y);let v=this.triangulation_.calculateSourceExtent();if(g){if(t.canWrapX()){v[1]=Y(v[1],g[1],g[3]);v[3]=Y(v[3],g[1],g[3])}else{v=se(v,g)}}if(!qt(v)){this.state=Ra.EMPTY}else{let n=0;let i=0;if(t.canWrapX()){n=ae(_);i=Math.floor((v[0]-_[0])/n)}const s=ge(v.slice(),t,true);s.forEach((t=>{const s=e.getTileRangeForExtentAndZ(t,this.sourceZ_);for(let t=s.minX;t<=s.maxX;t++){for(let e=s.minY;e<=s.maxY;e++){const s=l(this.sourceZ_,t,e,o);if(s){const t=i*n;this.sourceTiles_.push({tile:s,offset:t})}}}++i}));if(this.sourceTiles_.length===0){this.state=Ra.EMPTY}}}getImage(){return this.canvas_}reproject_(){const t=[];this.sourceTiles_.forEach((e=>{const n=e.tile;if(n&&n.getState()==Ra.LOADED){const i=this.sourceTileGrid_.getTileCoordExtent(n.tileCoord);i[0]+=e.offset;i[2]+=e.offset;const s=this.clipExtent_?.slice();if(s){s[0]+=e.offset;s[2]+=e.offset}t.push({extent:i,clipExtent:s,image:n.getImage()})}}));this.sourceTiles_.length=0;if(t.length===0){this.state=Ra.ERROR}else{const e=this.wrappedTileCoord_[0];const n=this.targetTileGrid_.getTileSize(e);const i=typeof n==="number"?n:n[0];const s=typeof n==="number"?n:n[1];const r=this.targetTileGrid_.getResolution(e);const o=this.sourceTileGrid_.getResolution(this.sourceZ_);const a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=wh(i,s,this.pixelRatio_,o,this.sourceTileGrid_.getExtent(),r,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate);this.state=Ra.LOADED}this.changed()}load(){if(this.state==Ra.IDLE){this.state=Ra.LOADING;this.changed();let t=0;this.sourcesListenerKeys_=[];this.sourceTiles_.forEach((({tile:e})=>{const n=e.getState();if(n==Ra.IDLE||n==Ra.LOADING){t++;const n=T(e,R.CHANGE,(i=>{const s=e.getState();if(s==Ra.LOADED||s==Ra.ERROR||s==Ra.EMPTY){S(n);t--;if(t===0){this.unlistenSources_();this.reproject_()}}}));this.sourcesListenerKeys_.push(n)}}));if(t===0){setTimeout(this.reproject_.bind(this),0)}else{this.sourceTiles_.forEach((function({tile:t},e,n){const i=t.getState();if(i==Ra.IDLE){t.load()}}))}}}unlistenSources_(){this.sourcesListenerKeys_.forEach(S);this.sourcesListenerKeys_=null}release(){if(this.canvas_){xs(this.canvas_.getContext("2d"));_h.push(this.canvas_);this.canvas_=null}super.release()}}var Th=Rh;class Ih{constructor(t,e,n,i){this.minX=t;this.maxX=e;this.minY=n;this.maxY=i}contains(t){return this.containsXY(t[1],t[2])}containsTileRange(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY}containsXY(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY}equals(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY}extend(t){if(t.minX<this.minX){this.minX=t.minX}if(t.maxX>this.maxX){this.maxX=t.maxX}if(t.minY<this.minY){this.minY=t.minY}if(t.maxY>this.maxY){this.maxY=t.maxY}}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY}}function Sh(t,e,n,i,s){if(s!==undefined){s.minX=t;s.maxX=e;s.minY=n;s.maxY=i;return s}return new Ih(t,e,n,i)}var Mh=Ih;function Ah(t,e,n,i){if(i!==undefined){i[0]=t;i[1]=e;i[2]=n;return i}return[t,e,n]}function Ph(t,e,n){return t+"/"+e+"/"+n}function Lh(t){return Ph(t[0],t[1],t[2])}function Oh(t){return t.split("/").map(Number)}function Dh(t){return Fh(t[0],t[1],t[2])}function Fh(t,e,n){return(e<<t)+n}function Nh(t,e){const n=t[0];const i=t[1];const s=t[2];if(e.getMinZoom()>n||n>e.getMaxZoom()){return false}const r=e.getFullTileRange(n);if(!r){return true}return r.containsXY(i,s)}function kh(t,e,n,i){return`${t},${Ph(e,n,i)}`}function zh(t,e,n){if(!(n in t)){t[n]=new Set([e]);return true}const i=t[n];const s=i.has(e);if(!s){i.add(e)}return!s}function Gh(t,e,n){const i=t[n];if(i){return i.delete(e)}return false}function Vh(t,e){const n=t.layerStatesArray[t.layerIndex];if(n.extent){e=se(e,We(n.extent,t.viewState.projection))}const i=n.layer.getRenderSource();if(!i.getWrapX()){const n=i.getTileGridForProjection(t.viewState.projection).getExtent();if(n){e=se(e,n)}}return e}class Kh extends Bl{constructor(t,e){super(t);e=e||{};this.extentChanged=true;this.renderComplete=false;this.renderedExtent_=null;this.renderedPixelRatio;this.renderedProjection=null;this.renderedRevision;this.renderedTiles=[];this.renderedSourceKey_;this.renderedSourceRevision_;this.tempExtent=Gt();this.tempTileRange_=new Mh(0,0,0,0);this.tempTileCoord_=Ah(0,0,0);const n=e.cacheSize!==undefined?e.cacheSize:512;this.tileCache_=new hh(n);this.maxStaleKeys=n*.5}getTileCache(){return this.tileCache_}getOrCreateTile(t,e,n,i){const s=this.tileCache_;const r=this.getLayer();const o=r.getSource();const a=kh(o.getKey(),t,e,n);let l;if(s.containsKey(a)){l=s.get(a)}else{l=o.getTile(t,e,n,i.pixelRatio,i.viewState.projection);if(!l){return null}s.set(a,l)}return l}getTile(t,e,n,i){const s=this.getOrCreateTile(t,e,n,i);if(!s){return null}return s}getData(t){const e=this.frameState;if(!e){return null}const n=this.getLayer();const i=hn(e.pixelToCoordinateTransform,t.slice());const s=n.getExtent();if(s){if(!Ft(s,i)){return null}}const r=e.viewState;const o=n.getRenderSource();const a=o.getTileGridForProjection(r.projection);const l=o.getTilePixelRatio(e.pixelRatio);for(let t=a.getZForResolution(r.resolution);t>=a.getMinZoom();--t){const n=a.getTileCoordForCoordAndZ(i,t);const s=this.getTile(t,n[1],n[2],e);if(!s||s.getState()!==Ra.LOADED){continue}const h=a.getOrigin(t);const c=Vi(a.getTileSize(t));const u=a.getResolution(t);let d;if(s instanceof ah){d=s.getImage()}else if(s instanceof sh){d=$l(s.getData());if(!d){continue}}else{continue}const f=Math.floor(l*((i[0]-h[0])/u-n[1]*c[0]));const g=Math.floor(l*((h[1]-i[1])/u-n[2]*c[1]));const p=Math.round(l*o.getGutterForProjection(r.projection));return this.getImageData(d,f+p,g+p)}return null}prepareFrame(t){const e=this.getLayer().getSource();if(!e){return false}const n=this.getLayer().getSource().getRevision();if(!this.renderedRevision_){this.renderedRevision_=n}else if(this.renderedRevision_!==n){this.renderedRevision_=n;if(this.renderedSourceKey_===e.getKey()){this.tileCache_.clear()}}return true}enqueueTiles(t,e,n,i,s){const r=t.viewState;const o=this.getLayer();const a=o.getRenderSource();const l=a.getTileGridForProjection(r.projection);const h=D(a);if(!(h in t.wantedTiles)){t.wantedTiles[h]={}}const c=t.wantedTiles[h];const u=o.getMapInternal();const d=Math.max(n-s,l.getMinZoom(),l.getZForResolution(Math.min(o.getMaxResolution(),u?u.getView().getResolutionForZoom(Math.max(o.getMinZoom(),0)):l.getResolution(0)),a.zDirection));for(let s=n;s>=d;--s){const n=l.getTileRangeForExtentAndZ(e,s,this.tempTileRange_);const r=l.getResolution(s);for(let e=n.minX;e<=n.maxX;++e){for(let o=n.minY;o<=n.maxY;++o){const n=this.getTile(s,e,o,t);if(!n){continue}const a=zh(i,n,s);if(!a){continue}const u=n.getKey();c[u]=true;if(n.getState()===Ra.IDLE){if(!t.tileQueue.isKeyQueued(u)){const i=Ah(s,e,o,this.tempTileCoord_);t.tileQueue.enqueue([n,h,l.getTileCoordCenter(i),r])}}}}}}findStaleTile_(t,e){const n=this.tileCache_;const i=t[0];const s=t[1];const r=t[2];const o=this.getStaleKeys();for(let t=0;t<o.length;++t){const a=kh(o[t],i,s,r);if(n.containsKey(a)){const t=n.get(a);if(t.getState()===Ra.LOADED){t.endTransition(D(this));zh(e,t,i);return true}}}return false}findAltTiles_(t,e,n,i){const s=t.getTileRangeForTileCoordAndZ(e,n,this.tempTileRange_);if(!s){return false}let r=true;const o=this.tileCache_;const a=this.getLayer().getRenderSource();const l=a.getKey();for(let t=s.minX;t<=s.maxX;++t){for(let e=s.minY;e<=s.maxY;++e){const s=kh(l,n,t,e);let a=false;if(o.containsKey(s)){const t=o.get(s);if(t.getState()===Ra.LOADED){zh(i,t,n);a=true}}if(!a){r=false}}}return r}renderFrame(t,e){this.renderComplete=true;const n=t.layerStatesArray[t.layerIndex];const i=t.viewState;const s=i.projection;const r=i.resolution;const o=i.center;const a=t.pixelRatio;const l=this.getLayer();const h=l.getSource();const c=h.getRevision();const d=h.getTileGridForProjection(s);const f=d.getZForResolution(r,h.zDirection);const g=d.getResolution(f);const p=h.getKey();if(!this.renderedSourceKey_){this.renderedSourceKey_=p}else if(this.renderedSourceKey_!==p){this.prependStaleKey(this.renderedSourceKey_);this.renderedSourceKey_=p}let _=t.extent;const m=h.getTilePixelRatio(a);this.prepareContainer(t,e);const y=this.context.canvas.width;const E=this.context.canvas.height;const v=n.extent&&We(n.extent);if(v){_=se(_,We(n.extent))}const x=g*y/2/m;const w=g*E/2/m;const C=[o[0]-x,o[1]-w,o[0]+x,o[1]+w];const b={};const R=l.getPreload();if(t.nextExtent){const e=d.getZForResolution(i.nextResolution,h.zDirection);const n=Vh(t,t.nextExtent);this.enqueueTiles(t,n,e,b,R)}const T=Vh(t,_);this.enqueueTiles(t,T,f,b,0);if(R>0){setTimeout((()=>{this.enqueueTiles(t,T,f-1,b,R-1)}),0)}const I=D(this);const S=t.time;for(const e of b[f]){const n=e.getState();if((e instanceof Th||e instanceof bh)&&n===Ra.EMPTY){continue}const i=e.tileCoord;if(n===Ra.LOADED){const t=e.getAlpha(I,S);if(t===1){e.endTransition(I);continue}}this.renderComplete=false;const s=this.findStaleTile_(i,b);if(s){Gh(b,e,f);t.animate=true;continue}const r=this.findAltTiles_(d,i,f+1,b);if(r){continue}const o=d.getMinZoom();for(let t=f-1;t>=o;--t){const e=this.findAltTiles_(d,i,t,b);if(e){break}}}const M=g/r*a/m;const A=this.getRenderContext(t);cn(this.tempTransform,y/2,E/2,M,M,0,-y/2,-E/2);if(n.extent){this.clipUnrotated(A,t,v)}if(!h.getInterpolate()){A.imageSmoothingEnabled=false}this.preRender(A,t);this.renderedTiles.length=0;const P=Object.keys(b).map(Number);P.sort(u);let L;const O=[];const F=[];for(let e=P.length-1;e>=0;--e){const n=P[e];const i=h.getTilePixelSize(n,a,s);const r=d.getResolution(n);const o=r/g;const l=i[0]*o*M;const c=i[1]*o*M;const u=d.getTileCoordForCoordAndZ(re(C),n);const f=d.getTileCoordExtent(u);const p=hn(this.tempTransform,[m*(f[0]-C[0])/g,m*(C[3]-f[3])/g]);const _=m*h.getGutterForProjection(s);for(const e of b[n]){if(e.getState()!==Ra.LOADED){continue}const i=e.tileCoord;const s=u[1]-i[1];const r=Math.round(p[0]-(s-1)*l);const o=u[2]-i[2];const a=Math.round(p[1]-(o-1)*c);const d=Math.round(p[0]-s*l);const f=Math.round(p[1]-o*c);const g=r-d;const m=a-f;const y=P.length===1;let E=false;L=[d,f,d+g,f,d+g,f+m,d,f+m];for(let t=0,e=O.length;t<e;++t){if(!y&&n<F[t]){const e=O[t];if(le([d,f,d+g,f+m],[e[0],e[3],e[4],e[7]])){if(!E){A.save();E=true}A.beginPath();A.moveTo(L[0],L[1]);A.lineTo(L[2],L[3]);A.lineTo(L[4],L[5]);A.lineTo(L[6],L[7]);A.moveTo(e[6],e[7]);A.lineTo(e[4],e[5]);A.lineTo(e[2],e[3]);A.lineTo(e[0],e[1]);A.clip()}}}O.push(L);F.push(n);this.drawTile(e,t,d,f,g,m,_,y);if(E){A.restore()}this.renderedTiles.unshift(e);this.updateUsedTiles(t.usedTiles,h,e)}}this.renderedRevision=c;this.renderedResolution=g;this.extentChanged=!this.renderedExtent_||!Wt(this.renderedExtent_,C);this.renderedExtent_=C;this.renderedPixelRatio=a;this.renderedProjection=s;this.postRender(this.context,t);if(n.extent){A.restore()}A.imageSmoothingEnabled=true;const N=(t,e)=>{const n=D(h);const i=e.wantedTiles[n];const s=i?Object.keys(i).length:0;this.updateCacheSize(s);this.tileCache_.expireCache()};t.postRenderFunctions.push(N);return this.container}updateCacheSize(t){this.tileCache_.highWaterMark=Math.max(this.tileCache_.highWaterMark,t*2)}drawTile(t,e,n,i,s,r,o,a){let l;if(t instanceof sh){l=$l(t.getData());if(!l){throw new Error("Rendering array data is not yet supported")}}else{l=this.getTileImage(t)}if(!l){return}const h=this.getRenderContext(e);const c=D(this);const u=e.layerStatesArray[e.layerIndex];const d=u.opacity*(a?t.getAlpha(c,e.time):1);const f=d!==h.globalAlpha;if(f){h.save();h.globalAlpha=d}h.drawImage(l,o,o,l.width-2*o,l.height-2*o,n,i,s,r);if(f){h.restore()}if(d!==u.opacity){e.animate=true}else if(a){t.endTransition(c)}}getImage(){const t=this.context;return t?t.canvas:null}getTileImage(t){return t.getImage()}updateUsedTiles(t,e,n){const i=D(e);if(!(i in t)){t[i]={}}t[i][n.getKey()]=true}}var jh=Kh;class Xh extends Gl{constructor(t){super(t)}createRenderer(){return new jh(this,{cacheSize:this.getCacheSize()})}}var Wh=Xh;const Yh=[0,0,0];const Zh=5;class Uh{constructor(t){this.minZoom=t.minZoom!==undefined?t.minZoom:0;this.resolutions_=t.resolutions;W(p(this.resolutions_,((t,e)=>e-t),true),"`resolutions` must be sorted in descending order");let e;if(!t.origins){for(let t=0,n=this.resolutions_.length-1;t<n;++t){if(!e){e=this.resolutions_[t]/this.resolutions_[t+1]}else{if(this.resolutions_[t]/this.resolutions_[t+1]!==e){e=undefined;break}}}}this.zoomFactor_=e;this.maxZoom=this.resolutions_.length-1;this.origin_=t.origin!==undefined?t.origin:null;this.origins_=null;if(t.origins!==undefined){this.origins_=t.origins;W(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal")}const n=t.extent;if(n!==undefined&&!this.origin_&&!this.origins_){this.origin_=re(n)}W(!this.origin_&&this.origins_||this.origin_&&!this.origins_,"Either `origin` or `origins` must be configured, never both");this.tileSizes_=null;if(t.tileSizes!==undefined){this.tileSizes_=t.tileSizes;W(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")}this.tileSize_=t.tileSize!==undefined?t.tileSize:!this.tileSizes_?at:null;W(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both");this.extent_=n!==undefined?n:null;this.fullTileRanges_=null;this.tmpSize_=[0,0];this.tmpExtent_=[0,0,0,0];if(t.sizes!==undefined){this.fullTileRanges_=t.sizes.map(((t,e)=>{const i=new Mh(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(n){const t=this.getTileRangeForExtentAndZ(n,e);i.minX=Math.max(t.minX,i.minX);i.maxX=Math.min(t.maxX,i.maxX);i.minY=Math.max(t.minY,i.minY);i.maxY=Math.min(t.maxY,i.maxY)}return i}))}else if(n){this.calculateTileRanges_(n)}}forEachTileCoord(t,e,n){const i=this.getTileRangeForExtentAndZ(t,e);for(let t=i.minX,s=i.maxX;t<=s;++t){for(let s=i.minY,r=i.maxY;s<=r;++s){n([e,t,s])}}}forEachTileCoordParentTileRange(t,e,n,i){let s,r,o;let a=null;let l=t[0]-1;if(this.zoomFactor_===2){r=t[1];o=t[2]}else{a=this.getTileCoordExtent(t,i)}while(l>=this.minZoom){if(r!==undefined&&o!==undefined){r=Math.floor(r/2);o=Math.floor(o/2);s=Sh(r,r,o,o,n)}else{s=this.getTileRangeForExtentAndZ(a,l,n)}if(e(l,s)){return true}--l}return false}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(t){if(this.origin_){return this.origin_}return this.origins_[t]}getResolution(t){return this.resolutions_[t]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(t,e,n){if(t[0]<this.maxZoom){if(this.zoomFactor_===2){const n=t[1]*2;const i=t[2]*2;return Sh(n,n+1,i,i+1,e)}const i=this.getTileCoordExtent(t,n||this.tmpExtent_);return this.getTileRangeForExtentAndZ(i,t[0]+1,e)}return null}getTileRangeForTileCoordAndZ(t,e,n){if(e>this.maxZoom||e<this.minZoom){return null}const i=t[0];const s=t[1];const r=t[2];if(e===i){return Sh(s,r,s,r,n)}if(this.zoomFactor_){const t=Math.pow(this.zoomFactor_,e-i);const o=Math.floor(s*t);const a=Math.floor(r*t);if(e<i){return Sh(o,o,a,a,n)}const l=Math.floor(t*(s+1))-1;const h=Math.floor(t*(r+1))-1;return Sh(o,l,a,h,n)}const o=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,e,n)}getTileRangeForExtentAndZ(t,e,n){this.getTileCoordForXYAndZ_(t[0],t[3],e,false,Yh);const i=Yh[1];const s=Yh[2];this.getTileCoordForXYAndZ_(t[2],t[1],e,true,Yh);const r=Yh[1];const o=Yh[2];return Sh(i,r,s,o,n)}getTileCoordCenter(t){const e=this.getOrigin(t[0]);const n=this.getResolution(t[0]);const i=Vi(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*i[0]*n,e[1]-(t[2]+.5)*i[1]*n]}getTileCoordExtent(t,e){const n=this.getOrigin(t[0]);const i=this.getResolution(t[0]);const s=Vi(this.getTileSize(t[0]),this.tmpSize_);const r=n[0]+t[1]*s[0]*i;const o=n[1]-(t[2]+1)*s[1]*i;const a=r+s[0]*i;const l=o+s[1]*i;return Vt(r,o,a,l,e)}getTileCoordForCoordAndResolution(t,e,n){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,false,n)}getTileCoordForXYAndResolution_(t,e,n,i,s){const r=this.getZForResolution(n);const o=n/this.getResolution(r);const a=this.getOrigin(r);const l=Vi(this.getTileSize(r),this.tmpSize_);let h=o*(t-a[0])/n/l[0];let c=o*(a[1]-e)/n/l[1];if(i){h=tt(h,Zh)-1;c=tt(c,Zh)-1}else{h=Q(h,Zh);c=Q(c,Zh)}return Ah(r,h,c,s)}getTileCoordForXYAndZ_(t,e,n,i,s){const r=this.getOrigin(n);const o=this.getResolution(n);const a=Vi(this.getTileSize(n),this.tmpSize_);let l=(t-r[0])/o/a[0];let h=(r[1]-e)/o/a[1];if(i){l=tt(l,Zh)-1;h=tt(h,Zh)-1}else{l=Q(l,Zh);h=Q(h,Zh)}return Ah(n,l,h,s)}getTileCoordForCoordAndZ(t,e,n){return this.getTileCoordForXYAndZ_(t[0],t[1],e,false,n)}getTileCoordResolution(t){return this.resolutions_[t[0]]}getTileSize(t){if(this.tileSize_){return this.tileSize_}return this.tileSizes_[t]}getFullTileRange(t){if(!this.fullTileRanges_){return this.extent_?this.getTileRangeForExtentAndZ(this.extent_,t):null}return this.fullTileRanges_[t]}getZForResolution(t,e){const n=d(this.resolutions_,t,e||0);return Y(n,this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(t,e){return Jn(e,0,e.length,2,this.getTileCoordExtent(t))}calculateTileRanges_(t){const e=this.resolutions_.length;const n=new Array(e);for(let i=this.minZoom;i<e;++i){n[i]=this.getTileRangeForExtentAndZ(t,i)}this.fullTileRanges_=n}}var Bh=Uh;class Hh extends hh{clear(){while(this.getCount()>0){this.pop().release()}super.clear()}expireCache(t){while(this.canExpireCache()){const e=this.peekLast();if(e.getKey()in t){break}else{this.pop().release()}}}pruneExceptNewestZ(){if(this.getCount()===0){return}const t=this.peekFirstKey();const e=Oh(t);const n=e[0];this.forEach((t=>{if(t.tileCoord[0]!==n){this.remove(Lh(t.tileCoord));t.release()}}))}}var qh=Hh;var $h={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};class Jh extends k{constructor(t){super();this.projection=Le(t.projection);this.attributions_=Qh(t.attributions);this.attributionsCollapsible_=t.attributionsCollapsible??true;this.loading=false;this.state_=t.state!==undefined?t.state:"ready";this.wrapX_=t.wrapX!==undefined?t.wrapX:false;this.interpolate_=!!t.interpolate;this.viewResolver=null;this.viewRejector=null;const e=this;this.viewPromise_=new Promise((function(t,n){e.viewResolver=t;e.viewRejector=n}))}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(t){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(t){this.attributions_=Qh(t);this.changed()}setState(t){this.state_=t;this.changed()}}function Qh(t){if(!t){return null}if(typeof t==="function"){return t}if(!Array.isArray(t)){t=[t]}return e=>t}var tc=Jh;function ec(t){let e=t.getDefaultTileGrid();if(!e){e=rc(t);t.setDefaultTileGrid(e)}return e}function nc(t,e,n){const i=e[0];const s=t.getTileCoordCenter(e);const r=oc(n);if(!Ft(r,s)){const e=ae(r);const n=Math.ceil((r[0]-s[0])/e);s[0]+=e*n;return t.getTileCoordForCoordAndZ(s,i)}return e}function ic(t,e,n,i){i=i!==undefined?i:"top-left";const s=sc(t,e,n);return new Bh({extent:t,origin:te(t,i),resolutions:s,tileSize:n})}function sc(t,e,n,i){e=e!==undefined?e:ot;n=Vi(n!==undefined?n:at);const s=ie(t);const r=ae(t);i=i>0?i:Math.max(r/n[0],s/n[1]);const o=e+1;const a=new Array(o);for(let t=0;t<o;++t){a[t]=i/Math.pow(2,t)}return a}function rc(t,e,n,i){const s=oc(t);return ic(s,e,n,i)}function oc(t){t=Le(t);let e=t.getExtent();if(!e){const n=180*lt.degrees/t.getMetersPerUnit();e=Vt(-n,-n,n,n)}return e}class ac extends tc{constructor(t){super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,projection:t.projection,state:t.state,wrapX:t.wrapX,interpolate:t.interpolate});this.on;this.once;this.un;this.tilePixelRatio_=t.tilePixelRatio!==undefined?t.tilePixelRatio:1;this.tileGrid=t.tileGrid!==undefined?t.tileGrid:null;const e=[256,256];if(this.tileGrid){Vi(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),e)}this.tileCache=new qh(t.cacheSize||0);this.tmpSize=[0,0];this.key_=t.key||"";this.tileOptions={transition:t.transition,interpolate:t.interpolate};this.zDirection=t.zDirection?t.zDirection:0}canExpireCache(){return this.tileCache.canExpireCache()}expireCache(t,e){const n=this.getTileCacheForProjection(t);if(n){n.expireCache(e)}}getGutterForProjection(t){return 0}getKey(){return this.key_}setKey(t){if(this.key_!==t){this.key_=t;this.changed()}}getResolutions(t){const e=t?this.getTileGridForProjection(t):this.tileGrid;if(!e){return null}return e.getResolutions()}getTile(t,e,n,i,s){return L()}getTileGrid(){return this.tileGrid}getTileGridForProjection(t){if(!this.tileGrid){return ec(t)}return this.tileGrid}getTileCacheForProjection(t){const e=this.getProjection();W(e===null||ke(e,t),"A VectorTile source can only be rendered if it has a projection compatible with the view projection.");return this.tileCache}getTilePixelRatio(t){return this.tilePixelRatio_}getTilePixelSize(t,e,n){const i=this.getTileGridForProjection(n);const s=this.getTilePixelRatio(e);const r=Vi(i.getTileSize(t),this.tmpSize);if(s==1){return r}return Gi(r,s,this.tmpSize)}getTileCoordForTileUrlFunction(t,e){e=e!==undefined?e:this.getProjection();const n=this.getTileGridForProjection(e);if(this.getWrapX()&&e.isGlobal()){t=nc(n,t,e)}return Nh(t,n)?t:null}clear(){this.tileCache.clear()}refresh(){this.clear();super.refresh()}useTile(t,e,n,i){}}class lc extends a{constructor(t,e){super(t);this.tile=e}}var hc=ac;const cc=/\{z\}/g;const uc=/\{x\}/g;const dc=/\{y\}/g;const fc=/\{-y\}/g;function gc(t,e,n,i,s){return t.replace(cc,e.toString()).replace(uc,n.toString()).replace(dc,i.toString()).replace(fc,(function(){if(s===undefined){throw new Error("If the URL template has a {-y} placeholder, the grid extent must be known")}return(s-i).toString()}))}function pc(t){const e=[];let n=/\{([a-z])-([a-z])\}/.exec(t);if(n){const i=n[1].charCodeAt(0);const s=n[2].charCodeAt(0);let r;for(r=i;r<=s;++r){e.push(t.replace(n[0],String.fromCharCode(r)))}return e}n=/\{(\d+)-(\d+)\}/.exec(t);if(n){const i=parseInt(n[2],10);for(let s=parseInt(n[1],10);s<=i;s++){e.push(t.replace(n[0],s.toString()))}return e}e.push(t);return e}function _c(t,e){return function(n,i,s){if(!n){return undefined}let r;const o=n[0];if(e){const t=e.getFullTileRange(o);if(t){r=t.getHeight()-1}}return gc(t,o,n[1],n[2],r)}}function mc(t,e){const n=t.length;const i=new Array(n);for(let s=0;s<n;++s){i[s]=_c(t[s],e)}return yc(i)}function yc(t){if(t.length===1){return t[0]}return function(e,n,i){if(!e){return undefined}const s=Dh(e);const r=q(s,t.length);return t[r](e,n,i)}}class Ec extends hc{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection});this.generateTileUrlFunction_=this.tileUrlFunction===Ec.prototype.tileUrlFunction;this.tileLoadFunction=t.tileLoadFunction;if(t.tileUrlFunction){this.tileUrlFunction=t.tileUrlFunction}this.urls=null;if(t.urls){this.setUrls(t.urls)}else if(t.url){this.setUrl(t.url)}this.tileLoadingKeys_={}}getTileLoadFunction(){return this.tileLoadFunction}getTileUrlFunction(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction}getUrls(){return this.urls}handleTileChange(t){const e=t.target;const n=D(e);const i=e.getState();let s;if(i==Ra.LOADING){this.tileLoadingKeys_[n]=true;s=$h.TILELOADSTART}else if(n in this.tileLoadingKeys_){delete this.tileLoadingKeys_[n];s=i==Ra.ERROR?$h.TILELOADERROR:i==Ra.LOADED?$h.TILELOADEND:undefined}if(s!=undefined){this.dispatchEvent(new lc(s,e))}}setTileLoadFunction(t){this.tileCache.clear();this.tileLoadFunction=t;this.changed()}setTileUrlFunction(t,e){this.tileUrlFunction=t;this.tileCache.pruneExceptNewestZ();if(typeof e!=="undefined"){this.setKey(e)}else{this.changed()}}setUrl(t){const e=pc(t);this.urls=e;this.setUrls(e)}setUrls(t){this.urls=t;const e=t.join("\n");if(this.generateTileUrlFunction_){this.setTileUrlFunction(mc(t,this.tileGrid),e)}else{this.setKey(e)}}tileUrlFunction(t,e,n){return undefined}useTile(t,e,n){const i=Ph(t,e,n);if(this.tileCache.containsKey(i)){this.tileCache.get(i)}}}var vc=Ec;class xc extends vc{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:wc,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate!==undefined?t.interpolate:true,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection});this.crossOrigin=t.crossOrigin!==undefined?t.crossOrigin:null;this.tileClass=t.tileClass!==undefined?t.tileClass:ah;this.tileCacheForProjection={};this.tileGridForProjection={};this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold;this.renderReprojectionEdges_=false}canExpireCache(){if(this.tileCache.canExpireCache()){return true}for(const t in this.tileCacheForProjection){if(this.tileCacheForProjection[t].canExpireCache()){return true}}return false}expireCache(t,e){const n=this.getTileCacheForProjection(t);this.tileCache.expireCache(this.tileCache==n?e:{});for(const t in this.tileCacheForProjection){const i=this.tileCacheForProjection[t];i.expireCache(i==n?e:{})}}getGutterForProjection(t){if(this.getProjection()&&t&&!ke(this.getProjection(),t)){return 0}return this.getGutter()}getGutter(){return 0}getKey(){let t=super.getKey();if(!this.getInterpolate()){t+=":disable-interpolation"}return t}getTileGridForProjection(t){const e=this.getProjection();if(this.tileGrid&&(!e||ke(e,t))){return this.tileGrid}const n=D(t);if(!(n in this.tileGridForProjection)){this.tileGridForProjection[n]=ec(t)}return this.tileGridForProjection[n]}getTileCacheForProjection(t){const e=this.getProjection();if(!e||ke(e,t)){return this.tileCache}const n=D(t);if(!(n in this.tileCacheForProjection)){this.tileCacheForProjection[n]=new qh(this.tileCache.highWaterMark)}return this.tileCacheForProjection[n]}createTile_(t,e,n,i,s,r){const o=[t,e,n];const a=this.getTileCoordForTileUrlFunction(o,s);const l=a?this.tileUrlFunction(a,i,s):undefined;const h=new this.tileClass(o,l!==undefined?Ra.IDLE:Ra.EMPTY,l!==undefined?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);h.key=r;h.addEventListener(R.CHANGE,this.handleTileChange.bind(this));return h}getTile(t,e,n,i,s){const r=this.getProjection();if(!r||!s||ke(r,s)){return this.getTileInternal(t,e,n,i,r||s)}const o=this.getTileCacheForProjection(s);const a=[t,e,n];let l;const h=Lh(a);if(o.containsKey(h)){l=o.get(h)}const c=this.getKey();if(l&&l.key==c){return l}const u=this.getTileGridForProjection(r);const d=this.getTileGridForProjection(s);const f=this.getTileCoordForTileUrlFunction(a,s);const g=new Th(r,u,s,d,a,f,this.getTilePixelRatio(i),this.getGutter(),((t,e,n,i)=>this.getTileInternal(t,e,n,i,r)),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);g.key=c;if(l){o.replace(h,g)}else{o.set(h,g)}return g}getTileInternal(t,e,n,i,s){const r=Ph(t,e,n);const o=this.getKey();if(!this.tileCache.containsKey(r)){const a=this.createTile_(t,e,n,i,s,o);this.tileCache.set(r,a);return a}let a=this.tileCache.get(r);if(a.key!=o){a=this.createTile_(t,e,n,i,s,o);this.tileCache.replace(r,a)}return a}setRenderReprojectionEdges(t){if(this.renderReprojectionEdges_==t){return}this.renderReprojectionEdges_=t;for(const t in this.tileCacheForProjection){this.tileCacheForProjection[t].clear()}this.changed()}setTileGridForProjection(t,e){const n=Le(t);if(n){const t=D(n);if(!(t in this.tileGridForProjection)){this.tileGridForProjection[t]=e}}}clear(){super.clear();for(const t in this.tileCacheForProjection){this.tileCacheForProjection[t].clear()}}}function wc(t,e){t.getImage().src=e}var Cc=xc;class bc extends ah{constructor(t,e,n,i,s,r,o){super(e,n,i,s,r,o);this.zoomifyImage_=null;this.tileSize_=t}getImage(){if(this.zoomifyImage_){return this.zoomifyImage_}const t=super.getImage();if(this.state==Ra.LOADED){const e=this.tileSize_;if(t.width==e[0]&&t.height==e[1]){this.zoomifyImage_=t;return t}const n=ys(e[0],e[1]);n.drawImage(t,0,0);this.zoomifyImage_=n.canvas;return n.canvas}return t}}class Rc extends Cc{constructor(t){const e=t.size;const n=t.tierSizeCalculation!==undefined?t.tierSizeCalculation:"default";const i=t.tilePixelRatio||1;const s=e[0];const r=e[1];const o=[];const a=t.tileSize||at;let l=a*i;switch(n){case"default":while(s>l||r>l){o.push([Math.ceil(s/l),Math.ceil(r/l)]);l+=l}break;case"truncated":let t=s;let e=r;while(t>l||e>l){o.push([Math.ceil(t/l),Math.ceil(e/l)]);t>>=1;e>>=1}break;default:throw new Error("Unknown `tierSizeCalculation` configured")}o.push([1,1]);o.reverse();const h=[i];const c=[0];for(let t=1,e=o.length;t<e;t++){h.push(i<<t);c.push(o[t-1][0]*o[t-1][1]+c[t-1])}h.reverse();const u=new Bh({tileSize:a,extent:t.extent||[0,-r,s,0],resolutions:h});let d=t.url;if(d&&!d.includes("{TileGroup}")&&!d.includes("{tileIndex}")){d+="{TileGroup}/{z}-{x}-{y}.jpg"}const f=pc(d);let g=a*i;function p(t){return function(e,n,i){if(!e){return undefined}const s=e[0];const r=e[1];const a=e[2];const l=r+a*o[s][0];const h=(l+c[s])/g|0;const u={z:s,x:r,y:a,tileIndex:l,TileGroup:"TileGroup"+h};return t.replace(/\{(\w+?)\}/g,(function(t,e){return u[e]}))}}const _=yc(f.map(p));const m=bc.bind(null,Vi(a*i));super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:t.projection,tilePixelRatio:i,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:m,tileGrid:u,tileUrlFunction:_,transition:t.transition});this.zDirection=t.zDirection;const y=u.getTileCoordForCoordAndResolution(Qt(u.getExtent()),h[h.length-1]);const E=_(y,1,null);const v=new Image;v.addEventListener("error",(()=>{g=a;this.changed()}));v.src=E}}var Tc=Rc;const Ic={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"};class Sc extends k{constructor(t){super();this.on;this.once;this.un;this.options=t;this.id=t.id;this.insertFirst=t.insertFirst!==undefined?t.insertFirst:true;this.stopEvent=t.stopEvent!==undefined?t.stopEvent:true;this.element=document.createElement("div");this.element.className=t.className!==undefined?t.className:"ol-overlay-container "+Gs;this.element.style.position="absolute";this.element.style.pointerEvents="auto";this.autoPan=t.autoPan===true?{}:t.autoPan||undefined;this.rendered={transform_:"",visible:true};this.mapPostrenderListenerKey=null;this.addChangeListener(Ic.ELEMENT,this.handleElementChanged);this.addChangeListener(Ic.MAP,this.handleMapChanged);this.addChangeListener(Ic.OFFSET,this.handleOffsetChanged);this.addChangeListener(Ic.POSITION,this.handlePositionChanged);this.addChangeListener(Ic.POSITIONING,this.handlePositioningChanged);if(t.element!==undefined){this.setElement(t.element)}this.setOffset(t.offset!==undefined?t.offset:[0,0]);this.setPositioning(t.positioning||"top-left");if(t.position!==undefined){this.setPosition(t.position)}}getElement(){return this.get(Ic.ELEMENT)}getId(){return this.id}getMap(){return this.get(Ic.MAP)||null}getOffset(){return this.get(Ic.OFFSET)}getPosition(){return this.get(Ic.POSITION)}getPositioning(){return this.get(Ic.POSITIONING)}handleElementChanged(){Rs(this.element);const t=this.getElement();if(t){this.element.appendChild(t)}}handleMapChanged(){if(this.mapPostrenderListenerKey){this.element?.remove();S(this.mapPostrenderListenerKey);this.mapPostrenderListenerKey=null}const t=this.getMap();if(t){this.mapPostrenderListenerKey=T(t,va.POSTRENDER,this.render,this);this.updatePixelPosition();const e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();if(this.insertFirst){e.insertBefore(this.element,e.childNodes[0]||null)}else{e.appendChild(this.element)}this.performAutoPan()}}render(){this.updatePixelPosition()}handleOffsetChanged(){this.updatePixelPosition()}handlePositionChanged(){this.updatePixelPosition();this.performAutoPan()}handlePositioningChanged(){this.updatePixelPosition()}setElement(t){this.set(Ic.ELEMENT,t)}setMap(t){this.set(Ic.MAP,t)}setOffset(t){this.set(Ic.OFFSET,t)}setPosition(t){this.set(Ic.POSITION,t)}performAutoPan(){if(this.autoPan){this.panIntoView(this.autoPan)}}panIntoView(t){const e=this.getMap();if(!e||!e.getTargetElement()||!this.get(Ic.POSITION)){return}const n=this.getRect(e.getTargetElement(),e.getSize());const i=this.getElement();const s=this.getRect(i,[ws(i),Cs(i)]);t=t||{};const r=t.margin===undefined?20:t.margin;if(!Nt(n,s)){const i=s[0]-n[0];const o=n[2]-s[2];const a=s[1]-n[1];const l=n[3]-s[3];const h=[0,0];if(i<0){h[0]=i-r}else if(o<0){h[0]=Math.abs(o)+r}if(a<0){h[1]=a-r}else if(l<0){h[1]=Math.abs(l)+r}if(h[0]!==0||h[1]!==0){const n=e.getView().getCenterInternal();const i=e.getPixelFromCoordinateInternal(n);if(!i){return}const s=[i[0]+h[0],i[1]+h[1]];const r=t.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(s),duration:r.duration,easing:r.easing})}}}getRect(t,e){const n=t.getBoundingClientRect();const i=n.left+window.pageXOffset;const s=n.top+window.pageYOffset;return[i,s,i+e[0],s+e[1]]}setPositioning(t){this.set(Ic.POSITIONING,t)}setVisible(t){if(this.rendered.visible!==t){this.element.style.display=t?"":"none";this.rendered.visible=t}}updatePixelPosition(){const t=this.getMap();const e=this.getPosition();if(!t||!t.isRendered()||!e){this.setVisible(false);return}const n=t.getPixelFromCoordinate(e);const i=t.getSize();this.updateRenderedPosition(n,i)}updateRenderedPosition(t,e){const n=this.element.style;const i=this.getOffset();const s=this.getPositioning();this.setVisible(true);const r=Math.round(t[0]+i[0])+"px";const o=Math.round(t[1]+i[1])+"px";let a="0%";let l="0%";if(s=="bottom-right"||s=="center-right"||s=="top-right"){a="-100%"}else if(s=="bottom-center"||s=="center-center"||s=="top-center"){a="-50%"}if(s=="bottom-left"||s=="bottom-center"||s=="bottom-right"){l="-100%"}else if(s=="center-left"||s=="center-center"||s=="center-right"){l="-50%"}const h=`translate(${a}, ${l}) translate(${r}, ${o})`;if(this.rendered.transform_!=h){this.rendered.transform_=h;n.transform=h}}getOptions(){return this.options}}var Mc=Sc;const Ac=.75;const Pc=.1;class Lc extends Aa{constructor(t){t=t?t:{};super({element:document.createElement("div"),render:t.render,target:t.target});this.boundHandleRotationChanged_=this.handleRotationChanged_.bind(this);this.collapsed_=t.collapsed!==undefined?t.collapsed:true;this.collapsible_=t.collapsible!==undefined?t.collapsible:true;if(!this.collapsible_){this.collapsed_=false}this.rotateWithView_=t.rotateWithView!==undefined?t.rotateWithView:false;this.viewExtent_=undefined;const e=t.className!==undefined?t.className:"ol-overviewmap";const n=t.tipLabel!==undefined?t.tipLabel:"Overview map";const i=t.collapseLabel!==undefined?t.collapseLabel:"‹";if(typeof i==="string"){this.collapseLabel_=document.createElement("span");this.collapseLabel_.textContent=i}else{this.collapseLabel_=i}const s=t.label!==undefined?t.label:"›";if(typeof s==="string"){this.label_=document.createElement("span");this.label_.textContent=s}else{this.label_=s}const r=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;const o=document.createElement("button");o.setAttribute("type","button");o.title=n;o.appendChild(r);o.addEventListener(R.CLICK,this.handleClick_.bind(this),false);this.ovmapDiv_=document.createElement("div");this.ovmapDiv_.className="ol-overviewmap-map";this.view_=t.view;const a=new Nl({view:t.view,controls:new j,interactions:new j});this.ovmap_=a;if(t.layers){t.layers.forEach((function(t){a.addLayer(t)}))}const l=document.createElement("div");l.className="ol-overviewmap-box";l.style.boxSizing="border-box";this.boxOverlay_=new Mc({position:[0,0],positioning:"center-center",element:l});this.ovmap_.addOverlay(this.boxOverlay_);const h=e+" "+Vs+" "+js+(this.collapsed_&&this.collapsible_?" "+Xs:"")+(this.collapsible_?"":" ol-uncollapsible");const c=this.element;c.className=h;c.appendChild(this.ovmapDiv_);c.appendChild(o);const u=this;const d=this.boxOverlay_;const f=this.boxOverlay_.getElement();const g=function(t){return{clientX:t.clientX,clientY:t.clientY}};const p=function(t){const e=g(t);const n=a.getEventCoordinate(e);d.setPosition(n)};const _=function(t){const e=a.getEventCoordinateInternal(t);u.getMap().getView().setCenterInternal(e);window.removeEventListener("pointermove",p);window.removeEventListener("pointerup",_)};this.ovmapDiv_.addEventListener("pointerdown",(function(){if(event.target===f){window.addEventListener("pointermove",p)}window.addEventListener("pointerup",_)}))}setMap(t){const e=this.getMap();if(t===e){return}if(e){const t=e.getView();if(t){this.unbindView_(t)}this.ovmap_.setTarget(null)}super.setMap(t);if(t){this.ovmap_.setTarget(this.ovmapDiv_);this.listenerKeys.push(T(t,l.PROPERTYCHANGE,this.handleMapPropertyChange_,this));const e=t.getView();if(e){this.bindView_(e)}if(!this.ovmap_.isRendered()){this.updateBoxAfterOvmapIsRendered_()}}}handleMapPropertyChange_(t){if(t.key===xa.VIEW){const e=t.oldValue;if(e){this.unbindView_(e)}const n=this.getMap().getView();this.bindView_(n)}else if(!this.ovmap_.isRendered()&&(t.key===xa.TARGET||t.key===xa.SIZE)){this.ovmap_.updateSize()}}bindView_(t){if(!this.view_){const e=new gi({projection:t.getProjection()});this.ovmap_.setView(e)}t.addChangeListener(rt.ROTATION,this.boundHandleRotationChanged_);this.handleRotationChanged_();if(t.isDef()){this.ovmap_.updateSize();this.resetExtent_()}}unbindView_(t){t.removeChangeListener(rt.ROTATION,this.boundHandleRotationChanged_)}handleRotationChanged_(){if(this.rotateWithView_){this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())}}validateExtent_(){const t=this.getMap();const e=this.ovmap_;if(!t.isRendered()||!e.isRendered()){return}const n=t.getSize();const i=t.getView();const s=i.calculateExtentInternal(n);if(this.viewExtent_&&Wt(s,this.viewExtent_)){return}this.viewExtent_=s;const r=e.getSize();const o=e.getView();const a=o.calculateExtentInternal(r);const l=e.getPixelFromCoordinateInternal(re(s));const h=e.getPixelFromCoordinateInternal(Jt(s));const c=Math.abs(l[0]-h[0]);const u=Math.abs(l[1]-h[1]);const d=r[0];const f=r[1];if(c<d*Pc||u<f*Pc||c>d*Ac||u>f*Ac){this.resetExtent_()}else if(!Nt(a,s)){this.recenter_()}}resetExtent_(){const t=this.getMap();const e=this.ovmap_;const n=t.getSize();const i=t.getView();const s=i.calculateExtentInternal(n);const r=e.getView();const o=Math.log(Ac/Pc)/Math.LN2;const a=1/(Math.pow(2,o/2)*Pc);ue(s,a);r.fitInternal(ri(s))}recenter_(){const t=this.getMap();const e=this.ovmap_;const n=t.getView();const i=e.getView();i.setCenterInternal(n.getCenterInternal())}updateBox_(){const t=this.getMap();const e=this.ovmap_;if(!t.isRendered()||!e.isRendered()){return}const n=t.getSize();const i=t.getView();const s=e.getView();const r=this.rotateWithView_?0:-i.getRotation();const o=this.boxOverlay_;const a=this.boxOverlay_.getElement();const l=i.getCenter();const h=i.getResolution();const c=s.getResolution();const u=n[0]*h/c;const d=n[1]*h/c;o.setPosition(l);if(a){a.style.width=u+"px";a.style.height=d+"px";const t="rotate("+r+"rad)";a.style.transform=t}}updateBoxAfterOvmapIsRendered_(){if(this.ovmapPostrenderKey_){return}this.ovmapPostrenderKey_=I(this.ovmap_,va.POSTRENDER,(t=>{delete this.ovmapPostrenderKey_;this.updateBox_()}))}handleClick_(t){t.preventDefault();this.handleToggle_()}handleToggle_(){this.element.classList.toggle(Xs);if(this.collapsed_){bs(this.collapseLabel_,this.label_)}else{bs(this.label_,this.collapseLabel_)}this.collapsed_=!this.collapsed_;const t=this.ovmap_;if(!this.collapsed_){if(t.isRendered()){this.viewExtent_=undefined;t.render();return}t.updateSize();this.resetExtent_();this.updateBoxAfterOvmapIsRendered_()}}getCollapsible(){return this.collapsible_}setCollapsible(t){if(this.collapsible_===t){return}this.collapsible_=t;this.element.classList.toggle("ol-uncollapsible");if(!t&&this.collapsed_){this.handleToggle_()}}setCollapsed(t){if(!this.collapsible_||this.collapsed_===t){return}this.handleToggle_()}getCollapsed(){return this.collapsed_}getRotateWithView(){return this.rotateWithView_}setRotateWithView(t){if(this.rotateWithView_===t){return}this.rotateWithView_=t;if(this.getMap().getView().getRotation()!==0){if(this.rotateWithView_){this.handleRotationChanged_()}else{this.ovmap_.getView().setRotation(0)}this.viewExtent_=undefined;this.validateExtent_();this.updateBox_()}}getOverviewMap(){return this.ovmap_}render(t){this.validateExtent_();this.updateBox_()}}var Oc=Lc;const Dc=["fullscreenchange","webkitfullscreenchange","MSFullscreenChange"];const Fc={ENTERFULLSCREEN:"enterfullscreen",LEAVEFULLSCREEN:"leavefullscreen"};class Nc extends Aa{constructor(t){t=t?t:{};super({element:document.createElement("div"),target:t.target});this.on;this.once;this.un;this.keys_=t.keys!==undefined?t.keys:false;this.source_=t.source;this.isInFullscreen_=false;this.boundHandleMapTargetChange_=this.handleMapTargetChange_.bind(this);this.cssClassName_=t.className!==undefined?t.className:"ol-full-screen";this.documentListeners_=[];this.activeClassName_=t.activeClassName!==undefined?t.activeClassName.split(" "):[this.cssClassName_+"-true"];this.inactiveClassName_=t.inactiveClassName!==undefined?t.inactiveClassName.split(" "):[this.cssClassName_+"-false"];const e=t.label!==undefined?t.label:"⤢";this.labelNode_=typeof e==="string"?document.createTextNode(e):e;const n=t.labelActive!==undefined?t.labelActive:"×";this.labelActiveNode_=typeof n==="string"?document.createTextNode(n):n;const i=t.tipLabel?t.tipLabel:"Toggle full-screen";this.button_=document.createElement("button");this.button_.title=i;this.button_.setAttribute("type","button");this.button_.appendChild(this.labelNode_);this.button_.addEventListener(R.CLICK,this.handleClick_.bind(this),false);this.setClassName_(this.button_,this.isInFullscreen_);this.element.className=`${this.cssClassName_} ${Vs} ${js}`;this.element.appendChild(this.button_)}handleClick_(t){t.preventDefault();this.handleFullScreen_()}handleFullScreen_(){const t=this.getMap();if(!t){return}const e=t.getOwnerDocument();if(!kc(e)){return}if(zc(e)){Kc(e)}else{let n;if(this.source_){n=typeof this.source_==="string"?e.getElementById(this.source_):this.source_}else{n=t.getTargetElement()}if(this.keys_){Vc(n)}else{Gc(n)}}}handleFullScreenChange_(){const t=this.getMap();if(!t){return}const e=this.isInFullscreen_;this.isInFullscreen_=zc(t.getOwnerDocument());if(e!==this.isInFullscreen_){this.setClassName_(this.button_,this.isInFullscreen_);if(this.isInFullscreen_){bs(this.labelActiveNode_,this.labelNode_);this.dispatchEvent(Fc.ENTERFULLSCREEN)}else{bs(this.labelNode_,this.labelActiveNode_);this.dispatchEvent(Fc.LEAVEFULLSCREEN)}t.updateSize()}}setClassName_(t,e){if(e){t.classList.remove(...this.inactiveClassName_);t.classList.add(...this.activeClassName_)}else{t.classList.remove(...this.activeClassName_);t.classList.add(...this.inactiveClassName_)}}setMap(t){const e=this.getMap();if(e){e.removeChangeListener(xa.TARGET,this.boundHandleMapTargetChange_)}super.setMap(t);this.handleMapTargetChange_();if(t){t.addChangeListener(xa.TARGET,this.boundHandleMapTargetChange_)}}handleMapTargetChange_(){const t=this.documentListeners_;for(let e=0,n=t.length;e<n;++e){S(t[e])}t.length=0;const e=this.getMap();if(e){const n=e.getOwnerDocument();if(kc(n)){this.element.classList.remove(Ks)}else{this.element.classList.add(Ks)}for(let e=0,i=Dc.length;e<i;++e){t.push(T(n,Dc[e],this.handleFullScreenChange_,this))}this.handleFullScreenChange_()}}}function kc(t){const e=t.body;return!!(e["webkitRequestFullscreen"]||e.requestFullscreen&&t.fullscreenEnabled)}function zc(t){return!!(t["webkitIsFullScreen"]||t.fullscreenElement)}function Gc(t){if(t.requestFullscreen){t.requestFullscreen()}else if(t["webkitRequestFullscreen"]){t["webkitRequestFullscreen"]()}}function Vc(t){if(t["webkitRequestFullscreen"]){t["webkitRequestFullscreen"]()}else{Gc(t)}}function Kc(t){if(t.exitFullscreen){t.exitFullscreen()}else if(t["webkitExitFullscreen"]){t["webkitExitFullscreen"]()}}var jc=Nc;class Xc{constructor(t,e){this.thumbnailClickListener=n=>{t.app.dispatch({type:"plot_edit",id:e.id,config:{settings:{displayedImageIndex:n}}})}}}function Wc(t={}){const e={displayedImageIndex:0,imageWidth:"47vw",imageHeight:"25vw",activeThumbnailBorderStyle:"2px solid red",nonActiveThumbnailBorderStyle:"2px solid black",thumbnailWidth:"60px",thumbnailHeight:"80px"};return n(e,t)}function Yc(e){return t(this,void 0,void 0,(function*(){const t=yield i("samplewsimages",{body:{genome:e.app.opts.state.vocab.genome,dslabel:e.app.opts.state.vocab.dslabel,sample_id:e.app.opts.state.sample_id}});return t.sampleWSImages}))}class Zc{constructor(t){this.type="WSIViewer";this.opts=t;this.wsiViewerInteractions=new Xc(this,t)}main(){var e,n;return t(this,void 0,void 0,(function*(){const t=this.app.getState();const i=t.plots.find((t=>t.id===this.id));const s=i.settings;const r=this.opts.holder;if(i.wsimages.length===0){r.append("div").style("margin-left","10px").text("No WSI images.");return}const o=yield this.getLayers(t,i.wsimages);if(o.length===0){r.append("div").style("margin-left","10px").text("There was an error loading the WSI images. Please try again later.");return}this.generateThumbnails(o,s);r.select('div[id="wsi-viewer"]').remove();r.append("div").attr("id","wsi-viewer").style("width",s.imageWidth).style("height",s.imageHeight);const a=o[s.displayedImageIndex];const l=(n=(e=a===null||a===void 0?void 0:a.getSource())===null||e===void 0?void 0:e.getTileGrid())===null||n===void 0?void 0:n.getExtent();const h=this.getMap(a);this.addControls(h,a);if(l){h.getView().fit(l)}if(this.opts.header){this.opts.header.html(`${t.sample_id} <span style="font-size:.8em">${t.termdbConfig.queries.WSImages.type} images</span>`)}}))}generateThumbnails(t,e){if(!this.thumbnailsContainer){const n=this.opts.holder;this.thumbnailsContainer=n.append("div").attr("id","thumbnails").attr("data-testid","sjpp-thumbnails").style("width","600px").style("height","80px").style("display","flex").style("margin-left","20px").style("margin-bottom","20px");for(let n=0;n<t.length;n++){const i=n===e.displayedImageIndex;const s=this.thumbnailsContainer.append("div").attr("id",`thumbnail${n}`).style("width",e.thumbnailWidth).style("height",e.thumbnailHeight).style("margin-right","10px").style("display","flex").style("align-items","center").style("justify-content","center").style("border",i?e.activeThumbnailBorderStyle:e.nonActiveThumbnailBorderStyle).on("click",(()=>{this.wsiViewerInteractions.thumbnailClickListener(n)}));s.append("img").attr("src",t[n].get("preview")).attr("alt",`Thumbnail ${n}`).style("max-width","100%").style("height","auto").style("object-fit","cover")}}else{for(let n=0;n<t.length;n++){const t=n===e.displayedImageIndex;this.thumbnailsContainer.select(`#thumbnail${n}`).style("border",t?e.activeThumbnailBorderStyle:e.nonActiveThumbnailBorderStyle)}}}getMap(t){var e,n;return new Nl({layers:[t],target:"wsi-viewer",view:new gi({resolutions:(n=(e=t.getSource())===null||e===void 0?void 0:e.getTileGrid())===null||n===void 0?void 0:n.getResolutions()})})}addControls(t,e){const n=new jc;t.addControl(n);const i=new Oc({className:"ol-overviewmap ol-custom-overviewmap",layers:[new Wh({source:e.getSource()})]});t.addControl(i)}getLayers(e,n){return t(this,void 0,void 0,(function*(){const t=[];for(let s=0;s<n.length;s++){const r={genome:e.genome||e.vocab.genome,dslabel:e.dslabel||e.vocab.dslabel,sampleId:e.sample_id,wsimage:n[s]};const o=yield i("wsimages",{body:r});if(o.status==="error"){return[]}const a=o.slide_dimensions[0];const l=o.slide_dimensions[1];const h=`/tileserver/layer/slide/${o.sessionId}/zoomify/{TileGroup}/{z}-{x}-{y}@1x.jpg`;const c=new Tc({url:h,size:[a,l],crossOrigin:"anonymous",zDirection:-1});const u={preview:`/tileserver/layer/slide/${o.sessionId}/zoomify/TileGroup0/0-0-0@1x.jpg`,source:c,baseLayer:true};const d=new Wh(u);t.push(d)}return t}))}}const Uc=s(Zc);const Bc=Uc;function Hc(e,n){return t(this,void 0,void 0,(function*(){return{chartType:"WSIViewer",subfolder:"wsiviewer",extension:"ts",wsimages:yield Yc({app:n}),settings:Wc(e.overrides)}}))}export{Bc as componentInit,Hc as getPlotConfig,Uc as wsiViewer};
|