@defra/interactive-map 0.0.54-alpha → 0.0.56-alpha

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 (472) hide show
  1. package/assets/templates/add-polygons.njk +1 -1
  2. package/assets/templates/add-symbols.njk +4 -4
  3. package/assets/templates/draw-tools.njk +7 -7
  4. package/assets/templates/marker-panel.njk +5 -5
  5. package/assets/templates/place-marker.njk +8 -8
  6. package/assets/templates/search-control.njk +1 -1
  7. package/assets/templates/select-feature.njk +7 -7
  8. package/assets/templates/style-switcher.njk +6 -6
  9. package/assets/templates/toggle-marker-label.njk +3 -3
  10. package/dist/esm/im-core.js +1 -1
  11. package/dist/esm/im-shell.js +1 -1
  12. package/dist/esm/index.js +1 -1
  13. package/dist/umd/im-core.js +1 -1
  14. package/dist/umd/im-core.js.LICENSE.txt +0 -30
  15. package/dist/umd/index.js +1 -1
  16. package/dist/umd/index.js.LICENSE.txt +0 -20
  17. package/docs/api/context.md +2 -0
  18. package/docs/api.md +20 -14
  19. package/docs/architecture/interactive-map.likec4 +4 -4
  20. package/docs/building-a-plugin.md +2 -2
  21. package/docs/examples/add-marker-with-panel.mdx +46 -44
  22. package/docs/examples/add-polygons.mdx +100 -98
  23. package/docs/examples/add-symbols.mdx +75 -73
  24. package/docs/examples/basic-map.mdx +16 -14
  25. package/docs/examples/button-map.mdx +16 -14
  26. package/docs/examples/draw-tools.mdx +119 -117
  27. package/docs/examples/place-marker.mdx +51 -49
  28. package/docs/examples/search-control.mdx +22 -20
  29. package/docs/examples/select-feature.mdx +107 -105
  30. package/docs/examples/style-switcher.mdx +47 -45
  31. package/docs/examples/toggle-marker-label.mdx +30 -28
  32. package/docs/getting-started.md +26 -24
  33. package/docs/plugins/datasets.md +11 -0
  34. package/docs/plugins/draw.md +18 -12
  35. package/docs/plugins/interact.md +33 -10
  36. package/docs/plugins/plugin-descriptor.md +1 -1
  37. package/docs/plugins/search.md +5 -5
  38. package/docusaurus.config.cjs +48 -3
  39. package/govuk-prototype-kit.config.json +6 -7
  40. package/package.json +22 -29
  41. package/plugins/datasets/dist/esm/im-datasets-esri-adapter.js +1 -1
  42. package/plugins/datasets/dist/esm/im-datasets-ml-adapter.js +1 -1
  43. package/plugins/datasets/dist/esm/im-datasets-ol-adapter.js +1 -1
  44. package/plugins/datasets/dist/esm/im-datasets-plugin.js +1 -1
  45. package/plugins/datasets/dist/esm/index.js +1 -1
  46. package/plugins/datasets/dist/esm/layerAdapter.js +1 -1
  47. package/plugins/datasets/dist/esm/mapboxStyleLayerAdapter.js +1 -1
  48. package/plugins/datasets/dist/umd/im-datasets-ml-adapter.js +1 -1
  49. package/plugins/datasets/dist/umd/im-datasets-ol-adapter.js +1 -1
  50. package/plugins/datasets/dist/umd/im-datasets-plugin.js +1 -1
  51. package/plugins/datasets/dist/umd/index.js +1 -1
  52. package/plugins/datasets/src/adapters/esri/esriLayerAdapter.js +18 -16
  53. package/plugins/datasets/src/adapters/esri/esriLayerAdapter.test.js +2 -2
  54. package/plugins/datasets/src/adapters/esri/registry/esriDataset.js +2 -3
  55. package/plugins/datasets/src/adapters/esri/registry/esriDataset.test.js +1 -1
  56. package/plugins/datasets/src/adapters/loadLayerAdapter.js +2 -20
  57. package/plugins/datasets/src/adapters/loadLayerAdapter.test.js +9 -9
  58. package/plugins/datasets/src/adapters/mapboxStyleLayerAdapter.js +7 -7
  59. package/plugins/datasets/src/adapters/maplibre/maplibreLayerAdapter.js +19 -19
  60. package/plugins/datasets/src/adapters/maplibre/maplibreLayerAdapter.test.js +1 -1
  61. package/plugins/datasets/src/adapters/maplibre/registry/mapLibreDataset.test.js +1 -1
  62. package/plugins/datasets/src/adapters/openlayers/canvasPatternStyle.test.js +2 -2
  63. package/plugins/datasets/src/adapters/openlayers/layerBuilders.test.js +1 -1
  64. package/plugins/datasets/src/adapters/openlayers/openlayersLayerAdapter.js +21 -21
  65. package/plugins/datasets/src/adapters/openlayers/openlayersLayerAdapter.test.js +5 -5
  66. package/plugins/datasets/src/adapters/openlayers/registry/openLayersDataset.js +2 -3
  67. package/plugins/datasets/src/adapters/openlayers/registry/openLayersDataset.test.js +2 -2
  68. package/plugins/datasets/src/api/getOpacity.js +1 -2
  69. package/plugins/datasets/src/api/getOpacity.test.js +9 -12
  70. package/plugins/datasets/src/api/getStyle.js +1 -2
  71. package/plugins/datasets/src/api/getStyle.test.js +5 -8
  72. package/plugins/datasets/src/api/removeDataset.js +2 -4
  73. package/plugins/datasets/src/api/removeDataset.test.js +5 -10
  74. package/plugins/datasets/src/api/setData.js +2 -4
  75. package/plugins/datasets/src/api/setData.test.js +6 -14
  76. package/plugins/datasets/src/api/setFeatureVisibility.js +1 -2
  77. package/plugins/datasets/src/api/setFeatureVisibility.test.js +8 -11
  78. package/plugins/datasets/src/components/LayersMenu/LayersMenu.jsx +1 -0
  79. package/plugins/datasets/src/components/LayersMenu/LayersMenuCheckbox.jsx +1 -3
  80. package/plugins/datasets/src/components/LayersMenu/LayersMenuCheckbox.test.jsx +13 -18
  81. package/plugins/datasets/src/index.js +2 -2
  82. package/plugins/datasets/src/index.test.js +8 -1
  83. package/plugins/datasets/src/initialise/DatasetsInit.jsx +48 -26
  84. package/plugins/datasets/src/initialise/DatasetsInit.test.jsx +160 -89
  85. package/plugins/datasets/src/initialise/initialiseDatasets.js +2 -3
  86. package/plugins/datasets/src/initialise/initialiseDatasets.test.js +23 -10
  87. package/plugins/datasets/src/manifest.js +53 -44
  88. package/plugins/datasets/src/manifest.test.js +36 -4
  89. package/plugins/datasets/src/reducers/pluginState.js +5 -5
  90. package/plugins/datasets/src/reducers/pluginState.test.js +21 -20
  91. package/plugins/datasets/src/registry/__mocks__/datasetRegistry.js +7 -6
  92. package/plugins/datasets/src/registry/createDataset.js +2 -2
  93. package/plugins/datasets/src/registry/dataset.js +9 -10
  94. package/plugins/datasets/src/registry/dataset.test.js +63 -64
  95. package/plugins/datasets/src/registry/datasetRegistry.js +39 -10
  96. package/plugins/datasets/src/registry/datasetRegistry.test.js +83 -1
  97. package/plugins/datasets/src/registry/globalDataset.js +9 -17
  98. package/plugins/datasets/src/registry/isVisibleWhen.js +9 -17
  99. package/plugins/datasets/src/registry/isVisibleWhen.test.js +27 -20
  100. package/plugins/datasets/src/registry/mapboxStyleDataset.test.js +26 -27
  101. package/plugins/datasets/src/utils/hasLayersMenu.js +13 -0
  102. package/plugins/datasets/src/utils/hasLayersMenu.test.js +25 -0
  103. package/plugins/draw/dist/esm/im-draw-ml-adapter.js +1 -1
  104. package/plugins/draw/dist/esm/im-draw-ol-adapter.js +1 -1
  105. package/plugins/draw/dist/esm/im-draw-plugin.js +1 -1
  106. package/plugins/draw/dist/esm/index.js +1 -1
  107. package/plugins/draw/dist/esm/liveDrawChecks.js +1 -1
  108. package/plugins/draw/dist/umd/im-draw-ml-adapter.js +1 -1
  109. package/plugins/draw/dist/umd/im-draw-ol-adapter.js +1 -1
  110. package/plugins/draw/dist/umd/im-draw-plugin.js +1 -1
  111. package/plugins/draw/dist/umd/index.js +1 -1
  112. package/plugins/draw/src/DrawInit.jsx +47 -26
  113. package/plugins/draw/src/DrawInit.test.jsx +90 -2
  114. package/plugins/draw/src/adapters/maplibre/styles.js +3 -2
  115. package/plugins/draw/src/adapters/maplibre/styles.test.js +3 -3
  116. package/plugins/draw/src/adapters/openlayers/core/styles.test.js +1 -1
  117. package/plugins/draw/src/adapters/openlayers/point/pointSymbolImages.test.js +1 -1
  118. package/plugins/draw/src/manifest.js +3 -2
  119. package/plugins/draw/src/manifest.test.js +13 -1
  120. package/plugins/draw/src/utils/needsDrawTarget.js +22 -0
  121. package/plugins/draw/src/utils/needsDrawTarget.test.js +42 -0
  122. package/plugins/draw-es/dist/esm/im-draw-es-plugin.js +1 -0
  123. package/plugins/draw-es/dist/esm/index.js +1 -0
  124. package/plugins/{beta/draw-es → draw-es}/src/DrawInit.jsx +1 -1
  125. package/plugins/{beta/draw-es → draw-es}/src/events.test.js +1 -1
  126. package/plugins/{beta/draw-es → draw-es}/src/graphic.js +1 -1
  127. package/plugins/frame/dist/esm/im-frame-plugin.js +1 -0
  128. package/plugins/frame/dist/esm/index.js +1 -0
  129. package/plugins/frame/dist/umd/im-frame-plugin.js +1 -0
  130. package/plugins/frame/dist/umd/index.js +2 -0
  131. package/plugins/{beta/frame → frame}/package.json +2 -2
  132. package/plugins/interact/dist/esm/im-interact-plugin.js +1 -1
  133. package/plugins/interact/dist/esm/index.js +1 -1
  134. package/plugins/interact/dist/umd/im-interact-plugin.js +1 -1
  135. package/plugins/interact/dist/umd/index.js +1 -1
  136. package/plugins/interact/src/InteractInit.jsx +3 -3
  137. package/plugins/interact/src/api/enable.test.js +13 -0
  138. package/plugins/interact/src/defaults.js +1 -0
  139. package/plugins/interact/src/hooks/useCrossHairVisibility.js +27 -17
  140. package/plugins/interact/src/hooks/useCrossHairVisibility.test.js +72 -7
  141. package/plugins/interact/src/manifest.js +4 -4
  142. package/plugins/interact/src/manifest.test.js +29 -0
  143. package/plugins/interact/src/reducer.js +7 -2
  144. package/plugins/interact/src/reducer.test.js +12 -2
  145. package/plugins/interact/src/utils/needsTarget.js +20 -0
  146. package/plugins/interact/src/utils/needsTarget.test.js +36 -0
  147. package/plugins/map-key/dist/esm/im-map-key-plugin.js +1 -1
  148. package/plugins/map-key/dist/esm/index.js +1 -1
  149. package/plugins/map-key/dist/umd/im-map-key-plugin.js +1 -1
  150. package/plugins/map-key/dist/umd/index.js +1 -1
  151. package/plugins/map-key/src/components/Key/KeySvgSymbol.jsx +4 -0
  152. package/plugins/map-key/src/components/Key/MapKey.jsx +15 -15
  153. package/plugins/map-key/src/components/Key/MapKey.test.jsx +29 -15
  154. package/plugins/map-key/src/initialise/MapKeyInit.jsx +5 -8
  155. package/plugins/map-key/src/initialise/MapKeyInit.test.jsx +9 -7
  156. package/plugins/map-key/src/manifest.test.js +0 -1
  157. package/plugins/map-key/src/reducers/mergeKeyGroupItems.js +14 -33
  158. package/plugins/map-key/src/reducers/mergeKeyGroupItems.test.js +34 -50
  159. package/plugins/map-key/src/reducers/pluginState.js +6 -1
  160. package/plugins/map-key/src/reducers/pluginState.test.js +13 -4
  161. package/plugins/map-styles/dist/esm/im-map-styles-plugin.js +1 -0
  162. package/plugins/map-styles/dist/esm/index.js +1 -0
  163. package/plugins/map-styles/dist/umd/im-map-styles-plugin.js +1 -0
  164. package/plugins/map-styles/dist/umd/index.js +2 -0
  165. package/plugins/{beta/map-styles → map-styles}/src/MapStyles.jsx +2 -2
  166. package/plugins/{beta/map-styles → map-styles}/src/MapStylesInit.jsx +1 -1
  167. package/plugins/menu/dist/esm/im-menu-plugin.js +1 -1
  168. package/plugins/menu/dist/esm/index.js +1 -1
  169. package/plugins/menu/dist/umd/im-menu-plugin.js +1 -1
  170. package/plugins/menu/dist/umd/index.js +1 -1
  171. package/plugins/scale-bar/dist/esm/im-scale-bar-plugin.js +1 -0
  172. package/plugins/scale-bar/dist/esm/index.js +1 -0
  173. package/plugins/scale-bar/dist/umd/im-scale-bar-plugin.js +1 -0
  174. package/plugins/scale-bar/dist/umd/index.js +2 -0
  175. package/plugins/{beta/scale-bar → scale-bar}/package.json +2 -2
  176. package/plugins/search/dist/esm/im-search-plugin.js +1 -1
  177. package/plugins/search/dist/esm/index.js +1 -1
  178. package/plugins/search/dist/umd/im-search-plugin.js +1 -1
  179. package/plugins/search/dist/umd/index.js +1 -1
  180. package/plugins/search/src/components/Suggestions/Suggestions.jsx +3 -1
  181. package/plugins/search/src/components/Suggestions/Suggestions.test.jsx +11 -0
  182. package/plugins/search/src/utils/markedToElements.jsx +25 -0
  183. package/plugins/search/src/utils/markedToElements.test.jsx +49 -0
  184. package/plugins/search/src/utils/parseOsNamesResults.js +6 -4
  185. package/plugins/search/src/utils/parseOsNamesResults.test.js +18 -0
  186. package/plugins/use-location/dist/esm/im-use-location-plugin.js +1 -0
  187. package/plugins/use-location/dist/esm/index.js +1 -0
  188. package/plugins/use-location/dist/umd/im-use-location-plugin.js +1 -0
  189. package/plugins/use-location/dist/umd/index.js +2 -0
  190. package/providers/esri/dist/esm/im-esri-provider.js +1 -0
  191. package/providers/esri/dist/esm/index.js +1 -0
  192. package/providers/{beta/esri → esri}/src/esriProvider.js +1 -1
  193. package/providers/{beta/esri → esri}/src/mapEvents.js +2 -2
  194. package/providers/maplibre/dist/esm/im-maplibre-provider.js +1 -1
  195. package/providers/maplibre/dist/esm/index.js +1 -1
  196. package/providers/maplibre/dist/umd/im-maplibre-framework.js +1 -1
  197. package/providers/maplibre/dist/umd/im-maplibre-framework.js.LICENSE.txt +3 -3
  198. package/providers/maplibre/dist/umd/im-maplibre-provider.js +1 -1
  199. package/providers/maplibre/dist/umd/im-maplibre-worker.js +2 -0
  200. package/providers/maplibre/dist/umd/im-maplibre-worker.js.LICENSE.txt +4 -0
  201. package/providers/maplibre/dist/umd/index.js +1 -1
  202. package/providers/maplibre/src/index.js +41 -12
  203. package/providers/maplibre/src/index.test.js +43 -12
  204. package/providers/maplibre/src/utils/detectModuleWorker.js +25 -0
  205. package/providers/maplibre/src/utils/detectModuleWorker.test.js +40 -0
  206. package/providers/maplibre/src/utils/spatial.js +22 -12
  207. package/providers/maplibre/src/utils/spatial.test.js +6 -6
  208. package/providers/maplibre/src/utils/workerUrl.js +15 -0
  209. package/providers/maplibre/src/utils/workerUrl.test.js +14 -0
  210. package/providers/open-names/dist/esm/im-reverse-geocode.js +1 -0
  211. package/providers/open-names/dist/esm/index.js +1 -0
  212. package/providers/open-names/dist/umd/im-reverse-geocode.js +2 -0
  213. package/providers/open-names/dist/umd/index.js +2 -0
  214. package/providers/openlayers/dist/esm/im-openlayers-provider.js +1 -0
  215. package/providers/openlayers/dist/esm/index.js +1 -0
  216. package/providers/openlayers/dist/umd/im-openlayers-provider.js +2 -0
  217. package/providers/openlayers/dist/umd/index.js +2 -0
  218. package/providers/openlayers/src/index.js +60 -0
  219. package/providers/openlayers/src/index.test.js +47 -0
  220. package/providers/{beta/openlayers → openlayers}/src/mapEvents.js +2 -2
  221. package/providers/{beta/openlayers → openlayers}/src/mapEvents.test.js +2 -2
  222. package/providers/{beta/openlayers → openlayers}/src/openlayersProvider.js +3 -3
  223. package/providers/{beta/openlayers → openlayers}/src/utils/highlightFeatures.js +1 -1
  224. package/providers/{beta/openlayers → openlayers}/src/utils/patternImages.js +1 -1
  225. package/providers/{beta/openlayers → openlayers}/src/utils/symbolImages.js +1 -1
  226. package/rollup.esm.mjs +79 -46
  227. package/sonar-project.properties +1 -1
  228. package/src/App/App.jsx +4 -1
  229. package/src/App/App.test.jsx +6 -0
  230. package/src/App/renderer/PluginInits.jsx +8 -7
  231. package/src/App/renderer/PluginInits.test.jsx +20 -5
  232. package/src/App/renderer/SlotItemsProvider.jsx +33 -0
  233. package/src/App/renderer/SlotItemsProvider.test.jsx +59 -0
  234. package/src/App/renderer/SlotRenderer.jsx +3 -14
  235. package/src/App/renderer/SlotRenderer.test.jsx +11 -44
  236. package/src/App/renderer/mapButtons.js +22 -11
  237. package/src/App/renderer/mapButtons.test.js +23 -1
  238. package/src/App/renderer/mapControls.js +6 -8
  239. package/src/App/renderer/mapControls.test.js +10 -0
  240. package/src/App/renderer/mapPanels.js +16 -19
  241. package/src/App/renderer/mapPanels.test.js +37 -9
  242. package/src/App/renderer/pluginWrapper.js +10 -8
  243. package/src/App/renderer/pluginWrapper.test.js +23 -9
  244. package/src/App/renderer/slotAggregator.js +18 -5
  245. package/src/App/renderer/slotAggregator.test.js +68 -25
  246. package/src/App/renderer/slotHelpers.js +13 -0
  247. package/src/App/renderer/slotHelpers.test.js +16 -1
  248. package/src/App/store/AppProvider.jsx +19 -1
  249. package/src/App/store/AppProvider.test.jsx +41 -0
  250. package/src/App/store/appActionsMap.js +10 -1
  251. package/src/App/store/appActionsMap.test.js +21 -0
  252. package/src/App/store/appDispatchMiddleware.js +29 -17
  253. package/src/App/store/appDispatchMiddleware.test.js +31 -0
  254. package/src/InteractiveMap/InteractiveMap.js +2 -1
  255. package/src/InteractiveMap/InteractiveMap.test.js +9 -2
  256. package/src/InteractiveMap/domStateManager.js +21 -1
  257. package/src/InteractiveMap/domStateManager.test.js +48 -1
  258. package/src/InteractiveMap/parseDataProperties.js +4 -4
  259. package/src/InteractiveMap/parseDataProperties.test.js +62 -6
  260. package/src/InteractiveMap/polyfills.js +4 -3
  261. package/src/InteractiveMap/polyfills.test.js +12 -0
  262. package/src/config/events.js +4 -2
  263. package/src/scss/tools/_govuk-content.scss +4 -3
  264. package/src/types.js +3 -5
  265. package/webpack.dev.mjs +11 -3
  266. package/webpack.prod.mjs +11 -4
  267. package/webpack.umd.mjs +34 -14
  268. package/plugins/beta/draw-es/dist/esm/im-draw-es-plugin.js +0 -1
  269. package/plugins/beta/draw-es/dist/esm/index.js +0 -1
  270. package/plugins/beta/draw-ml/dist/esm/im-draw-ml-plugin.js +0 -1
  271. package/plugins/beta/draw-ml/dist/esm/index.js +0 -1
  272. package/plugins/beta/draw-ml/dist/umd/im-draw-ml-plugin.js +0 -1
  273. package/plugins/beta/draw-ml/dist/umd/index.js +0 -2
  274. package/plugins/beta/draw-ml/src/DrawInit.jsx +0 -85
  275. package/plugins/beta/draw-ml/src/api/addFeature.js +0 -27
  276. package/plugins/beta/draw-ml/src/api/deleteFeature.js +0 -13
  277. package/plugins/beta/draw-ml/src/api/editFeature.js +0 -75
  278. package/plugins/beta/draw-ml/src/api/merge.js +0 -9
  279. package/plugins/beta/draw-ml/src/api/newLine.js +0 -68
  280. package/plugins/beta/draw-ml/src/api/newPolygon.js +0 -68
  281. package/plugins/beta/draw-ml/src/api/split.js +0 -81
  282. package/plugins/beta/draw-ml/src/defaults.js +0 -17
  283. package/plugins/beta/draw-ml/src/draw.scss +0 -26
  284. package/plugins/beta/draw-ml/src/events.js +0 -185
  285. package/plugins/beta/draw-ml/src/index.js +0 -13
  286. package/plugins/beta/draw-ml/src/manifest.js +0 -110
  287. package/plugins/beta/draw-ml/src/mapboxDraw.js +0 -143
  288. package/plugins/beta/draw-ml/src/mapboxSnap.js +0 -321
  289. package/plugins/beta/draw-ml/src/modes/createDrawMode.js +0 -552
  290. package/plugins/beta/draw-ml/src/modes/disabledMode.js +0 -23
  291. package/plugins/beta/draw-ml/src/modes/drawLineMode.js +0 -18
  292. package/plugins/beta/draw-ml/src/modes/drawPolygonMode.js +0 -16
  293. package/plugins/beta/draw-ml/src/modes/editVertex/geometryHelpers.js +0 -135
  294. package/plugins/beta/draw-ml/src/modes/editVertex/helpers.js +0 -2
  295. package/plugins/beta/draw-ml/src/modes/editVertex/touchHandlers.js +0 -142
  296. package/plugins/beta/draw-ml/src/modes/editVertex/undoHandlers.js +0 -133
  297. package/plugins/beta/draw-ml/src/modes/editVertex/vertexOperations.js +0 -142
  298. package/plugins/beta/draw-ml/src/modes/editVertex/vertexQueries.js +0 -121
  299. package/plugins/beta/draw-ml/src/modes/editVertexMode.js +0 -495
  300. package/plugins/beta/draw-ml/src/reducer.js +0 -90
  301. package/plugins/beta/draw-ml/src/styles.js +0 -190
  302. package/plugins/beta/draw-ml/src/undoStack.js +0 -50
  303. package/plugins/beta/draw-ml/src/utils/debounce.js +0 -16
  304. package/plugins/beta/draw-ml/src/utils/flattenStyleProperties.js +0 -49
  305. package/plugins/beta/draw-ml/src/utils/snapHelpers.js +0 -200
  306. package/plugins/beta/draw-ml/src/utils/spatial.js +0 -258
  307. package/plugins/beta/draw-ol/dist/css/index.css +0 -1
  308. package/plugins/beta/draw-ol/dist/esm/DrawMode.js +0 -1
  309. package/plugins/beta/draw-ol/dist/esm/EditMode.js +0 -1
  310. package/plugins/beta/draw-ol/dist/esm/geometryHelpers.js +0 -1
  311. package/plugins/beta/draw-ol/dist/esm/im-draw-ol-plugin.js +0 -1
  312. package/plugins/beta/draw-ol/dist/esm/index.js +0 -1
  313. package/plugins/beta/draw-ol/src/DrawInit.jsx +0 -65
  314. package/plugins/beta/draw-ol/src/api/addFeature.js +0 -29
  315. package/plugins/beta/draw-ol/src/api/deleteFeature.js +0 -11
  316. package/plugins/beta/draw-ol/src/api/editFeature.js +0 -50
  317. package/plugins/beta/draw-ol/src/api/newLine.js +0 -44
  318. package/plugins/beta/draw-ol/src/api/newPolygon.js +0 -44
  319. package/plugins/beta/draw-ol/src/core/OLDrawManager.js +0 -153
  320. package/plugins/beta/draw-ol/src/core/featureStore.js +0 -65
  321. package/plugins/beta/draw-ol/src/core/styles.js +0 -98
  322. package/plugins/beta/draw-ol/src/core/undoStack.js +0 -31
  323. package/plugins/beta/draw-ol/src/defaults.js +0 -16
  324. package/plugins/beta/draw-ol/src/draw/DrawMode.js +0 -121
  325. package/plugins/beta/draw-ol/src/draw/drawInput.js +0 -243
  326. package/plugins/beta/draw-ol/src/draw.scss +0 -17
  327. package/plugins/beta/draw-ol/src/edit/EditMode.js +0 -424
  328. package/plugins/beta/draw-ol/src/edit/keyboardHandler.js +0 -229
  329. package/plugins/beta/draw-ol/src/edit/midpointLayer.js +0 -57
  330. package/plugins/beta/draw-ol/src/edit/touchHandler.js +0 -171
  331. package/plugins/beta/draw-ol/src/edit/undoOps.js +0 -95
  332. package/plugins/beta/draw-ol/src/edit/vertexHitTest.js +0 -72
  333. package/plugins/beta/draw-ol/src/edit/vertexLayer.js +0 -49
  334. package/plugins/beta/draw-ol/src/edit/vertexOps.js +0 -99
  335. package/plugins/beta/draw-ol/src/events.js +0 -114
  336. package/plugins/beta/draw-ol/src/index.js +0 -12
  337. package/plugins/beta/draw-ol/src/manifest.js +0 -125
  338. package/plugins/beta/draw-ol/src/olDraw.js +0 -38
  339. package/plugins/beta/draw-ol/src/reducer.js +0 -41
  340. package/plugins/beta/draw-ol/src/snap/snapEngine.js +0 -153
  341. package/plugins/beta/draw-ol/src/snap/snapGeometry.js +0 -177
  342. package/plugins/beta/draw-ol/src/snap/snapIndicator.js +0 -81
  343. package/plugins/beta/draw-ol/src/snap/snapInteraction.js +0 -57
  344. package/plugins/beta/draw-ol/src/snap/snapManager.js +0 -99
  345. package/plugins/beta/draw-ol/src/utils/flattenStyleProperties.js +0 -47
  346. package/plugins/beta/draw-ol/src/utils/geometryHelpers.js +0 -103
  347. package/plugins/beta/draw-ol/src/utils/olCoords.js +0 -35
  348. package/plugins/beta/draw-ol/src/utils/resolveColors.js +0 -39
  349. package/plugins/beta/draw-ol/src/utils/spatial.js +0 -24
  350. package/plugins/beta/draw-ol/src/utils/touchTarget.js +0 -61
  351. package/plugins/beta/frame/dist/esm/im-frame-plugin.js +0 -1
  352. package/plugins/beta/frame/dist/esm/index.js +0 -1
  353. package/plugins/beta/frame/dist/umd/im-frame-plugin.js +0 -1
  354. package/plugins/beta/frame/dist/umd/index.js +0 -2
  355. package/plugins/beta/map-styles/dist/esm/im-map-styles-plugin.js +0 -1
  356. package/plugins/beta/map-styles/dist/esm/index.js +0 -1
  357. package/plugins/beta/map-styles/dist/umd/im-map-styles-plugin.js +0 -1
  358. package/plugins/beta/map-styles/dist/umd/index.js +0 -2
  359. package/plugins/beta/scale-bar/dist/esm/im-scale-bar-plugin.js +0 -1
  360. package/plugins/beta/scale-bar/dist/esm/index.js +0 -1
  361. package/plugins/beta/scale-bar/dist/umd/im-scale-bar-plugin.js +0 -1
  362. package/plugins/beta/scale-bar/dist/umd/index.js +0 -2
  363. package/plugins/beta/use-location/dist/esm/im-use-location-plugin.js +0 -1
  364. package/plugins/beta/use-location/dist/esm/index.js +0 -1
  365. package/plugins/beta/use-location/dist/umd/im-use-location-plugin.js +0 -1
  366. package/plugins/beta/use-location/dist/umd/index.js +0 -2
  367. package/plugins/map-key/src/registry/getDatasetRegistry.js +0 -6
  368. package/plugins/map-key/src/registry/getDatasetRegistry.test.js +0 -23
  369. package/plugins/map-key/src/registry/index.js +0 -1
  370. package/plugins/map-key/src/registry/index.test.js +0 -7
  371. package/providers/beta/esri/dist/esm/im-esri-provider.js +0 -1
  372. package/providers/beta/esri/dist/esm/index.js +0 -1
  373. package/providers/beta/open-names/dist/esm/im-reverse-geocode.js +0 -1
  374. package/providers/beta/open-names/dist/esm/index.js +0 -1
  375. package/providers/beta/open-names/dist/umd/im-reverse-geocode.js +0 -2
  376. package/providers/beta/open-names/dist/umd/index.js +0 -2
  377. package/providers/beta/openlayers/dist/esm/im-openlayers-provider.js +0 -1
  378. package/providers/beta/openlayers/dist/esm/index.js +0 -1
  379. package/providers/beta/openlayers/dist/umd/im-openlayers-provider.js +0 -2
  380. package/providers/beta/openlayers/dist/umd/index.js +0 -2
  381. package/providers/beta/openlayers/dist/umd/index.js.LICENSE.txt +0 -1
  382. package/providers/beta/openlayers/src/index.js +0 -37
  383. /package/plugins/{beta/draw-es → draw-es}/src/api/addFeature.js +0 -0
  384. /package/plugins/{beta/draw-es → draw-es}/src/api/deleteFeature.js +0 -0
  385. /package/plugins/{beta/draw-es → draw-es}/src/api/editFeature.js +0 -0
  386. /package/plugins/{beta/draw-es → draw-es}/src/api/newPolygon.js +0 -0
  387. /package/plugins/{beta/draw-es → draw-es}/src/api/removeSafeZone.js +0 -0
  388. /package/plugins/{beta/draw-es → draw-es}/src/events.js +0 -0
  389. /package/plugins/{beta/draw-es → draw-es}/src/index.js +0 -0
  390. /package/plugins/{beta/draw-es → draw-es}/src/manifest.js +0 -0
  391. /package/plugins/{beta/draw-es → draw-es}/src/reducer.js +0 -0
  392. /package/plugins/{beta/draw-es → draw-es}/src/sketchViewModel.js +0 -0
  393. /package/plugins/{beta/frame → frame}/dist/css/index.css +0 -0
  394. /package/plugins/{beta/draw-ml → frame}/dist/umd/index.js.LICENSE.txt +0 -0
  395. /package/plugins/{beta/frame → frame}/src/Frame.jsx +0 -0
  396. /package/plugins/{beta/frame → frame}/src/FrameInit.jsx +0 -0
  397. /package/plugins/{beta/frame → frame}/src/api/addFrame.js +0 -0
  398. /package/plugins/{beta/frame → frame}/src/api/editFeature.js +0 -0
  399. /package/plugins/{beta/frame → frame}/src/config.js +0 -0
  400. /package/plugins/{beta/frame → frame}/src/frame.scss +0 -0
  401. /package/plugins/{beta/frame → frame}/src/index.js +0 -0
  402. /package/plugins/{beta/frame → frame}/src/manifest.js +0 -0
  403. /package/plugins/{beta/frame → frame}/src/reducer.js +0 -0
  404. /package/plugins/{beta/frame → frame}/src/utils.js +0 -0
  405. /package/plugins/{beta/map-styles → map-styles}/dist/css/index.css +0 -0
  406. /package/plugins/{beta/frame → map-styles}/dist/umd/index.js.LICENSE.txt +0 -0
  407. /package/plugins/{beta/map-styles → map-styles}/src/config.js +0 -0
  408. /package/plugins/{beta/map-styles → map-styles}/src/index.js +0 -0
  409. /package/plugins/{beta/map-styles → map-styles}/src/manifest.js +0 -0
  410. /package/plugins/{beta/map-styles → map-styles}/src/mapStyles.scss +0 -0
  411. /package/plugins/{beta/scale-bar → scale-bar}/dist/css/index.css +0 -0
  412. /package/plugins/{beta/map-styles → scale-bar}/dist/umd/index.js.LICENSE.txt +0 -0
  413. /package/plugins/{beta/scale-bar → scale-bar}/src/ScaleBar.jsx +0 -0
  414. /package/plugins/{beta/scale-bar → scale-bar}/src/ScaleBar.test.jsx +0 -0
  415. /package/plugins/{beta/scale-bar → scale-bar}/src/index.js +0 -0
  416. /package/plugins/{beta/scale-bar → scale-bar}/src/index.test.js +0 -0
  417. /package/plugins/{beta/scale-bar → scale-bar}/src/manifest.js +0 -0
  418. /package/plugins/{beta/scale-bar → scale-bar}/src/scaleBar.scss +0 -0
  419. /package/plugins/{beta/scale-bar → scale-bar}/src/utils.js +0 -0
  420. /package/plugins/{beta/scale-bar → scale-bar}/src/utils.test.js +0 -0
  421. /package/plugins/{beta/scale-bar → use-location}/dist/umd/index.js.LICENSE.txt +0 -0
  422. /package/plugins/{beta/use-location → use-location}/src/UseLocation.jsx +0 -0
  423. /package/plugins/{beta/use-location → use-location}/src/UseLocationInit.jsx +0 -0
  424. /package/plugins/{beta/use-location → use-location}/src/defaults.js +0 -0
  425. /package/plugins/{beta/use-location → use-location}/src/events.js +0 -0
  426. /package/plugins/{beta/use-location → use-location}/src/index.js +0 -0
  427. /package/plugins/{beta/use-location → use-location}/src/manifest.js +0 -0
  428. /package/plugins/{beta/use-location → use-location}/src/reducer.js +0 -0
  429. /package/providers/{beta/esri → esri}/dist/css/index.css +0 -0
  430. /package/providers/{beta/esri → esri}/src/appEvents.js +0 -0
  431. /package/providers/{beta/esri → esri}/src/defaults.js +0 -0
  432. /package/providers/{beta/esri → esri}/src/esriProvider.scss +0 -0
  433. /package/providers/{beta/esri → esri}/src/index.js +0 -0
  434. /package/providers/{beta/esri → esri}/src/utils/coords.js +0 -0
  435. /package/providers/{beta/esri → esri}/src/utils/coords.test.js +0 -0
  436. /package/providers/{beta/esri → esri}/src/utils/detectWebGL.js +0 -0
  437. /package/providers/{beta/esri → esri}/src/utils/esriFixes.js +0 -0
  438. /package/providers/{beta/esri → esri}/src/utils/query.js +0 -0
  439. /package/providers/{beta/esri → esri}/src/utils/spatial.js +0 -0
  440. /package/providers/{beta/esri → esri}/src/utils/spatial.test.js +0 -0
  441. /package/providers/{beta/open-names → open-names}/dist/umd/im-reverse-geocode.js.LICENSE.txt +0 -0
  442. /package/{plugins/beta/use-location → providers/open-names}/dist/umd/index.js.LICENSE.txt +0 -0
  443. /package/providers/{beta/open-names → open-names}/src/index.js +0 -0
  444. /package/providers/{beta/open-names → open-names}/src/reverseGeocode.js +0 -0
  445. /package/providers/{beta/open-names → open-names}/src/utils/mapToLocationModel.js +0 -0
  446. /package/providers/{beta/open-names → open-names}/src/utils/mapToLocationModel.test.js +0 -0
  447. /package/providers/{beta/openlayers → openlayers}/dist/umd/im-openlayers-provider.js.LICENSE.txt +0 -0
  448. /package/providers/{beta/open-names → openlayers}/dist/umd/index.js.LICENSE.txt +0 -0
  449. /package/providers/{beta/openlayers → openlayers}/src/appEvents.js +0 -0
  450. /package/providers/{beta/openlayers → openlayers}/src/appEvents.test.js +0 -0
  451. /package/providers/{beta/openlayers → openlayers}/src/defaults.js +0 -0
  452. /package/providers/{beta/openlayers → openlayers}/src/openlayersProvider.test.js +0 -0
  453. /package/providers/{beta/openlayers → openlayers}/src/utils/bngProjection.js +0 -0
  454. /package/providers/{beta/openlayers → openlayers}/src/utils/filterEvaluator.js +0 -0
  455. /package/providers/{beta/openlayers → openlayers}/src/utils/filterEvaluator.test.js +0 -0
  456. /package/providers/{beta/openlayers → openlayers}/src/utils/highlightFeatures.test.js +0 -0
  457. /package/providers/{beta/openlayers → openlayers}/src/utils/hoverCursor.js +0 -0
  458. /package/providers/{beta/openlayers → openlayers}/src/utils/hoverCursor.test.js +0 -0
  459. /package/providers/{beta/openlayers → openlayers}/src/utils/openLayersFixes.js +0 -0
  460. /package/providers/{beta/openlayers → openlayers}/src/utils/openLayersFixes.test.js +0 -0
  461. /package/providers/{beta/openlayers → openlayers}/src/utils/patternImages.test.js +0 -0
  462. /package/providers/{beta/openlayers → openlayers}/src/utils/queryFeatures.js +0 -0
  463. /package/providers/{beta/openlayers → openlayers}/src/utils/queryFeatures.test.js +0 -0
  464. /package/providers/{beta/openlayers → openlayers}/src/utils/spatial.js +0 -0
  465. /package/providers/{beta/openlayers → openlayers}/src/utils/spatial.test.js +0 -0
  466. /package/providers/{beta/openlayers → openlayers}/src/utils/symbolImages.test.js +0 -0
  467. /package/providers/{beta/openlayers → openlayers}/src/utils/tileLayers.js +0 -0
  468. /package/providers/{beta/openlayers → openlayers}/src/utils/tileLayers.test.js +0 -0
  469. /package/providers/{beta/openlayers → openlayers}/src/utils/vtTileFragments.js +0 -0
  470. /package/providers/{beta/openlayers → openlayers}/src/utils/vtTileFragments.test.js +0 -0
  471. /package/providers/{beta/openlayers → openlayers}/src/utils/zoom.js +0 -0
  472. /package/providers/{beta/openlayers → openlayers}/src/utils/zoom.test.js +0 -0
