@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.
Files changed (307) hide show
  1. package/dist/{2dmaf-b2d78c57.js → 2dmaf-74b99126.js} +1 -1
  2. package/dist/AppHeader-cecb39c2.js +1 -0
  3. package/dist/{ColorScale-9c76aef3.js → ColorScale-21cab8d2.js} +1 -1
  4. package/dist/DEanalysis-95bad59a.js +1 -0
  5. package/dist/Disco-a6e921a0.js +1 -0
  6. package/dist/Disco.UI-9ad999ed.js +1 -0
  7. package/dist/{DragControls-586f72db.js → DragControls-e3b6a937.js} +1 -1
  8. package/dist/{DziViewer-6311327c.js → DziViewer-354a790d.js} +1 -1
  9. package/dist/FilterRxComp-701a1480.js +1 -0
  10. package/dist/{FilterStateless-046081c2.js → FilterStateless-54c0b763.js} +1 -1
  11. package/dist/{HicApp-40e44cba.js → HicApp-d5a946bf.js} +1 -1
  12. package/dist/{OrbitControls-0cda1772.js → OrbitControls-694652cd.js} +1 -1
  13. package/dist/WSIViewer-dc7f8eb0.js +1 -0
  14. package/dist/adSandbox-f438e388.js +1 -0
  15. package/dist/app-3320ab6f.js +1 -0
  16. package/dist/app-649f8357.js +1 -0
  17. package/dist/app-b369b169.js +1 -0
  18. package/dist/app.js +1 -1
  19. package/dist/bam-431875ef.js +1 -0
  20. package/dist/barchart-8277ed43.js +1 -0
  21. package/dist/barchart.events-da29c90d.js +1 -0
  22. package/dist/{bars.renderer-5f7a4174.js → bars.renderer-dcfdd59b.js} +1 -1
  23. package/dist/block-6aedd569.js +1 -0
  24. package/dist/block.lazyload-87b12654.js +1 -0
  25. package/dist/block.legend-d3f61ef7.js +1 -0
  26. package/dist/{block.mds-effc078d.js → block.mds-3ad17dfa.js} +1 -1
  27. package/dist/{block.mds.cnv-ec861a26.js → block.mds.cnv-857ba868.js} +1 -1
  28. package/dist/{block.mds.expressionrank-a2ad7c80.js → block.mds.expressionrank-7e3b208c.js} +1 -1
  29. package/dist/{block.mds.expressionstat-31dc5595.js → block.mds.expressionstat-f2d31c86.js} +1 -1
  30. package/dist/{block.mds.geneboxplot-3ca857ce.js → block.mds.geneboxplot-f0fbaf12.js} +1 -1
  31. package/dist/{block.mds.junction-debba938.js → block.mds.junction-7f87f48f.js} +1 -1
  32. package/dist/{block.mds.svcnv-8dc5abdf.js → block.mds.svcnv-ac035c12.js} +1 -1
  33. package/dist/{block.mds.svcnv.share-81e62600.js → block.mds.svcnv.share-886d9479.js} +1 -1
  34. package/dist/block.mds2-7852c1ee.js +1 -0
  35. package/dist/{block.svg-9121e8e7.js → block.svg-9b916fa6.js} +1 -1
  36. package/dist/{block.tk.aicheck-c1b478e9.js → block.tk.aicheck-6770e333.js} +1 -1
  37. package/dist/{block.tk.ase-0f6ded48.js → block.tk.ase-ee807e59.js} +1 -1
  38. package/dist/{block.tk.bam-7cd06aee.js → block.tk.bam-00fba6e8.js} +1 -1
  39. package/dist/{block.tk.bedgraphdot-3ef8b94e.js → block.tk.bedgraphdot-7fda78e9.js} +1 -1
  40. package/dist/{block.tk.bigwig.ui-d1248810.js → block.tk.bigwig.ui-cc1a42f3.js} +1 -1
  41. package/dist/{block.tk.hicstraw-ee731e55.js → block.tk.hicstraw-526470e3.js} +1 -1
  42. package/dist/{block.tk.junction-4d8cab4d.js → block.tk.junction-b43a4cda.js} +1 -1
  43. package/dist/{block.tk.junction.textmatrixui-a6430b27.js → block.tk.junction.textmatrixui-a60ed78a.js} +1 -1
  44. package/dist/{block.tk.ld-8429a18b.js → block.tk.ld-d15bde41.js} +1 -1
  45. package/dist/{block.tk.menu-3f31f958.js → block.tk.menu-3aeb93c6.js} +1 -1
  46. package/dist/{block.tk.pgv-07e46705.js → block.tk.pgv-9af2bd64.js} +1 -1
  47. package/dist/boxplot-e17a17b7.js +1 -0
  48. package/dist/brainImaging-bf2ceee9.js +1 -0
  49. package/dist/{brush-c386fe3d.js → brush-aa175142.js} +1 -1
  50. package/dist/categorical-a52014a1.js +1 -0
  51. package/dist/condition-c646e357.js +1 -0
  52. package/dist/controls-287e6efa.js +1 -0
  53. package/dist/{controls.btns-1cb2bfab.js → controls.btns-79b805dd.js} +1 -1
  54. package/dist/controls.config-28d6d6a8.js +1 -0
  55. package/dist/cuminc-9e275854.js +1 -0
  56. package/dist/{customdata.inputui-cbd712ea.js → customdata.inputui-dc49d94b.js} +1 -1
  57. package/dist/dataDownload-3a3d4f33.js +1 -0
  58. package/dist/databrowser.ui-d8d3f8fd.js +1 -0
  59. package/dist/{density-19266ebf.js → density-a82a8b1c.js} +1 -1
  60. package/dist/dictionary-c5a19d90.js +1 -0
  61. package/dist/{drag-0b968811.js → drag-7b30ba17.js} +1 -1
  62. package/dist/{e2pca-b8752945.js → e2pca-82765817.js} +1 -1
  63. package/dist/{ep-a86b185a.js → ep-d017ec2f.js} +1 -1
  64. package/dist/facet-a9b44ef3.js +1 -0
  65. package/dist/{fusion.parse-244b2b97.js → fusion.parse-d40d0b9d.js} +1 -1
  66. package/dist/geneExpClustering-34c3f518.js +1 -0
  67. package/dist/geneExpression-0d1b7244.js +1 -0
  68. package/dist/{geneExpression-e0430f2e.js → geneExpression-589f485b.js} +1 -1
  69. package/dist/{geneExpression-387205bf.js → geneExpression-7d14983f.js} +1 -1
  70. package/dist/geneORA-903a780f.js +1 -0
  71. package/dist/{geneVariant-7de021b6.js → geneVariant-89601b34.js} +1 -1
  72. package/dist/geneVariant-92c4e870.js +1 -0
  73. package/dist/{genefusion.ui-a331de19.js → genefusion.ui-7e22e811.js} +1 -1
  74. package/dist/{genesearch-ea59f5d4.js → genesearch-a4e19f0d.js} +1 -1
  75. package/dist/geneset-108a39d2.js +1 -0
  76. package/dist/genomeBrowser-12f86a36.js +1 -0
  77. package/dist/genomeBrowser.controls-d5067811.js +1 -0
  78. package/dist/{groupsetting-20ffef77.js → groupsetting-b4416a96.js} +1 -1
  79. package/dist/gsea-543dab25.js +1 -0
  80. package/dist/hierCluster-26e14090.js +1 -0
  81. package/dist/hierCluster.config-98e82dff.js +1 -0
  82. package/dist/{hierCluster.interactivity-9b433033.js → hierCluster.interactivity-e56f6542.js} +1 -1
  83. package/dist/hierCluster.renderers-74a64cf5.js +1 -0
  84. package/dist/{html.legend-abb5452e.js → html.legend-a3f4ebfe.js} +1 -1
  85. package/dist/imagePlot-b9eae4ae.js +1 -0
  86. package/dist/{lasso-55cf4057.js → lasso-f767f634.js} +1 -1
  87. package/dist/launch.adhoc-abca6af3.js +1 -0
  88. package/dist/leftlabel.sample-24c2388d.js +1 -0
  89. package/dist/legacyDataset-e0e201ab.js +1 -0
  90. package/dist/{log-cf45fcf2.js → log-99af3443.js} +1 -1
  91. package/dist/{lollipop-c5b6e615.js → lollipop-806f8fa4.js} +1 -1
  92. package/dist/{maf-7535f1f9.js → maf-b06579e4.js} +1 -1
  93. package/dist/{maftimeline-1292ab62.js → maftimeline-4840a380.js} +1 -1
  94. package/dist/matrix-00bb50ff.js +1 -0
  95. package/dist/matrix.cells-914dd0c6.js +1 -0
  96. package/dist/{matrix.cluster-168bc96b.js → matrix.cluster-783ceab0.js} +1 -1
  97. package/dist/matrix.config-6ce74dfe.js +1 -0
  98. package/dist/matrix.controls-7b2a6f95.js +1 -0
  99. package/dist/{matrix.data-b1d0febe.js → matrix.data-dac4f1b7.js} +1 -1
  100. package/dist/{matrix.dom-00defa30.js → matrix.dom-4e10bbe9.js} +1 -1
  101. package/dist/matrix.groups-b9fca14a.js +1 -0
  102. package/dist/matrix.interactivity-84169b43.js +1 -0
  103. package/dist/{matrix.layout-c2345231.js → matrix.layout-dd5a44fd.js} +1 -1
  104. package/dist/matrix.legend-ac6d45e6.js +1 -0
  105. package/dist/matrix.renderers-78010275.js +1 -0
  106. package/dist/matrix.serieses-9b4fd744.js +1 -0
  107. package/dist/matrix.sort-014d798d.js +1 -0
  108. package/dist/{matrix.sorterUi-a741ba2e.js → matrix.sorterUi-9bf7e6f9.js} +1 -1
  109. package/dist/{mavb-92136d17.js → mavb-c6be46fc.js} +1 -1
  110. package/dist/{mds.fimo-c03115b4.js → mds.fimo-bff6a1ed.js} +1 -1
  111. package/dist/mds.samplescatterplot-9a02b9fb.js +1 -0
  112. package/dist/{mds.survivalplot-366db380.js → mds.survivalplot-055549f4.js} +1 -1
  113. package/dist/{metaboliteIntensity-ddb6e480.js → metaboliteIntensity-fac92f8b.js} +1 -1
  114. package/dist/niceNumLabels-238aabce.js +1 -0
  115. package/dist/{nodrag-2c046d31.js → nodrag-16ad4b03.js} +1 -1
  116. package/dist/{notify-44ebc0df.js → notify-224cccbd.js} +1 -1
  117. package/dist/{numeric-918d4686.js → numeric-b0b17185.js} +1 -1
  118. package/dist/numeric.binary-1f9e93f2.js +1 -0
  119. package/dist/numeric.continuous-ebcd0567.js +1 -0
  120. package/dist/numeric.discrete-7b97044a.js +1 -0
  121. package/dist/numeric.spline-1be88f3d.js +1 -0
  122. package/dist/numeric.toggle-7fa2a770.js +1 -0
  123. package/dist/oncomatrix-351af2a0.js +1 -0
  124. package/dist/{parseData-e66308cd.js → parseData-21fe9822.js} +1 -1
  125. package/dist/partjson.esm-b3f1fc21.js +1 -0
  126. package/dist/{plot.2dvaf-73dbfbd1.js → plot.2dvaf-18a35e4b.js} +1 -1
  127. package/dist/plot.app-30c4b8e5.js +1 -0
  128. package/dist/plot.barplot-7c4865a2.js +1 -0
  129. package/dist/{plot.boxplot-641da058.js → plot.boxplot-fe3046c6.js} +1 -1
  130. package/dist/plot.brainImaging-2ceb6023.js +1 -0
  131. package/dist/plot.disco-6011f87f.js +1 -0
  132. package/dist/{plot.dzi-41ea26e5.js → plot.dzi-6728a7c8.js} +1 -1
  133. package/dist/plot.ssgq-5581dc56.js +1 -0
  134. package/dist/{plot.vaf2cov-80e58833.js → plot.vaf2cov-b2284c64.js} +1 -1
  135. package/dist/{plot.wsi-51cc48ef.js → plot.wsi-9a9d4034.js} +1 -1
  136. package/dist/profileBarchart-0476f1f8.js +1 -0
  137. package/dist/profileHome-32eb9b50.js +1 -0
  138. package/dist/profilePlot-c7e099e8.js +1 -0
  139. package/dist/profilePolar-6b981e63.js +1 -0
  140. package/dist/profileRadar-bca1cc03.js +1 -0
  141. package/dist/profileRadarFacility-bbb1ecd8.js +1 -0
  142. package/dist/profileSummary-b114204f.js +1 -0
  143. package/dist/recover-49e09de0.js +1 -0
  144. package/dist/regression.inputs-a761f40d.js +1 -0
  145. package/dist/regression.inputs.values.table-5929d25a.js +1 -0
  146. package/dist/regression.results-69bc42d0.js +1 -0
  147. package/dist/{renderPvalueTable-895a72c2.js → renderPvalueTable-dc5d15f2.js} +1 -1
  148. package/dist/sampleScatter-2d0ed680.js +1 -0
  149. package/dist/{sampleScatter.rendererThree-5e686004.js → sampleScatter.rendererThree-0b12ac61.js} +2 -2
  150. package/dist/sampleView-484ab133.js +1 -0
  151. package/dist/samplelst-689796e6.js +1 -0
  152. package/dist/{samplematrix-2a1d7d82.js → samplematrix-2b137a05.js} +1 -1
  153. package/dist/scatter-205e013f.js +1 -0
  154. package/dist/{select2Terms-b4fffc50.js → select2Terms-b21e184a.js} +1 -1
  155. package/dist/{selectGenomeWithTklst-acf7e568.js → selectGenomeWithTklst-466995b4.js} +1 -1
  156. package/dist/singleCellCellType-5db730bb.js +1 -0
  157. package/dist/{singleCellGeneExpression-6de17162.js → singleCellGeneExpression-7147a2d0.js} +1 -1
  158. package/dist/singleCellPlot-73b2738f.js +1 -0
  159. package/dist/{singlecell-f76c856a.js → singlecell-24409b72.js} +1 -1
  160. package/dist/singlecell-bca774ed.js +1 -0
  161. package/dist/{snp-9590a1b4.js → snp-37d06246.js} +1 -1
  162. package/dist/snp-a8388ce4.js +1 -0
  163. package/dist/snplocus-7a1ea8c9.js +1 -0
  164. package/dist/{snplst-007a1926.js → snplst-6865d7c7.js} +1 -1
  165. package/dist/{spliceevent.a53ss.diagram-63dfef69.js → spliceevent.a53ss.diagram-e2eab72b.js} +1 -1
  166. package/dist/{spliceevent.exonskip.diagram-76fa9af8.js → spliceevent.exonskip.diagram-4d5df3a1.js} +1 -1
  167. package/dist/spliceevent.exonskip.getdefault-a94aad6e.js +1 -0
  168. package/dist/{spliceevent.noeventdiagram-64a099e0.js → spliceevent.noeventdiagram-ea97b0fb.js} +1 -1
  169. package/dist/{spliceevent.phrase-770c8cac.js → spliceevent.phrase-c5832470.js} +1 -1
  170. package/dist/{stattable-f1189f0f.js → stattable-7c5ecc2f.js} +1 -1
  171. package/dist/{style.gdc-89cfdb0f.js → style.gdc-131f3c77.js} +1 -1
  172. package/dist/summary-5ec455d3.js +1 -0
  173. package/dist/{sunburst-d5379952.js → sunburst-533902a7.js} +1 -1
  174. package/dist/survival-92250664.js +1 -0
  175. package/dist/survival-e16e068f.js +1 -0
  176. package/dist/{svg.download-86850940.js → svg.download-35926549.js} +1 -1
  177. package/dist/{svg.legend-a94b0697.js → svg.legend-8d490df2.js} +1 -1
  178. package/dist/{svgraph-c57b9ae3.js → svgraph-6fac8cbc.js} +1 -1
  179. package/dist/{svmr-cf6f1b27.js → svmr-d07ff695.js} +1 -1
  180. package/dist/table-29d5a973.js +1 -0
  181. package/dist/table-ad744310.js +1 -0
  182. package/dist/termInfo-bf99a37e.js +1 -0
  183. package/dist/{termdb.bins-9faa5170.js → termdb.bins-8b656cc3.js} +1 -1
  184. package/dist/termsetting-33ea66f1.js +1 -0
  185. package/dist/tk-071a7550.js +1 -0
  186. package/dist/{toggleButtons-002aeda1.js → toggleButtons-dbdbad01.js} +1 -1
  187. package/dist/tp.ui-9c2e9fc5.js +1 -0
  188. package/dist/tslib.es6-c3c2d88f.js +1 -0
  189. package/dist/tvs.density-f6128793.js +1 -0
  190. package/dist/{tvs.geneVariant-3a65ad94.js → tvs.geneVariant-ca4bdbb1.js} +1 -1
  191. package/dist/tvs.numeric-0260a825.js +1 -0
  192. package/dist/{tvs.samplelst-1eeb586b.js → tvs.samplelst-cb71b3bf.js} +1 -1
  193. package/dist/{uiUtils-1336bad7.js → uiUtils-f1bd2bcc.js} +1 -1
  194. package/dist/{variantBrowser-f0c812c1.js → variantBrowser-7c540224.js} +1 -1
  195. package/dist/{vcf-c4a23924.js → vcf-5cc55588.js} +1 -1
  196. package/dist/violin-2ba509eb.js +1 -0
  197. package/dist/violin.interactivity-4da6d7a9.js +1 -0
  198. package/dist/{violin.renderer-dafd89fa.js → violin.renderer-ce024265.js} +1 -1
  199. package/dist/{violinRenderer-8215f40d.js → violinRenderer-f7c96a60.js} +1 -1
  200. package/dist/{viridis-ffd14c4d.js → viridis-01ab20c5.js} +1 -1
  201. package/dist/{y-dd197cc9.js → y-67939f83.js} +1 -1
  202. package/dist/{zoom-9c63e74c.js → zoom-25dce8b9.js} +1 -1
  203. package/package.json +6 -4
  204. package/dist/AppHeader-a2a7e518.js +0 -1
  205. package/dist/DEanalysis-a6b50e49.js +0 -1
  206. package/dist/Disco-1c71b7dd.js +0 -1
  207. package/dist/Disco.UI-4c16ee50.js +0 -1
  208. package/dist/FilterRxComp-242f4615.js +0 -1
  209. package/dist/WSIViewer-d90032d7.js +0 -1
  210. package/dist/adSandbox-3528c372.js +0 -1
  211. package/dist/app-07dee349.js +0 -1
  212. package/dist/app-a8c4854a.js +0 -1
  213. package/dist/app-ade9c62a.js +0 -1
  214. package/dist/bam-92483a98.js +0 -1
  215. package/dist/barchart-3e69d094.js +0 -1
  216. package/dist/barchart.events-9b11d97e.js +0 -1
  217. package/dist/block-dcb130fb.js +0 -1
  218. package/dist/block.lazyload-9f031cac.js +0 -1
  219. package/dist/block.legend-b2987cd9.js +0 -1
  220. package/dist/block.mds2-de6e0986.js +0 -1
  221. package/dist/boxplot-1178fffc.js +0 -1
  222. package/dist/brainImaging-98ed7aa2.js +0 -1
  223. package/dist/categorical-26528ce8.js +0 -1
  224. package/dist/condition-b0d74550.js +0 -1
  225. package/dist/controls-0bacec22.js +0 -1
  226. package/dist/controls.config-0ccc9d79.js +0 -1
  227. package/dist/controls.divide-a9fe9466.js +0 -1
  228. package/dist/controls.overlay-fe20d41d.js +0 -1
  229. package/dist/controls.term1-faa2efcf.js +0 -1
  230. package/dist/cuminc-7e2cac2d.js +0 -1
  231. package/dist/dataDownload-ade8d840.js +0 -1
  232. package/dist/databrowser.ui-716f0519.js +0 -1
  233. package/dist/dictionary-3f83ce63.js +0 -1
  234. package/dist/facet-6850cfed.js +0 -1
  235. package/dist/geneExpClustering-7fd3c87e.js +0 -1
  236. package/dist/geneExpression-6462537d.js +0 -1
  237. package/dist/geneORA-7eb818c4.js +0 -1
  238. package/dist/geneVariant-b58e924a.js +0 -1
  239. package/dist/geneset-9f69ad3f.js +0 -1
  240. package/dist/genomeBrowser-1b2b83f7.js +0 -1
  241. package/dist/genomeBrowser.controls-cd8ddeb1.js +0 -1
  242. package/dist/gsea-36376589.js +0 -1
  243. package/dist/hierCluster-f1e30c19.js +0 -1
  244. package/dist/hierCluster.config-da3510b1.js +0 -1
  245. package/dist/hierCluster.renderers-610d8860.js +0 -1
  246. package/dist/imagePlot-7089bdff.js +0 -1
  247. package/dist/launch.adhoc-d229fd55.js +0 -1
  248. package/dist/leftlabel.sample-a919168c.js +0 -1
  249. package/dist/legacyDataset-1cbcb67d.js +0 -1
  250. package/dist/matrix-0614794d.js +0 -1
  251. package/dist/matrix.cells-819d4991.js +0 -1
  252. package/dist/matrix.config-c54ca273.js +0 -1
  253. package/dist/matrix.controls-5eca7822.js +0 -1
  254. package/dist/matrix.groups-4660dd70.js +0 -1
  255. package/dist/matrix.interactivity-23d83183.js +0 -1
  256. package/dist/matrix.legend-2e647224.js +0 -1
  257. package/dist/matrix.renderers-43445f4f.js +0 -1
  258. package/dist/matrix.serieses-972fbe5d.js +0 -1
  259. package/dist/matrix.sort-80d9b788.js +0 -1
  260. package/dist/mds.samplescatterplot-1623e6d0.js +0 -1
  261. package/dist/niceNumLabels-6cfc1508.js +0 -1
  262. package/dist/numeric.binary-80467e8b.js +0 -1
  263. package/dist/numeric.continuous-69a62a15.js +0 -1
  264. package/dist/numeric.discrete-86181905.js +0 -1
  265. package/dist/numeric.spline-1b07fd13.js +0 -1
  266. package/dist/numeric.toggle-37c4bee8.js +0 -1
  267. package/dist/oncomatrix-475271da.js +0 -1
  268. package/dist/plot.app-aa916e0e.js +0 -1
  269. package/dist/plot.barplot-8b440a2b.js +0 -1
  270. package/dist/plot.brainImaging-2f796b0c.js +0 -1
  271. package/dist/plot.disco-43e18d2f.js +0 -1
  272. package/dist/plot.ssgq-e49cb70b.js +0 -1
  273. package/dist/profileBarchart-91463ab6.js +0 -1
  274. package/dist/profileHome-d37a6821.js +0 -1
  275. package/dist/profilePlot-9ca577cb.js +0 -1
  276. package/dist/profilePolar-19c7da5b.js +0 -1
  277. package/dist/profileRadar-8bf094e3.js +0 -1
  278. package/dist/profileRadarFacility-f9fd8971.js +0 -1
  279. package/dist/profileSummary-93999c14.js +0 -1
  280. package/dist/recover-36ada47f.js +0 -1
  281. package/dist/regression.inputs-cb57ece6.js +0 -1
  282. package/dist/regression.inputs.values.table-908bb37a.js +0 -1
  283. package/dist/regression.results-c186a8dc.js +0 -1
  284. package/dist/roundValue-b0d0517c.js +0 -1
  285. package/dist/sampleScatter-9d5b3630.js +0 -1
  286. package/dist/sampleView-2d895023.js +0 -1
  287. package/dist/samplelst-9f8343ff.js +0 -1
  288. package/dist/scatter-b4992f64.js +0 -1
  289. package/dist/singleCellCellType-84a0c2cf.js +0 -1
  290. package/dist/singleCellPlot-2f2b8619.js +0 -1
  291. package/dist/singlecell-90567dde.js +0 -1
  292. package/dist/snp-79ec95ba.js +0 -1
  293. package/dist/snplocus-cb629be1.js +0 -1
  294. package/dist/spliceevent.exonskip.getdefault-31d2950c.js +0 -1
  295. package/dist/summary-b77bef3c.js +0 -1
  296. package/dist/survival-61ab375a.js +0 -1
  297. package/dist/survival-80a0ade9.js +0 -1
  298. package/dist/table-79e3e776.js +0 -1
  299. package/dist/table-eee91e14.js +0 -1
  300. package/dist/termInfo-f851b415.js +0 -1
  301. package/dist/tk-75566002.js +0 -1
  302. package/dist/tp.ui-02911b56.js +0 -1
  303. package/dist/tslib.es6-1f85f553.js +0 -1
  304. package/dist/tvs.density-026fca97.js +0 -1
  305. package/dist/tvs.numeric-3f3d9919.js +0 -1
  306. package/dist/violin-1515c3e6.js +0 -1
  307. package/dist/violin.interactivity-8e2f480d.js +0 -1