@@ -1 +1 @@
1
- import t from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/objectWithoutProperties";import a from"@babel/runtime/helpers/asyncToGenerator";class r{_notImplemented(t){throw new Error("".concat(this.name," must implement ").concat(t,"()"))}isBaseMapReady(){this._notImplemented("isBaseMapReady")}addSymbolsToMap(){this._notImplemented("addSymbolsToMap")}addPatternsToMap(){this._notImplemented("addPatternsToMap")}getActiveSymbolImageId(){this._notImplemented("getActiveSymbolImageId")}getSelectedSymbolImageId(){this._notImplemented("getSelectedSymbolImageId")}}var n=400,i=7,o=["showKeyboardHelp","selectControl","moveLarge","nudgeMap","zoomLarge","nudgeZoom","highlightLabelAtCenter","highlightNextLabel"];var s=(t,e)=>{var a=null,r=function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];clearTimeout(a),a=setTimeout(()=>{t(...n)},e)};return r.cancel=()=>{a&&(clearTimeout(a),a=null)},r};function l(t){var{map:e,events:a,eventBus:r,getCenter:n,getZoom:i,getBounds:o,getResolution:l}=t,h=[],c=[],u=()=>{var t=i();return{center:n(),bounds:o(),resolution:l(),zoom:t,isAtMaxZoom:e.getMaxZoom()<=t,isAtMinZoom:e.getMinZoom()>=t}},d=(t,e)=>r.emit(t,e),g=()=>d(a.MAP_LOADED);e.on("load",g),h.push(["load",g]);e.once("idle",()=>d(a.MAP_FIRST_IDLE,u()));var p=()=>d(a.MAP_MOVE_START);e.on("movestart",p),h.push(["movestart",p]);var m=s(()=>{d(a.MAP_MOVE_END,u())},500);e.on("moveend",m),h.push(["moveend",m]);var y,f,v,M=(y=()=>{d(a.MAP_MOVE,u())},f=10,v=0,function(){var t=Date.now();t-v>=f&&(v=t,y(...arguments))});e.on("zoom",M),h.push(["zoom",M]);var b=()=>d(a.MAP_RENDER);e.on("render",b),h.push(["render",b]);var w=s(()=>{d(a.MAP_DATA_CHANGE,u())},500),I=t=>{t.isSourceLoaded&&w()};e.on("styledata",w),e.on("sourcedata",I),h.push(["styledata",w],["sourcedata",I]);var x=()=>d(a.MAP_STYLE_CHANGE);e.on("style.load",x),h.push(["style.load",x]);var S=t=>d(a.MAP_CLICK,{point:t.point,coords:[t.lngLat.lng,t.lngLat.lat]});return e.on("click",S),h.push(["click",S]),c.push(m,M,w),{remove(){c.forEach(t=>t.cancel()),h.forEach(t=>{var[a,r]=t;return e.off(a,r)})}}}let h=" ";class c{static get separator(){return h}static set separator(t){h=t}static parse(t){if(!isNaN(parseFloat(t))&&isFinite(t))return Number(t);const e=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==e[e.length-1]&&e.splice(e.length-1),""==e)return NaN;let a=null;switch(e.length){case 3:a=e[0]/1+e[1]/60+e[2]/3600;break;case 2:a=e[0]/1+e[1]/60;break;case 1:a=e[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(a=-a),Number(a)}static toDms(t,e="d",a=void 0){if(isNaN(t))return null;if("string"==typeof t&&""==t.trim())return null;if("boolean"==typeof t)return null;if(t==1/0)return null;if(null==t)return null;if(void 0===a)switch(e){case"d":case"deg":a=4;break;case"dm":case"deg+min":a=2;break;case"dms":case"deg+min+sec":a=0;break;default:e="d",a=4}t=Math.abs(t);let r=null,n=null,i=null,o=null;switch(e){default:case"d":case"deg":n=t.toFixed(a),n<100&&(n="0"+n),n<10&&(n="0"+n),r=n+"°";break;case"dm":case"deg+min":n=Math.floor(t),i=(60*t%60).toFixed(a),60==i&&(i=(0).toFixed(a),n++),n=("000"+n).slice(-3),i<10&&(i="0"+i),r=n+"°"+c.separator+i+"′";break;case"dms":case"deg+min+sec":n=Math.floor(t),i=Math.floor(3600*t/60)%60,o=(3600*t%60).toFixed(a),60==o&&(o=(0).toFixed(a),i++),60==i&&(i=0,n++),n=("000"+n).slice(-3),i=("00"+i).slice(-2),o<10&&(o="0"+o),r=n+"°"+c.separator+i+"′"+c.separator+o+"″"}return r}static toLat(t,e,a){const r=c.toDms(c.wrap90(t),e,a);return null===r?"–":r.slice(1)+c.separator+(t<0?"S":"N")}static toLon(t,e,a){const r=c.toDms(c.wrap180(t),e,a);return null===r?"–":r+c.separator+(t<0?"W":"E")}static toBrng(t,e,a){const r=c.toDms(c.wrap360(t),e,a);return null===r?"–":r.replace("360","0")}static fromLocale(t){const e=123456.789.toLocaleString(),a={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(a.thousands,"⁜").replace(a.decimal,".").replace("⁜",",")}static toLocale(t){const e=123456.789.toLocaleString(),a={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(/,([0-9])/,"⁜$1").replace(".",a.decimal).replace("⁜",a.thousands)}static compassPoint(t,e=3){if(![1,2,3].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);t=c.wrap360(t);const a=4*2**(e-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*a/360)%a*16/a]}static wrap90(t){if(-90<=t&&t<=90)return t;const e=t,a=360;return 1*Math.abs(((e-90)%a+a)%a-180)-90}static wrap180(t){if(-180<=t&&t<=180)return t;const e=360;return((360*t/e-180)%e+e)%e-180}static wrap360(t){if(0<=t&&t<360)return t;const e=360;return(360*t/e%e+e)%e}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const u=Math.PI;class d{constructor(t,e){if(isNaN(t))throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e))throw new TypeError(`invalid lon ‘${e}’`);this._lat=c.wrap90(Number(t)),this._lon=c.wrap180(Number(e))}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?c.wrap90(c.parse(t)):c.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?c.wrap90(c.parse(t)):c.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${t}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(t){if(this._lon=isNaN(t)?c.wrap180(c.parse(t)):c.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?c.wrap180(c.parse(t)):c.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?c.wrap180(c.parse(t)):c.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${t}’`)}static get metresToKm(){return.001}static get metresToMiles(){return 1/1609.344}static get metresToNauticalMiles(){return 1/1852}static parse(...t){if(0==t.length)throw new TypeError("invalid (empty) point");if(null===t[0]||null===t[1])throw new TypeError("invalid (null) point");let e,a;if(2==t.length&&([e,a]=t,e=c.wrap90(c.parse(e)),a=c.wrap180(c.parse(a)),isNaN(e)||isNaN(a)))throw new TypeError(`invalid point ‘${t.toString()}’`);if(1==t.length&&"string"==typeof t[0]&&([e,a]=t[0].split(","),e=c.wrap90(c.parse(e)),a=c.wrap180(c.parse(a)),isNaN(e)||isNaN(a)))throw new TypeError(`invalid point ‘${t[0]}’`);if(1==t.length&&"object"==typeof t[0]){const r=t[0];if("Point"==r.type&&Array.isArray(r.coordinates)?[a,e]=r.coordinates:(null!=r.latitude&&(e=r.latitude),null!=r.lat&&(e=r.lat),null!=r.longitude&&(a=r.longitude),null!=r.lng&&(a=r.lng),null!=r.lon&&(a=r.lon),e=c.wrap90(c.parse(e)),a=c.wrap180(c.parse(a))),isNaN(e)||isNaN(a))throw new TypeError(`invalid point ‘${JSON.stringify(t[0])}’`)}if(isNaN(e)||isNaN(a))throw new TypeError(`invalid point ‘${t.toString()}’`);return new d(e,a)}distanceTo(t,e=6371e3){if(t instanceof d||(t=d.parse(t)),isNaN(e))throw new TypeError(`invalid radius ‘${e}’`);const a=e,r=this.lat.toRadians(),n=this.lon.toRadians(),i=t.lat.toRadians(),o=i-r,s=t.lon.toRadians()-n,l=Math.sin(o/2)*Math.sin(o/2)+Math.cos(r)*Math.cos(i)*Math.sin(s/2)*Math.sin(s/2);return a*(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)))}initialBearingTo(t){if(t instanceof d||(t=d.parse(t)),this.equals(t))return NaN;const e=this.lat.toRadians(),a=t.lat.toRadians(),r=(t.lon-this.lon).toRadians(),n=Math.cos(e)*Math.sin(a)-Math.sin(e)*Math.cos(a)*Math.cos(r),i=Math.sin(r)*Math.cos(a),o=Math.atan2(i,n).toDegrees();return c.wrap360(o)}finalBearingTo(t){t instanceof d||(t=d.parse(t));const e=t.initialBearingTo(this)+180;return c.wrap360(e)}midpointTo(t){t instanceof d||(t=d.parse(t));const e=this.lat.toRadians(),a=this.lon.toRadians(),r=t.lat.toRadians(),n=(t.lon-this.lon).toRadians(),i=Math.cos(e),o=0,s=Math.sin(e),l={x:i+Math.cos(r)*Math.cos(n),y:o+Math.cos(r)*Math.sin(n),z:s+Math.sin(r)},h=Math.atan2(l.z,Math.sqrt(l.x*l.x+l.y*l.y)),c=a+Math.atan2(l.y,l.x),u=h.toDegrees(),g=c.toDegrees();return new d(u,g)}intermediatePointTo(t,e){if(t instanceof d||(t=d.parse(t)),this.equals(t))return new d(this.lat,this.lon);const a=this.lat.toRadians(),r=this.lon.toRadians(),n=t.lat.toRadians(),i=t.lon.toRadians(),o=n-a,s=i-r,l=Math.sin(o/2)*Math.sin(o/2)+Math.cos(a)*Math.cos(n)*Math.sin(s/2)*Math.sin(s/2),h=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),c=Math.sin((1-e)*h)/Math.sin(h),u=Math.sin(e*h)/Math.sin(h),g=c*Math.cos(a)*Math.cos(r)+u*Math.cos(n)*Math.cos(i),p=c*Math.cos(a)*Math.sin(r)+u*Math.cos(n)*Math.sin(i),m=c*Math.sin(a)+u*Math.sin(n),y=Math.atan2(m,Math.sqrt(g*g+p*p)),f=Math.atan2(p,g),v=y.toDegrees(),M=f.toDegrees();return new d(v,M)}destinationPoint(t,e,a=6371e3){const r=t/a,n=Number(e).toRadians(),i=this.lat.toRadians(),o=this.lon.toRadians(),s=Math.sin(i)*Math.cos(r)+Math.cos(i)*Math.sin(r)*Math.cos(n),l=Math.asin(s),h=Math.sin(n)*Math.sin(r)*Math.cos(i),c=Math.cos(r)-Math.sin(i)*s,u=o+Math.atan2(h,c),g=l.toDegrees(),p=u.toDegrees();return new d(g,p)}static intersection(t,e,a,r){if(t instanceof d||(t=d.parse(t)),a instanceof d||(a=d.parse(a)),isNaN(e))throw new TypeError(`invalid brng1 ‘${e}’`);if(isNaN(r))throw new TypeError(`invalid brng2 ‘${r}’`);const n=t.lat.toRadians(),i=t.lon.toRadians(),o=a.lat.toRadians(),s=a.lon.toRadians(),l=Number(e).toRadians(),h=Number(r).toRadians(),c=o-n,g=s-i,p=2*Math.asin(Math.sqrt(Math.sin(c/2)*Math.sin(c/2)+Math.cos(n)*Math.cos(o)*Math.sin(g/2)*Math.sin(g/2)));if(Math.abs(p)<Number.EPSILON)return new d(t.lat,t.lon);const m=(Math.sin(o)-Math.sin(n)*Math.cos(p))/(Math.sin(p)*Math.cos(n)),y=(Math.sin(n)-Math.sin(o)*Math.cos(p))/(Math.sin(p)*Math.cos(o)),f=Math.acos(Math.min(Math.max(m,-1),1)),v=Math.acos(Math.min(Math.max(y,-1),1)),M=l-(Math.sin(s-i)>0?f:2*u-f),b=(Math.sin(s-i)>0?2*u-v:v)-h;if(0==Math.sin(M)&&0==Math.sin(b))return null;if(Math.sin(M)*Math.sin(b)<0)return null;const w=-Math.cos(M)*Math.cos(b)+Math.sin(M)*Math.sin(b)*Math.cos(p),I=Math.atan2(Math.sin(p)*Math.sin(M)*Math.sin(b),Math.cos(b)+Math.cos(M)*w),x=Math.asin(Math.min(Math.max(Math.sin(n)*Math.cos(I)+Math.cos(n)*Math.sin(I)*Math.cos(l),-1),1)),S=i+Math.atan2(Math.sin(l)*Math.sin(I)*Math.cos(n),Math.cos(I)-Math.sin(n)*Math.sin(x)),P=x.toDegrees(),N=S.toDegrees();return new d(P,N)}crossTrackDistanceTo(t,e,a=6371e3){t instanceof d||(t=d.parse(t)),e instanceof d||(e=d.parse(e));const r=a;if(this.equals(t))return 0;const n=t.distanceTo(this,r)/r,i=t.initialBearingTo(this).toRadians(),o=t.initialBearingTo(e).toRadians();return Math.asin(Math.sin(n)*Math.sin(i-o))*r}alongTrackDistanceTo(t,e,a=6371e3){t instanceof d||(t=d.parse(t)),e instanceof d||(e=d.parse(e));const r=a;if(this.equals(t))return 0;const n=t.distanceTo(this,r)/r,i=t.initialBearingTo(this).toRadians(),o=t.initialBearingTo(e).toRadians(),s=Math.asin(Math.sin(n)*Math.sin(i-o));return Math.acos(Math.cos(n)/Math.abs(Math.cos(s)))*Math.sign(Math.cos(o-i))*r}maxLatitude(t){const e=Number(t).toRadians(),a=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(e)*Math.cos(a))).toDegrees()}static crossingParallels(t,e,a){if(t.equals(e))return null;const r=Number(a).toRadians(),n=t.lat.toRadians(),i=t.lon.toRadians(),o=e.lat.toRadians(),s=e.lon.toRadians()-i,l=Math.sin(n)*Math.cos(o)*Math.cos(r)*Math.sin(s),h=Math.sin(n)*Math.cos(o)*Math.cos(r)*Math.cos(s)-Math.cos(n)*Math.sin(o)*Math.cos(r),u=Math.cos(n)*Math.cos(o)*Math.sin(r)*Math.sin(s);if(u*u>l*l+h*h)return null;const d=Math.atan2(-h,l),g=Math.acos(u/Math.sqrt(l*l+h*h)),p=i+d+g,m=(i+d-g).toDegrees(),y=p.toDegrees();return{lon1:c.wrap180(m),lon2:c.wrap180(y)}}rhumbDistanceTo(t,e=6371e3){t instanceof d||(t=d.parse(t));const a=e,r=this.lat.toRadians(),n=t.lat.toRadians(),i=n-r;let o=Math.abs(t.lon-this.lon).toRadians();Math.abs(o)>u&&(o=o>0?-(2*u-o):2*u+o);const s=Math.log(Math.tan(n/2+u/4)/Math.tan(r/2+u/4)),l=Math.abs(s)>1e-11?i/s:Math.cos(r);return Math.sqrt(i*i+l*l*o*o)*a}rhumbBearingTo(t){if(t instanceof d||(t=d.parse(t)),this.equals(t))return NaN;const e=this.lat.toRadians(),a=t.lat.toRadians();let r=(t.lon-this.lon).toRadians();Math.abs(r)>u&&(r=r>0?-(2*u-r):2*u+r);const n=Math.log(Math.tan(a/2+u/4)/Math.tan(e/2+u/4)),i=Math.atan2(r,n).toDegrees();return c.wrap360(i)}rhumbDestinationPoint(t,e,a=6371e3){const r=this.lat.toRadians(),n=this.lon.toRadians(),i=Number(e).toRadians(),o=t/a,s=o*Math.cos(i);let l=r+s;Math.abs(l)>u/2&&(l=l>0?u-l:-u-l);const h=Math.log(Math.tan(l/2+u/4)/Math.tan(r/2+u/4)),c=Math.abs(h)>1e-11?s/h:Math.cos(r),g=n+o*Math.sin(i)/c,p=l.toDegrees(),m=g.toDegrees();return new d(p,m)}rhumbMidpointTo(t){t instanceof d||(t=d.parse(t));const e=this.lat.toRadians();let a=this.lon.toRadians();const r=t.lat.toRadians(),n=t.lon.toRadians();Math.abs(n-a)>u&&(a+=2*u);const i=(e+r)/2,o=Math.tan(u/4+e/2),s=Math.tan(u/4+r/2),l=Math.tan(u/4+i/2);let h=((n-a)*Math.log(l)+a*Math.log(s)-n*Math.log(o))/Math.log(s/o);isFinite(h)||(h=(a+n)/2);const c=i.toDegrees(),g=h.toDegrees();return new d(c,g)}static areaOf(t,e=6371e3){const a=e,r=t[0].equals(t[t.length-1]);r||t.push(t[0]);const n=t.length-1;let i=0;for(let e=0;e<n;e++){const a=t[e].lat.toRadians(),r=t[e+1].lat.toRadians(),n=(t[e+1].lon-t[e].lon).toRadians();i+=2*Math.atan2(Math.tan(n/2)*(Math.tan(a/2)+Math.tan(r/2)),1+Math.tan(a/2)*Math.tan(r/2))}(function(t){let e=0,a=t[0].initialBearingTo(t[1]);for(let r=0;r<t.length-1;r++){const n=t[r].initialBearingTo(t[r+1]),i=t[r].finalBearingTo(t[r+1]);e+=(n-a+540)%360-180,e+=(i-n+540)%360-180,a=i}const r=t[0].initialBearingTo(t[1]);e+=(r-a+540)%360-180;return Math.abs(e)<90})(t)&&(i=Math.abs(i)-2*u);const o=Math.abs(i*a*a);return r||t.pop(),o}equals(t){return t instanceof d||(t=d.parse(t)),!(Math.abs(this.lat-t.lat)>Number.EPSILON)&&!(Math.abs(this.lon-t.lon)>Number.EPSILON)}toGeoJSON(){return{type:"Point",coordinates:[this.lon,this.lat]}}toString(t="d",e=void 0){if(!["d","dm","dms","n"].includes(t))throw new RangeError(`invalid format ‘${t}’`);if("n"==t)return null==e&&(e=4),`${this.lat.toFixed(e)},${this.lon.toFixed(e)}`;return`${c.toLat(this.lat,t,e)}, ${c.toLon(this.lon,t,e)}`}}function g(t,e,a){if(null!==t)for(var r,n,i,o,s,l,h,c,u=0,d=0,p=t.type,m="FeatureCollection"===p,y="Feature"===p,f=m?t.features.length:1,v=0;v<f;v++){s=(c=!!(h=m?t.features[v].geometry:y?t.geometry:t)&&"GeometryCollection"===h.type)?h.geometries.length:1;for(var M=0;M<s;M++){var b=0,w=0;if(null!==(o=c?h.geometries[M]:h)){l=o.coordinates;var I=o.type;switch(u=0,I){case null:break;case"Point":if(!1===e(l,d,v,b,w))return!1;d++,b++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(!1===e(l[r],d,v,b,w))return!1;d++,"MultiPoint"===I&&b++}"LineString"===I&&b++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(n=0;n<l[r].length-u;n++){if(!1===e(l[r][n],d,v,b,w))return!1;d++}"MultiLineString"===I&&b++,"Polygon"===I&&w++}"Polygon"===I&&b++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(w=0,n=0;n<l[r].length;n++){for(i=0;i<l[r][n].length-u;i++){if(!1===e(l[r][n][i],d,v,b,w))return!1;d++}w++}b++}break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===g(o.geometries[r],e))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}var p=function(t,e={}){if(null!=t.bbox&&!0!==e.recompute)return t.bbox;const a=[1/0,1/0,-1/0,-1/0];return g(t,t=>{a[0]>t[0]&&(a[0]=t[0]),a[1]>t[1]&&(a[1]=t[1]),a[2]<t[0]&&(a[2]=t[0]),a[3]<t[1]&&(a[3]=t[1])}),a},m=(t,e)=>{var[a,r]=t,[n,i]=e,o=new d(r,a),s=new d(i,n);return o.distanceTo(s)},y=t=>{var e=t/1609.344;if(e<.5){var a=Math.round(t),r=1===a?"metre":"metres";return"".concat(a," ").concat(r)}if(e<10){var n=Number.parseFloat(e.toFixed(1)),i=1===n?"mile":"miles";return"".concat(n," ").concat(i)}var o=Math.round(e);return"".concat(o," miles")},f=t=>p(t);function v(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,r)}return a}function M(e){for(var a=1;a<arguments.length;a++){var r=null!=arguments[a]?arguments[a]:{};a%2?v(Object(r),!0).forEach(function(a){t(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var b="highlighted-label";function w(t,e){if("number"==typeof t)return t;if(!Array.isArray(t)||"interpolate"!==t[0])return function(t,e){var{stops:a}=t;if(a.length<2)return a.length>0?a[0][1]:0;for(var r=a[0],n=a[a.length-1],i=1;i<a.length;i++){var o=a[i];if(o[0]>e){n=o,r=a[i-1];break}r=a[i-1],n=o}var[s,l]=r,[h,c]=n;return e<=s?l:e>=h?c:l+(e-s)/(h-s)*(c-l)}(t,e);var[,,a,...r]=t;if("zoom"!==a[0])throw new Error("Only zoom-based expressions supported");for(var n=0;n<r.length-2;n+=2){var i=r[n],o=r[n+1],s=r[n+2],l=r[n+3];if(e<=i)return o;if(e<=s)return o+(e-i)/(s-i)*(l-o)}return r[r.length-1]}function I(t,e,a){return e.flatMap(e=>{var r,n=function(t){var e,a;return"string"==typeof t?null===(e=/^{(.+)}$/.exec(t))||void 0===e?void 0:e[1]:Array.isArray(t)?null===(a=t.find(t=>Array.isArray(t)&&"get"===t[0]))||void 0===a?void 0:a[1]:null}(null===(r=e.layout)||void 0===r?void 0:r["text-field"]);return n?a.filter(t=>{var a;return t.layer.id===e.id&&(null===(a=t.properties)||void 0===a?void 0:a[n])}).map(a=>function(t,e,a,r){var n=function(t){var{type:e,coordinates:a}=t;if("Point"===e)return a;if("MultiPoint"===e)return a[0];if(e.includes("LineString")){var r="LineString"===e?a:a[0];return[(r[0][0]+r[r.length-1][0])/2,(r[0][1]+r[r.length-1][1])/2]}if(e.includes("Polygon")){var n="Polygon"===e?a[0]:a[0][0],i=n.reduce((t,e)=>[t[0]+e[0],t[1]+e[1]],[0,0]);return[i[0]/n.length,i[1]/n.length]}return null}(t.geometry);if(!n)return null;var i=r.project({lng:n[0],lat:n[1]});return{text:t.properties[a],x:i.x,y:i.y,feature:t,layer:e}}(a,e,n,t)).filter(Boolean):[]})}function x(t,e){if(e.highlightLayerId&&t.getLayer(e.highlightLayerId)){try{t.removeLayer(e.highlightLayerId)}catch(t){}e.highlightLayerId=null,e.highlightedExpr=null}}function S(t,e,a){var r;if(null!=e&&null!==(r=e.feature)&&void 0!==r&&r.layer){x(t,a);var{feature:n,layer:i}=e;a.highlightLayerId="highlight-".concat(i.id);var{id:o,type:s,properties:l,geometry:h}=n;t.getSource(b).setData({id:o,type:s,properties:l,geometry:h}),a.highlightedExpr=i.layout["text-size"];var c=t.getZoom(),u=function(t,e,a){return{id:"highlight-".concat(t.id),type:t.type,source:b,layout:M(M({},t.layout),{},{"text-size":e,"text-allow-overlap":!0,"text-ignore-placement":!0,"text-max-angle":90}),paint:M(M({},t.paint),{},{"text-color":a.text,"text-halo-color":a.halo,"text-halo-width":3,"text-halo-blur":1,"text-opacity":1})}}(i,1.5*w(a.highlightedExpr,c),a.isDarkStyle?{text:"#ffffff",halo:"#000000"}:{text:"#000000",halo:"#ffffff"});t.addLayer(u),t.moveLayer(a.highlightLayerId)}}function P(t,e){if(!e.currentPixel)return null;var a=e.labels.map((t,e)=>({pixel:[t.x,t.y],index:e})).filter(t=>t.pixel[0]!==e.currentPixel.x||t.pixel[1]!==e.currentPixel.y);if(!a.length)return null;var r=a.map(t=>t.pixel),n=((t,e,a)=>{var r=(t,e)=>t[0]===e[0]&&t[1]===e[1],n=e.filter(e=>{var n=Math.abs(e[0]-t[0]),i=Math.abs(e[1]-t[1]);return("ArrowUp"===a?e[1]<=t[1]&&i>=n:"ArrowDown"===a?e[1]>t[1]&&i>=n:"ArrowLeft"===a?e[0]<=t[0]&&i<n:"ArrowRight"!==a||e[0]>t[0]&&i<n)&&!r(e,t)});n.length||n.push(t);var i=e=>Math.hypot(t[0]-e[0],t[1]-e[1]),o=n.reduce((t,e)=>i(e)<i(t)?e:t,n[0]);return e.findIndex(t=>r(t,o))})([e.currentPixel.x,e.currentPixel.y],r,t);return(null==n||n<0||n>=a.length)&&(n=0),e.labels[a[n].index]}function N(t){t.getSource(b)||t.addSource(b,{type:"geojson",data:{type:"FeatureCollection",features:[]}})}function E(t){t.getStyle().layers.filter(t=>{var e;return"line"===(null===(e=t.layout)||void 0===e?void 0:e["symbol-placement"])}).forEach(e=>t.setLayoutProperty(e.id,"symbol-placement","line-center"))}var L=t=>t.endsWith(".cold")?"".concat(t.slice(0,-5),".hot"):t.endsWith(".hot")?"".concat(t.slice(0,-4),".cold"):null;function R(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,r)}return a}function O(e){for(var a=1;a<arguments.length;a++){var r=null!=arguments[a]?arguments[a]:{};a%2?R(Object(r),!0).forEach(function(a){t(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var T="icon-image",A="active-highlight",D="active-highlight-inner",j="selected-highlight",_=(t,e)=>"active"===e?{property:"user_symbolActiveImageId",getImageId:e=>{var a;return null!==(a=null==t?void 0:t.getActiveImageId(e))&&void 0!==a?a:null}}:{property:"user_symbolSelectedImageId",getImageId:e=>{var a;return null!==(a=null==t?void 0:t.getSelectedImageId(e))&&void 0!==a?a:null}},C=(t,e,a,r)=>{var{featureId:n,idProperty:i,geometry:o}=r,s=t.getLayer(a);s&&(e[a]||(e[a]={ids:new Set,fillIds:new Set,idProperty:i,sourceId:s.source,hasFillGeometry:!1}),!o||"Polygon"!==o.type&&"MultiPolygon"!==o.type||(e[a].hasFillGeometry=!0,e[a].fillIds.add(n)),e[a].ids.add(n))},B=(t,e,a,r)=>{e.forEach(e=>{if(!a.has(e)){var n="".concat(r,"-").concat(e);["".concat(n,"-fill"),"".concat(n,"-line"),"".concat(n,"-symbol")].forEach(e=>{t.getLayer(e)&&t.setFilter(e,["==","id",""])})}})},F=(t,e)=>{var a="_".concat(e.replaceAll("-",""),"Sources");B(t,t[a]||new Set,new Set,e),t[a]=new Set},k=(t,e,a,r,n,i,o)=>{!!t.getLayer(e)||t.addLayer(O(O({id:e,type:a,source:r},n&&{"source-layer":n}),{},{paint:i})),Object.entries(i).forEach(a=>{var[r,n]=a;t.setPaintProperty(e,r,n)}),t.setFilter(e,o),t.moveLayer(e)},z=(t,e,a,r,n,i,o)=>{var s,l=t.getLayoutProperty(n,"icon-offset");t.getLayer(e)||t.addLayer(O(O({id:e,type:"symbol",source:a},r&&{"source-layer":r}),{},{layout:O(O({[T]:i,"icon-anchor":null!==(s=t.getLayoutProperty(n,"icon-anchor"))&&void 0!==s?s:"center"},void 0!==l&&{"icon-offset":l}),{},{"icon-allow-overlap":!0})}));t.setLayoutProperty(e,T,i),void 0!==l&&t.setLayoutProperty(e,"icon-offset",l),t.setFilter(e,o),t.moveLayer(e)},W=(t,e,a,r,n,i)=>{var o,{ids:s,fillIds:l,idProperty:h,sourceId:c,hasFillGeometry:u}=a[e],d=t.getLayer(e),g=null!==(o=r[e])&&void 0!==o?o:r[L(e)];if(d&&g){var p=d.sourceLayer,m=u?"fill":d.type,y="".concat(n,"-").concat(e),{fill:f}=g,v=n===j,M=(t=>t===j||t===D)(n),{lineColor:b,lineWidth:w}=((t,e)=>({lineColor:e?t.selectionStroke:t.stroke,lineWidth:e?t.strokeWidth:t.activeStrokeWidth}))(g,M),I=h?["get",h]:["id"],x=["in",I,["literal",Array.from(s)]];if("fill-extrusion"!==d.type)switch(m){case"fill":((t,e,a,r,n)=>{var{isSelected:i,idExpression:o,fillIds:s,fill:l,lineColor:h,lineWidth:c,filter:u}=n;if(i){var d=[];s.forEach(t=>d.push(t));var g=["in",o,["literal",d]];k(t,"".concat(e,"-fill"),"fill",a,r,{"fill-color":l},g)}k(t,"".concat(e,"-line"),"line",a,r,{"line-color":h,"line-width":c},u)})(t,y,c,p,{isSelected:v,idExpression:I,fillIds:l,fill:f,lineColor:b,lineWidth:w,filter:x});break;case"line":((t,e,a,r,n,i,o)=>{t.getLayer("".concat(e,"-fill"))&&t.setFilter("".concat(e,"-fill"),["==","id",""]),k(t,"".concat(e,"-line"),"line",a,r,{"line-color":n,"line-width":i},o)})(t,y,c,p,b,w,x);break;case"symbol":((t,e,a,r,n,i,o)=>{var s=t.getLayoutProperty(n,T);if(Array.isArray(s))z(t,"".concat(e,"-symbol"),a,r,n,["get",o.property],i);else{var l=o.getImageId(s);l&&z(t,"".concat(e,"-symbol"),a,r,n,l,i)}})(t,y,c,p,e,x,i)}else((t,e,a,r)=>{var{ids:n,lineColor:i,lineWidth:o,idExpression:s}=r,l=[];n.forEach(t=>l.push(t));var h=["in",s,["literal",l]],{source:c,sourceLayer:u}=t.getLayer(a);k(t,"".concat(e,"-line"),"line",c,u,{"line-color":i,"line-width":o},h)})(t,y,e,{ids:s,lineColor:b,lineWidth:w,idExpression:I})}},q=(t,e,a,r,n)=>{var i=((t,e)=>{var a={};return null==e||e.forEach(e=>{C(t,a,e.layerId,e);var r=L(e.layerId);r&&C(t,a,r,e)}),a})(t,e),o=new Set(Object.keys(i)),s="_".concat(r.replaceAll("-",""),"Sources"),l=t[s]||new Set;return B(t,l,o,r),t[s]=o,o.forEach(e=>W(t,e,i,a,r,n)),i};var $=(t,e,a)=>{var r=(e.x-a.x)**2+(e.y-a.y)**2;if(0===r)return(t.x-e.x)**2+(t.y-e.y)**2;var n=((t.x-e.x)*(a.x-e.x)+(t.y-e.y)*(a.y-e.y))/r;return n=Math.max(0,Math.min(1,n)),(t.x-(e.x+n*(a.x-e.x)))**2+(t.y-(e.y+n*(a.y-e.y)))**2},Z=function(t,e){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{radius:r=10}=a,n=[[e.x-r,e.y-r],[e.x+r,e.y+r]],i=t.queryRenderedFeatures(n);if(0===i.length)return[];var o=new Set(t.queryRenderedFeatures([e.x,e.y]).map(t=>{var e,a=void 0===t.id?JSON.stringify(t.properties):t.id;return"".concat(null===(e=t.layer)||void 0===e?void 0:e.source,":").concat(a)})),s=[];i.forEach(t=>{!1===s.includes(t.layer.id)&&s.push(t.layer.id)});for(var l=new Set,h=[],c=i.length-1;c>=0;c--){var u,d=i[c],g=void 0===d.id?JSON.stringify(d.properties):d.id,p="".concat(null===(u=d.layer)||void 0===u?void 0:u.source,":").concat(g);!1===l.has(p)&&(l.add(p),h.push(d))}var m=t.unproject(e),y=[m.lng,m.lat],f=h.filter(t=>{var e=t.geometry.type;if(e.includes("Polygon"))return("Polygon"===e?[t.geometry.coordinates]:t.geometry.coordinates).some(t=>((t,e)=>{for(var[a,r]=t,n=!1,i=0,o=e.length-1;i<e.length;o=i,i++){var[s,l]=e[i],[h,c]=e[o];l>r!=c>r&&a<(h-s)*(r-l)/(c-l)+s&&(n=!n)}return n})(y,t[0]));if("Point"===e||"MultiPoint"===e){var a,r=void 0===t.id?JSON.stringify(t.properties):t.id;return o.has("".concat(null===(a=t.layer)||void 0===a?void 0:a.source,":").concat(r))}return!0});return f.map(a=>{var r=0,n=a.geometry.type,i=((t,e,a)=>{var{coordinates:r,type:n}=a,i=1/0,o=e=>t.project(e),s=t=>{for(var a=0;a<t.length-1;a++){var r=$(e,o(t[a]),o(t[a+1]));r<i&&(i=r)}};if("Point"===n){var l=o(r);i=(e.x-l.x)**2+(e.y-l.y)**2}else"LineString"===n||"MultiPoint"===n?"LineString"===n?s(r):r.forEach(t=>{var a=o(t),r=(e.x-a.x)**2+(e.y-a.y)**2;r<i&&(i=r)}):"Polygon"===n||"MultiLineString"===n?r.forEach(s):"MultiPolygon"===n&&r.forEach(t=>t.forEach(s));return i})(t,e,a.geometry);return r+=1e6*s.indexOf(a.layer.id),n.includes("Polygon")&&(r-=5e5),{f:a,score:r+=i}}).sort((t,e)=>t.score-e.score).map(t=>{var{f:e}=t;return e})},G=(t,e,a)=>{var r=t.getCanvas();if(a&&t.off("mousemove",a),null==e||!e.length)return r.style.cursor="",null;var n=a=>{var n=(t=>{var e=new Set(t);return t.forEach(t=>{var a=L(t);a&&e.add(a)}),[...e]})(e).filter(e=>t.getLayer(e));if(0!==n.length){var{lineLayers:i,otherLayers:o}=((t,e)=>{var a=[],r=[];for(var n of e)if("line"===t.getLayer(n).type){var i=n.endsWith("-stroke")?n.slice(0,-7):null;null!==i&&e.includes(i)||a.push(n)}else r.push(n);return{lineLayers:a,otherLayers:r}})(t,n),{x:s,y:l}=a.point,h=[[s-10,l-10],[s+10,l+10]],c=i.length>0&&t.queryRenderedFeatures(h,{layers:i}).length>0,u=o.length>0&&t.queryRenderedFeatures(a.point,{layers:o}).length>0;r.style.cursor=c||u?"pointer":""}else r.style.cursor=""};return t.on("mousemove",n),n};class H{constructor(){t(this,"sets",new Map)}add(t,e){var a,r=null!==(a=this.sets.get(t))&&void 0!==a?a:new Set;this.sets.delete(t),this.sets.set(t,r),e.forEach(t=>r.add(t));for(var n=new Set;this.sets.size>2;){var[i,o]=this.sets.entries().next().value;this.sets.delete(i),o.forEach(t=>n.add(t))}return this.sets.forEach(t=>t.forEach(t=>n.delete(t))),Array.from(n)}}var J=.25,V=.75,Y=t=>{var[e,a]=t,r=(t=>t<=J?"left":t>=V?"right":"")(e),n=(t=>t<=J?"top":t>=V?"bottom":"")(a);return n+(r&&n?"-":"")+r||"center"},K=t=>t<=J?0:t>=V?1:.5,U=t=>Math.round(100*t)/100,X=(t,e)=>{var[a,r]=t,[,,n,i]=e.split(" ").map(Number);return[U((K(a)-a)*n),U((K(r)-r)*i)]};class Q{constructor(e){t(this,"activeImageIds",new Map),t(this,"selectedImageIds",new Map),t(this,"recentImageSets",new H),this.map=e}getActiveImageId(t){var e;return null!==(e=this.activeImageIds.get(t))&&void 0!==e?e:null}getSelectedImageId(t){var e;return null!==(e=this.selectedImageIds.get(t))&&void 0!==e?e:null}removeImage(t){this.map.hasImage(t)&&this.map.removeImage(t),this.activeImageIds.delete(t),this.selectedImageIds.delete(t)}registerSymbols(t,e,r,n){var i=this;return a(function*(){var{map:o}=i,s=yield Promise.all(t.map(function(){var t=a(function*(t){var s=r.getSymbolImageIds(t,e,n);return s?(i.activeImageIds.set(s.normal,s.active),i.selectedImageIds.set(s.normal,s.selected),yield Promise.all(Object.entries(s).map(function(){var i=a(function*(a){var[i,s]=a;if(!o.hasImage(s)){var l=yield r.rasteriseSymbolImage(t,e,i,n);l&&!o.hasImage(l.imageId)&&o.addImage(l.imageId,l.imageData,{pixelRatio:n})}});return function(t){return i.apply(this,arguments)}}())),Object.values(s)):[]});return function(e){return t.apply(this,arguments)}}()));i.recentImageSets.add("".concat(null==e?void 0:e.id,"|").concat(n),s.flat()).forEach(t=>i.removeImage(t))})()}}class tt{constructor(e){t(this,"recentImageSets",new H),this.map=e}registerPatterns(t,e,r,n){var i=this;return a(function*(){var{map:o}=i,s=new Map;t.forEach(t=>{var a=r.getPatternImageId(t,e,n);a&&!s.has(a)&&s.set(a,t)});var l=(t=>Math.max(2,2*t))(n);yield Promise.all(Array.from(s,function(){var t=a(function*(t){var[a,i]=t;if(!o.hasImage(a)){var s=yield r.rasterisePatternImage(i,e,n);s&&!o.hasImage(s.imageId)&&o.addImage(s.imageId,s.imageData,{pixelRatio:l})}});return function(e){return t.apply(this,arguments)}}())),i.recentImageSets.add("".concat(e,"|").concat(n),Array.from(s.keys())).forEach(t=>{o.hasImage(t)&&o.removeImage(t)})})()}}var et=["container","padding","mapStyle","mapSize","center","zoom","bounds","pixelRatio"];function at(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,r)}return a}function rt(e){for(var a=1;a<arguments.length;a++){var r=null!=arguments[a]?arguments[a]:{};a%2?at(Object(r),!0).forEach(function(a){t(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):at(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}class nt extends r{constructor(t){var{mapFramework:e,mapProviderConfig:a={},events:r,eventBus:n}=t;super(),this.maplibreModule=e,this.events=r,this.eventBus=n,this.capabilities={supportedShortcuts:o,supportsMapSizes:!0},Object.assign(this,a)}get name(){return"MapLibreProvider"}initMap(t){var r=this;return a(function*(){var{container:a,padding:n,mapStyle:i,mapSize:o,center:s,zoom:h,bounds:c,pixelRatio:u}=t,d=e(t,et);r.mapStyleId=null==i?void 0:i.id,r.mapSize=o;var{Map:g}=r.maplibreModule,{events:p,eventBus:m}=r,y=new g(rt(rt({},d),{},{container:a,style:null==i?void 0:i.url,pixelRatio:u,padding:n,center:s,zoom:h,fadeDuration:0,attributionControl:!1,dragRotate:!1,doubleClickZoom:!1}));y.touchZoomRotate.disableRotation(),r.map=y,r.symbolImages=new Q(y),r.patternImages=new tt(y),r.map.setPadding(n),c&&y.fitBounds(c,{duration:0}),function(t){var e=Event.prototype.preventDefault;Event.prototype.preventDefault=function(){if(("touchmove"===this.type||"touchstart"===this.type)&&!this.cancelable){var a=t.getCanvas();if(a&&(this.target===a||a.contains(this.target)))return}e.call(this)}}(y),function(t){var e=t.getCanvas();e.removeAttribute("role"),e.setAttribute("tabindex",-1),e.removeAttribute("aria-label"),e.style.display="block",e.addEventListener("focus",t=>{e.blur(),t.relatedTarget&&t.relatedTarget.focus({preventScroll:!0})})}(y),l({map:y,events:p,eventBus:m,getCenter:r.getCenter.bind(r),getZoom:r.getZoom.bind(r),getBounds:r.getBounds.bind(r),getResolution:r.getResolution.bind(r)}),function(t){var{mapProvider:e,map:a,events:r,eventBus:n}=t,i=t=>{a.once("style.load",()=>{n.emit(r.MAP_STYLE_CHANGE,{mapStyleId:t.id})}),a.setStyle(t.url,{diff:!1})},o=t=>{a.setPixelRatio(t)},s=t=>{var{mapSize:a}=t;e.mapSize=a};n.on(r.MAP_SET_STYLE,i),n.on(r.MAP_SET_PIXEL_RATIO,o),n.on(r.MAP_SIZE_CHANGE,s)}({mapProvider:r,map:y,events:p,eventBus:m}),y.on("load",()=>{r.labelNavigator=function(t,e,a,r){var n={isDarkStyle:"dark"===e,labels:[],currentPixel:null,highlightLayerId:null,highlightedExpr:null};function i(){var e=t.getStyle().layers.filter(t=>"symbol"===t.type),a=t.queryRenderedFeatures({layers:e.map(t=>t.id)});n.labels=I(t,e,a)}function o(){if(i(),!n.labels.length)return null;var e=t.project(t.getCenter()),a=function(t,e){var a;return null===(a=t.reduce((t,a)=>{var r=(a.x-e.x)**2+(a.y-e.y)**2;return!t||r<t.dist?{label:a,dist:r}:t},null))||void 0===a?void 0:a.label}(n.labels,e);return n.currentPixel={x:a.x,y:a.y},S(t,a,n),a.text}return E(t),N(t),null==r||r.on(a.MAP_SET_STYLE,e=>{t.once("styledata",()=>t.once("idle",()=>{E(t),N(t),n.isDarkStyle="dark"===(null==e?void 0:e.mapColorScheme)}))}),t.on("zoom",()=>{if(n.highlightLayerId&&n.highlightedExpr){var e=w(n.highlightedExpr,t.getZoom());t.setLayoutProperty(n.highlightLayerId,"text-size",1.5*e)}}),function(t){t.getStyle().layers.filter(t=>"symbol"===t.type).forEach(e=>{t.setPaintProperty(e.id,"text-opacity",["case",["boolean",["feature-state","highlighted"],!1],0,1])})}(t),{refreshLabels:i,highlightNextLabel:function(e){if(i(),!n.labels.length)return null;if(!n.currentPixel)return o();var a=P(e,n);return a?(n.currentPixel={x:a.x,y:a.y},S(t,a,n),a.text):null},highlightLabelAtCenter:o,clearHighlightedLabel:()=>x(t,n)}}(y,null==i?void 0:i.mapColorScheme,p,m)}),r.eventBus.emit(p.MAP_READY,{map:r.map,mapStyleId:r.mapStyleId,mapSize:r.mapSize,crs:r.crs})})()}isBaseMapReady(){var t;return Boolean(null===(t=this.map)||void 0===t?void 0:t.getStyle())}destroyMap(){var t,e;this.setHoverCursor([]),null===(t=this.mapEvents)||void 0===t||t.remove(),null===(e=this.appEvents)||void 0===e||e.remove(),this.mapEvents=null,this.appEvents=null,this.map.remove()}setHoverCursor(t){this.map&&(this._onHoverMove=G(this.map,t,this._onHoverMove))}setView(t){var{center:e,zoom:a}=t;this.map.flyTo({center:e||this.getCenter(),zoom:a||this.getZoom(),duration:this.map.isStyleLoaded()?n:0})}zoomIn(t){this.map.easeTo({zoom:this.getZoom()+t,duration:n})}zoomOut(t){this.map.easeTo({zoom:this.getZoom()-t,duration:n})}panBy(t){this.map.panBy(t,{duration:n})}fitToBounds(t){var e=Array.isArray(t)?t:f(t),a=this.map.isStyleLoaded()?n:0;this.map.fitBounds(e,{duration:a})}setPadding(t){this.map.setPadding(t)}updateHighlightedFeatures(t,e,a){var{LngLatBounds:r}=this.maplibreModule;return function(t){var{LngLatBounds:e,map:a,selectedFeatures:r,activeFeatures:n,stylesMap:i,symbolImages:o}=t;if(!a)return null;var s=_(o,"active"),l=_(o,"selected");null!=n&&n.length?(q(a,n,i,A,s),q(a,n,i,D,l)):(F(a,A),F(a,D));var h={};null!=r&&r.length?h=q(a,r,i,j,l):F(a,j);var c=[];return Object.entries(h).forEach(t=>{var[e,{ids:r,idProperty:n}]=t;c.push(...a.queryRenderedFeatures({layers:[e]}).filter(t=>{var e;return r.has(n?null===(e=t.properties)||void 0===e?void 0:e[n]:t.id)}))}),((t,e)=>{if(!e.length)return null;var a=new t;return e.forEach(t=>{var e=t=>"number"==typeof t[0]?a.extend(t):t.forEach(e);e(t.geometry.coordinates)}),[a.getWest(),a.getSouth(),a.getEast(),a.getNorth()]})(e,c)}({LngLatBounds:r,map:this.map,selectedFeatures:t,activeFeatures:e,stylesMap:a,symbolImages:this.symbolImages})}highlightNextLabel(t){var e;return(null===(e=this.labelNavigator)||void 0===e?void 0:e.highlightNextLabel(t))||null}highlightLabelAtCenter(){var t;return(null===(t=this.labelNavigator)||void 0===t?void 0:t.highlightLabelAtCenter())||null}clearHighlightedLabel(){var t;return(null===(t=this.labelNavigator)||void 0===t?void 0:t.clearHighlightedLabel())||null}getCenter(){var t=this.map.getCenter();return[Number(t.lng.toFixed(i)),Number(t.lat.toFixed(i))]}getZoom(){return Number(this.map.getZoom().toFixed(i))}getBounds(){return this.map.getBounds().toArray().flat(1)}getFeaturesAtPoint(t,e){return Z(this.map,t,e)}getVisibleFeatures(t){var e=t.filter(t=>this.map.getLayer(t));return e.length?this.map.queryRenderedFeatures(void 0,{layers:e}):[]}addSymbolsToMap(t,e,r){var n=arguments,i=this;return a(function*(){var a=n.length>3&&void 0!==n[3]?n[3]:i.map.getPixelRatio()||1;return i.symbolImages.registerSymbols(t,e,r,a)})()}getSymbolIconLayout(t){return(t=>{var{anchor:e,viewBox:a}=t;return{"icon-anchor":Y(e),"icon-offset":X(e,a)}})(t)}getActiveSymbolImageId(t){var e,a;return null!==(e=null===(a=this.symbolImages)||void 0===a?void 0:a.getActiveImageId(t))&&void 0!==e?e:null}getSelectedSymbolImageId(t){var e,a;return null!==(e=null===(a=this.symbolImages)||void 0===a?void 0:a.getSelectedImageId(t))&&void 0!==e?e:null}addPatternsToMap(t,e,r){var n=arguments,i=this;return a(function*(){var a=n.length>3&&void 0!==n[3]?n[3]:i.map.getPixelRatio()||1;return i.patternImages.registerPatterns(t,e,r,a)})()}getAreaDimensions(){var{LngLatBounds:t}=this.maplibreModule;return(t=>{var e,a,r,n;if(t&&"function"==typeof t.getWest)e=t.getWest(),a=t.getSouth(),r=t.getEast(),n=t.getNorth();else{if(!Array.isArray(t)||2!==t.length)return"";[[e,a],[r,n]]=t}var i=m([e,a],[r,a]),o=m([e,a],[e,n]),s=y(i),l=y(o);return"".concat(l," by ").concat(s)})(((t,e)=>{var{width:a,height:r}=e.getContainer().getBoundingClientRect(),n=e.getPadding(),i=[n.left,r-n.bottom],o=[a-n.right,n.top];return new t(e.unproject(i),e.unproject(o))})(t,this.map))}getCardinalMove(t,e){return((t,e)=>{var[a,r]=t,[n,i]=e,o=i-r,s=n-a,l=[];if(Math.abs(o)>1e-4){var h=Math.round(m([a,r],[a,i]));l.push("".concat(o>0?"north":"south"," ").concat(y(h)))}if(Math.abs(s)>1e-4){var c=Math.round(m([a,r],[n,r]));l.push("".concat(s>0?"east":"west"," ").concat(y(c)))}return l.join(", ")})(t,e)}getResolution(){return t=this.map.getCenter(),e=this.map.getZoom(),a=t.lat,r=Math.pow(2,e),40075016.686*Math.cos(a*Math.PI/180)/(512*r);var t,e,a,r}mapToScreen(t){return this.map.project(t)}screenToMap(t){var{lng:e,lat:a}=this.map.unproject([t.x,t.y]);return[e,a]}isGeometryObscured(t,e){return((t,e,a)=>{var r=a.getContainer().getBoundingClientRect(),[n,i,o,s]=f(t),l=[a.project([n,i]),a.project([n,s]),a.project([o,i]),a.project([o,s])],h=Math.min(...l.map(t=>t.x)),c=Math.max(...l.map(t=>t.x)),u=Math.min(...l.map(t=>t.y)),d=Math.max(...l.map(t=>t.y)),g=e.left-r.left,p=e.top-r.top,m=e.right-r.left,y=e.bottom-r.top;return h<m&&c>g&&u<y&&d>p})(t,e,this.map)}}export{nt as default};
1
+ class e{_notImplemented(e){throw new Error(`${this.name} must implement ${e}()`)}isBaseMapReady(){this._notImplemented("isBaseMapReady")}addSymbolsToMap(){this._notImplemented("addSymbolsToMap")}addPatternsToMap(){this._notImplemented("addPatternsToMap")}getActiveSymbolImageId(){this._notImplemented("getActiveSymbolImageId")}getSelectedSymbolImageId(){this._notImplemented("getSelectedSymbolImageId")}}const t=400,r=7,o=["showKeyboardHelp","selectControl","moveLarge","nudgeMap","zoomLarge","nudgeZoom","highlightLabelAtCenter","highlightNextLabel"];const n=(e,t)=>{let r=null;const o=(...o)=>{clearTimeout(r),r=setTimeout(()=>{e(...o)},t)};return o.cancel=()=>{r&&(clearTimeout(r),r=null)},o};function i({map:e,events:t,eventBus:r,getCenter:o,getZoom:i,getBounds:s,getResolution:a}){const l=[],c=[],u=()=>{const t=i();return{center:o(),bounds:s(),resolution:a(),zoom:t,isAtMaxZoom:e.getMaxZoom()<=t,isAtMinZoom:e.getMinZoom()>=t}},h=(e,t)=>r.emit(e,t),g=()=>h(t.MAP_LOADED);e.on("load",g),l.push(["load",g]);e.once("idle",()=>h(t.MAP_FIRST_IDLE,u()));const d=()=>h(t.MAP_MOVE_START);e.on("movestart",d),l.push(["movestart",d]);const m=n(()=>{h(t.MAP_MOVE_END,u())},500);e.on("moveend",m),l.push(["moveend",m]);const y=((e,t)=>{let r=0;return(...o)=>{const n=Date.now();n-r>=t&&(r=n,e(...o))}})(()=>{h(t.MAP_MOVE,u())},10);e.on("zoom",y),l.push(["zoom",y]);const p=()=>h(t.MAP_RENDER);e.on("render",p),l.push(["render",p]);const f=n(()=>{h(t.MAP_DATA_CHANGE,u())},500),I=e=>{e.isSourceLoaded&&f()};e.on("styledata",f),e.on("sourcedata",I),l.push(["styledata",f],["sourcedata",I]);const b=()=>h(t.MAP_STYLE_CHANGE);e.on("style.load",b),l.push(["style.load",b]);const x=e=>h(t.MAP_CLICK,{point:e.point,coords:[e.lngLat.lng,e.lngLat.lat]});return e.on("click",x),l.push(["click",x]),c.push(m,y,f),{remove(){c.forEach(e=>e.cancel()),l.forEach(([t,r])=>e.off(t,r))}}}function s(e,t,r){if(null!==e)for(var o,n,i,a,l,c,u,h,g=0,d=0,m=e.type,y="FeatureCollection"===m,p="Feature"===m,f=y?e.features.length:1,I=0;I<f;I++){l=(h=!!(u=y?e.features[I].geometry:p?e.geometry:e)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var b=0;b<l;b++){var x=0,v=0;if(null!==(a=h?u.geometries[b]:u)){c=a.coordinates;var S=a.type;switch(g=0,S){case null:break;case"Point":if(!1===t(c,d,I,x,v))return!1;d++,x++;break;case"LineString":case"MultiPoint":for(o=0;o<c.length;o++){if(!1===t(c[o],d,I,x,v))return!1;d++,"MultiPoint"===S&&x++}"LineString"===S&&x++;break;case"Polygon":case"MultiLineString":for(o=0;o<c.length;o++){for(n=0;n<c[o].length-g;n++){if(!1===t(c[o][n],d,I,x,v))return!1;d++}"MultiLineString"===S&&x++,"Polygon"===S&&v++}"Polygon"===S&&x++;break;case"MultiPolygon":for(o=0;o<c.length;o++){for(v=0,n=0;n<c[o].length;n++){for(i=0;i<c[o][n].length-g;i++){if(!1===t(c[o][n][i],d,I,x,v))return!1;d++}v++}x++}break;case"GeometryCollection":for(o=0;o<a.geometries.length;o++)if(!1===s(a.geometries[o],t))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}var a=function(e,t={}){if(null!=e.bbox&&!0!==t.recompute)return e.bbox;const r=[1/0,1/0,-1/0,-1/0];return s(e,e=>{r[0]>e[0]&&(r[0]=e[0]),r[1]>e[1]&&(r[1]=e[1]),r[2]<e[0]&&(r[2]=e[0]),r[3]<e[1]&&(r[3]=e[1])}),r};const l=Math.PI/180,c=1e-4,u=e=>e*l,h=(e,t)=>{const[r,o]=e,[n,i]=t,s=u(o),a=u(i),l=a-s,c=u(n-r),h=Math.sin(l/2)**2+Math.cos(s)*Math.cos(a)*Math.sin(c/2)**2;return 6371e3*(2*Math.atan2(Math.sqrt(h),Math.sqrt(1-h)))},g=e=>{const t=e/1609.344;if(t<.5){const t=Math.round(e);return`${t} ${1===t?"metre":"metres"}`}if(t<10){const e=Number.parseFloat(t.toFixed(1));return`${e} ${1===e?"mile":"miles"}`}return`${Math.round(t)} miles`},d=e=>a(e);const m="highlighted-label";function y(e,t){if("number"==typeof e)return e;if(!Array.isArray(e)||"interpolate"!==e[0])return function(e,t){const{stops:r}=e;if(r.length<2)return r.length>0?r[0][1]:0;let o=r[0],n=r[r.length-1];for(let e=1;e<r.length;e++){const i=r[e];if(i[0]>t){n=i,o=r[e-1];break}o=r[e-1],n=i}const[i,s]=o,[a,l]=n;return t<=i?s:t>=a?l:s+(t-i)/(a-i)*(l-s)}(e,t);const[,,r,...o]=e;if("zoom"!==r[0])throw new Error("Only zoom-based expressions supported");for(let e=0;e<o.length-2;e+=2){const r=o[e],n=o[e+1],i=o[e+2],s=o[e+3];if(t<=r)return n;if(t<=i)return n+(t-r)/(i-r)*(s-n)}return o[o.length-1]}function p(e,t,r){return t.flatMap(t=>{const o=t.layout?.["text-field"],n=function(e){return"string"==typeof e?/^{(.+)}$/.exec(e)?.[1]:Array.isArray(e)?e.find(e=>Array.isArray(e)&&"get"===e[0])?.[1]:null}(o);return n?r.filter(e=>e.layer.id===t.id&&e.properties?.[n]).map(r=>function(e,t,r,o){const n=function(e){const{type:t,coordinates:r}=e;if("Point"===t)return r;if("MultiPoint"===t)return r[0];if(t.includes("LineString")){const e="LineString"===t?r:r[0];return[(e[0][0]+e[e.length-1][0])/2,(e[0][1]+e[e.length-1][1])/2]}if(t.includes("Polygon")){const e="Polygon"===t?r[0]:r[0][0],o=e.reduce((e,t)=>[e[0]+t[0],e[1]+t[1]],[0,0]);return[o[0]/e.length,o[1]/e.length]}return null}(e.geometry);if(!n)return null;const i=o.project({lng:n[0],lat:n[1]});return{text:e.properties[r],x:i.x,y:i.y,feature:e,layer:t}}(r,t,n,e)).filter(Boolean):[]})}function f(e,t){if(t.highlightLayerId&&e.getLayer(t.highlightLayerId)){try{e.removeLayer(t.highlightLayerId)}catch{}t.highlightLayerId=null,t.highlightedExpr=null}}function I(e,t,r){if(!t?.feature?.layer)return;f(e,r);const{feature:o,layer:n}=t;r.highlightLayerId=`highlight-${n.id}`;const{id:i,type:s,properties:a,geometry:l}=o;e.getSource(m).setData({id:i,type:s,properties:a,geometry:l}),r.highlightedExpr=n.layout["text-size"];const c=e.getZoom();const u=function(e,t,r){return{id:`highlight-${e.id}`,type:e.type,source:m,layout:{...e.layout,"text-size":t,"text-allow-overlap":!0,"text-ignore-placement":!0,"text-max-angle":90},paint:{...e.paint,"text-color":r.text,"text-halo-color":r.halo,"text-halo-width":3,"text-halo-blur":1,"text-opacity":1}}}(n,1.5*y(r.highlightedExpr,c),r.isDarkStyle?{text:"#ffffff",halo:"#000000"}:{text:"#000000",halo:"#ffffff"});e.addLayer(u),e.moveLayer(r.highlightLayerId)}function b(e,t){if(!t.currentPixel)return null;const r=t.labels.map((e,t)=>({pixel:[e.x,e.y],index:t})).filter(e=>e.pixel[0]!==t.currentPixel.x||e.pixel[1]!==t.currentPixel.y);if(!r.length)return null;const o=r.map(e=>e.pixel);let n=((e,t,r)=>{const o=(e,t)=>e[0]===t[0]&&e[1]===t[1],n=t.filter(t=>{const n=Math.abs(t[0]-e[0]),i=Math.abs(t[1]-e[1]);let s=!1;return s="ArrowUp"===r?t[1]<=e[1]&&i>=n:"ArrowDown"===r?t[1]>e[1]&&i>=n:"ArrowLeft"===r?t[0]<=e[0]&&i<n:"ArrowRight"!==r||t[0]>e[0]&&i<n,s&&!o(t,e)});n.length||n.push(e);const i=t=>Math.hypot(e[0]-t[0],e[1]-t[1]),s=n.reduce((e,t)=>i(t)<i(e)?t:e,n[0]);return t.findIndex(e=>o(e,s))})([t.currentPixel.x,t.currentPixel.y],o,e);return(null==n||n<0||n>=r.length)&&(n=0),t.labels[r[n].index]}function x(e){e.getSource(m)||e.addSource(m,{type:"geojson",data:{type:"FeatureCollection",features:[]}})}function v(e){e.getStyle().layers.filter(e=>"line"===e.layout?.["symbol-placement"]).forEach(t=>e.setLayoutProperty(t.id,"symbol-placement","line-center"))}const S=e=>e.endsWith(".cold")?`${e.slice(0,-5)}.hot`:e.endsWith(".hot")?`${e.slice(0,-4)}.cold`:null,M="icon-image",L="active-highlight",P="active-highlight-inner",E="selected-highlight",A=(e,t)=>"active"===t?{property:"user_symbolActiveImageId",getImageId:t=>e?.getActiveImageId(t)??null}:{property:"user_symbolSelectedImageId",getImageId:t=>e?.getSelectedImageId(t)??null},w=(e,t,r,{featureId:o,idProperty:n,geometry:i})=>{const s=e.getLayer(r);s&&(t[r]||(t[r]={ids:new Set,fillIds:new Set,idProperty:n,sourceId:s.source,hasFillGeometry:!1}),!i||"Polygon"!==i.type&&"MultiPolygon"!==i.type||(t[r].hasFillGeometry=!0,t[r].fillIds.add(o)),t[r].ids.add(o))},$=(e,t,r,o)=>{t.forEach(t=>{if(!r.has(t)){const r=`${o}-${t}`;[`${r}-fill`,`${r}-line`,`${r}-symbol`].forEach(t=>{e.getLayer(t)&&e.setFilter(t,["==","id",""])})}})},C=(e,t)=>{const r=`_${t.replaceAll("-","")}Sources`;$(e,e[r]||new Set,new Set,t),e[r]=new Set},_=(e,t,r,o,n,i,s)=>{!!e.getLayer(t)||e.addLayer({id:t,type:r,source:o,...n&&{"source-layer":n},paint:i}),Object.entries(i).forEach(([r,o])=>{e.setPaintProperty(t,r,o)}),e.setFilter(t,s),e.moveLayer(t)},R=(e,t,r,o,n,i,s)=>{const a=e.getLayoutProperty(n,"icon-offset");e.getLayer(t)||e.addLayer({id:t,type:"symbol",source:r,...o&&{"source-layer":o},layout:{[M]:i,"icon-anchor":e.getLayoutProperty(n,"icon-anchor")??"center",...void 0!==a&&{"icon-offset":a},"icon-allow-overlap":!0}}),e.setLayoutProperty(t,M,i),void 0!==a&&e.setLayoutProperty(t,"icon-offset",a),e.setFilter(t,s),e.moveLayer(t)},F=(e,t,r,o,n,i)=>{const{ids:s,fillIds:a,idProperty:l,sourceId:c,hasFillGeometry:u}=r[t],h=e.getLayer(t),g=o[t]??o[S(t)];if(!h||!g)return;const d=h.sourceLayer,m=u?"fill":h.type,y=`${n}-${t}`,{fill:p}=g,f=n===E,I=(e=>e===E||e===P)(n),{lineColor:b,lineWidth:x}=((e,t)=>({lineColor:t?e.selectionStroke:e.stroke,lineWidth:t?e.strokeWidth:e.activeStrokeWidth}))(g,I),v=l?["get",l]:["id"],L=["in",v,["literal",Array.from(s)]];if("fill-extrusion"!==h.type)switch(m){case"fill":((e,t,r,o,{isSelected:n,idExpression:i,fillIds:s,fill:a,lineColor:l,lineWidth:c,filter:u})=>{if(n){const n=[];s.forEach(e=>n.push(e)),_(e,`${t}-fill`,"fill",r,o,{"fill-color":a},["in",i,["literal",n]])}_(e,`${t}-line`,"line",r,o,{"line-color":l,"line-width":c},u)})(e,y,c,d,{isSelected:f,idExpression:v,fillIds:a,fill:p,lineColor:b,lineWidth:x,filter:L});break;case"line":((e,t,r,o,n,i,s)=>{e.getLayer(`${t}-fill`)&&e.setFilter(`${t}-fill`,["==","id",""]),_(e,`${t}-line`,"line",r,o,{"line-color":n,"line-width":i},s)})(e,y,c,d,b,x,L);break;case"symbol":((e,t,r,o,n,i,s)=>{const a=e.getLayoutProperty(n,M);if(Array.isArray(a))return void R(e,`${t}-symbol`,r,o,n,["get",s.property],i);const l=s.getImageId(a);l&&R(e,`${t}-symbol`,r,o,n,l,i)})(e,y,c,d,t,L,i)}else((e,t,r,{ids:o,lineColor:n,lineWidth:i,idExpression:s})=>{const a=[];o.forEach(e=>a.push(e));const l=["in",s,["literal",a]],{source:c,sourceLayer:u}=e.getLayer(r);_(e,`${t}-line`,"line",c,u,{"line-color":n,"line-width":i},l)})(e,y,t,{ids:s,lineColor:b,lineWidth:x,idExpression:v})},B=(e,t,r,o,n)=>{const i=((e,t)=>{const r={};return t?.forEach(t=>{w(e,r,t.layerId,t);const o=S(t.layerId);o&&w(e,r,o,t)}),r})(e,t),s=new Set(Object.keys(i)),a=`_${o.replaceAll("-","")}Sources`,l=e[a]||new Set;return $(e,l,s,o),e[a]=s,s.forEach(t=>F(e,t,i,r,o,n)),i};const T=(e,t,r)=>{const o=(t.x-r.x)**2+(t.y-r.y)**2;if(0===o)return(e.x-t.x)**2+(e.y-t.y)**2;let n=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/o;return n=Math.max(0,Math.min(1,n)),(e.x-(t.x+n*(r.x-t.x)))**2+(e.y-(t.y+n*(r.y-t.y)))**2},k=(e,t,r={})=>{const{radius:o=10}=r,n=[[t.x-o,t.y-o],[t.x+o,t.y+o]],i=e.queryRenderedFeatures(n);if(0===i.length)return[];const s=new Set(e.queryRenderedFeatures([t.x,t.y]).map(e=>{const t=void 0===e.id?JSON.stringify(e.properties):e.id;return`${e.layer?.source}:${t}`})),a=[];i.forEach(e=>{!1===a.includes(e.layer.id)&&a.push(e.layer.id)});const l=new Set,c=[];for(let e=i.length-1;e>=0;e--){const t=i[e],r=void 0===t.id?JSON.stringify(t.properties):t.id,o=`${t.layer?.source}:${r}`;!1===l.has(o)&&(l.add(o),c.push(t))}const u=e.unproject(t),h=[u.lng,u.lat],g=c.filter(e=>{const t=e.geometry.type;if(t.includes("Polygon")){return("Polygon"===t?[e.geometry.coordinates]:e.geometry.coordinates).some(e=>((e,t)=>{const[r,o]=e;let n=!1;for(let e=0,i=t.length-1;e<t.length;i=e,e++){const[s,a]=t[e],[l,c]=t[i];a>o!=c>o&&(r<(l-s)*(o-a)/(c-a)+s&&(n=!n))}return n})(h,e[0]))}if("Point"===t||"MultiPoint"===t){const t=void 0===e.id?JSON.stringify(e.properties):e.id;return s.has(`${e.layer?.source}:${t}`)}return!0});return g.map(r=>{let o=0;const n=r.geometry.type,i=((e,t,r)=>{const{coordinates:o,type:n}=r;let i=1/0;const s=t=>e.project(t),a=e=>{for(let r=0;r<e.length-1;r++){const o=T(t,s(e[r]),s(e[r+1]));o<i&&(i=o)}};if("Point"===n){const e=s(o);i=(t.x-e.x)**2+(t.y-e.y)**2}else"LineString"===n||"MultiPoint"===n?"LineString"===n?a(o):o.forEach(e=>{const r=s(e),o=(t.x-r.x)**2+(t.y-r.y)**2;o<i&&(i=o)}):"Polygon"===n||"MultiLineString"===n?o.forEach(a):"MultiPolygon"===n&&o.forEach(e=>e.forEach(a));return i})(e,t,r.geometry);return o+=1e6*a.indexOf(r.layer.id),n.includes("Polygon")&&(o-=5e5),o+=i,{f:r,score:o}}).sort((e,t)=>e.score-t.score).map(({f:e})=>e)},z=(e,t,r)=>{const o=e.getCanvas();if(r&&e.off("mousemove",r),!t?.length)return o.style.cursor="",null;const n=r=>{const n=(e=>{const t=new Set(e);return e.forEach(e=>{const r=S(e);r&&t.add(r)}),[...t]})(t).filter(t=>e.getLayer(t));if(0===n.length)return void(o.style.cursor="");const{lineLayers:i,otherLayers:s}=((e,t)=>{const r=[],o=[];for(const n of t)if("line"===e.getLayer(n).type){const e=n.endsWith("-stroke")?n.slice(0,-7):null;null!==e&&t.includes(e)||r.push(n)}else o.push(n);return{lineLayers:r,otherLayers:o}})(e,n),{x:a,y:l}=r.point,c=[[a-10,l-10],[a+10,l+10]],u=i.length>0&&e.queryRenderedFeatures(c,{layers:i}).length>0,h=s.length>0&&e.queryRenderedFeatures(r.point,{layers:s}).length>0;o.style.cursor=u||h?"pointer":""};return e.on("mousemove",n),n};class N{sets=(()=>new Map)();add(e,t){const r=this.sets.get(e)??new Set;this.sets.delete(e),this.sets.set(e,r),t.forEach(e=>r.add(e));const o=new Set;for(;this.sets.size>2;){const[e,t]=this.sets.entries().next().value;this.sets.delete(e),t.forEach(e=>o.add(e))}return this.sets.forEach(e=>e.forEach(e=>o.delete(e))),Array.from(o)}}const j=.25,D=.75,Z=([e,t])=>{const r=(e=>e<=j?"left":e>=D?"right":"")(e),o=(e=>e<=j?"top":e>=D?"bottom":"")(t);return o+(r&&o?"-":"")+r||"center"},O=e=>e<=j?0:e>=D?1:.5,W=e=>Math.round(100*e)/100,H=([e,t],r)=>{const[,,o,n]=r.split(" ").map(Number);return[W((O(e)-e)*o),W((O(t)-t)*n)]};class G{activeImageIds=(()=>new Map)();selectedImageIds=(()=>new Map)();recentImageSets=(()=>new N)();constructor(e){this.map=e}getActiveImageId(e){return this.activeImageIds.get(e)??null}getSelectedImageId(e){return this.selectedImageIds.get(e)??null}removeImage(e){this.map.hasImage(e)&&this.map.removeImage(e),this.activeImageIds.delete(e),this.selectedImageIds.delete(e)}async registerSymbols(e,t,r,o){const{map:n}=this,i=await Promise.all(e.map(async e=>{const i=r.getSymbolImageIds(e,t,o);return i?(this.activeImageIds.set(i.normal,i.active),this.selectedImageIds.set(i.normal,i.selected),await Promise.all(Object.entries(i).map(async([i,s])=>{if(n.hasImage(s))return;const a=await r.rasteriseSymbolImage(e,t,i,o);a&&!n.hasImage(a.imageId)&&n.addImage(a.imageId,a.imageData,{pixelRatio:o})})),Object.values(i)):[]}));this.recentImageSets.add(`${t?.id}|${o}`,i.flat()).forEach(e=>this.removeImage(e))}}class q{recentImageSets=(()=>new N)();constructor(e){this.map=e}async registerPatterns(e,t,r,o){const{map:n}=this,i=new Map;e.forEach(e=>{const n=r.getPatternImageId(e,t,o);n&&!i.has(n)&&i.set(n,e)});const s=(e=>Math.max(2,2*e))(o);await Promise.all(Array.from(i,async([e,i])=>{if(n.hasImage(e))return;const a=await r.rasterisePatternImage(i,t,o);a&&!n.hasImage(a.imageId)&&n.addImage(a.imageId,a.imageData,{pixelRatio:s})})),this.recentImageSets.add(`${t}|${o}`,Array.from(i.keys())).forEach(e=>{n.hasImage(e)&&n.removeImage(e)})}}class V extends e{constructor({mapFramework:e,mapProviderConfig:t={},events:r,eventBus:n}){super(),this.maplibreModule=e,this.events=r,this.eventBus=n,this.capabilities={supportedShortcuts:o,supportsMapSizes:!0},Object.assign(this,t)}get name(){return"MapLibreProvider"}async initMap(e){const{container:t,padding:r,mapStyle:o,mapSize:n,center:s,zoom:a,bounds:l,pixelRatio:c,...u}=e;this.mapStyleId=o?.id,this.mapSize=n;const{Map:h}=this.maplibreModule,{events:g,eventBus:d}=this,m=new h({...u,container:t,style:o?.url,pixelRatio:c,padding:r,center:s,zoom:a,fadeDuration:0,attributionControl:!1,dragRotate:!1,doubleClickZoom:!1});m.touchZoomRotate.disableRotation(),this.map=m,this.symbolImages=new G(m),this.patternImages=new q(m),this.map.setPadding(r),l&&m.fitBounds(l,{duration:0}),function(e){const t=Event.prototype.preventDefault;Event.prototype.preventDefault=function(){if(("touchmove"===this.type||"touchstart"===this.type)&&!this.cancelable){const t=e.getCanvas();if(t&&(this.target===t||t.contains(this.target)))return}t.call(this)}}(m),function(e){const t=e.getCanvas();t.removeAttribute("role"),t.setAttribute("tabindex",-1),t.removeAttribute("aria-label"),t.style.display="block",t.addEventListener("focus",e=>{t.blur(),e.relatedTarget&&e.relatedTarget.focus({preventScroll:!0})})}(m),i({map:m,events:g,eventBus:d,getCenter:this.getCenter.bind(this),getZoom:this.getZoom.bind(this),getBounds:this.getBounds.bind(this),getResolution:this.getResolution.bind(this)}),function({mapProvider:e,map:t,events:r,eventBus:o}){const n=e=>{t.once("style.load",()=>{o.emit(r.MAP_STYLE_CHANGE,{mapStyleId:e.id})}),t.setStyle(e.url,{diff:!1})},i=e=>{t.setPixelRatio(e)},s=({mapSize:t})=>{e.mapSize=t};o.on(r.MAP_SET_STYLE,n),o.on(r.MAP_SET_PIXEL_RATIO,i),o.on(r.MAP_SIZE_CHANGE,s)}({mapProvider:this,map:m,events:g,eventBus:d}),m.on("load",()=>{this.labelNavigator=function(e,t,r,o){const n={isDarkStyle:"dark"===t,labels:[],currentPixel:null,highlightLayerId:null,highlightedExpr:null};function i(){const t=e.getStyle().layers.filter(e=>"symbol"===e.type),r=e.queryRenderedFeatures({layers:t.map(e=>e.id)});n.labels=p(e,t,r)}function s(){if(i(),!n.labels.length)return null;const t=e.project(e.getCenter()),r=function(e,t){return e.reduce((e,r)=>{const o=(r.x-t.x)**2+(r.y-t.y)**2;return!e||o<e.dist?{label:r,dist:o}:e},null)?.label}(n.labels,t);return n.currentPixel={x:r.x,y:r.y},I(e,r,n),r.text}return v(e),x(e),o?.on(r.MAP_SET_STYLE,t=>{e.once("styledata",()=>e.once("idle",()=>{v(e),x(e),n.isDarkStyle="dark"===t?.mapColorScheme}))}),e.on("zoom",()=>{if(n.highlightLayerId&&n.highlightedExpr){const t=y(n.highlightedExpr,e.getZoom());e.setLayoutProperty(n.highlightLayerId,"text-size",1.5*t)}}),function(e){e.getStyle().layers.filter(e=>"symbol"===e.type).forEach(t=>{e.setPaintProperty(t.id,"text-opacity",["case",["boolean",["feature-state","highlighted"],!1],0,1])})}(e),{refreshLabels:i,highlightNextLabel:function(t){if(i(),!n.labels.length)return null;if(!n.currentPixel)return s();const r=b(t,n);return r?(n.currentPixel={x:r.x,y:r.y},I(e,r,n),r.text):null},highlightLabelAtCenter:s,clearHighlightedLabel:()=>f(e,n)}}(m,o?.mapColorScheme,g,d)}),this.eventBus.emit(g.MAP_READY,{map:this.map,mapStyleId:this.mapStyleId,mapSize:this.mapSize,crs:this.crs})}isBaseMapReady(){return Boolean(this.map?.getStyle())}destroyMap(){this.setHoverCursor([]),this.mapEvents?.remove(),this.appEvents?.remove(),this.mapEvents=null,this.appEvents=null,this.map.remove()}setHoverCursor(e){this.map&&(this._onHoverMove=z(this.map,e,this._onHoverMove))}setView({center:e,zoom:r}){this.map.flyTo({center:e||this.getCenter(),zoom:r||this.getZoom(),duration:this.map.isStyleLoaded()?t:0})}zoomIn(e){this.map.easeTo({zoom:this.getZoom()+e,duration:t})}zoomOut(e){this.map.easeTo({zoom:this.getZoom()-e,duration:t})}panBy(e){this.map.panBy(e,{duration:t})}fitToBounds(e){const r=Array.isArray(e)?e:d(e),o=this.map.isStyleLoaded()?t:0;this.map.fitBounds(r,{duration:o})}setPadding(e){this.map.setPadding(e)}updateHighlightedFeatures(e,t,r){const{LngLatBounds:o}=this.maplibreModule;return function({LngLatBounds:e,map:t,selectedFeatures:r,activeFeatures:o,stylesMap:n,symbolImages:i}){if(!t)return null;const s=A(i,"active"),a=A(i,"selected");o?.length?(B(t,o,n,L,s),B(t,o,n,P,a)):(C(t,L),C(t,P));let l={};r?.length?l=B(t,r,n,E,a):C(t,E);const c=[];return Object.entries(l).forEach(([e,{ids:r,idProperty:o}])=>{c.push(...t.queryRenderedFeatures({layers:[e]}).filter(e=>r.has(o?e.properties?.[o]:e.id)))}),((e,t)=>{if(!t.length)return null;const r=new e;return t.forEach(e=>{const t=e=>"number"==typeof e[0]?r.extend(e):e.forEach(t);t(e.geometry.coordinates)}),[r.getWest(),r.getSouth(),r.getEast(),r.getNorth()]})(e,c)}({LngLatBounds:o,map:this.map,selectedFeatures:e,activeFeatures:t,stylesMap:r,symbolImages:this.symbolImages})}highlightNextLabel(e){return this.labelNavigator?.highlightNextLabel(e)||null}highlightLabelAtCenter(){return this.labelNavigator?.highlightLabelAtCenter()||null}clearHighlightedLabel(){return this.labelNavigator?.clearHighlightedLabel()||null}getCenter(){const e=this.map.getCenter();return[Number(e.lng.toFixed(r)),Number(e.lat.toFixed(r))]}getZoom(){return Number(this.map.getZoom().toFixed(r))}getBounds(){return this.map.getBounds().toArray().flat(1)}getFeaturesAtPoint(e,t){return k(this.map,e,t)}getVisibleFeatures(e){const t=e.filter(e=>this.map.getLayer(e));return t.length?this.map.queryRenderedFeatures(void 0,{layers:t}):[]}async addSymbolsToMap(e,t,r,o=this.map.getPixelRatio()||1){return this.symbolImages.registerSymbols(e,t,r,o)}getSymbolIconLayout(e){return(({anchor:e,viewBox:t})=>({"icon-anchor":Z(e),"icon-offset":H(e,t)}))(e)}getActiveSymbolImageId(e){return this.symbolImages?.getActiveImageId(e)??null}getSelectedSymbolImageId(e){return this.symbolImages?.getSelectedImageId(e)??null}async addPatternsToMap(e,t,r,o=this.map.getPixelRatio()||1){return this.patternImages.registerPatterns(e,t,r,o)}getAreaDimensions(){const{LngLatBounds:e}=this.maplibreModule;return(e=>{let t,r,o,n;if(e&&"function"==typeof e.getWest)t=e.getWest(),r=e.getSouth(),o=e.getEast(),n=e.getNorth();else{if(!Array.isArray(e)||2!==e.length)return"";[[t,r],[o,n]]=e}const i=h([t,r],[o,r]),s=h([t,r],[t,n]),a=g(i);return`${g(s)} by ${a}`})(((e,t)=>{const{width:r,height:o}=t.getContainer().getBoundingClientRect(),n=t.getPadding(),i=[n.left,o-n.bottom],s=[r-n.right,n.top];return new e(t.unproject(i),t.unproject(s))})(e,this.map))}getCardinalMove(e,t){return((e,t)=>{const[r,o]=e,[n,i]=t,s=i-o,a=n-r,l=[];if(Math.abs(s)>c){const e=Math.round(h([r,o],[r,i]));l.push(`${s>0?"north":"south"} ${g(e)}`)}if(Math.abs(a)>c){const e=Math.round(h([r,o],[n,o]));l.push(`${a>0?"east":"west"} ${g(e)}`)}return l.join(", ")})(e,t)}getResolution(){return((e,t)=>{const r=e.lat,o=Math.pow(2,t);return 40075016.686*Math.cos(u(r))/(512*o)})(this.map.getCenter(),this.map.getZoom())}mapToScreen(e){return this.map.project(e)}screenToMap(e){const{lng:t,lat:r}=this.map.unproject([e.x,e.y]);return[t,r]}isGeometryObscured(e,t){return((e,t,r)=>{const o=r.getContainer().getBoundingClientRect(),[n,i,s,a]=d(e),l=[r.project([n,i]),r.project([n,a]),r.project([s,i]),r.project([s,a])],c=Math.min(...l.map(e=>e.x)),u=Math.max(...l.map(e=>e.x)),h=Math.min(...l.map(e=>e.y)),g=Math.max(...l.map(e=>e.y)),m=t.left-o.left,y=t.top-o.top,p=t.right-o.left,f=t.bottom-o.top;return c<p&&u>m&&h<f&&g>y})(e,t,this.map)}}export{V as default};
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/asyncToGenerator";function t(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function o(r){for(var o=1;o<arguments.length;o++){var n=null!=arguments[o]?arguments[o]:{};o%2?t(Object(n),!0).forEach(function(t){e(r,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):t(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))})}return r}function n(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{checkDeviceCapabilities:()=>{var e=(e=>{if(!window.WebGLRenderingContext)return{isEnabled:!1,error:"WebGL is not supported"};var r=document.createElement("canvas"),t=!1;for(var o of e)try{if((t=r.getContext(o))&&"function"==typeof t.getParameter)return{isEnabled:!0}}catch(e){}return{isEnabled:!1,error:"WebGL is supported, but disabled"}})(["webgl2","webgl1"]),r=document.documentMode;return{isSupported:e.isEnabled&&"function"==typeof"".replaceAll,error:r?"Internet Explorer is not supported":e.error}},load:(e=r(function*(){var e=yield import("maplibre-gl");return t.workerUrl&&e.setWorkerUrl(t.workerUrl),{MapProvider:(yield import(/* webpackChunkName: "im-maplibre-provider" */ "./im-maplibre-provider.js")).default,mapProviderConfig:o(o({},t),{},{crs:"EPSG:4326"}),mapFramework:e}}),function(){return e.apply(this,arguments)})}}export{n as default};
1
+ import r from"@babel/runtime/helpers/regenerator";import e from"@babel/runtime/helpers/objectSpread2";import t from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/helpers/createForOfIteratorHelper";var o=function(r){var e=new URL("maplibre-gl/dist/maplibre-gl-worker.mjs",import.meta.url);return e.searchParams.set("v",r),e.href};function a(){if(document.documentMode)return"Internet Explorer is not supported";var r=function(r){if(!window.WebGLRenderingContext)return{isEnabled:!1,error:"WebGL is not supported"};var e,t=document.createElement("canvas"),o=!1,a=n(r);try{for(a.s();!(e=a.n()).done;){var i=e.value;try{if((o=t.getContext(i))&&"function"==typeof o.getParameter)return{isEnabled:!0}}catch(r){}}}catch(r){a.e(r)}finally{a.f()}return{isEnabled:!1,error:"WebGL is supported, but disabled"}}(["webgl2"]);return r.isEnabled?function(){if("function"!=typeof(null===Intl||void 0===Intl?void 0:Intl.supportedValuesOf))return!1;try{return new RegExp("(?<=a)b").test("ab")}catch(r){return!1}}()?function(){if("undefined"==typeof Worker)return!1;var r=!1,e={get type(){return r=!0,"module"}};try{new Worker("blob://",e).terminate()}catch(r){}return r}()?void 0:"Browser does not support module workers":"Browser does not support the JavaScript features MapLibre requires":r.error}function i(){var n,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{checkDeviceCapabilities:function(){var r=a();return{isSupported:!r,error:r}},load:(n=t(r().m(function t(){var n,a,u;return r().w(function(r){for(;;)switch(r.n){case 0:return r.n=1,import("maplibre-gl");case 1:return(n=r.v).setWorkerUrl(i.workerUrl||o(n.getVersion())),r.n=2,import(/* webpackChunkName: "im-maplibre-provider" */ "./im-maplibre-provider.js");case 2:return a=r.v.default,u=e(e({},i),{},{crs:"EPSG:4326"}),r.a(2,{MapProvider:a,mapProviderConfig:u,mapFramework:n})}},t)})),function(){return n.apply(this,arguments)})}}export{i as default};