@@ -0,0 +1 @@
1
+ import{_ as t}from"./tslib.es6-c3c2d88f.js";import{s as e,P as n,b as i,h as s,D as r}from"./app-b369b169.js";var o=':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(o);class a{constructor(t){this.propagationStopped;this.defaultPrevented;this.type=t;this.target=null}preventDefault(){this.defaultPrevented=true}stopPropagation(){this.propagationStopped=true}}var l=a;var h={PROPERTYCHANGE:"propertychange"};class c{constructor(){this.disposed=false}dispose(){if(!this.disposed){this.disposed=true;this.disposeInternal()}}disposeInternal(){}}var u=c;function d(t,e){return t>e?1:t<e?-1:0}function f(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 g(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 p(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 _(t,e,n){const i=e||d;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 m(){return true}function y(){return false}function E(){}function v(t){let e;let n;let i;return function(){const s=Array.prototype.slice.call(arguments);if(!n||this!==i||!p(s,n)){i=this;n=s;e=t.apply(this,arguments)}return e}}function x(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 w(t){for(const e in t){delete t[e]}}function C(t){let e;for(e in t){return false}return!e}class b extends u{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 l(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 a;for(let t=0,e=i.length;t<e;++t){if("handleEvent"in i[t]){a=i[t].handleEvent(s)}else{a=i[t].call(this,s)}if(a===false||s.propagationStopped){a=false;break}}if(--r[n]===0){let t=o[n];delete o[n];while(t--){this.removeEventListener(n,E)}delete r[n]}return a}disposeInternal(){this.listeners_&&w(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]=E;++this.pendingRemovals_[t]}else{n.splice(i,1);if(n.length===0){delete this.listeners_[t]}}}}}var R=b;var T={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 I(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 S(t,e,n,i){return I(t,e,n,i,true)}function M(t){if(t&&t.target){t.target.removeEventListener(t.type,t.listener);w(t)}}class A extends R{constructor(){super();this.on=this.onInternal;this.once=this.onceInternal;this.un=this.unInternal;this.revision_=0}changed(){++this.revision_;this.dispatchEvent(T.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]=I(this,t[s],e)}return i}return I(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]=S(this,t[s],e)}}else{n=S(this,t,e)}e.ol_key=n;return n}unInternal(t,e){const n=e.ol_key;if(n){P(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)}}}A.prototype.on;A.prototype.once;A.prototype.un;function P(t){if(Array.isArray(t)){for(let e=0,n=t.length;e<n;++e){M(t[e])}}else{M(t)}}var L=A;function O(){throw new Error("Unimplemented abstract method.")}let D=0;function F(t){return t.ol_uid||(t.ol_uid=String(++D))}class N extends l{constructor(t,e,n){super(t);this.key=e;this.oldValue=n}}class k extends L{constructor(t){super();this.on;this.once;this.un;F(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 N(n,t,e))}n=h.PROPERTYCHANGE;if(this.hasListener(n)){this.dispatchEvent(new N(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(C(this.values_)){this.values_=null}if(!e){this.notify(t,n)}}}}var z=k;var G={ADD:"add",REMOVE:"remove"};const V={LENGTH:"length"};class K extends l{constructor(t,e,n){super(t);this.element=e;this.index=n}}class j extends z{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(V.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 K(G.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 K(G.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 K(G.REMOVE,i,t));this.dispatchEvent(new K(G.ADD,e,t))}updateLength_(){this.set(V.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 X=j;var W={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 Y(t,e){if(!t){throw new Error(e)}}function Z(t,e,n){return Math.min(Math.max(t,e),n)}function U(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 B(t,e,n,i)}function B(t,e,n,i){const s=n-t;const r=i-e;return s*s+r*r}function H(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 q(t){return t*Math.PI/180}function $(t,e){const n=t%e;return n*e<0?n+e:n}function J(t,e,n){return t+n*(e-t)}function Q(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}function tt(t,e){return Math.floor(Q(t,e))}function et(t,e){return Math.ceil(Q(t,e))}class nt extends z{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[W.OPACITY]=t.opacity!==undefined?t.opacity:1;Y(typeof e[W.OPACITY]==="number","Layer opacity must be a number");e[W.VISIBLE]=t.visible!==undefined?t.visible:true;e[W.Z_INDEX]=t.zIndex;e[W.MAX_RESOLUTION]=t.maxResolution!==undefined?t.maxResolution:Infinity;e[W.MIN_RESOLUTION]=t.minResolution!==undefined?t.minResolution:0;e[W.MIN_ZOOM]=t.minZoom!==undefined?t.minZoom:-Infinity;e[W.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=Z(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 O()}getLayerStatesArray(t){return O()}getExtent(){return this.get(W.EXTENT)}getMaxResolution(){return this.get(W.MAX_RESOLUTION)}getMinResolution(){return this.get(W.MIN_RESOLUTION)}getMinZoom(){return this.get(W.MIN_ZOOM)}getMaxZoom(){return this.get(W.MAX_ZOOM)}getOpacity(){return this.get(W.OPACITY)}getSourceState(){return O()}getVisible(){return this.get(W.VISIBLE)}getZIndex(){return this.get(W.Z_INDEX)}setBackground(t){this.background_=t;this.changed()}setExtent(t){this.set(W.EXTENT,t)}setMaxResolution(t){this.set(W.MAX_RESOLUTION,t)}setMinResolution(t){this.set(W.MIN_RESOLUTION,t)}setMaxZoom(t){this.set(W.MAX_ZOOM,t)}setMinZoom(t){this.set(W.MIN_ZOOM,t)}setOpacity(t){Y(typeof t==="number","Layer opacity must be a number");this.set(W.OPACITY,t)}setVisible(t){this.set(W.VISIBLE,t)}setZIndex(t){this.set(W.Z_INDEX,t)}disposeInternal(){if(this.state_){this.state_.layer=null;this.state_=null}super.disposeInternal()}}var it=nt;var st={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"};var rt={ANIMATING:0,INTERACTING:1};var ot={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};const at=42;const lt=256;const ht={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class ct{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_||ht[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 ut=ct;const dt=6378137;const ft=Math.PI*dt;const gt=[-ft,-ft,ft,ft];const pt=[-180,-85,180,85];const _t=dt*Math.log(Math.tan(Math.PI/2));class mt extends ut{constructor(t){super({code:t,units:"m",extent:gt,global:true,worldExtent:pt,getPointResolution:function(t,e){return t/Math.cosh(e[1]/dt)}})}}const yt=[new mt("EPSG:3857"),new mt("EPSG:102100"),new mt("EPSG:102113"),new mt("EPSG:900913"),new mt("http://www.opengis.net/def/crs/EPSG/0/3857"),new mt("http://www.opengis.net/gml/srs/epsg.xml#3857")];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]=ft*t[s]/180;let n=dt*Math.log(Math.tan(Math.PI*(+t[s+1]+90)/360));if(n>_t){n=_t}else if(n<-_t){n=-_t}e[s+1]=n}return e}function vt(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]/ft;e[s+1]=360*Math.atan(Math.exp(t[s+1]/dt))/Math.PI-90}return e}const xt=6378137;const wt=[-180,-90,180,90];const Ct=Math.PI*xt/180;class bt extends ut{constructor(t,e){super({code:t,units:"degrees",extent:wt,axisOrientation:e,global:true,metersPerUnit:Ct,worldExtent:wt})}}const Rt=[new bt("CRS:84"),new bt("EPSG:4326","neu"),new bt("urn:ogc:def:crs:OGC:1.3:CRS84"),new bt("urn:ogc:def:crs:OGC:2:84"),new bt("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new bt("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new bt("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let Tt={};function It(t){return Tt[t]||Tt[t.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function St(t,e){Tt[t]=e}let Mt={};function At(t,e,n){const i=t.getCode();const s=e.getCode();if(!(i in Mt)){Mt[i]={}}Mt[i][s]=n}function Pt(t,e){let n;if(t in Mt&&e in Mt[t]){n=Mt[t][e]}return n}var Lt={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function Ot(t){const e=Vt();for(let n=0,i=t.length;n<i;++n){Ut(e,t[n])}return e}function Dt(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 Ft(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 Nt(t,e){return zt(t,e[0],e[1])}function kt(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function zt(t,e,n){return t[0]<=e&&e<=t[2]&&t[1]<=n&&n<=t[3]}function Gt(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=Lt.UNKNOWN;if(o<n){l=l|Lt.LEFT}else if(o>s){l=l|Lt.RIGHT}if(a<i){l=l|Lt.BELOW}else if(a>r){l=l|Lt.ABOVE}if(l===Lt.UNKNOWN){l=Lt.INTERSECTING}return l}function Vt(){return[Infinity,Infinity,-Infinity,-Infinity]}function Kt(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 jt(t){return Kt(Infinity,Infinity,-Infinity,-Infinity,t)}function Xt(t,e){const n=t[0];const i=t[1];return Kt(n,i,n,i,e)}function Wt(t,e,n,i,s){const r=jt(s);return Bt(r,t,e,n,i)}function Yt(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function Zt(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 Ut(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 Bt(t,e,n,i,s){for(;n<i;n+=s){Ht(t,e[n],e[n+1])}return t}function Ht(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 qt(t,e){let n;n=e(Jt(t));if(n){return n}n=e(Qt(t));if(n){return n}n=e(ae(t));if(n){return n}n=e(oe(t));if(n){return n}return false}function $t(t){let e=0;if(!ce(t)){e=le(t)*se(t)}return e}function Jt(t){return[t[0],t[1]]}function Qt(t){return[t[2],t[1]]}function te(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function ee(t,e){let n;if(e==="bottom-left"){n=Jt(t)}else if(e==="bottom-right"){n=Qt(t)}else if(e==="top-left"){n=oe(t)}else if(e==="top-right"){n=ae(t)}else{throw new Error("Invalid corner")}return n}function ne(t,e,n,i,s){const[r,o,a,l,h,c,u,d]=ie(t,e,n,i);return Kt(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 ie(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 se(t){return t[3]-t[1]}function re(t,e,n){const i=n?n:Vt();if(he(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{jt(i)}return i}function oe(t){return[t[0],t[3]]}function ae(t){return[t[2],t[3]]}function le(t){return t[2]-t[0]}function he(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function ce(t){return t[2]<t[0]||t[3]<t[1]}function ue(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 de(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 fe(t,e,n){let i=false;const s=Gt(t,e);const r=Gt(t,n);if(s===Lt.INTERSECTING||r===Lt.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&Lt.ABOVE)&&!(s&Lt.ABOVE)){p=d-(f-h)/g;i=p>=o&&p<=l}if(!i&&!!(r&Lt.RIGHT)&&!(s&Lt.RIGHT)){_=f-(d-l)*g;i=_>=a&&_<=h}if(!i&&!!(r&Lt.BELOW)&&!(s&Lt.BELOW)){p=d-(f-a)/g;i=p>=o&&p<=l}if(!i&&!!(r&Lt.LEFT)&&!(s&Lt.LEFT)){_=f-(d-o)*g;i=_>=a&&_<=h}}return i}function ge(t,e){const n=e.getExtent();const i=te(t);if(e.canWrapX()&&(i[0]<n[0]||i[0]>=n[2])){const e=le(n);const s=Math.floor((i[0]-n[0])/e);const r=s*e;t[0]-=r;t[2]-=r}return t}function pe(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]]]}ge(t,e);const s=le(i);if(le(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 _e(t,e){t[0]+=+e[0];t[1]+=+e[1];return t}function me(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 ye(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 Ee(t,e){t[0]*=e;t[1]*=e;return t}function ve(t,e){if(e.canWrapX()){const n=le(e.getExtent());const i=xe(t,e,n);if(i){t[0]-=i*n}}return t}function xe(t,e,n){const i=e.getExtent();let s=0;if(e.canWrapX()&&(t[0]<i[0]||t[0]>i[2])){n=n||le(i);s=Math.floor((t[0]-i[0])/n)}return s}const we=6371008.8;function Ce(t,e,n){n=n||we;const i=q(t[1]);const s=q(e[1]);const r=(s-i)/2;const o=q(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 be={info:1,warn:2,error:3,none:4};let Re=be.info;function Te(...t){if(Re>be.warn){return}console.warn(...t)}let Ie=true;function Se(t){const e=t===undefined?true:t;Ie=!e}function Me(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 Ae(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 Pe(t){St(t.getCode(),t);At(t,t,Me)}function Le(t){t.forEach(Pe)}function Oe(t){return typeof t==="string"?It(t):t||null}function De(t,e,n,i){t=Oe(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/ht[i]}}}else{const r=t.getUnits();if(r=="degrees"&&!i||i=="degrees"){s=e}else{const o=Ge(t,Oe("EPSG:4326"));if(o===Ae&&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=Ce(t.slice(0,2),t.slice(2,4));const r=Ce(t.slice(4,6),t.slice(6,8));s=(i+r)/2}const a=i?ht[i]:t.getMetersPerUnit();if(a!==undefined){s/=a}}}return s}function Fe(t){Le(t);t.forEach((function(e){t.forEach((function(t){if(e!==t){At(e,t,Me)}}))}))}function Ne(t,e,n,i){t.forEach((function(t){e.forEach((function(e){At(t,e,n);At(e,t,i)}))}))}function ke(t,e){if(!t){return Oe(e)}if(typeof t==="string"){return Oe(t)}return t}function ze(t,e){if(t===e){return true}const n=t.getUnits()===e.getUnits();if(t.getCode()===e.getCode()){return n}const i=Ge(t,e);return i===Me&&n}function Ge(t,e){const n=t.getCode();const i=e.getCode();let s=Pt(n,i);if(!s){s=Ae}return s}function Ve(t,e){const n=Oe(t);const i=Oe(e);return Ge(n,i)}function Ke(t,e,n){const i=Ve(e,n);return i(t,undefined,t.length)}function je(t,e){{return t}}function Xe(t,e){{if(Ie&&!me(t,[0,0])&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90){Ie=false;Te("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")}return t}}function We(t,e){{return t}}function Ye(t,e){{return t}}function Ze(){Fe(yt);Fe(Rt);Ne(Rt,yt,Et,vt)}Ze();function Ue(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 _=Z(i[0],d,f);let m=Z(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 Be(t){return t}function He(t,e,n,i){const s=le(e)/n[0];const r=se(e)/n[1];if(i){return Math.min(t,Math.max(s,r))}return Math.min(t,Math.min(s,r))}function qe(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 Z(i,n/2,e*2)}function $e(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?He(l,n,o,i):l;if(a){if(!e){return Z(s,h,c)}return qe(s,c,h)}const u=Math.min(c,s);const d=Math.floor(f(t,u,r));if(t[d]>c&&d<t.length-1){return t[d+1]}return t[d]}return undefined}}function Je(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?He(e,s,l,r):e;if(h){if(!i){return Z(o,n,c)}return qe(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 Z(m,n,c)}return undefined}}function Qe(t,e,n,i,s){n=n!==undefined?n:true;return function(r,o,a,l){if(r!==undefined){const o=i?He(t,i,a,s):t;if(!n||!l){return Z(r,e,o)}return qe(r,o,e)}return undefined}}function tn(t){if(t!==undefined){return 0}return undefined}function en(t){if(t!==undefined){return t}return undefined}function nn(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 sn(t){const e=t===undefined?q(5):t;return function(t,n){if(n||t===undefined){return t}if(Math.abs(t)<=e){return 0}return t}}function rn(t){return Math.pow(t,3)}function on(t){return 1-rn(1-t)}function an(t){return 3*t*t-2*t*t*t}function ln(t){return t}new Array(6);function hn(){return[1,0,0,1,0,0]}function cn(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 un(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 dn(t,e){const n=fn(e);Y(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 fn(t){return t[0]*t[3]-t[1]*t[2]}const gn=[1e6,1e6,1e6,1e6,2,2];function pn(t){const e="matrix("+t.map(((t,e)=>Math.round(t*gn[e])/gn[e])).join(", ")+")";return e}function _n(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 mn(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 yn(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 En(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 vn=hn();class xn extends z{constructor(){super();this.extent_=Vt();this.extentRevision_=-1;this.simplifiedGeometryMaxMinSquaredTolerance=0;this.simplifiedGeometryRevision=0;this.simplifyTransformedInternal=v(((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 O()}closestPointXY(t,e,n,i){return O()}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 O()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const t=this.computeExtent(this.extent_);if(isNaN(t[0])||isNaN(t[1])){jt(t)}this.extentRevision_=this.getRevision()}return ue(this.extent_,t)}rotate(t,e){O()}scale(t,e,n){O()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return O()}getType(){return O()}applyTransform(t){O()}intersectsExtent(t){return O()}translate(t,e){O()}transform(t,e){const n=Oe(t);const i=n.getUnits()=="tile-pixels"?function(t,i,s){const r=n.getExtent();const o=n.getWorldExtent();const a=se(o)/se(r);un(vn,o[0],o[3],a,-a,0,0,0);_n(t,0,t.length,s,vn,i);return Ve(n,e)(t,i,s)}:Ve(n,e);this.applyTransform(i);return this}}var wn=xn;class Cn extends wn{constructor(){super();this.layout="XY";this.stride=2;this.flatCoordinates}computeExtent(t){return Wt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return O()}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=Rn(t);this.layout=t;this.flatCoordinates=e}setCoordinates(t,e){O()}setLayout(t,e,n){let i;if(t){i=Rn(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=bn(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();mn(n,0,n.length,i,t,e,n);this.changed()}}scale(t,e,n){if(e===undefined){e=t}if(!n){n=te(this.getExtent())}const i=this.getFlatCoordinates();if(i){const s=this.getStride();yn(i,0,i.length,s,t,e,n,i);this.changed()}}translate(t,e){const n=this.getFlatCoordinates();if(n){const i=this.getStride();En(n,0,n.length,i,t,e,n);this.changed()}}}function bn(t){let e;if(t==2){e="XY"}else if(t==3){e="XYZ"}else if(t==4){e="XYZM"}return e}function Rn(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 Tn=Cn;function In(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]=J(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 Sn(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=B(r,o,n,i);if(a>s){s=a}r=n;o=i}return s}function Mn(t,e,n,i,s){for(let r=0,o=n.length;r<o;++r){const o=n[r];s=Sn(t,e,o,i,s);e=o}return s}function An(t,e,n,i,s,r,o,a,l,h,c){if(e==n){return h}let u,d;if(s===0){d=B(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){In(t,f-i,f,i,o,a,c);d=B(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){In(t,n-i,e,i,o,a,c);d=B(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 Pn(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=An(t,e,d,i,s,r,o,a,l,h,c);e=d}return h}function Ln(t,e,n,i){for(let i=0,s=n.length;i<s;++i){t[e++]=n[i]}return e}function On(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 Dn(t,e,n,i,s){s=s?s:[];let r=0;for(let o=0,a=n.length;o<a;++o){const a=On(t,e,n[o],i);s[r++]=a;e=a}s.length=r;return s}function Fn(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=U(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 Nn(t,e){return e*Math.round(t/e)}function kn(t,e,n,i,s,r,o){if(e==n){return o}let a=Nn(t[e],s);let l=Nn(t[e+1],s);e+=i;r[o++]=a;r[o++]=l;let h,c;do{h=Nn(t[e],s);c=Nn(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=Nn(t[e],s);const u=Nn(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 zn(t,e,n,i,s,r,o,a){for(let l=0,h=n.length;l<h;++l){const h=n[l];o=kn(t,e,h,i,s,r,o);a.push(o);e=h}return o}function Gn(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 Vn(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++]=Gn(t,e,a,i,s[r]);e=a}s.length=r;return s}function Kn(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 jn(t,e,n,i){let s=0;for(let r=0,o=n.length;r<o;++r){const o=n[r];s+=Kn(t,e,o,i);e=o}return s}class Xn extends Tn{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 Xn(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,e,n,i){if(i<Ft(this.getExtent(),t,e)){return i}if(this.maxDeltaRevision_!=this.getRevision()){this.maxDelta_=Math.sqrt(Sn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0));this.maxDeltaRevision_=this.getRevision()}return An(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,true,t,e,n,i)}getArea(){return Kn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return Gn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){const e=[];e.length=Fn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0);return new Xn(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=On(this.flatCoordinates,0,t,this.stride);this.changed()}}var Wn=Xn;class Yn extends Tn{constructor(t,e){super();this.setCoordinates(t,e)}clone(){const t=new Yn(this.flatCoordinates.slice(),this.layout);t.applyProperties(this);return t}closestPointXY(t,e,n,i){const s=this.flatCoordinates;const r=B(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 Xt(this.flatCoordinates,t)}getType(){return"Point"}intersectsExtent(t){return zt(t,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(t,e){this.setLayout(e,t,0);if(!this.flatCoordinates){this.flatCoordinates=[]}this.flatCoordinates.length=Ln(this.flatCoordinates,0,t,this.stride);this.changed()}}var Zn=Yn;function Un(t,e,n,i,s){const r=qt(s,(function(s){return!Bn(t,e,n,i,s[0],s[1])}));return!r}function Bn(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 Hn(t,e,n,i,s,r){if(n.length===0){return false}if(!Bn(t,e,n[0],i,s,r)){return false}for(let e=1,o=n.length;e<o;++e){if(Bn(t,n[e-1],n[e],i,s,r)){return false}}return true}function qn(t,e,n,i,s,r,o){let a,l,h,c,u,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){u=t[a];g=t[a+1];if(p<=f&&g<=p||f<=p&&p<=g){h=(p-f)/(g-f)*(u-c)+c;_.push(h)}c=u;f=g}}let m=NaN;let y=-Infinity;_.sort(d);c=_[0];for(a=1,l=_.length;a<l;++a){u=_[a];const s=Math.abs(u-c);if(s>y){h=(c+u)/2;if(Hn(t,e,n,i,h,p)){m=h;y=s}}c=u}if(isNaN(m)){m=s[r]}if(o){o.push(m,p,y);return o}return[m,p,y]}function $n(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 Jn(t,e,n,i,s){const r=Bt(Vt(),t,e,n,i);if(!he(s,r)){return false}if(kt(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 $n(t,e,n,i,(function(t,e){return fe(s,t,e)}))}function Qn(t,e,n,i,s){if(Jn(t,e,n,i,s)){return true}if(Bn(t,e,n,i,s[0],s[1])){return true}if(Bn(t,e,n,i,s[0],s[3])){return true}if(Bn(t,e,n,i,s[2],s[1])){return true}if(Bn(t,e,n,i,s[2],s[3])){return true}return false}function ti(t,e,n,i,s){if(!Qn(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(Un(t,n[e-1],n[e],i,s)){if(!Jn(t,n[e-1],n[e],i,s)){return false}}}return true}function ei(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 ni(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 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=ni(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 si(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=ni(t,e,o,i);const l=r===0?s&&a||!s&&!a:s&&!a||!s&&a;if(l){ei(t,e,o,i)}e=o}return e}class ri extends Tn{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{g(this.flatCoordinates,t.getFlatCoordinates())}this.ends_.push(this.flatCoordinates.length);this.changed()}clone(){const t=new ri(this.flatCoordinates.slice(),this.layout,this.ends_.slice());t.applyProperties(this);return t}closestPointXY(t,e,n,i){if(i<Ft(this.getExtent(),t,e)){return i}if(this.maxDeltaRevision_!=this.getRevision()){this.maxDelta_=Math.sqrt(Mn(this.flatCoordinates,0,this.ends_,this.stride,0));this.maxDeltaRevision_=this.getRevision()}return Pn(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,true,t,e,n,i)}containsXY(t,e){return Hn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)}getArea(){return jn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(t){let e;if(t!==undefined){e=this.getOrientedFlatCoordinates().slice();si(e,0,this.ends_,this.stride,t)}else{e=this.flatCoordinates}return Vn(e,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const t=te(this.getExtent());this.flatInteriorPoint_=qn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0);this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new Zn(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(t){if(t<0||this.ends_.length<=t){return null}return new Wn(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 Wn(e.slice(s,o),t);i.push(a);s=o}return i}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;if(ii(t,0,this.ends_,this.stride)){this.orientedFlatCoordinates_=t}else{this.orientedFlatCoordinates_=t.slice();this.orientedFlatCoordinates_.length=si(this.orientedFlatCoordinates_,0,this.ends_,this.stride)}this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[];const n=[];e.length=zn(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),e,0,n);return new ri(e,"XY",n)}getType(){return"Polygon"}intersectsExtent(t){return ti(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2);if(!this.flatCoordinates){this.flatCoordinates=[]}const n=Dn(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=n.length===0?0:n[n.length-1];this.changed()}}function oi(t){if(ce(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 ri(r,"XY",[r.length])}const ai=0;class li extends z{constructor(t){super();this.on;this.once;this.un;t=Object.assign({},t);this.hints_=[0,0];this.animations_=[];this.updateAnimationKey_;this.projection_=ke(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){Se()}if(t.center){t.center=Xe(t.center,this.projection_)}if(t.extent){t.extent=Ye(t.extent,this.projection_)}this.applyOptions_(t)}applyOptions_(t){const e=Object.assign({},t);for(const t in ot){delete e[t]}this.setProperties(e,true);const n=ui(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=ci(t);const s=n.constraint;const r=di(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=Xe(n.center,this.getProjection())}if(n.anchor){n=Object.assign({},n);n.anchor=Xe(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){hi(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||an,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=$(t.rotation-a+Math.PI,2*Math.PI)-Math.PI;e.targetRotation=a+n;a=e.targetRotation}if(fi(e)){e.complete=true}else{s+=e.duration}l.push(e)}this.animations_.push(l);this.setHint(rt.ANIMATING,1);this.updateAnimations_()}getAnimating(){return this.hints_[rt.ANIMATING]>0}getInteracting(){return this.hints_[rt.INTERACTING]>0}cancelAnimations(){this.setHint(rt.ANIMATING,-this.hints_[rt.ANIMATING]);let t;for(let e=0,n=this.animations_.length;e<n;++e){const n=this.animations_[e];if(n[0].callback){hi(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?$(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(rt.ANIMATING,-1);this.nextCenter_=null;this.nextResolution_=NaN;this.nextRotation_=NaN;const t=i[0].callback;if(t){hi(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]];ye(n,t-this.getRotation());_e(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 je(t,this.getProjection())}getCenterInternal(){return this.get(ot.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 We(e,this.getProjection())}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();const e=this.getCenterInternal();Y(e,"The view center is not defined");const n=this.getResolution();Y(n!==undefined,"The view resolution is not defined");const i=this.getRotation();Y(i!==undefined,"The view rotation is not defined");return ne(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(ot.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,e){return this.getResolutionForExtentInternal(Ye(t,this.getProjection()),e)}getResolutionForExtentInternal(t,e){e=e||this.getViewportSizeMinusPadding_();const n=le(t)/e[0];const i=se(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(ot.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=gi(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=f(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=Z(Math.floor(t),0,this.resolutions_.length-2);const n=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(n,Z(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}fit(t,e){let n;Y(Array.isArray(t)||typeof t.getSimplifiedGeometry==="function","Invalid extent or geometry provided as `geometry`");if(Array.isArray(t)){Y(!ce(t),"Cannot fit empty extent provided as `geometry`");const e=Ye(t,this.getProjection());n=oi(e)}else if(t.getType()==="Circle"){const e=Ye(t.getExtent(),this.getProjection());n=oi(e);n.rotate(this.getRotation(),te(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=te(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:E;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);hi(p,true)}}centerOn(t,e,n){this.centerOnInternal(Xe(t,this.getProjection()),e,n)}centerOnInternal(t,e,n){this.setCenterInternal(gi(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=gi(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=je(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&&Xe(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=Xe(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?Xe(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(ot.ROTATION)!==i){this.set(ot.ROTATION,i)}if(this.get(ot.RESOLUTION)!==r){this.set(ot.RESOLUTION,r);this.set("zoom",this.getZoom(),true)}if(!o||!this.get(ot.CENTER)||!me(this.get(ot.CENTER),o)){this.set(ot.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()||!me(this.getCenterInternal(),a)){if(this.getAnimating()){this.cancelAnimations()}this.animateInternal({rotation:s,center:a,resolution:o,duration:t,easing:on,anchor:n})}}beginInteraction(){this.resolveConstraints(0);this.setHint(rt.INTERACTING,1)}endInteraction(t,e,n){n=n&&Xe(n,this.getProjection());this.endInteractionInternal(t,e,n)}endInteractionInternal(t,e,n){if(!this.getInteracting()){return}this.setHint(rt.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 hi(t,e){setTimeout((function(){t(e)}),0)}function ci(t){if(t.extent!==undefined){const e=t.smoothExtentConstraint!==undefined?t.smoothExtentConstraint:true;return Ue(t.extent,t.constrainOnlyCenter,e)}const e=ke(t.projection,"EPSG:3857");if(t.multiWorld!==true&&e.isGlobal()){const t=e.getExtent().slice();t[0]=-Infinity;t[2]=Infinity;return Ue(t,false,false)}return Be}function ui(t){let e;let n;let i;const s=28;const r=2;let o=t.minZoom!==undefined?t.minZoom:ai;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=ke(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=$e(s,c,!g&&p,u)}else{e=Qe(n,i,c,!g&&p,u)}}else{const h=!f?360*ht.degrees/d.getMetersPerUnit():Math.max(le(f),se(f));const _=h/lt/Math.pow(r,ai);const m=_/Math.pow(r,s-ai);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=Je(l,n,i,c,!g&&p,u)}else{e=Qe(n,i,c,!g&&p,u)}}return{constraint:e,maxResolution:n,minResolution:i,minZoom:o,zoomFactor:l}}function di(t){const e=t.enableRotation!==undefined?t.enableRotation:true;if(e){const e=t.constrainRotation;if(e===undefined||e===true){return sn()}if(e===false){return en}if(typeof e==="number"){return nn(e)}return en}return tn}function fi(t){if(t.sourceCenter&&t.targetCenter){if(!me(t.sourceCenter,t.targetCenter)){return false}}if(t.sourceResolution!==t.targetResolution){return false}if(t.sourceRotation!==t.targetRotation){return false}return true}function gi(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 pi=li;class _i extends it{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(W.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(W.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_){M(this.sourceChangeKey_);this.sourceChangeKey_=null}this.sourceReady_=false;const t=this.getSource();if(t){this.sourceChangeKey_=I(t,T.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 pi){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 mi(i,e.viewState)&&(!s||he(s,e.extent))}getAttributions(t){if(!this.isVisible(t)){return[]}const e=this.getSource()?.getAttributions();if(!e){return[]}const n=t instanceof pi?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(W.MAP,t)}getMapInternal(){return this.get(W.MAP)}setMap(t){if(this.mapPrecomposeKey_){M(this.mapPrecomposeKey_);this.mapPrecomposeKey_=null}if(!t){this.changed()}if(this.mapRenderKey_){M(this.mapRenderKey_);this.mapRenderKey_=null}if(t){this.mapPrecomposeKey_=I(t,st.PRECOMPOSE,(t=>{const e=t;const n=e.frameState.layerStatesArray;const i=this.getLayerState(false);Y(!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_=I(this,T.CHANGE,t.render,t);this.changed()}}setSource(t){this.set(W.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 mi(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 yi=_i;function Ei(t,e,n,i,s){vi(t,e,n||0,i||t.length-1,s||wi)}function vi(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));vi(t,e,c,u,s)}var d=t[e];var f=n;var g=i;xi(t,n,e);if(s(t[i],d)>0)xi(t,n,i);while(f<g){xi(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)xi(t,n,g);else{g++;xi(t,g,i)}if(g<=e)n=g+1;if(e<=g)i=g-1}}function xi(t,e,n){var i=t[e];t[e]=t[n];t[n]=i}function wi(t,e){return t<e?-1:t>e?1:0}class Ci{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(!Fi(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(Fi(t,a)){if(e.leaf)n.push(o);else if(Di(t,a))this._all(o,n);else s.push(o)}}e=s.pop()}return n}collides(t){let e=this.data;if(!Fi(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(Fi(t,r)){if(e.leaf||Di(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=Ni([]);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=bi(t,n.children,e);if(i!==-1){n.children.splice(i,1);s.push(n);this._condense(s);return this}}if(!l&&!n.leaf&&Di(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=Ni(t.slice(e,n+1));Ri(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=Ni([]);o.leaf=false;o.height=i;const a=Math.ceil(s/r);const l=a*Math.ceil(Math.sqrt(r));ki(t,e,n,l,this.compareMinX);for(let s=e;s<=n;s+=l){const e=Math.min(s+l-1,n);ki(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))}}Ri(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=Ai(i);const l=Li(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);Ii(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=Ni(n.children.splice(r,n.children.length-r));o.height=n.height;o.leaf=n.leaf;Ri(n,this.toBBox);Ri(o,this.toBBox);if(e)t[e-1].children.push(o);else this._splitRoot(n,o)}_splitRoot(t,e){this.data=Ni([t,e]);this.data.height=t.height+1;this.data.leaf=false;Ri(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=Ti(t,0,o,this.toBBox);const a=Ti(t,o,n,this.toBBox);const l=Oi(e,a);const h=Ai(e)+Ai(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:Si;const s=t.leaf?this.compareMinY:Mi;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=Ti(t,0,e,s);const o=Ti(t,n-e,n,s);let a=Pi(r)+Pi(o);for(let i=e;i<n-e;i++){const e=t.children[i];Ii(r,t.leaf?s(e):e);a+=Pi(r)}for(let i=n-e-1;i>=e;i--){const e=t.children[i];Ii(o,t.leaf?s(e):e);a+=Pi(o)}return a}_adjustParentBBoxes(t,e,n){for(let i=n;i>=0;i--){Ii(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 Ri(t[e],this.toBBox)}}}function bi(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 Ri(t,e){Ti(t,0,t.children.length,e,t)}function Ti(t,e,n,i,s){if(!s)s=Ni(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];Ii(s,t.leaf?i(e):e)}return s}function Ii(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 Si(t,e){return t.minX-e.minX}function Mi(t,e){return t.minY-e.minY}function Ai(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function Pi(t){return t.maxX-t.minX+(t.maxY-t.minY)}function Li(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 Oi(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 Di(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function Fi(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function Ni(t){return{children:t,height:1,leaf:true,minX:Infinity,minY:Infinity,maxX:-Infinity,maxY:-Infinity}}function ki(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;Ei(t,o,e,n,s);r.push(e,o,o,n)}}var zi={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function Gi(t){return t[0]>0&&t[1]>0}function Vi(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 Ki(t,e){if(Array.isArray(t)){return t}if(e===undefined){e=[t,t]}else{e[0]=t;e[1]=t}return e}class ji{constructor(t){this.opacity_=t.opacity;this.rotateWithView_=t.rotateWithView;this.rotation_=t.rotation;this.scale_=t.scale;this.scaleArray_=Ki(t.scale);this.displacement_=t.displacement;this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new ji({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 O()}getImage(t){return O()}getHitDetectionImage(){return O()}getPixelRatio(t){return 1}getImageState(){return O()}getImageSize(){return O()}getOrigin(){return O()}getSize(){return O()}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_=Ki(t)}listenImageChange(t){O()}load(){O()}unlistenImageChange(t){O()}ready(){return Promise.resolve()}}var Xi=ji;var Wi={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};var Yi={name:"xyz",min:[0,0,0],channel:["X","Y","Z"],alias:["XYZ","ciexyz","cie1931"]};Yi.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]}};Yi.max=Yi.whitepoint[2].D65;Yi.rgb=function(t,e){e=e||Yi.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]};Wi.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||Yi.whitepoint[2].E;return[r*e[0],o*e[1],a*e[2]]};var Zi={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=Yi.whitepoint[n][e][0];d=Yi.whitepoint[n][e][1];f=Yi.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]}};Yi.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=Yi.whitepoint[n][e][0];d=Yi.whitepoint[n][e][1];f=Yi.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 Ui={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 Zi.xyz(Ui.luv(t))}};Zi.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]};Yi.lchuv=function(t){return Zi.lchuv(Yi.luv(t))};var Bi={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 Hi={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function qi(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(Bi[t]){n=Bi[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(Hi[t]!==undefined)return Hi[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 $i={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}};Wi.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 Ji(t){if(Array.isArray(t)&&t.raw)t=String.raw(...arguments);if(t instanceof Number)t=+t;var e;var n=qi(t);if(!n.space)return[];const i=n.space[0]==="h"?$i.min:Wi.min;const s=n.space[0]==="h"?$i.max:Wi.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=$i.rgb(e)}e.push(Math.min(Math.max(n.alpha,0),1));return e}function Qi(t){if(typeof t==="string"){return t}return hs(t)}const ts=1024;const es={};let ns=0;function is(t){if(t.length===4){return t}const e=t.slice();e[3]=1;return e}function ss(t){const e=Yi.lchuv(Wi.xyz(t));e[3]=t[3];return e}function rs(t){const e=Yi.rgb(Ui.xyz(t));e[3]=t[3];return e}function os(t){if(es.hasOwnProperty(t)){return es[t]}if(ns>=ts){let t=0;for(const e in es){if((t++&3)===0){delete es[e];--ns}}}const e=Ji(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')}}ls(e);es[t]=e;++ns;return e}function as(t){if(Array.isArray(t)){return t}return os(t)}function ls(t){t[0]=Z(t[0]+.5|0,0,255);t[1]=Z(t[1]+.5|0,0,255);t[2]=Z(t[2]+.5|0,0,255);t[3]=Z(t[3],0,1);return t}function hs(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 cs=typeof navigator!=="undefined"&&typeof navigator.userAgent!=="undefined"?navigator.userAgent.toLowerCase():"";const us=cs.includes("firefox");const ds=cs.includes("safari")&&!cs.includes("chrom");ds&&(cs.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(cs));const fs=cs.includes("webkit")&&!cs.includes("edge");const gs=cs.includes("macintosh");const ps=typeof devicePixelRatio!=="undefined"?devicePixelRatio:1;const _s=typeof WorkerGlobalScope!=="undefined"&&typeof OffscreenCanvas!=="undefined"&&self instanceof WorkerGlobalScope;const ms=typeof Image!=="undefined"&&Image.prototype.decode;const ys=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 Es(t,e,n,i){let s;if(n&&n.length){s=n.shift()}else if(_s){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 vs;function xs(){if(!vs){vs=Es(1,1)}return vs}function ws(t){const e=t.canvas;e.width=1;e.height=1;t.clearRect(0,0,1,1)}function Cs(t){let e=t.offsetWidth;const n=getComputedStyle(t);e+=parseInt(n.marginLeft,10)+parseInt(n.marginRight,10);return e}function bs(t){let e=t.offsetHeight;const n=getComputedStyle(t);e+=parseInt(n.marginTop,10)+parseInt(n.marginBottom,10);return e}function Rs(t,e){const n=e.parentNode;if(n){n.replaceChild(t,e)}}function Ts(t){while(t.lastChild){t.lastChild.remove()}}function Is(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 Ss(t,e,n){const i=t;let s=true;let r=false;let o=false;const a=[S(i,T.LOAD,(function(){o=true;if(!r){e()}}))];if(i.src&&ms){r=true;i.decode().then((function(){if(s){e()}})).catch((function(t){if(s){if(o){e()}else{n()}}}))}else{a.push(S(i,T.ERROR,n))}return function t(){s=false;a.forEach(M)}}function Ms(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 As(t,e){if(e){t.src=e}return t.src&&ms?new Promise(((e,n)=>t.decode().then((()=>e(t))).catch((i=>t.complete&&t.width?e(t):n(i))))):Ms(t)}class Ps{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=Ls(t,e,n);return i in this.cache_?this.cache_[i]:null}getPattern(t,e,n){const i=Ls(t,e,n);return i in this.patternCache_?this.patternCache_[i]:null}set(t,e,n,i,s){const r=Ls(t,e,n);const o=r in this.cache_;this.cache_[r]=i;if(s){if(i.getImageState()===zi.IDLE){i.load()}if(i.getImageState()===zi.LOADING){i.ready().then((()=>{this.patternCache_[r]=xs().createPattern(i.getImage(1),"repeat")}))}else{this.patternCache_[r]=xs().createPattern(i.getImage(1),"repeat")}}if(!o){++this.cacheSize_}}setSize(t){this.maxCacheSize_=t;this.expire()}}function Ls(t,e,n){const i=n?as(n):"null";return e+":"+t+":"+i}const Os=new Ps;let Ds=null;class Fs extends R{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?zi.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_===zi.LOADED){if(!Ds){Ds=Es(1,1,undefined,{willReadFrequently:true})}Ds.drawImage(this.image_,0,0);try{Ds.getImageData(0,0,1,1);this.tainted_=false}catch(t){Ds=null;this.tainted_=true}}return this.tainted_===true}dispatchChangeEvent_(){this.dispatchEvent(T.CHANGE)}handleImageError_(){this.imageState_=zi.ERROR;this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=zi.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=Es(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_!==zi.IDLE){return}if(!this.image_){this.initializeImage_()}this.imageState_=zi.LOADING;try{if(this.src_!==undefined){this.image_.src=this.src_}}catch(t){this.handleImageError_()}if(this.image_ instanceof HTMLImageElement){As(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_!==zi.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=Qi(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_===zi.LOADED||this.imageState_===zi.ERROR){t()}else{const e=()=>{if(this.imageState_===zi.LOADED||this.imageState_===zi.ERROR){this.removeEventListener(T.CHANGE,e);t()}};this.addEventListener(T.CHANGE,e)}}))}return this.ready_}}function Ns(t,e,n,i,s,r){let o=e===undefined?undefined:Os.get(e,n,s);if(!o){o=new Fs(t,t&&"src"in t?t.src||undefined:e,n,i,s);Os.set(e,n,s,o,r)}if(r&&o&&!Os.getPattern(e,n,s)){Os.set(e,n,s,o,r)}return o}function ks(t){if(!t){return null}if(Array.isArray(t)){return hs(t)}if(typeof t==="object"&&"src"in t){return zs(t)}return t}function zs(t){if(!t.offset||!t.size){return Os.getPattern(t.src,"anonymous",t.color)}const e=t.src+":"+t.offset;const n=Os.getPattern(e,undefined,t.color);if(n){return n}const i=Os.get(t.src,"anonymous",null);if(i.getImageState()!==zi.LOADED){return null}const s=Es(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]);Ns(s.canvas,e,undefined,zi.LOADED,t.color,true);return Os.getPattern(e,undefined,t.color)}const Gs="ol-hidden";const Vs="ol-selectable";const Ks="ol-unselectable";const js="ol-unsupported";const Xs="ol-control";const Ws="ol-collapsed";const Ys="#000";const Zs="round";const Us="round";const Bs=10;const Hs="#000";const qs=1;const $s=new z;class Js extends Xi{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()?zi.LOADING:zi.LOADED;if(this.imageState_===zi.LOADING){this.ready().then((()=>this.imageState_=zi.LOADED))}this.render()}clone(){const t=this.getScale();const e=new Js({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=Es(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=Zs;let e=Us;let n=0;let i=null;let s=0;let r;let o=0;if(this.stroke_){r=ks(this.stroke_.getColor()??Hs);o=this.stroke_.getWidth()??qs;i=this.stroke_.getLineDash();s=this.stroke_.getLineDashOffset()??0;e=this.stroke_.getLineJoin()??Us;t=this.stroke_.getLineCap()??Zs;n=this.stroke_.getMiterLimit()??Bs}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=Ys}e.fillStyle=ks(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=as(n)}if(n===null){i=1}else if(Array.isArray(n)){i=n.length===4?n[3]:1}if(i===0){e=Es(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=Ys;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 Qs=Js;class tr extends Qs{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 tr({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 er=tr;class nr{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 nr({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=Ns(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()===zi.IDLE){e.load()}if(e.getImageState()===zi.LOADING){this.patternImage_=e}}this.color_=t}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}var ir=nr;class sr{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 sr({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 rr=sr;class or{constructor(t){t=t||{};this.geometry_=null;this.geometryFunction_=cr;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 or({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_=cr}else if(t!==undefined){this.geometryFunction_=function(){return t}}this.geometry_=t}setZIndex(t){this.zIndex_=t}}function ar(t){let e;if(typeof t==="function"){e=t}else{let n;if(Array.isArray(t)){n=t}else{Y(typeof t.getZIndex==="function","Expected an `Style` or an array of `Style`");const e=t;n=[e]}e=function(){return n}}return e}let lr=null;function hr(t,e){if(!lr){const t=new ir({color:"rgba(255,255,255,0.4)"});const e=new rr({color:"#3399CC",width:1.25});lr=[new or({image:new er({fill:t,stroke:e,radius:5}),fill:t,stroke:e})]}return lr}function cr(t){return t.getGeometry()}var ur=or;function dr(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 fr extends Xi{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;Y(!(o!==undefined&&r),"`image` and `src` cannot be provided at the same time");if((o===undefined||o.length===0)&&r){o=r.src||F(r)}Y(o!==undefined&&o.length>0,"A defined and non-empty `src` or `image` must be provided");Y(!((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=zi.IDLE}else if(r!==undefined){if("complete"in r){if(r.complete){a=r.src?zi.LOADED:zi.IDLE}else{a=zi.LOADING}}else{a=zi.LOADED}}this.color_=t.color!==undefined?as(t.color):null;this.iconImage_=Ns(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(dr(n[0],n[1],t.width,t.height))};this.listenImageChange(e);return}}if(e!==undefined){this.setScale(dr(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 fr({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()==zi.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()==zi.LOADED){return this.iconImage_.getSize()[1]*t[1]}return undefined}setScale(t){delete this.initialOptions_;super.setScale(t)}listenImageChange(t){this.iconImage_.addEventListener(T.CHANGE,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(T.CHANGE,t)}ready(){return this.iconImage_.ready()}}var gr=fr;const pr="#333";class _r{constructor(t){t=t||{};this.font_=t.font;this.rotation_=t.rotation;this.rotateWithView_=t.rotateWithView;this.scale_=t.scale;this.scaleArray_=Ki(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 ir({color:pr});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 _r({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_=Ki(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 mr=_r;let yr=0;const Er=1<<yr++;const vr=1<<yr++;const xr=1<<yr++;const wr=1<<yr++;const Cr=1<<yr++;const br=1<<yr++;const Rr=Math.pow(2,yr)-1;const Tr={[Er]:"boolean",[vr]:"number",[xr]:"string",[wr]:"color",[Cr]:"number[]",[br]:"size"};const Ir=Object.keys(Tr).map(Number).sort(d);function Sr(t){return t in Tr}function Mr(t){const e=[];for(const n of Ir){if(Ar(t,n)){e.push(Tr[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 Ar(t,e){return(t&e)===e}function Pr(t,e){return t===e}class Lr{constructor(t,e){if(!Sr(t)){throw new Error(`literal expressions must have a specific type, got ${Mr(t)}`)}this.type=t;this.value=e}}class Or{constructor(t,e,...n){this.type=t;this.operator=e;this.args=n}}function Dr(){return{variables:new Set,properties:new Set,featureId:false,geometryType:false}}function Fr(t,e,n){switch(typeof t){case"boolean":{if(Pr(e,xr)){return new Lr(xr,t?"true":"false")}if(!Ar(e,Er)){throw new Error(`got a boolean, but expected ${Mr(e)}`)}return new Lr(Er,t)}case"number":{if(Pr(e,br)){return new Lr(br,Ki(t))}if(Pr(e,Er)){return new Lr(Er,!!t)}if(Pr(e,xr)){return new Lr(xr,t.toString())}if(!Ar(e,vr)){throw new Error(`got a number, but expected ${Mr(e)}`)}return new Lr(vr,t)}case"string":{if(Pr(e,wr)){return new Lr(wr,os(t))}if(Pr(e,Er)){return new Lr(Er,!!t)}if(!Ar(e,xr)){throw new Error(`got a string, but expected ${Mr(e)}`)}return new Lr(xr,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 to(t,e,n)}for(const e of t){if(typeof e!=="number"){throw new Error("expected an array of numbers")}}if(Pr(e,br)){if(t.length!==2){throw new Error(`expected an array of two values for a size, got ${t.length}`)}return new Lr(br,t)}if(Pr(e,wr)){if(t.length===3){return new Lr(wr,[...t,1])}if(t.length===4){return new Lr(wr,t)}throw new Error(`expected an array of 3 or 4 values for a color, got ${t.length}`)}if(!Ar(e,Cr)){throw new Error(`got an array of numbers, but expected ${Mr(e)}`)}return new Lr(Cr,t)}const Nr={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 kr={[Nr.Get]:Qr(Xr(1,Infinity),zr),[Nr.Var]:Qr(Xr(1,1),Gr),[Nr.Id]:Qr(Vr,jr),[Nr.Concat]:Qr(Xr(2,Infinity),Yr(xr)),[Nr.GeometryType]:Qr(Kr,jr),[Nr.Resolution]:Qr(jr),[Nr.Zoom]:Qr(jr),[Nr.Time]:Qr(jr),[Nr.Any]:Qr(Xr(2,Infinity),Yr(Er)),[Nr.All]:Qr(Xr(2,Infinity),Yr(Er)),[Nr.Not]:Qr(Xr(1,1),Yr(Er)),[Nr.Equal]:Qr(Xr(2,2),Yr(Rr)),[Nr.NotEqual]:Qr(Xr(2,2),Yr(Rr)),[Nr.GreaterThan]:Qr(Xr(2,2),Yr(vr)),[Nr.GreaterThanOrEqualTo]:Qr(Xr(2,2),Yr(vr)),[Nr.LessThan]:Qr(Xr(2,2),Yr(vr)),[Nr.LessThanOrEqualTo]:Qr(Xr(2,2),Yr(vr)),[Nr.Multiply]:Qr(Xr(2,Infinity),Wr),[Nr.Coalesce]:Qr(Xr(2,Infinity),Wr),[Nr.Divide]:Qr(Xr(2,2),Yr(vr)),[Nr.Add]:Qr(Xr(2,Infinity),Yr(vr)),[Nr.Subtract]:Qr(Xr(2,2),Yr(vr)),[Nr.Clamp]:Qr(Xr(3,3),Yr(vr)),[Nr.Mod]:Qr(Xr(2,2),Yr(vr)),[Nr.Pow]:Qr(Xr(2,2),Yr(vr)),[Nr.Abs]:Qr(Xr(1,1),Yr(vr)),[Nr.Floor]:Qr(Xr(1,1),Yr(vr)),[Nr.Ceil]:Qr(Xr(1,1),Yr(vr)),[Nr.Round]:Qr(Xr(1,1),Yr(vr)),[Nr.Sin]:Qr(Xr(1,1),Yr(vr)),[Nr.Cos]:Qr(Xr(1,1),Yr(vr)),[Nr.Atan]:Qr(Xr(1,2),Yr(vr)),[Nr.Sqrt]:Qr(Xr(1,1),Yr(vr)),[Nr.Match]:Qr(Xr(4,Infinity),Ur,Br),[Nr.Between]:Qr(Xr(3,3),Yr(vr)),[Nr.Interpolate]:Qr(Xr(6,Infinity),Ur,Hr),[Nr.Case]:Qr(Xr(3,Infinity),Zr,qr),[Nr.In]:Qr(Xr(2,2),$r),[Nr.Number]:Qr(Xr(1,Infinity),Yr(Rr)),[Nr.String]:Qr(Xr(1,Infinity),Yr(Rr)),[Nr.Array]:Qr(Xr(1,Infinity),Yr(vr)),[Nr.Color]:Qr(Xr(1,4),Yr(vr)),[Nr.Band]:Qr(Xr(1,3),Yr(vr)),[Nr.Palette]:Qr(Xr(2,2),Jr),[Nr.ToString]:Qr(Xr(1,1),Yr(Er|vr|xr|wr))};function zr(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 Lr(vr,i);break}case"string":{s[e]=new Lr(xr,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 Gr(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 Lr(xr,i)]}function Vr(t,e,n){n.featureId=true}function Kr(t,e,n){n.geometryType=true}function jr(t,e,n){const i=t[0];if(t.length!==1){throw new Error(`expected no arguments for ${i} operation`)}return[]}function Xr(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 Wr(t,e,n){const i=t.length-1;const s=new Array(i);for(let r=0;r<i;++r){const i=Fr(t[r+1],e,n);s[r]=i}return s}function Yr(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=Fr(e[n+1],t,i);r[n]=s}return r}}function Zr(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 Ur(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 Br(t,e,n){const i=t.length-1;const s=xr|vr|Er;const r=Fr(t[1],s,n);const o=Fr(t[t.length-1],e,n);const a=new Array(i-2);for(let e=0;e<i-2;e+=2){try{const i=Fr(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=Fr(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 Hr(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 Lr(vr,s);let o;try{o=Fr(t[2],vr,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=Fr(t[i+3],vr,n);a[i]=e}catch(t){throw new Error(`failed to parse argument ${i+2} for interpolate expression: ${t.message}`)}try{const s=Fr(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 qr(t,e,n){const i=Fr(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=Fr(t[e+1],Er,n);s[e]=i}catch(t){throw new Error(`failed to parse argument ${e} of case expression: ${t.message}`)}try{const r=Fr(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 $r(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=xr}else{s=vr}const r=new Array(i.length);for(let t=0;t<r.length;t++){try{const e=Fr(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=Fr(t[1],s,n);return[o,...r]}function Jr(t,e,n){let i;try{i=Fr(t[1],vr,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=Fr(s[t],wr,n)}catch(e){throw new Error(`failed to parse color at index ${t} in palette expression: ${e.message}`)}if(!(e instanceof Lr)){throw new Error(`the palette color at index ${t} must be a literal value`)}r[t]=e}return[i,...r]}function Qr(...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 Or(n,s,...r)}}function to(t,e,n){const i=t[0];const s=kr[i];if(!s){throw new Error(`unknown operator: ${i}`)}return s(t,e,n)}function eo(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 eo(t.getGeometries()[0]);default:return""}}function no(){return{variables:{},properties:{},resolution:NaN,featureId:null,geometryType:""}}function io(t,e,n){const i=Fr(t,e,n);return so(i)}function so(t,e){if(t instanceof Lr){if(t.type===wr&&typeof t.value==="string"){const e=os(t.value);return function(){return e}}return function(){return t.value}}const n=t.operator;switch(n){case Nr.Number:case Nr.String:case Nr.Coalesce:{return ro(t)}case Nr.Get:case Nr.Var:{return oo(t)}case Nr.Id:{return t=>t.featureId}case Nr.GeometryType:{return t=>t.geometryType}case Nr.Concat:{const e=t.args.map((t=>so(t)));return t=>"".concat(...e.map((e=>e(t).toString())))}case Nr.Resolution:{return t=>t.resolution}case Nr.Any:case Nr.All:case Nr.Between:case Nr.In:case Nr.Not:{return lo(t)}case Nr.Equal:case Nr.NotEqual:case Nr.LessThan:case Nr.LessThanOrEqualTo:case Nr.GreaterThan:case Nr.GreaterThanOrEqualTo:{return ao(t)}case Nr.Multiply:case Nr.Divide:case Nr.Add:case Nr.Subtract:case Nr.Clamp:case Nr.Mod:case Nr.Pow:case Nr.Abs:case Nr.Floor:case Nr.Ceil:case Nr.Round:case Nr.Sin:case Nr.Cos:case Nr.Atan:case Nr.Sqrt:{return ho(t)}case Nr.Case:{return co(t)}case Nr.Match:{return uo(t)}case Nr.Interpolate:{return fo(t)}case Nr.ToString:{return go(t)}default:{throw new Error(`Unsupported operator ${n}`)}}}function ro(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]=so(t.args[e])}switch(n){case Nr.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 Nr.Number:case Nr.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 oo(t,e){const n=t.args[0];const i=n.value;switch(t.operator){case Nr.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 Nr.Var:{return t=>t.variables[i]}default:{throw new Error(`Unsupported accessor operator ${t.operator}`)}}}function ao(t,e){const n=t.operator;const i=so(t.args[0]);const s=so(t.args[1]);switch(n){case Nr.Equal:{return t=>i(t)===s(t)}case Nr.NotEqual:{return t=>i(t)!==s(t)}case Nr.LessThan:{return t=>i(t)<s(t)}case Nr.LessThanOrEqualTo:{return t=>i(t)<=s(t)}case Nr.GreaterThan:{return t=>i(t)>s(t)}case Nr.GreaterThanOrEqualTo:{return t=>i(t)>=s(t)}default:{throw new Error(`Unsupported comparison 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]=so(t.args[e])}switch(n){case Nr.Any:{return t=>{for(let e=0;e<i;++e){if(s[e](t)){return true}}return false}}case Nr.All:{return t=>{for(let e=0;e<i;++e){if(!s[e](t)){return false}}return true}}case Nr.Between:{return t=>{const e=s[0](t);const n=s[1](t);const i=s[2](t);return e>=n&&e<=i}}case Nr.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 Nr.Not:{return t=>!s[0](t)}default:{throw new Error(`Unsupported logical operator ${n}`)}}}function ho(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]=so(t.args[e])}switch(n){case Nr.Multiply:{return t=>{let e=1;for(let n=0;n<i;++n){e*=s[n](t)}return e}}case Nr.Divide:{return t=>s[0](t)/s[1](t)}case Nr.Add:{return t=>{let e=0;for(let n=0;n<i;++n){e+=s[n](t)}return e}}case Nr.Subtract:{return t=>s[0](t)-s[1](t)}case Nr.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 Nr.Mod:{return t=>s[0](t)%s[1](t)}case Nr.Pow:{return t=>Math.pow(s[0](t),s[1](t))}case Nr.Abs:{return t=>Math.abs(s[0](t))}case Nr.Floor:{return t=>Math.floor(s[0](t))}case Nr.Ceil:{return t=>Math.ceil(s[0](t))}case Nr.Round:{return t=>Math.round(s[0](t))}case Nr.Sin:{return t=>Math.sin(s[0](t))}case Nr.Cos:{return t=>Math.cos(s[0](t))}case Nr.Atan:{if(i===2){return t=>Math.atan2(s[0](t),s[1](t))}return t=>Math.atan(s[0](t))}case Nr.Sqrt:{return t=>Math.sqrt(s[0](t))}default:{throw new Error(`Unsupported numeric operator ${n}`)}}}function co(t,e){const n=t.args.length;const i=new Array(n);for(let e=0;e<n;++e){i[e]=so(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 uo(t,e){const n=t.args.length;const i=new Array(n);for(let e=0;e<n;++e){i[e]=so(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 fo(t,e){const n=t.args.length;const i=new Array(n);for(let e=0;e<n;++e){i[e]=so(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=is(l)}if(n>=s){if(a===2){return l}if(h){return _o(e,s,r,o,n,l)}return po(e,s,r,o,n,l)}r=n;o=l}return o}}function go(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]=so(t.args[e])}switch(n){case Nr.ToString:{return e=>{const n=s[0](e);if(t.args[0].type===wr){return hs(n)}return n.toString()}}default:{throw new Error(`Unsupported convert operator ${n}`)}}}function po(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 _o(t,e,n,i,s,r){const o=s-n;if(o===0){return i}const a=ss(i);const l=ss(r);let h=l[2]-a[2];if(h>180){h-=360}else if(h<-180){h+=360}const c=[po(t,e,n,a[0],s,l[0]),po(t,e,n,a[1],s,l[1]),a[2]+po(t,e,n,0,s,h),po(t,e,n,i[3],s,r[3])];return ls(rs(c))}function mo(t){return true}function yo(t){const e=Dr();const n=vo(t,e);const i=no();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=eo(t.getGeometry())}return n(i)}}function Eo(t){const e=Dr();const n=t.length;const i=new Array(n);for(let s=0;s<n;++s){i[s]=xo(t[s],e)}const s=no();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 vo(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?io(n.filter,Er,e):mo;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]=xo(n.style[i],e)}}else{o=[xo(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 xo(t,e){const n=wo(t,"",e);const i=Co(t,"",e);const s=bo(t,e);const r=Ro(t,e);const o=Mo(t,"z-index",e);if(!n&&!i&&!s&&!r&&!C(t)){throw new Error("No fill, stroke, point, or text symbolizer properties in style: "+JSON.stringify(t))}const a=new ur;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 wo(t,e,n){let i;if(e+"fill-pattern-src"in t){i=Po(t,e+"fill-",n)}else{if(t[e+"fill-color"]==="none"){return t=>null}i=Oo(t,e+"fill-color",n)}if(!i){return null}const s=new ir;return function(t){const e=i(t);if(e==="none"){return null}s.setColor(e);return s}}function Co(t,e,n){const i=Mo(t,e+"stroke-width",n);const s=Oo(t,e+"stroke-color",n);if(!i&&!s){return null}const r=Ao(t,e+"stroke-line-cap",n);const o=Ao(t,e+"stroke-line-join",n);const a=Do(t,e+"stroke-line-dash",n);const l=Mo(t,e+"stroke-line-dash-offset",n);const h=Mo(t,e+"stroke-miter-limit",n);const c=new rr;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 bo(t,e){const n="text-";const i=Ao(t,n+"value",e);if(!i){return null}const s=wo(t,n,e);const r=wo(t,n+"background-",e);const o=Co(t,n,e);const a=Co(t,n+"background-",e);const l=Ao(t,n+"font",e);const h=Mo(t,n+"max-angle",e);const c=Mo(t,n+"offset-x",e);const u=Mo(t,n+"offset-y",e);const d=Lo(t,n+"overflow",e);const f=Ao(t,n+"placement",e);const g=Mo(t,n+"repeat",e);const p=ko(t,n+"scale",e);const _=Lo(t,n+"rotate-with-view",e);const m=Mo(t,n+"rotation",e);const y=Ao(t,n+"align",e);const E=Ao(t,n+"justify",e);const v=Ao(t,n+"baseline",e);const x=Do(t,n+"padding",e);const w=Wo(t,n+"declutter-mode");const C=new mr({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 Ro(t,e){if("icon-src"in t){return To(t,e)}if("shape-points"in t){return Io(t,e)}if("circle-radius"in t){return So(t,e)}return null}function To(t,e){const n="icon-";const i=n+"src";const s=Uo(t[i],i);const r=Fo(t,n+"anchor",e);const o=ko(t,n+"scale",e);const a=Mo(t,n+"opacity",e);const l=Fo(t,n+"displacement",e);const h=Mo(t,n+"rotation",e);const c=Lo(t,n+"rotate-with-view",e);const u=Ko(t,n+"anchor-origin");const d=jo(t,n+"anchor-x-units");const f=jo(t,n+"anchor-y-units");const g=Yo(t,n+"color");const p=Vo(t,n+"cross-origin");const _=Xo(t,n+"offset");const m=Ko(t,n+"offset-origin");const y=zo(t,n+"width");const E=zo(t,n+"height");const v=Go(t,n+"size");const x=Wo(t,n+"declutter-mode");const w=new gr({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 Io(t,e){const n="shape-";const i=n+"points";const s=n+"radius";const r=Bo(t[i],i);const o=Bo(t[s],s);const a=wo(t,n,e);const l=Co(t,n,e);const h=ko(t,n+"scale",e);const c=Fo(t,n+"displacement",e);const u=Mo(t,n+"rotation",e);const d=Lo(t,n+"rotate-with-view",e);const f=zo(t,n+"radius2");const g=zo(t,n+"angle");const p=Wo(t,n+"declutter-mode");const _=new Qs({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 So(t,e){const n="circle-";const i=wo(t,n,e);const s=Co(t,n,e);const r=Mo(t,n+"radius",e);const o=ko(t,n+"scale",e);const a=Fo(t,n+"displacement",e);const l=Mo(t,n+"rotation",e);const h=Lo(t,n+"rotate-with-view",e);const c=Wo(t,n+"declutter-mode");const u=new er({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 Mo(t,e,n){if(!(e in t)){return undefined}const i=io(t[e],vr,n);return function(t){return Bo(i(t),e)}}function Ao(t,e,n){if(!(e in t)){return null}const i=io(t[e],xr,n);return function(t){return Uo(i(t),e)}}function Po(t,e,n){const i=Ao(t,e+"pattern-src",n);const s=No(t,e+"pattern-offset",n);const r=No(t,e+"pattern-size",n);const o=Oo(t,e+"color",n);return function(t){return{src:i(t),offset:s&&s(t),size:r&&r(t),color:o&&o(t)}}}function Lo(t,e,n){if(!(e in t)){return null}const i=io(t[e],Er,n);return function(t){const n=i(t);if(typeof n!=="boolean"){throw new Error(`Expected a boolean for ${e}`)}return n}}function Oo(t,e,n){if(!(e in t)){return null}const i=io(t[e],wr,n);return function(t){return Ho(i(t),e)}}function Do(t,e,n){if(!(e in t)){return null}const i=io(t[e],Cr,n);return function(t){return Zo(i(t),e)}}function Fo(t,e,n){if(!(e in t)){return null}const i=io(t[e],Cr,n);return function(t){const n=Zo(i(t),e);if(n.length!==2){throw new Error(`Expected two numbers for ${e}`)}return n}}function No(t,e,n){if(!(e in t)){return null}const i=io(t[e],Cr,n);return function(t){return qo(i(t),e)}}function ko(t,e,n){if(!(e in t)){return null}const i=io(t[e],Cr|vr,n);return function(t){return $o(i(t),e)}}function zo(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 Go(t,e){const n=t[e];if(n===undefined){return undefined}if(typeof n==="number"){return Ki(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 Vo(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 Ko(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 jo(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 Xo(t,e){const n=t[e];if(n===undefined){return undefined}return Zo(n,e)}function Wo(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 Yo(t,e){const n=t[e];if(n===undefined){return undefined}return Ho(n,e)}function Zo(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 Uo(t,e){if(typeof t!=="string"){throw new Error(`Expected a string for ${e}`)}return t}function Bo(t,e){if(typeof t!=="number"){throw new Error(`Expected a number for ${e}`)}return t}function Ho(t,e){if(typeof t==="string"){return t}const n=Zo(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 qo(t,e){const n=Zo(t,e);if(n.length!==2){throw new Error(`Expected an array of two numbers for ${e}`)}return n}function $o(t,e){if(typeof t==="number"){return t}return qo(t,e)}const Jo={RENDER_ORDER:"renderOrder"};class Qo extends yi{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(Jo.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 Ci(9)}this.getRenderer().renderDeclutter(t,e)}setRenderOrder(t){this.set(Jo.RENDER_ORDER,t)}setStyle(t){this.style_=t===undefined?hr:t;const e=ta(t);this.styleFunction_=t===null?undefined:ar(e);this.changed()}}function ta(t){if(t===undefined){return hr}if(!t){return null}if(typeof t==="function"){return t}if(t instanceof ur){return t}if(!Array.isArray(t)){return Eo([t])}if(t.length===0){return[]}const e=t.length;const n=t[0];if(n instanceof ur){const n=new Array(e);for(let i=0;i<e;++i){const e=t[i];if(!(e instanceof ur)){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 yo(n)}const i=t;return Eo(i)}var ea=Qo;class na extends u{constructor(t){super();this.map_=t}dispatchRenderEvent(t,e){O()}calculateMatrices2D(t){const e=t.viewState;const n=t.coordinateToPixelTransform;const i=t.pixelToCoordinateTransform;un(n,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]);dn(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=ve(t.slice(),u);const f=[[0,0]];if(u.canWrapX()&&i){const t=u.getExtent();const e=le(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()&&mi(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,m,this,s,r);return o!==undefined}getMap(){return this.map_}renderFrame(t){O()}scheduleExpireIconCache(t){if(Os.canExpireCache()){t.postRenderFunctions.push(ia)}}}function ia(t,e){Os.expire()}var sa=na;class ra extends l{constructor(t,e,n,i){super(t);this.inversePixelTransform=e;this.frameState=n;this.context=i}}var oa=ra;class aa extends sa{constructor(t){super(t);this.fontChangeListenerKey_=I($s,h.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=Ks+" 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 oa(t,undefined,e);n.dispatchEvent(i)}}disposeInternal(){M(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(st.PRECOMPOSE,t);const e=t.layerStatesArray.sort(((t,e)=>t.zIndex-e.zIndex));const n=e.some((t=>t.layer instanceof ea&&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(!mi(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);Is(this.element_,this.children_);this.dispatchRenderEvent(st.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 la=aa;class ha extends l{constructor(t,e){super(t);this.layer=e}}const ca={LAYERS:"layers"};class ua extends it{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(ca.LAYERS,this.handleLayersChanged_);if(n){if(Array.isArray(n)){n=new X(n.slice(),{unique:true})}else{Y(typeof n.getArray==="function","Expected `layers` to be an array or a `Collection`")}}else{n=new X(undefined,{unique:true})}this.setLayers(n)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(M);this.layersListenerKeys_.length=0;const t=this.getLayers();this.layersListenerKeys_.push(I(t,G.ADD,this.handleLayersAdd_,this),I(t,G.REMOVE,this.handleLayersRemove_,this));for(const t in this.listenerKeys_){this.listenerKeys_[t].forEach(M)}w(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 ha("addlayer",n))}this.changed()}registerLayerListeners_(t){const e=[I(t,h.PROPERTYCHANGE,this.handleLayerChange_,this),I(t,T.CHANGE,this.handleLayerChange_,this)];if(t instanceof ua){e.push(I(t,"addlayer",this.handleLayerGroupAdd_,this),I(t,"removelayer",this.handleLayerGroupRemove_,this))}this.listenerKeys_[F(t)]=e}handleLayerGroupAdd_(t){this.dispatchEvent(new ha("addlayer",t.layer))}handleLayerGroupRemove_(t){this.dispatchEvent(new ha("removelayer",t.layer))}handleLayersAdd_(t){const e=t.element;this.registerLayerListeners_(e);this.dispatchEvent(new ha("addlayer",e));this.changed()}handleLayersRemove_(t){const e=t.element;const n=F(e);this.listenerKeys_[n].forEach(M);delete this.listenerKeys_[n];this.dispatchEvent(new ha("removelayer",e));this.changed()}getLayers(){return this.get(ca.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 ha("removelayer",t[e]))}}this.set(ca.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=re(n.extent,i.extent)}else{n.extent=i.extent}}if(n.zIndex===undefined){n.zIndex=s}}return e}getSourceState(){return"ready"}}var da=ua;class fa extends l{constructor(t,e,n){super(t);this.map=e;this.frameState=n!==undefined?n:null}}var ga=fa;class pa extends ga{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 _a=pa;var ma={SINGLECLICK:"singleclick",CLICK:T.CLICK,DBLCLICK:T.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};var ya={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};class Ea extends R{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_=I(n,ya.POINTERDOWN,this.handlePointerDown_,this);this.originalPointerMoveEvent_;this.relayedListenerKey_=I(n,ya.POINTERMOVE,this.relayMoveEvent_,this);this.boundHandleTouchMove_=this.handleTouchMove_.bind(this);this.element_.addEventListener(T.TOUCHMOVE,this.boundHandleTouchMove_,ys?{passive:false}:false)}emulateClick_(t){let e=new _a(ma.CLICK,this.map_,t);this.dispatchEvent(e);if(this.clickTimeoutId_!==undefined){clearTimeout(this.clickTimeoutId_);this.clickTimeoutId_=undefined;e=new _a(ma.DBLCLICK,this.map_,t);this.dispatchEvent(e)}else{this.clickTimeoutId_=setTimeout((()=>{this.clickTimeoutId_=undefined;const e=new _a(ma.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}),250)}}updateActivePointers_(t){const e=t;const n=e.pointerId;if(e.type==ma.POINTERUP||e.type==ma.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==ma.POINTERDOWN||e.type==ma.POINTERMOVE){this.trackedTouches_[n]=e}this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(t){this.updateActivePointers_(t);const e=new _a(ma.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(M);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 _a(ma.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(I(t,ma.POINTERMOVE,this.handlePointerMove_,this),I(t,ma.POINTERUP,this.handlePointerUp_,this),I(this.element_,ma.POINTERCANCEL,this.handlePointerUp_,this));if(this.element_.getRootNode&&this.element_.getRootNode()!==t){this.dragListenerKeys_.push(I(this.element_.getRootNode(),ma.POINTERUP,this.handlePointerUp_,this))}}}handlePointerMove_(t){if(this.isMoving_(t)){this.updateActivePointers_(t);this.dragging_=true;const e=new _a(ma.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 _a(ma.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_){M(this.relayedListenerKey_);this.relayedListenerKey_=null}this.element_.removeEventListener(T.TOUCHMOVE,this.boundHandleTouchMove_);if(this.pointerdownListenerKey_){M(this.pointerdownListenerKey_);this.pointerdownListenerKey_=null}this.dragListenerKeys_.forEach(M);this.dragListenerKeys_.length=0;this.element_=null;super.disposeInternal()}}var va=Ea;var xa={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"};var wa={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};const Ca=Infinity;class ba{constructor(t,e){this.priorityFunction_=t;this.keyFunction_=e;this.elements_=[];this.priorities_=[];this.queuedElements_={}}clear(){this.elements_.length=0;this.priorities_.length=0;w(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){Y(!(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!=Ca){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==Ca){delete this.queuedElements_[this.keyFunction_(r)]}else{n[i]=a;e[i++]=r}}e.length=i;n.length=i;this.heapify_()}}var Ra=ba;var Ta={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};class Ia extends Ra{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(T.CHANGE,this.boundHandleTileChange_)}return e}getTilesLoading(){return this.tilesLoading_}handleTileChange(t){const e=t.target;const n=e.getState();if(n===Ta.LOADED||n===Ta.ERROR||n===Ta.EMPTY){if(n!==Ta.ERROR){e.removeEventListener(T.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===Ta.IDLE&&!(e in this.tilesLoadingKeys_)){this.tilesLoadingKeys_[e]=true;++this.tilesLoading_;++n;t.load()}}}}var Sa=Ia;function Ma(t,e,n,i,s){if(!t||!(n in t.wantedTiles)){return Ca}if(!t.wantedTiles[n][e.getKey()]){return Ca}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 Aa extends z{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){M(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!==E){this.listenerKeys.push(I(t,xa.POSTRENDER,this.render,this))}t.render()}}render(t){}setTarget(t){this.target_=typeof t==="string"?document.getElementById(t):t}}var Pa=Aa;class La extends Pa{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(T.CLICK,this.handleClick_.bind(this),false);const l=e+" "+Ks+" "+Xs+(this.collapsed_&&this.collapsible_?" "+Ws:"")+(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=>x((()=>t)))));const n=e.length>0;if(this.renderedVisible_!=n){this.element.style.display=n?"":"none";this.renderedVisible_=n}if(p(e,this.renderedAttributions_)){return}Ts(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(Ws);if(this.collapsed_){Rs(this.collapseLabel_,this.label_)}else{Rs(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 Oa=La;class Da extends Pa{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(T.CLICK,this.handleClick_.bind(this),false);const o=e+" "+Ks+" "+Xs;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(Gs)}}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:on})}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(Gs);if(!t&&n===0){this.element.classList.add(Gs)}else if(t&&n!==0){this.element.classList.remove(Gs)}}this.label_.style.transform=t}this.rotation_=n}}var Fa=Da;class Na extends Pa{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(T.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(T.CLICK,this.handleClick_.bind(this,-n),false);const u=e+" "+Ks+" "+Xs;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:on})}else{n.setZoom(e)}}}}var ka=Na;function za(t){t=t?t:{};const e=new X;const n=t.zoom!==undefined?t.zoom:true;if(n){e.push(new ka(t.zoomOptions))}const i=t.rotate!==undefined?t.rotate:true;if(i){e.push(new Fa(t.rotateOptions))}const s=t.attribution!==undefined?t.attribution:true;if(s){e.push(new Oa(t.attributionOptions))}return e}var Ga={ACTIVE:"active"};class Va extends z{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(Ga.ACTIVE)}getMap(){return this.map_}handleEvent(t){return true}setActive(t){this.set(Ga.ACTIVE,t)}setMap(t){this.map_=t}}function Ka(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:ln,center:t.getConstrainedCenter(s)})}}function ja(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:on})}var Xa=Va;class Wa extends Xa{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==ma.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();ja(o,r,s,this.duration_);n.preventDefault();e=true}return!e}}var Ya=Wa;class Za extends Xa{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==ma.POINTERDRAG){this.handleDragEvent(t);t.originalEvent.preventDefault()}else if(t.type==ma.POINTERUP){const e=this.handleUpEvent(t);this.handlingDownUpSequence=e&&this.targetPointers.length>0}}else{if(t.type==ma.POINTERDOWN){const n=this.handleDownEvent(t);this.handlingDownUpSequence=n;e=this.stopDown(n)}else if(t.type==ma.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 Ua(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 Ba=Za;function Ha(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 qa=function(t){const e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey};const $a=function(t){const e=t.map.getTargetElement();const n=t.map.getOwnerDocument().activeElement;return e.contains(n)};const Ja=function(t){return t.map.getTargetElement().hasAttribute("tabindex")?$a(t):true};const Qa=m;const tl=function(t){const e=t.originalEvent;return e.button==0&&!(fs&&gs&&e.ctrlKey)};const el=function(t){const e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey};const nl=function(t){const e=t.originalEvent;return gs?e.metaKey:e.ctrlKey};const il=function(t){const e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey};const sl=function(t){const e=t.originalEvent;const n=e.target.tagName;return n!=="INPUT"&&n!=="SELECT"&&n!=="TEXTAREA"&&!e.target.isContentEditable};const rl=function(t){const e=t.originalEvent;Y(e!==undefined,"mapBrowserEvent must originate from a pointer event");return e.pointerType=="mouse"};const ol=function(t){const e=t.originalEvent;Y(e!==undefined,"mapBrowserEvent must originate from a pointer event");return e.isPrimary&&e.button===0};class al extends Ba{constructor(t){super({stopDown:y});t=t?t:{};this.kinetic_=t.kinetic;this.lastCentroid=null;this.lastPointersCount_;this.panning_=false;const e=t.condition?t.condition:Ha(el,ol);this.condition_=t.onFocusOnly?Ha(Ja,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(Ua(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();Ee(e,s.getResolution());ye(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:on})}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 ll=al;class hl extends Ba{constructor(t){t=t?t:{};super({stopDown:y});this.condition_=t.condition?t.condition:qa;this.lastAngle_=undefined;this.duration_=t.duration!==undefined?t.duration:250}handleDragEvent(t){if(!rl(t)){return}const e=t.map;const n=e.getView();if(n.getConstraints().rotation===tn){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(!rl(t)){return true}const e=t.map;const n=e.getView();n.endInteraction(this.duration_);return false}handleDownEvent(t){if(!rl(t)){return false}if(tl(t)&&this.condition_(t)){const e=t.map;e.getView().beginInteraction();this.lastAngle_=undefined;return true}return false}}var cl=hl;class ul extends u{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 ri([i])}else{this.geometry_.setCoordinates([i])}}getGeometry(){return this.geometry_}}var dl=ul;const fl={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"};class gl extends l{constructor(t,e,n){super(t);this.coordinate=e;this.mapBrowserEvent=n}}class pl extends Ba{constructor(t){super();this.on;this.once;this.un;t=t?t:{};this.box_=new dl(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:tl;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 gl(fl.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 gl(e?fl.BOXEND:fl.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 gl(fl.BOXSTART,t.coordinate,t));return true}return false}onBoxEnd(t){}setActive(t){if(!t){this.box_.setMap(null);if(this.startPixel_){this.dispatchEvent(new gl(fl.BOXCANCEL,this.startPixel_,null));this.startPixel_=null}}super.setActive(t)}}var _l=pl;class ml extends _l{constructor(t){t=t?t:{};const e=t.condition?t.condition:il;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:on})}}var yl=ml;var El={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"};class vl extends Xa{constructor(t){super();t=t||{};this.defaultCondition_=function(t){return el(t)&&sl(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==T.KEYDOWN){const n=t.originalEvent;const i=n.key;if(this.condition_(t)&&(i==El.DOWN||i==El.LEFT||i==El.RIGHT||i==El.UP)){const s=t.map;const r=s.getView();const o=r.getResolution()*this.pixelDelta_;let a=0,l=0;if(i==El.DOWN){l=-o}else if(i==El.LEFT){a=-o}else if(i==El.RIGHT){a=o}else{l=o}const h=[a,l];ye(h,r.getRotation());Ka(r,h,this.duration_);n.preventDefault();e=true}}return!e}}var xl=vl;class wl extends Xa{constructor(t){super();t=t?t:{};this.condition_=t.condition?t.condition:function(t){return!nl(t)&&sl(t)};this.delta_=t.delta?t.delta:1;this.duration_=t.duration!==undefined?t.duration:100}handleEvent(t){let e=false;if(t.type==T.KEYDOWN||t.type==T.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();ja(o,r,undefined,this.duration_);n.preventDefault();e=true}}return!e}}var Cl=wl;class bl{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 Rl=bl;class Tl extends Xa{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:Qa;this.condition_=t.onFocusOnly?Ha(Ja,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!==T.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==T.WHEEL){s=i.deltaY;if(us&&i.deltaMode===WheelEvent.DOM_DELTA_PIXEL){s/=ps}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=-Z(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;if(e.getConstrainResolution()||this.constrainResolution_){n=n?n>0?1:-1:0}ja(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 Il=Tl;class Sl extends Ba{constructor(t){t=t?t:{};const e=t;if(!e.stopDown){e.stopDown=y}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===tn){return}this.anchor_=r.getCoordinateFromPixelInternal(r.getEventPixel(Ua(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 Ml=Sl;class Al extends Ba{constructor(t){t=t?t:{};const e=t;if(!e.stopDown){e.stopDown=y}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(Ua(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 Pl=Al;function Ll(t){t=t?t:{};const e=new X;const n=new Rl(-.005,.05,100);const i=t.altShiftDragRotate!==undefined?t.altShiftDragRotate:true;if(i){e.push(new cl)}const s=t.doubleClickZoom!==undefined?t.doubleClickZoom:true;if(s){e.push(new Ya({delta:t.zoomDelta,duration:t.zoomDuration}))}const r=t.dragPan!==undefined?t.dragPan:true;if(r){e.push(new ll({onFocusOnly:t.onFocusOnly,kinetic:n}))}const o=t.pinchRotate!==undefined?t.pinchRotate:true;if(o){e.push(new Ml)}const a=t.pinchZoom!==undefined?t.pinchZoom:true;if(a){e.push(new Pl({duration:t.zoomDuration}))}const l=t.keyboard!==undefined?t.keyboard:true;if(l){e.push(new xl);e.push(new Cl({delta:t.zoomDelta,duration:t.zoomDuration}))}const h=t.mouseWheelZoom!==undefined?t.mouseWheelZoom:true;if(h){e.push(new Il({onFocusOnly:t.onFocusOnly,duration:t.zoomDuration}))}const c=t.shiftDragZoom!==undefined?t.shiftDragZoom:true;if(c){e.push(new yl({duration:t.zoomDuration}))}return e}function Ol(t){if(t instanceof yi){t.setMapInternal(null);return}if(t instanceof da){t.getLayers().forEach(Ol)}}function Dl(t,e){if(t instanceof yi){t.setMapInternal(e);return}if(t instanceof da){const n=t.getLayers().getArray();for(let t=0,i=n.length;t<i;++t){Dl(n[t],e)}}}class Fl extends z{constructor(t){super();t=t||{};this.on;this.once;this.un;const e=Nl(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:ps;this.postRenderTimeoutHandle_;this.animationDelayKey_;this.animationDelay_=this.animationDelay_.bind(this);this.coordinateToPixelTransform_=hn();this.pixelToCoordinateTransform_=hn();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||za();this.interactions=e.interactions||Ll({onFocusOnly:true});this.overlays_=e.overlays;this.overlayIdIndex_={};this.renderer_=null;this.postRenderFunctions_=[];this.tileQueue_=new Sa(this.getTilePriority.bind(this),this.handleTileChange_.bind(this));this.addChangeListener(wa.LAYERGROUP,this.handleLayerGroupChanged_);this.addChangeListener(wa.VIEW,this.handleViewChanged_);this.addChangeListener(wa.SIZE,this.handleSizeChanged_);this.addChangeListener(wa.TARGET,this.handleTargetChanged_);this.setProperties(e.values);const n=this;if(t.view&&!(t.view instanceof pi)){t.view.then((function(t){n.setView(new pi(t))}))}this.controls.addEventListener(G.ADD,(t=>{t.element.setMap(this)}));this.controls.addEventListener(G.REMOVE,(t=>{t.element.setMap(null)}));this.interactions.addEventListener(G.ADD,(t=>{t.element.setMap(this)}));this.interactions.addEventListener(G.REMOVE,(t=>{t.element.setMap(null)}));this.overlays_.addEventListener(G.ADD,(t=>{this.addOverlayInternal_(t.element)}));this.overlays_.addEventListener(G.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){Dl(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:m;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 da){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:m;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(wa.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(t){return je(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())}getCoordinateFromPixelInternal(t){const e=this.frameState_;if(!e){return null}return cn(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(wa.LAYERGROUP)}setLayers(t){const e=this.getLayerGroup();if(t instanceof X){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=Xe(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)}getPixelFromCoordinateInternal(t){const e=this.frameState_;if(!e){return null}return cn(e.coordinateToPixelTransform,t.slice(0,2))}getRenderer(){return this.renderer_}getSize(){return this.get(wa.SIZE)}getView(){return this.get(wa.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 Ma(this.frameState_,t,e,n,i)}handleBrowserEvent(t,e){e=e||t.type;const n=new _a(e,this,t);this.handleMapBrowserEvent(n)}handleMapBrowserEvent(t){if(!this.frameState_){return}const e=t.originalEvent;const n=e.type;if(n===ya.POINTERDOWN||n===T.WHEEL||n===T.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[rt.ANIMATING]||e[rt.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(st.RENDERCOMPLETE)){this.renderer_.dispatchRenderEvent(st.RENDERCOMPLETE,t)}if(this.loaded_===false){this.loaded_=true;this.dispatchEvent(new ga(xa.LOADEND,this,t))}}else if(this.loaded_===true){this.loaded_=false;this.dispatchEvent(new ga(xa.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){M(this.targetChangeHandlerKeys_[t])}this.targetChangeHandlerKeys_=null;this.viewport_.removeEventListener(T.CONTEXTMENU,this.boundHandleBrowserEvent_);this.viewport_.removeEventListener(T.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 la(this)}this.mapBrowserEventHandler_=new va(this,this.moveTolerance_);for(const t in ma){this.mapBrowserEventHandler_.addEventListener(ma[t],this.handleMapBrowserEvent.bind(this))}this.viewport_.addEventListener(T.CONTEXTMENU,this.boundHandleBrowserEvent_,false);this.viewport_.addEventListener(T.WHEEL,this.boundHandleBrowserEvent_,ys?{passive:false}:false);const t=!this.keyboardEventTarget_?e:this.keyboardEventTarget_;this.targetChangeHandlerKeys_=[I(t,T.KEYDOWN,this.handleBrowserEvent,this),I(t,T.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_){M(this.viewPropertyListenerKey_);this.viewPropertyListenerKey_=null}if(this.viewChangeListenerKey_){M(this.viewChangeListenerKey_);this.viewChangeListenerKey_=null}const t=this.getView();if(t){this.updateViewportSize_(this.getSize());this.viewPropertyListenerKey_=I(t,h.PROPERTYCHANGE,this.handleViewPropertyChanged_,this);this.viewChangeListenerKey_=I(t,T.CHANGE,this.handleViewPropertyChanged_,this);t.resolveConstraints(0)}this.render()}handleLayerGroupChanged_(){if(this.layerGroupPropertyListenerKeys_){this.layerGroupPropertyListenerKeys_.forEach(M);this.layerGroupPropertyListenerKeys_=null}const t=this.getLayerGroup();if(t){this.handleLayerAdd_(new ha("addlayer",t));this.layerGroupPropertyListenerKeys_=[I(t,h.PROPERTYCHANGE,this.render,this),I(t,T.CHANGE,this.render,this),I(t,"addlayer",this.handleLayerAdd_,this),I(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){Ol(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&&Gi(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:ne(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:F(this),renderTargets:{}};if(r.nextCenter&&r.nextResolution){const t=isNaN(r.nextRotation)?r.rotation:r.nextRotation;s.nextExtent=ne(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_||!ce(this.previousExtent_)&&!Yt(s.extent,this.previousExtent_);if(t){this.dispatchEvent(new ga(xa.MOVESTART,this,i));this.previousExtent_=jt(this.previousExtent_)}}const t=this.previousExtent_&&!s.viewHints[rt.ANIMATING]&&!s.viewHints[rt.INTERACTING]&&!Yt(s.extent,this.previousExtent_);if(t){this.dispatchEvent(new ga(xa.MOVEEND,this,s));Dt(s.extent,this.previousExtent_)}}this.dispatchEvent(new ga(xa.POSTRENDER,this,s));this.renderComplete_=(this.hasListener(xa.LOADSTART)||this.hasListener(xa.LOADEND)||this.hasListener(st.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 ha("removelayer",e))}this.set(wa.LAYERGROUP,t)}setSize(t){this.set(wa.SIZE,t)}setTarget(t){this.set(wa.TARGET,t)}setView(t){if(!t||t instanceof pi){this.set(wa.VIEW,t);return}this.set(wa.VIEW,new pi);const e=this;t.then((function(t){e.setView(new pi(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(!Gi(e)&&!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)){Te("No map visible because the map container's width or height are 0.")}}}const n=this.getSize();if(e&&(!n||!p(e,n))){this.setSize(e);this.updateViewportSize_(e)}}updateViewportSize_(t){const e=this.getView();if(e){e.setViewportSize(t)}}}function Nl(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 da({layers:t.layers});n[wa.LAYERGROUP]=i;n[wa.TARGET]=t.target;n[wa.VIEW]=t.view instanceof pi?t.view:new pi;let s;if(t.controls!==undefined){if(Array.isArray(t.controls)){s=new X(t.controls.slice())}else{Y(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 X(t.interactions.slice())}else{Y(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 X(t.overlays.slice())}else{Y(typeof t.overlays.getArray==="function","Expected `overlays` to be an array or an `ol/Collection.js`");o=t.overlays}}else{o=new X}return{controls:s,interactions:r,keyboardEventTarget:e,overlays:o,values:n}}var kl=Fl;var zl={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class Gl extends yi{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(zl.PRELOAD)}setPreload(t){this.set(zl.PRELOAD,t)}getUseInterimTilesOnError(){return this.get(zl.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(t){this.set(zl.USE_INTERIM_TILES_ON_ERROR,t)}getData(t){return super.getData(t)}}var Vl=Gl;const Kl=5;class jl extends L{constructor(t){super();this.ready=true;this.boundHandleImageChange_=this.handleImageChange_.bind(this);this.layer_=t;this.staleKeys_=new Array;this.maxStaleKeys=Kl}getStaleKeys(){return this.staleKeys_}prependStaleKey(t){this.staleKeys_.unshift(t);if(this.staleKeys_.length>this.maxStaleKeys){this.staleKeys_.length=this.maxStaleKeys}}getFeatures(t){return O()}getData(t){return null}prepareFrame(t){return O()}renderFrame(t,e){return O()}forEachFeatureAtCoordinate(t,e,n,i,s){return undefined}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){const e=t.target;if(e.getState()===zi.LOADED||e.getState()===zi.ERROR){this.renderIfReadyAndVisible()}}loadImage(t){let e=t.getState();if(e!=zi.LOADED&&e!=zi.ERROR){t.addEventListener(T.CHANGE,this.boundHandleImageChange_)}if(e==zi.IDLE){t.load();e=t.getState()}return e==zi.LOADED}renderIfReadyAndVisible(){const t=this.getLayer();if(t&&t.getVisible()&&t.getSourceState()==="ready"){t.changed()}}renderDeferred(t){}disposeInternal(){delete this.layer_;super.disposeInternal()}}var Xl=jl;class Wl{constructor(){this.instructions_=[];this.zIndex=0;this.offset_=0;this.context_=new Proxy(xs(),{get:(t,e)=>{if(typeof xs()[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 Yl=Wl;let Zl=null;function Ul(){Zl=Es(1,1,undefined,{willReadFrequently:true})}class Bl extends Xl{constructor(t){super(t);this.container=null;this.renderedResolution;this.tempTransform=hn();this.pixelTransform=hn();this.inversePixelTransform=hn();this.context=null;this.deferredContext_=null;this.containerReused=false;this.frameState=null}getImageData(t,e,n){if(!Zl){Ul()}Zl.clearRect(0,0,1,1);let i;try{Zl.drawImage(t,e,n,1,1,0,0,1,1);i=Zl.getImageData(0,0,1,1).data}catch(t){Zl=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&&p(as(t.style.backgroundColor),as(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=Es();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=oe(n);const s=ae(n);const r=Qt(n);const o=Jt(n);cn(e.coordinateToPixelTransform,i);cn(e.coordinateToPixelTransform,s);cn(e.coordinateToPixelTransform,r);cn(e.coordinateToPixelTransform,o);const a=this.inversePixelTransform;cn(a,i);cn(a,s);cn(a,r);cn(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(le(n)/i*r);const a=Math.round(se(n)/i*r);un(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/r,1/r,s,-o/2,-a/2);dn(this.inversePixelTransform,this.pixelTransform);const l=pn(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 oa(t,this.inversePixelTransform,n,e);i.dispatchEvent(s)}}preRender(t,e){this.frameState=e;if(e.declutter){return}this.dispatchRenderEvent_(st.PRERENDER,t,e)}postRender(t,e){if(e.declutter){return}this.dispatchRenderEvent_(st.POSTRENDER,t,e)}renderDeferredInternal(t){}getRenderContext(t){if(t.declutter&&!this.deferredContext_){this.deferredContext_=new Yl}return t.declutter?this.deferredContext_.getContext():this.context}renderDeferred(t){if(!t.declutter){return}this.dispatchRenderEvent_(st.PRERENDER,this.context,t);if(t.declutter&&this.deferredContext_){this.deferredContext_.draw(this.context);this.deferredContext_.clear()}this.renderDeferredInternal(t);this.dispatchRenderEvent_(st.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 un(this.tempTransform,a,l,h,c,-n,u,d)}disposeInternal(){delete this.frameState;super.disposeInternal()}}var Hl=Bl;class ql extends R{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(T.CHANGE)}release(){if(this.state===Ta.ERROR){this.setState(Ta.EMPTY)}}getKey(){return this.key+"/"+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(t){if(this.state!==Ta.ERROR&&this.state>t){throw new Error("Tile load sequence violation")}this.state=t;this.changed()}load(){O()}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 rn(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 $l=ql;function Jl(t){return t instanceof Image||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageBitmap?t:null}function Ql(t){return t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Float32Array||t instanceof DataView?t:null}const th=new Error("disposed");let eh=null;function nh(t){if(!eh){eh=Es(t.width,t.height,undefined,{willReadFrequently:true})}const e=eh.canvas;const n=t.width;if(e.width!==n){e.width=n}const i=t.height;if(e.height!==i){e.height=i}eh.clearRect(0,0,n,i);eh.drawImage(t,0,0);return eh.getImageData(0,0,n,i).data}const ih=[256,256];class sh extends $l{constructor(t){const e=Ta.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=Jl(this.data_);if(t){return[t.width,t.height]}return ih}getData(){return this.data_}getError(){return this.error_}load(){if(this.state!==Ta.IDLE&&this.state!==Ta.ERROR){return}this.state=Ta.LOADING;this.changed();const t=this;this.loader_().then((function(e){t.data_=e;t.state=Ta.LOADED;t.changed()})).catch((function(e){t.error_=e;t.state=Ta.ERROR;t.changed()}))}disposeInternal(){if(this.controller_){this.controller_.abort(th);this.controller_=null}super.disposeInternal()}}var rh=sh;class oh extends $l{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=Ta.LOADED;this.unlistenImage_();this.changed()}handleImageError_(){this.state=Ta.ERROR;this.unlistenImage_();this.image_=ah();this.changed()}handleImageLoad_(){const t=this.image_;if(t.naturalWidth&&t.naturalHeight){this.state=Ta.LOADED}else{this.state=Ta.EMPTY}this.unlistenImage_();this.changed()}load(){if(this.state==Ta.ERROR){this.state=Ta.IDLE;this.image_=new Image;if(this.crossOrigin_!==null){this.image_.crossOrigin=this.crossOrigin_}}if(this.state==Ta.IDLE){this.state=Ta.LOADING;this.changed();this.tileLoadFunction_(this,this.src_);this.unlisten_=Ss(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}}unlistenImage_(){if(this.unlisten_){this.unlisten_();this.unlisten_=null}}}function ah(){const t=Es(1,1);t.fillStyle="rgba(0,0,0,0)";t.fillRect(0,0,1,1);return t.canvas}var lh=oh;class hh{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];Y(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];Y(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){Y(!(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 ch=hh;const uh=.5;const dh=10;const fh=.25;class gh{constructor(t,e,n,i,s,r){this.sourceProj_=t;this.targetProj_=e;let o={};const a=Ve(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()&&le(i)>=le(this.sourceProj_.getExtent());this.sourceWorldWidth_=this.sourceProj_.getExtent()?le(this.sourceProj_.getExtent()):null;this.targetWorldWidth_=this.targetProj_.getExtent()?le(this.targetProj_.getExtent()):null;const l=oe(n);const h=ae(n);const c=Qt(n);const u=Jt(n);const d=this.transformInv_(l);const f=this.transformInv_(h);const g=this.transformInv_(c);const p=this.transformInv_(u);const _=dh+(r?Math.max(0,Math.ceil(Math.log2($t(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=Ot([s,r,o,a]);const c=this.sourceWorldWidth_?le(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=Ot([t,e,n,i]);const r=le(s)/this.targetWorldWidth_;f=r>fh||f}if(!d&&this.sourceProj_.isGlobal()&&c){f=c>fh||f}}if(!f&&this.maxSourceExtent_){if(isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3])){if(!he(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=($(s[0],u)+$(o[0],u))/2;r=t-$(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=Vt();this.triangles_.forEach((function(e,n,i){const s=e.source;Ut(t,s[0]);Ut(t,s[1]);Ut(t,s[2])}));return t}getTriangles(){return this.triangles_}}var ph=gh;let _h;const mh=[];function yh(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 Eh(t,e){return Math.abs(t[e*4]-210)>2||Math.abs(t[e*4+3]-.75*255)>2}function vh(){if(_h===undefined){const t=Es(6,6,mh);t.globalCompositeOperation="lighter";t.fillStyle="rgba(210, 0, 0, 0.75)";yh(t,4,5,4,0);yh(t,4,5,0,5);const e=t.getImageData(0,0,3,3).data;_h=Eh(e,0)||Eh(e,4)||Eh(e,8);ws(t);mh.push(t.canvas)}return _h}function xh(t,e,n,i){const s=Ke(n,e,t);let r=De(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||Nt(l,s)){const e=De(t,r,s)/r;if(isFinite(e)&&e>0){r/=e}}return r}function wh(t,e,n,i){const s=te(n);let r=xh(t,e,s,i);if(!isFinite(r)||r<=0){qt(n,(function(n){r=xh(t,e,n,i);return isFinite(r)&&r>0}))}return r}function Ch(t,e,n,i,s,r,o,a,l,h,c,u,d,f){const g=Es(Math.round(n*t),Math.round(n*e),mh);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 _=Vt();l.forEach((function(t,e,n){Zt(_,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=Es(Math.round(le(_)*y),Math.round(se(_)*y),mh);if(!u){m.imageSmoothingEnabled=false}if(s&&f){const t=(s[0]-_[0])*y;const e=-(s[3]-_[3])*y;const n=le(s)*y;const i=se(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=le(t.clipExtent)*y;const s=se(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=le(t.extent)*y;const s=se(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=oe(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=H(S);if(!M){return}g.save();g.beginPath();if(vh()||!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(le(e)/A.width,-se(e)/A.height)}g.drawImage(A,0,0);g.restore()}));if(m){ws(m);mh.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 bh extends rh{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?re(n,i):n:i;const s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);const r=this.targetTileGrid_.getExtent();let o=this.sourceTileGrid_.getExtent();const a=r?re(s,r):s;if($t(a)===0){this.state=Ta.EMPTY;return}if(n){if(!o){o=n}else{o=re(o,n)}}const l=this.targetTileGrid_.getResolution(this.wrappedTileCoord_[0]);const h=t.targetProj;const c=wh(e,h,a,l);if(!isFinite(c)||c<=0){this.state=Ta.EMPTY;return}const u=t.errorThreshold!==undefined?t.errorThreshold:uh;this.triangulation_=new ph(e,h,a,o,c*u,l);if(this.triangulation_.getTriangles().length===0){this.state=Ta.EMPTY;return}this.sourceZ_=this.sourceTileGrid_.getZForResolution(c);let d=this.triangulation_.calculateSourceExtent();if(o){if(e.canWrapX()){d[1]=Z(d[1],o[1],o[3]);d[3]=Z(d[3],o[1],o[3])}else{d=re(d,o)}}if(!$t(d)){this.state=Ta.EMPTY}else{let i=0;let s=0;if(e.canWrapX()){i=le(n);s=Math.floor((d[0]-n[0])/i)}const r=pe(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=Ta.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()!==Ta.LOADED){return}const s=i.getSize();const r=this.gutter_;let o;const a=Ql(i.getData());if(a){o=a}else{e=true;o=nh(Jl(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=Ta.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=Es(a,l,mh);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=Ch(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");ws(i);mh.push(i.canvas)}const d=i.getContext("2d");const f=d.getImageData(0,0,i.width,i.height);ws(d);mh.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=Es(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=Ta.LOADED;this.changed()}load(){if(this.state!==Ta.IDLE&&this.state!==Ta.ERROR){return}this.state=Ta.LOADING;this.changed();let t=0;this.sourcesListenerKeys_=[];this.sourceTiles_.forEach((({tile:e})=>{const n=e.getState();if(n!==Ta.IDLE&&n!==Ta.LOADING){return}t++;const i=I(e,T.CHANGE,(()=>{const n=e.getState();if(n==Ta.LOADED||n==Ta.ERROR||n==Ta.EMPTY){M(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==Ta.IDLE){t.load()}}))}}unlistenSources_(){this.sourcesListenerKeys_.forEach(M);this.sourcesListenerKeys_=null}}var Rh=bh;class Th extends $l{constructor(t,e,n,i,s,r,o,a,l,h,c,u){super(s,Ta.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?re(d,f):d;if($t(p)===0){this.state=Ta.EMPTY;return}const _=t.getExtent();if(_){if(!g){g=_}else{g=re(g,_)}}const m=i.getResolution(this.wrappedTileCoord_[0]);const y=wh(t,n,p,m);if(!isFinite(y)||y<=0){this.state=Ta.EMPTY;return}const E=h!==undefined?h:uh;this.triangulation_=new ph(t,n,p,g,y*E,m);if(this.triangulation_.getTriangles().length===0){this.state=Ta.EMPTY;return}this.sourceZ_=e.getZForResolution(y);let v=this.triangulation_.calculateSourceExtent();if(g){if(t.canWrapX()){v[1]=Z(v[1],g[1],g[3]);v[3]=Z(v[3],g[1],g[3])}else{v=re(v,g)}}if(!$t(v)){this.state=Ta.EMPTY}else{let n=0;let i=0;if(t.canWrapX()){n=le(_);i=Math.floor((v[0]-_[0])/n)}const s=pe(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=Ta.EMPTY}}}getImage(){return this.canvas_}reproject_(){const t=[];this.sourceTiles_.forEach((e=>{const n=e.tile;if(n&&n.getState()==Ta.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=Ta.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_=Ch(i,s,this.pixelRatio_,o,this.sourceTileGrid_.getExtent(),r,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate);this.state=Ta.LOADED}this.changed()}load(){if(this.state==Ta.IDLE){this.state=Ta.LOADING;this.changed();let t=0;this.sourcesListenerKeys_=[];this.sourceTiles_.forEach((({tile:e})=>{const n=e.getState();if(n==Ta.IDLE||n==Ta.LOADING){t++;const n=I(e,T.CHANGE,(i=>{const s=e.getState();if(s==Ta.LOADED||s==Ta.ERROR||s==Ta.EMPTY){M(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==Ta.IDLE){t.load()}}))}}}unlistenSources_(){this.sourcesListenerKeys_.forEach(M);this.sourcesListenerKeys_=null}release(){if(this.canvas_){ws(this.canvas_.getContext("2d"));mh.push(this.canvas_);this.canvas_=null}super.release()}}var Ih=Th;class Sh{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 Mh(t,e,n,i,s){if(s!==undefined){s.minX=t;s.maxX=e;s.minY=n;s.maxY=i;return s}return new Sh(t,e,n,i)}var Ah=Sh;function Ph(t,e,n,i){if(i!==undefined){i[0]=t;i[1]=e;i[2]=n;return i}return[t,e,n]}function Lh(t,e,n){return t+"/"+e+"/"+n}function Oh(t){return Lh(t[0],t[1],t[2])}function Dh(t){return t.split("/").map(Number)}function Fh(t){return Nh(t[0],t[1],t[2])}function Nh(t,e,n){return(e<<t)+n}function kh(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 zh(t,e,n,i){return`${t},${Lh(e,n,i)}`}function Gh(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 Vh(t,e,n){const i=t[n];if(i){return i.delete(e)}return false}function Kh(t,e){const n=t.layerStatesArray[t.layerIndex];if(n.extent){e=re(e,Ye(n.extent,t.viewState.projection))}const i=n.layer.getRenderSource();if(!i.getWrapX()){const n=i.getTileGridForProjection(t.viewState.projection).getExtent();if(n){e=re(e,n)}}return e}class jh extends Hl{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=Vt();this.tempTileRange_=new Ah(0,0,0,0);this.tempTileCoord_=Ph(0,0,0);const n=e.cacheSize!==undefined?e.cacheSize:512;this.tileCache_=new ch(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=zh(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=cn(e.pixelToCoordinateTransform,t.slice());const s=n.getExtent();if(s){if(!Nt(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()!==Ta.LOADED){continue}const h=a.getOrigin(t);const c=Ki(a.getTileSize(t));const u=a.getResolution(t);let d;if(s instanceof lh){d=s.getImage()}else if(s instanceof rh){d=Jl(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=F(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=Gh(i,n,s);if(!a){continue}const u=n.getKey();c[u]=true;if(n.getState()===Ta.IDLE){if(!t.tileQueue.isKeyQueued(u)){const i=Ph(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=zh(o[t],i,s,r);if(n.containsKey(a)){const t=n.get(a);if(t.getState()===Ta.LOADED){t.endTransition(F(this));Gh(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=zh(l,n,t,e);let a=false;if(o.containsKey(s)){const t=o.get(s);if(t.getState()===Ta.LOADED){Gh(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 u=h.getTileGridForProjection(s);const f=u.getZForResolution(r,h.zDirection);const g=u.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&&Ye(n.extent);if(v){_=re(_,Ye(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=u.getZForResolution(i.nextResolution,h.zDirection);const n=Kh(t,t.nextExtent);this.enqueueTiles(t,n,e,b,R)}const T=Kh(t,_);this.enqueueTiles(t,T,f,b,0);if(R>0){setTimeout((()=>{this.enqueueTiles(t,T,f-1,b,R-1)}),0)}const I=F(this);const S=t.time;for(const e of b[f]){const n=e.getState();if((e instanceof Ih||e instanceof Rh)&&n===Ta.EMPTY){continue}const i=e.tileCoord;if(n===Ta.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){Vh(b,e,f);t.animate=true;continue}const r=this.findAltTiles_(u,i,f+1,b);if(r){continue}const o=u.getMinZoom();for(let t=f-1;t>=o;--t){const e=this.findAltTiles_(u,i,t,b);if(e){break}}}const M=g/r*a/m;const A=this.getRenderContext(t);un(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(d);let L;const O=[];const D=[];for(let e=P.length-1;e>=0;--e){const n=P[e];const i=h.getTilePixelSize(n,a,s);const r=u.getResolution(n);const o=r/g;const l=i[0]*o*M;const c=i[1]*o*M;const d=u.getTileCoordForCoordAndZ(oe(C),n);const f=u.getTileCoordExtent(d);const p=cn(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()!==Ta.LOADED){continue}const i=e.tileCoord;const s=d[1]-i[1];const r=Math.round(p[0]-(s-1)*l);const o=d[2]-i[2];const a=Math.round(p[1]-(o-1)*c);const u=Math.round(p[0]-s*l);const f=Math.round(p[1]-o*c);const g=r-u;const m=a-f;const y=P.length===1;let E=false;L=[u,f,u+g,f,u+g,f+m,u,f+m];for(let t=0,e=O.length;t<e;++t){if(!y&&n<D[t]){const e=O[t];if(he([u,f,u+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);D.push(n);this.drawTile(e,t,u,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_||!Yt(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=F(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 rh){l=Jl(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=F(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=F(e);if(!(i in t)){t[i]={}}t[i][n.getKey()]=true}}var Xh=jh;class Wh extends Vl{constructor(t){super(t)}createRenderer(){return new Xh(this,{cacheSize:this.getCacheSize()})}}var Yh=Wh;const Zh=[0,0,0];const Uh=5;class Bh{constructor(t){this.minZoom=t.minZoom!==undefined?t.minZoom:0;this.resolutions_=t.resolutions;Y(_(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;Y(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_=oe(n)}Y(!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;Y(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")}this.tileSize_=t.tileSize!==undefined?t.tileSize:!this.tileSizes_?lt:null;Y(!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 Ah(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=Mh(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 Mh(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 Mh(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 Mh(o,o,a,a,n)}const l=Math.floor(t*(s+1))-1;const h=Math.floor(t*(r+1))-1;return Mh(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,Zh);const i=Zh[1];const s=Zh[2];this.getTileCoordForXYAndZ_(t[2],t[1],e,true,Zh);const r=Zh[1];const o=Zh[2];return Mh(i,r,s,o,n)}getTileCoordCenter(t){const e=this.getOrigin(t[0]);const n=this.getResolution(t[0]);const i=Ki(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=Ki(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 Kt(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=Ki(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=et(h,Uh)-1;c=et(c,Uh)-1}else{h=tt(h,Uh);c=tt(c,Uh)}return Ph(r,h,c,s)}getTileCoordForXYAndZ_(t,e,n,i,s){const r=this.getOrigin(n);const o=this.getResolution(n);const a=Ki(this.getTileSize(n),this.tmpSize_);let l=(t-r[0])/o/a[0];let h=(r[1]-e)/o/a[1];if(i){l=et(l,Uh)-1;h=et(h,Uh)-1}else{l=tt(l,Uh);h=tt(h,Uh)}return Ph(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=f(this.resolutions_,t,e||0);return Z(n,this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(t,e){return Qn(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 Hh=Bh;class qh extends ch{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=Dh(t);const n=e[0];this.forEach((t=>{if(t.tileCoord[0]!==n){this.remove(Oh(t.tileCoord));t.release()}}))}}var $h=qh;var Jh={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};class Qh extends z{constructor(t){super();this.projection=Oe(t.projection);this.attributions_=tc(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_=tc(t);this.changed()}setState(t){this.state_=t;this.changed()}}function tc(t){if(!t){return null}if(typeof t==="function"){return t}if(!Array.isArray(t)){t=[t]}return e=>t}var ec=Qh;function nc(t){let e=t.getDefaultTileGrid();if(!e){e=oc(t);t.setDefaultTileGrid(e)}return e}function ic(t,e,n){const i=e[0];const s=t.getTileCoordCenter(e);const r=ac(n);if(!Nt(r,s)){const e=le(r);const n=Math.ceil((r[0]-s[0])/e);s[0]+=e*n;return t.getTileCoordForCoordAndZ(s,i)}return e}function sc(t,e,n,i){i=i!==undefined?i:"top-left";const s=rc(t,e,n);return new Hh({extent:t,origin:ee(t,i),resolutions:s,tileSize:n})}function rc(t,e,n,i){e=e!==undefined?e:at;n=Ki(n!==undefined?n:lt);const s=se(t);const r=le(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 oc(t,e,n,i){const s=ac(t);return sc(s,e,n,i)}function ac(t){t=Oe(t);let e=t.getExtent();if(!e){const n=180*ht.degrees/t.getMetersPerUnit();e=Kt(-n,-n,n,n)}return e}class lc extends ec{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){Ki(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),e)}this.tileCache=new $h(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 O()}getTileGrid(){return this.tileGrid}getTileGridForProjection(t){if(!this.tileGrid){return nc(t)}return this.tileGrid}getTileCacheForProjection(t){const e=this.getProjection();Y(e===null||ze(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=Ki(i.getTileSize(t),this.tmpSize);if(s==1){return r}return Vi(r,s,this.tmpSize)}getTileCoordForTileUrlFunction(t,e){e=e!==undefined?e:this.getProjection();const n=this.getTileGridForProjection(e);if(this.getWrapX()&&e.isGlobal()){t=ic(n,t,e)}return kh(t,n)?t:null}clear(){this.tileCache.clear()}refresh(){this.clear();super.refresh()}useTile(t,e,n,i){}}class hc extends l{constructor(t,e){super(t);this.tile=e}}var cc=lc;const uc=/\{z\}/g;const dc=/\{x\}/g;const fc=/\{y\}/g;const gc=/\{-y\}/g;function pc(t,e,n,i,s){return t.replace(uc,e.toString()).replace(dc,n.toString()).replace(fc,i.toString()).replace(gc,(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 _c(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 mc(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 pc(t,o,n[1],n[2],r)}}function yc(t,e){const n=t.length;const i=new Array(n);for(let s=0;s<n;++s){i[s]=mc(t[s],e)}return Ec(i)}function Ec(t){if(t.length===1){return t[0]}return function(e,n,i){if(!e){return undefined}const s=Fh(e);const r=$(s,t.length);return t[r](e,n,i)}}class vc extends cc{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===vc.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=F(e);const i=e.getState();let s;if(i==Ta.LOADING){this.tileLoadingKeys_[n]=true;s=Jh.TILELOADSTART}else if(n in this.tileLoadingKeys_){delete this.tileLoadingKeys_[n];s=i==Ta.ERROR?Jh.TILELOADERROR:i==Ta.LOADED?Jh.TILELOADEND:undefined}if(s!=undefined){this.dispatchEvent(new hc(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=_c(t);this.urls=e;this.setUrls(e)}setUrls(t){this.urls=t;const e=t.join("\n");if(this.generateTileUrlFunction_){this.setTileUrlFunction(yc(t,this.tileGrid),e)}else{this.setKey(e)}}tileUrlFunction(t,e,n){return undefined}useTile(t,e,n){const i=Lh(t,e,n);if(this.tileCache.containsKey(i)){this.tileCache.get(i)}}}var xc=vc;class wc extends xc{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:Cc,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:lh;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&&!ze(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||ze(e,t))){return this.tileGrid}const n=F(t);if(!(n in this.tileGridForProjection)){this.tileGridForProjection[n]=nc(t)}return this.tileGridForProjection[n]}getTileCacheForProjection(t){const e=this.getProjection();if(!e||ze(e,t)){return this.tileCache}const n=F(t);if(!(n in this.tileCacheForProjection)){this.tileCacheForProjection[n]=new $h(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?Ta.IDLE:Ta.EMPTY,l!==undefined?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);h.key=r;h.addEventListener(T.CHANGE,this.handleTileChange.bind(this));return h}getTile(t,e,n,i,s){const r=this.getProjection();if(!r||!s||ze(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=Oh(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 Ih(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=Lh(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=Oe(t);if(n){const t=F(n);if(!(t in this.tileGridForProjection)){this.tileGridForProjection[t]=e}}}clear(){super.clear();for(const t in this.tileCacheForProjection){this.tileCacheForProjection[t].clear()}}}function Cc(t,e){t.getImage().src=e}var bc=wc;class Rc extends lh{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==Ta.LOADED){const e=this.tileSize_;if(t.width==e[0]&&t.height==e[1]){this.zoomifyImage_=t;return t}const n=Es(e[0],e[1]);n.drawImage(t,0,0);this.zoomifyImage_=n.canvas;return n.canvas}return t}}class Tc extends bc{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||lt;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 Hh({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=_c(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 _=Ec(f.map(p));const m=Rc.bind(null,Ki(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(te(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 Ic=Tc;const Sc={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"};class Mc extends z{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 "+Vs;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(Sc.ELEMENT,this.handleElementChanged);this.addChangeListener(Sc.MAP,this.handleMapChanged);this.addChangeListener(Sc.OFFSET,this.handleOffsetChanged);this.addChangeListener(Sc.POSITION,this.handlePositionChanged);this.addChangeListener(Sc.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(Sc.ELEMENT)}getId(){return this.id}getMap(){return this.get(Sc.MAP)||null}getOffset(){return this.get(Sc.OFFSET)}getPosition(){return this.get(Sc.POSITION)}getPositioning(){return this.get(Sc.POSITIONING)}handleElementChanged(){Ts(this.element);const t=this.getElement();if(t){this.element.appendChild(t)}}handleMapChanged(){if(this.mapPostrenderListenerKey){this.element?.remove();M(this.mapPostrenderListenerKey);this.mapPostrenderListenerKey=null}const t=this.getMap();if(t){this.mapPostrenderListenerKey=I(t,xa.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(Sc.ELEMENT,t)}setMap(t){this.set(Sc.MAP,t)}setOffset(t){this.set(Sc.OFFSET,t)}setPosition(t){this.set(Sc.POSITION,t)}performAutoPan(){if(this.autoPan){this.panIntoView(this.autoPan)}}panIntoView(t){const e=this.getMap();if(!e||!e.getTargetElement()||!this.get(Sc.POSITION)){return}const n=this.getRect(e.getTargetElement(),e.getSize());const i=this.getElement();const s=this.getRect(i,[Cs(i),bs(i)]);t=t||{};const r=t.margin===undefined?20:t.margin;if(!kt(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(Sc.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 Ac=Mc;const Pc=.75;const Lc=.1;class Oc extends Pa{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(T.CLICK,this.handleClick_.bind(this),false);this.ovmapDiv_=document.createElement("div");this.ovmapDiv_.className="ol-overviewmap-map";this.view_=t.view;const a=new kl({view:t.view,controls:new X,interactions:new X});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 Ac({position:[0,0],positioning:"center-center",element:l});this.ovmap_.addOverlay(this.boxOverlay_);const h=e+" "+Ks+" "+Xs+(this.collapsed_&&this.collapsible_?" "+Ws:"")+(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(I(t,h.PROPERTYCHANGE,this.handleMapPropertyChange_,this));const e=t.getView();if(e){this.bindView_(e)}if(!this.ovmap_.isRendered()){this.updateBoxAfterOvmapIsRendered_()}}}handleMapPropertyChange_(t){if(t.key===wa.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===wa.TARGET||t.key===wa.SIZE)){this.ovmap_.updateSize()}}bindView_(t){if(!this.view_){const e=new pi({projection:t.getProjection()});this.ovmap_.setView(e)}t.addChangeListener(ot.ROTATION,this.boundHandleRotationChanged_);this.handleRotationChanged_();if(t.isDef()){this.ovmap_.updateSize();this.resetExtent_()}}unbindView_(t){t.removeChangeListener(ot.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_&&Yt(s,this.viewExtent_)){return}this.viewExtent_=s;const r=e.getSize();const o=e.getView();const a=o.calculateExtentInternal(r);const l=e.getPixelFromCoordinateInternal(oe(s));const h=e.getPixelFromCoordinateInternal(Qt(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*Lc||u<f*Lc||c>d*Pc||u>f*Pc){this.resetExtent_()}else if(!kt(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(Pc/Lc)/Math.LN2;const a=1/(Math.pow(2,o/2)*Lc);de(s,a);r.fitInternal(oi(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_=S(this.ovmap_,xa.POSTRENDER,(t=>{delete this.ovmapPostrenderKey_;this.updateBox_()}))}handleClick_(t){t.preventDefault();this.handleToggle_()}handleToggle_(){this.element.classList.toggle(Ws);if(this.collapsed_){Rs(this.collapseLabel_,this.label_)}else{Rs(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 Dc=Oc;const Fc=["fullscreenchange","webkitfullscreenchange","MSFullscreenChange"];const Nc={ENTERFULLSCREEN:"enterfullscreen",LEAVEFULLSCREEN:"leavefullscreen"};class kc extends Pa{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(T.CLICK,this.handleClick_.bind(this),false);this.setClassName_(this.button_,this.isInFullscreen_);this.element.className=`${this.cssClassName_} ${Ks} ${Xs}`;this.element.appendChild(this.button_)}handleClick_(t){t.preventDefault();this.handleFullScreen_()}handleFullScreen_(){const t=this.getMap();if(!t){return}const e=t.getOwnerDocument();if(!zc(e)){return}if(Gc(e)){jc(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_){Kc(n)}else{Vc(n)}}}handleFullScreenChange_(){const t=this.getMap();if(!t){return}const e=this.isInFullscreen_;this.isInFullscreen_=Gc(t.getOwnerDocument());if(e!==this.isInFullscreen_){this.setClassName_(this.button_,this.isInFullscreen_);if(this.isInFullscreen_){Rs(this.labelActiveNode_,this.labelNode_);this.dispatchEvent(Nc.ENTERFULLSCREEN)}else{Rs(this.labelNode_,this.labelActiveNode_);this.dispatchEvent(Nc.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(wa.TARGET,this.boundHandleMapTargetChange_)}super.setMap(t);this.handleMapTargetChange_();if(t){t.addChangeListener(wa.TARGET,this.boundHandleMapTargetChange_)}}handleMapTargetChange_(){const t=this.documentListeners_;for(let e=0,n=t.length;e<n;++e){M(t[e])}t.length=0;const e=this.getMap();if(e){const n=e.getOwnerDocument();if(zc(n)){this.element.classList.remove(js)}else{this.element.classList.add(js)}for(let e=0,i=Fc.length;e<i;++e){t.push(I(n,Fc[e],this.handleFullScreenChange_,this))}this.handleFullScreenChange_()}}}function zc(t){const e=t.body;return!!(e["webkitRequestFullscreen"]||e.requestFullscreen&&t.fullscreenEnabled)}function Gc(t){return!!(t["webkitIsFullScreen"]||t.fullscreenElement)}function Vc(t){if(t.requestFullscreen){t.requestFullscreen()}else if(t["webkitRequestFullscreen"]){t["webkitRequestFullscreen"]()}}function Kc(t){if(t["webkitRequestFullscreen"]){t["webkitRequestFullscreen"]()}else{Vc(t)}}function jc(t){if(t.exitFullscreen){t.exitFullscreen()}else if(t["webkitExitFullscreen"]){t["webkitExitFullscreen"]()}}var Xc=kc;class Wc{constructor(t,e){this.thumbnailClickListener=n=>{t.app.dispatch({type:"plot_edit",id:e.id,config:{settings:{displayedImageIndex:n}}})}}}function Yc(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 Zc(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 Uc{constructor(t){this.type="WSIViewer";this.opts=t;this.wsiViewerInteractions=new Wc(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>`)}this.renderMetadata(r,o,s)}))}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("height","auto").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","60px").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 kl({layers:[t],target:"wsi-viewer",view:new pi({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 Xc;t.addControl(n);const i=new Dc({className:"ol-overviewmap ol-custom-overviewmap",layers:[new Yh({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].filename};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 Ic({url:h,size:[a,l],crossOrigin:"anonymous",zDirection:-1});const u={preview:`/tileserver/layer/slide/${o.sessionId}/zoomify/TileGroup0/0-0-0@1x.jpg`,metadata:n[s].metadata,source:c,baseLayer:true};const d=new Yh(u);t.push(d)}return t}))}renderMetadata(t,e,n){t.select('div[id="metadata"]').remove();const i=t.append("div").attr("id","metadata");const s=r({holder:i});const o=e[n.displayedImageIndex].get("metadata");if(o){Object.entries(JSON.parse(o)).forEach((([t,e])=>{const[n,i]=s.addRow();n.html(t);i.html(e)}))}}}const Bc=s(Uc);const Hc=Bc;function qc(e,n){return t(this,void 0,void 0,(function*(){return{chartType:"WSIViewer",subfolder:"wsiviewer",extension:"ts",wsimages:yield Zc({app:n}),settings:Yc(e.overrides)}}))}export{Hc as componentInit,qc as getPlotConfig,Bc as wsiViewer};