@defra/interactive-map 0.0.40-alpha → 0.0.41-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.
- package/dist/css/index.css +1 -1
- package/dist/esm/im-core.js +1 -1
- package/dist/esm/im-shell.js +1 -1
- package/dist/umd/im-core.js +1 -1
- package/dist/umd/index.js +1 -1
- package/docs/api/control-definition.md +9 -1
- package/docs/api/slots.md +26 -5
- package/docs/assets/images/slot-map.svg +61 -262
- package/docs/examples/draw-tools.mdx +3 -3
- package/docs/plugins/draw.md +79 -16
- package/docs/plugins/search.md +1 -1
- package/govuk-prototype-kit.config.json +2 -0
- package/jest.setup.js +5 -0
- package/package.json +9 -1
- package/plugins/beta/draw-es/dist/esm/im-draw-es-plugin.js +1 -1
- package/plugins/beta/draw-ml/dist/esm/im-draw-ml-plugin.js +1 -1
- package/plugins/beta/draw-ml/dist/umd/im-draw-ml-plugin.js +1 -1
- package/plugins/beta/draw-ol/dist/esm/im-draw-ol-plugin.js +1 -1
- package/plugins/beta/map-styles/dist/umd/im-map-styles-plugin.js +1 -1
- package/plugins/beta/map-styles/dist/umd/index.js +1 -1
- package/plugins/datasets/dist/css/index.css +1 -1
- package/plugins/datasets/dist/esm/esriLayerAdapter.js +1 -1
- package/plugins/datasets/dist/esm/im-datasets-ml-adapter.js +1 -1
- package/plugins/datasets/dist/esm/im-datasets-plugin.js +1 -1
- package/plugins/datasets/dist/umd/im-datasets-esri-adapter.js +1 -1
- package/plugins/datasets/dist/umd/im-datasets-ml-adapter.js +1 -1
- package/plugins/datasets/dist/umd/im-datasets-plugin.js +1 -1
- package/plugins/datasets/dist/umd/index.js +1 -1
- package/plugins/datasets/src/adapters/esri/esriLayerAdapter.test.js +175 -0
- package/plugins/datasets/src/adapters/esri/registry/esriDataset.test.js +55 -0
- package/plugins/datasets/src/adapters/loadLayerAdapter.test.js +61 -0
- package/plugins/datasets/src/adapters/maplibre/maplibreLayerAdapter.test.js +14 -0
- package/plugins/datasets/src/api/setOpacity.test.js +9 -0
- package/plugins/datasets/src/components/LayersMenu/LayersMenu.jsx +10 -25
- package/plugins/datasets/src/components/LayersMenu/LayersMenu.test.jsx +0 -42
- package/plugins/datasets/src/datasets.scss +0 -1
- package/plugins/datasets/src/fetch/createDynamicSource.js +135 -129
- package/plugins/datasets/src/fetch/createDynamicSource.test.js +318 -0
- package/plugins/datasets/src/fetch/fetchGeoJSON.test.js +83 -0
- package/plugins/datasets/src/index.test.js +36 -0
- package/plugins/datasets/src/initialise/DatasetsInit.jsx +17 -7
- package/plugins/datasets/src/initialise/DatasetsInit.test.jsx +262 -0
- package/plugins/datasets/src/initialise/initialiseDatasets.js +16 -4
- package/plugins/datasets/src/initialise/initialiseDatasets.test.js +42 -0
- package/plugins/datasets/src/manifest.js +0 -38
- package/plugins/datasets/src/manifest.test.js +49 -0
- package/plugins/datasets/src/reducers/datasetsToMenu.test.js +54 -1
- package/plugins/datasets/src/reducers/pluginState.js +3 -16
- package/plugins/datasets/src/reducers/pluginState.test.js +23 -0
- package/plugins/datasets/src/registry/dataset.js +13 -1
- package/plugins/datasets/src/registry/dataset.test.js +61 -0
- package/plugins/datasets/src/registry/datasetRegistry.js +12 -6
- package/plugins/datasets/src/registry/datasetRegistry.test.js +16 -4
- package/plugins/datasets/src/registry/isVisibleWhen.js +6 -3
- package/plugins/datasets/src/registry/isVisibleWhen.test.js +11 -1
- package/plugins/datasets/src/utils/bbox.test.js +125 -0
- package/plugins/draw/dist/esm/im-draw-ml-adapter.js +1 -1
- package/plugins/draw/dist/esm/im-draw-ol-adapter.js +1 -1
- package/plugins/draw/dist/esm/im-draw-plugin.js +1 -1
- package/plugins/draw/dist/esm/index.js +1 -1
- package/plugins/draw/dist/umd/im-draw-ml-adapter.js +2 -1
- package/plugins/draw/dist/umd/im-draw-ml-adapter.js.LICENSE.txt +1 -0
- package/plugins/draw/dist/umd/im-draw-ol-adapter.js +1 -1
- package/plugins/draw/dist/umd/im-draw-plugin.js +1 -1
- package/plugins/draw/dist/umd/index.js +1 -1
- package/plugins/draw/src/DrawInit.jsx +10 -2
- package/plugins/draw/src/DrawInit.test.jsx +51 -10
- package/plugins/draw/src/adapters/maplibre/MaplibreDrawAdapter.js +91 -11
- package/plugins/draw/src/adapters/maplibre/MaplibreDrawAdapter.test.js +246 -4
- package/plugins/draw/src/adapters/maplibre/mapboxDraw.js +109 -14
- package/plugins/draw/src/adapters/maplibre/mapboxDraw.test.js +174 -11
- package/plugins/draw/src/adapters/maplibre/modes/drawMode/clickHandlers.test.js +12 -0
- package/plugins/draw/src/adapters/maplibre/modes/drawMode/lifecycle.js +9 -1
- package/plugins/draw/src/adapters/maplibre/modes/drawMode/lifecycle.test.js +24 -3
- package/plugins/draw/src/adapters/maplibre/modes/drawPointMode.js +194 -0
- package/plugins/draw/src/adapters/maplibre/modes/drawPointMode.test.js +457 -0
- package/plugins/draw/src/adapters/maplibre/modes/editPointMode/__helpers__/harness.js +102 -0
- package/plugins/draw/src/adapters/maplibre/modes/editPointMode/keyboardHandlers.js +82 -0
- package/plugins/draw/src/adapters/maplibre/modes/editPointMode/keyboardHandlers.test.js +83 -0
- package/plugins/draw/src/adapters/maplibre/modes/editPointMode/pointOperations.js +55 -0
- package/plugins/draw/src/adapters/maplibre/modes/editPointMode/pointOperations.test.js +62 -0
- package/plugins/draw/src/adapters/maplibre/modes/editPointMode/pointerHandlers.js +138 -0
- package/plugins/draw/src/adapters/maplibre/modes/editPointMode/pointerHandlers.test.js +197 -0
- package/plugins/draw/src/adapters/maplibre/modes/editPointMode/touchHandlers.js +92 -0
- package/plugins/draw/src/adapters/maplibre/modes/editPointMode/touchHandlers.test.js +101 -0
- package/plugins/draw/src/adapters/maplibre/modes/editPointMode/undoHandlers.js +46 -0
- package/plugins/draw/src/adapters/maplibre/modes/editPointMode/undoHandlers.test.js +42 -0
- package/plugins/draw/src/adapters/maplibre/modes/editPointMode.js +151 -0
- package/plugins/draw/src/adapters/maplibre/modes/editPointMode.test.js +156 -0
- package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/keyboardHandlers.js +4 -27
- package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/keyboardHandlers.test.js +24 -39
- package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/pointerHandlers.js +4 -5
- package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/touchHandlers.js +20 -23
- package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/touchHandlers.test.js +25 -5
- package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/undoHandlers.js +6 -36
- package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/undoHandlers.test.js +7 -49
- package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/vertexOperations.js +3 -53
- package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/vertexOperations.test.js +8 -33
- package/plugins/draw/src/adapters/maplibre/modes/editVertexMode.js +29 -72
- package/plugins/draw/src/adapters/maplibre/modes/editVertexMode.test.js +10 -3
- package/plugins/draw/src/adapters/maplibre/pointSymbolImages.js +158 -0
- package/plugins/draw/src/adapters/maplibre/pointSymbolImages.test.js +314 -0
- package/plugins/draw/src/adapters/maplibre/snap/prototypePatches.js +6 -1
- package/plugins/draw/src/adapters/maplibre/snap/prototypePatches.test.js +21 -0
- package/plugins/draw/src/adapters/maplibre/snap/snapInstance.js +6 -2
- package/plugins/draw/src/adapters/maplibre/snap/snapInstance.test.js +12 -0
- package/plugins/draw/src/adapters/maplibre/styles.js +38 -11
- package/plugins/draw/src/adapters/maplibre/styles.test.js +39 -0
- package/plugins/draw/src/adapters/maplibre/utils/editModeEvents.js +79 -0
- package/plugins/draw/src/adapters/maplibre/utils/editModeEvents.test.js +135 -0
- package/plugins/draw/src/adapters/maplibre/utils/geometryValidation.js +42 -0
- package/plugins/draw/src/adapters/maplibre/utils/geometryValidation.test.js +85 -0
- package/plugins/draw/src/adapters/maplibre/utils/keyboardShortcuts.js +34 -0
- package/plugins/draw/src/adapters/maplibre/utils/keyboardShortcuts.test.js +78 -0
- package/plugins/draw/src/adapters/maplibre/utils/snapHelpers.js +16 -3
- package/plugins/draw/src/adapters/maplibre/utils/snapHelpers.test.js +21 -3
- package/plugins/draw/src/adapters/maplibre/utils/snapMovement.js +59 -0
- package/plugins/draw/src/adapters/maplibre/utils/snapMovement.test.js +73 -0
- package/plugins/draw/src/adapters/maplibre/utils/touchDragMath.js +33 -0
- package/plugins/draw/src/adapters/maplibre/utils/touchDragMath.test.js +70 -0
- package/plugins/draw/src/adapters/openlayers/OLDrawAdapter.js +27 -2
- package/plugins/draw/src/adapters/openlayers/OLDrawAdapter.test.js +93 -0
- package/plugins/draw/src/adapters/openlayers/__helpers__/harness.js +9 -0
- package/plugins/draw/src/adapters/openlayers/core/OLDrawManager.js +19 -1
- package/plugins/draw/src/adapters/openlayers/core/OLDrawManager.test.js +34 -1
- package/plugins/draw/src/adapters/openlayers/core/styles.js +73 -1
- package/plugins/draw/src/adapters/openlayers/core/styles.test.js +122 -3
- package/plugins/draw/src/adapters/openlayers/draw/DrawMode.test.js +12 -0
- package/plugins/draw/src/adapters/openlayers/draw/drawInput.js +8 -2
- package/plugins/draw/src/adapters/openlayers/edit/EditMode.test.js +31 -0
- package/plugins/draw/src/adapters/openlayers/edit/keyboardHandler.js +9 -5
- package/plugins/draw/src/adapters/openlayers/edit/keyboardHandler.test.js +33 -0
- package/plugins/draw/src/adapters/openlayers/edit/modifyInteraction.js +5 -3
- package/plugins/draw/src/adapters/openlayers/edit/modifyInteraction.test.js +11 -0
- package/plugins/draw/src/adapters/openlayers/edit/nudge.js +10 -3
- package/plugins/draw/src/adapters/openlayers/edit/nudge.test.js +24 -1
- package/plugins/draw/src/adapters/openlayers/edit/touchHandler.js +18 -13
- package/plugins/draw/src/adapters/openlayers/edit/touchHandler.test.js +46 -1
- package/plugins/draw/src/adapters/openlayers/olDraw.js +11 -4
- package/plugins/draw/src/adapters/openlayers/olDraw.test.js +48 -6
- package/plugins/draw/src/adapters/openlayers/point/drawPointMode.js +156 -0
- package/plugins/draw/src/adapters/openlayers/point/drawPointMode.test.js +246 -0
- package/plugins/draw/src/adapters/openlayers/point/editPointMode.js +267 -0
- package/plugins/draw/src/adapters/openlayers/point/editPointMode.test.js +327 -0
- package/plugins/draw/src/adapters/openlayers/point/pointDragInteraction.js +71 -0
- package/plugins/draw/src/adapters/openlayers/point/pointOps.js +34 -0
- package/plugins/draw/src/adapters/openlayers/point/pointOps.test.js +32 -0
- package/plugins/draw/src/adapters/openlayers/point/pointSelectionState.js +82 -0
- package/plugins/draw/src/adapters/openlayers/point/pointSelectionState.test.js +107 -0
- package/plugins/draw/src/adapters/openlayers/point/pointSymbolImages.js +83 -0
- package/plugins/draw/src/adapters/openlayers/point/pointSymbolImages.test.js +214 -0
- package/plugins/draw/src/adapters/openlayers/snap/snapIndicator.js +3 -1
- package/plugins/draw/src/adapters/openlayers/snap/snapInteraction.js +6 -9
- package/plugins/draw/src/adapters/openlayers/snap/snapInteraction.test.js +15 -4
- package/plugins/draw/src/adapters/openlayers/utils/olCoords.js +1 -1
- package/plugins/draw/src/api/addFeature.js +16 -1
- package/plugins/draw/src/api/addFeature.test.js +62 -5
- package/plugins/draw/src/api/editFeature.js +7 -4
- package/plugins/draw/src/api/editFeature.test.js +16 -0
- package/plugins/draw/src/api/newPoint.js +42 -0
- package/plugins/draw/src/api/newPoint.test.js +117 -0
- package/plugins/draw/src/api/setStyle.js +43 -0
- package/plugins/draw/src/api/setStyle.test.js +75 -0
- package/plugins/draw/src/events.js +17 -10
- package/plugins/draw/src/events.test.js +14 -0
- package/plugins/draw/src/manifest.js +18 -6
- package/plugins/draw/src/manifest.test.js +32 -1
- package/plugins/draw/src/reducer.test.js +7 -0
- package/plugins/draw/src/utils/stripInternalProperties.js +19 -0
- package/plugins/draw/src/utils/stripInternalProperties.test.js +50 -0
- package/plugins/draw/src/utils/symbolKeys.js +5 -0
- package/plugins/draw/src/validation/liveDrawChecks.test.js +54 -0
- package/plugins/draw/src/validation/liveStroke.test.js +64 -1
- package/plugins/interact/dist/esm/im-interact-plugin.js +1 -1
- package/plugins/interact/dist/umd/im-interact-plugin.js +1 -1
- package/plugins/interact/dist/umd/index.js +1 -1
- package/plugins/interact/src/hooks/useHighlightSync.js +33 -12
- package/plugins/interact/src/hooks/useHighlightSync.test.js +96 -25
- package/plugins/interact/src/utils/featureQueries.js +18 -0
- package/plugins/interact/src/utils/featureQueries.test.js +15 -0
- package/plugins/interact/src/utils/spatial.js +9 -3
- package/plugins/interact/src/utils/spatial.test.js +12 -1
- package/plugins/map-key/dist/css/index.css +62 -0
- package/plugins/map-key/dist/esm/im-map-key-plugin.js +1 -0
- package/plugins/map-key/dist/esm/index.js +1 -0
- package/plugins/map-key/dist/umd/im-map-key-plugin.js +2 -0
- package/plugins/map-key/dist/umd/im-map-key-plugin.js.LICENSE.txt +1 -0
- package/plugins/map-key/dist/umd/index.js +2 -0
- package/plugins/map-key/dist/umd/index.js.LICENSE.txt +1 -0
- package/plugins/map-key/package.json +28 -0
- package/plugins/map-key/src/components/Key/EmptyKey.jsx +7 -0
- package/plugins/{datasets → map-key}/src/components/Key/EmptyKey.test.jsx +2 -2
- package/plugins/map-key/src/components/Key/Key.jsx +41 -0
- package/plugins/{datasets → map-key}/src/components/Key/Key.module.scss +15 -14
- package/plugins/map-key/src/components/Key/Key.test.jsx +73 -0
- package/plugins/map-key/src/components/Key/KeyGroupItem.jsx +16 -0
- package/plugins/map-key/src/components/Key/KeyGroupItem.test.jsx +53 -0
- package/plugins/map-key/src/components/Key/KeyItem.jsx +29 -0
- package/plugins/map-key/src/components/Key/KeyItem.test.jsx +67 -0
- package/plugins/map-key/src/components/Key/KeySvg.jsx +42 -0
- package/plugins/{datasets → map-key}/src/components/Key/KeySvg.test.jsx +14 -12
- package/plugins/map-key/src/components/Key/KeySvgLine.jsx +28 -0
- package/plugins/{datasets → map-key}/src/components/Key/KeySvgLine.test.jsx +1 -1
- package/plugins/map-key/src/components/Key/KeySvgPattern.jsx +23 -0
- package/plugins/{datasets → map-key}/src/components/Key/KeySvgPattern.test.jsx +2 -2
- package/plugins/map-key/src/components/Key/KeySvgRect.jsx +33 -0
- package/plugins/{datasets → map-key}/src/components/Key/KeySvgRect.test.jsx +1 -1
- package/plugins/map-key/src/components/Key/KeySvgSymbol.jsx +27 -0
- package/plugins/{datasets → map-key}/src/components/Key/KeySvgSymbol.test.jsx +5 -6
- package/plugins/map-key/src/components/Key/MapKey.jsx +50 -0
- package/plugins/map-key/src/components/Key/MapKey.test.jsx +130 -0
- package/plugins/{datasets → map-key}/src/components/Key/svgProperties.js +2 -2
- package/plugins/{datasets → map-key}/src/components/Key/svgProperties.test.js +2 -2
- package/plugins/map-key/src/index.js +13 -0
- package/plugins/map-key/src/index.test.js +31 -0
- package/plugins/map-key/src/initialise/MapKeyInit.jsx +15 -0
- package/plugins/map-key/src/initialise/MapKeyInit.test.jsx +39 -0
- package/plugins/map-key/src/manifest.js +30 -0
- package/plugins/map-key/src/manifest.test.js +63 -0
- package/plugins/map-key/src/mapKey.scss +4 -0
- package/plugins/map-key/src/registry/getDatasetRegistry.js +6 -0
- package/plugins/map-key/src/registry/getDatasetRegistry.test.js +23 -0
- package/plugins/map-key/src/registry/index.js +3 -0
- package/plugins/map-key/src/registry/index.test.js +15 -0
- package/plugins/menu/dist/css/index.css +80 -0
- package/plugins/menu/dist/esm/im-menu-plugin.js +1 -0
- package/plugins/menu/dist/esm/index.js +1 -0
- package/plugins/menu/dist/umd/im-menu-plugin.js +1 -0
- package/plugins/menu/dist/umd/index.js +2 -0
- package/plugins/menu/dist/umd/index.js.LICENSE.txt +1 -0
- package/plugins/menu/package.json +28 -0
- package/plugins/menu/src/components/Menu/CheckboxGroupWrapper.jsx +21 -0
- package/plugins/menu/src/components/Menu/GroupLegend.jsx +17 -0
- package/plugins/menu/src/components/Menu/GroupLegend.test.jsx +68 -0
- package/plugins/menu/src/components/Menu/Menu.jsx +19 -0
- package/plugins/menu/src/components/Menu/Menu.module.scss +90 -0
- package/plugins/menu/src/components/Menu/Menu.test.jsx +161 -0
- package/plugins/menu/src/components/Menu/MenuCheckbox.jsx +35 -0
- package/plugins/menu/src/components/Menu/MenuCheckbox.test.jsx +93 -0
- package/plugins/menu/src/components/Menu/MenuGroup.jsx +11 -0
- package/plugins/{datasets/src/components/LayersMenu/LayersMenuRadio.jsx → menu/src/components/Menu/MenuRadio.jsx} +6 -4
- package/plugins/{datasets/src/components/LayersMenu/LayersMenuRadio.test.jsx → menu/src/components/Menu/MenuRadio.test.jsx} +18 -18
- package/plugins/menu/src/components/Menu/RadioGroupWrapper.jsx +32 -0
- package/plugins/{datasets/src/components/LayersMenu/LayersRadioGroupWrapper.test.jsx → menu/src/components/Menu/RadioGroupWrapper.test.jsx} +21 -21
- package/plugins/menu/src/components/Menu/useIdPrefix.jsx +4 -0
- package/plugins/menu/src/index.js +13 -0
- package/plugins/menu/src/index.test.js +31 -0
- package/plugins/menu/src/initialise/MenuInit.jsx +24 -0
- package/plugins/menu/src/initialise/MenuInit.test.jsx +50 -0
- package/plugins/menu/src/initialise/createMenu.js +10 -0
- package/plugins/menu/src/initialise/createMenu.test.js +37 -0
- package/plugins/menu/src/manifest.js +35 -0
- package/plugins/menu/src/manifest.test.js +63 -0
- package/plugins/menu/src/menu.scss +4 -0
- package/plugins/menu/src/reducers/menuStateReducer.test.js +38 -0
- package/plugins/menu/src/reducers/pluginState.js +35 -0
- package/plugins/menu/src/reducers/pluginState.test.js +57 -0
- package/plugins/menu/src/registry/getDatasetRegistry.js +9 -0
- package/plugins/menu/src/registry/getDatasetRegistry.test.js +23 -0
- package/plugins/menu/src/registry/index.js +3 -0
- package/plugins/menu/src/registry/index.test.js +15 -0
- package/plugins/menu/src/registry/isVisibleWhen.js +43 -0
- package/plugins/menu/src/registry/isVisibleWhen.test.js +48 -0
- package/plugins/search/dist/css/index.css +1 -1
- package/plugins/search/dist/esm/im-search-plugin.js +1 -1
- package/plugins/search/dist/esm/index.js +1 -1
- package/plugins/search/dist/umd/im-search-plugin.js +1 -1
- package/plugins/search/dist/umd/index.js +1 -1
- package/plugins/search/src/Search.jsx +2 -3
- package/plugins/search/src/components/Form/Form.module.scss +9 -20
- package/plugins/search/src/index.js +0 -1
- package/plugins/search/src/index.test.js +2 -4
- package/plugins/search/src/manifest.js +1 -1
- package/plugins/search/src/search.scss +17 -16
- package/providers/beta/openlayers/dist/esm/im-openlayers-provider.js +1 -1
- package/providers/beta/openlayers/dist/umd/im-openlayers-provider.js +1 -1
- package/providers/beta/openlayers/dist/umd/index.js +1 -1
- package/providers/beta/openlayers/src/openlayersProvider.js +4 -1
- package/providers/beta/openlayers/src/openlayersProvider.test.js +18 -0
- package/providers/beta/openlayers/src/utils/highlightFeatures.js +52 -5
- package/providers/beta/openlayers/src/utils/highlightFeatures.test.js +176 -0
- package/providers/beta/openlayers/src/utils/symbolImages.js +40 -0
- package/providers/beta/openlayers/src/utils/symbolImages.test.js +58 -0
- package/providers/maplibre/dist/esm/im-maplibre-provider.js +1 -1
- package/providers/maplibre/dist/umd/im-maplibre-provider.js +1 -1
- package/providers/maplibre/dist/umd/index.js +1 -1
- package/providers/maplibre/src/utils/drawLayerBuckets.js +14 -0
- package/providers/maplibre/src/utils/drawLayerBuckets.test.js +18 -0
- package/providers/maplibre/src/utils/highlightFeatures.js +80 -55
- package/providers/maplibre/src/utils/highlightFeatures.test.js +156 -17
- package/providers/maplibre/src/utils/hoverCursor.js +30 -14
- package/providers/maplibre/src/utils/hoverCursor.test.js +35 -0
- package/providers/maplibre/src/utils/patternImages.js +1 -1
- package/providers/maplibre/src/utils/symbolImages.js +41 -3
- package/providers/maplibre/src/utils/symbolImages.test.js +40 -6
- package/rollup.esm.mjs +11 -1
- package/src/App/components/Actions/Actions.test.jsx +47 -0
- package/src/App/components/Hints/Hints.test.jsx +13 -0
- package/src/App/components/MoveControls/MoveControls.module.scss +41 -10
- package/src/App/components/Panel/Panel.jsx +18 -3
- package/src/App/components/Panel/Panel.module.scss +18 -8
- package/src/App/components/Panel/Panel.test.jsx +34 -0
- package/src/App/components/Tooltip/Tooltip.test.jsx +12 -14
- package/src/App/hooks/useFeatureItems.js +16 -7
- package/src/App/hooks/useFeatureItems.test.js +57 -0
- package/src/App/hooks/useLayoutMeasurements.js +95 -84
- package/src/App/hooks/useLayoutMeasurements.test.js +61 -1
- package/src/App/layout/Layout.jsx +9 -10
- package/src/App/layout/Layout.test.jsx +2 -0
- package/src/App/layout/layout.module.scss +31 -17
- package/src/App/registry/pluginRegistry.js +1 -1
- package/src/App/registry/pluginRegistry.test.js +12 -0
- package/src/App/renderer/HtmlElementHost.jsx +18 -5
- package/src/App/renderer/HtmlElementHost.test.jsx +54 -0
- package/src/App/renderer/mapButtons.js +28 -12
- package/src/App/renderer/mapButtons.test.js +17 -4
- package/src/App/renderer/mapControls.js +3 -1
- package/src/App/renderer/mapControls.test.js +16 -0
- package/src/App/renderer/mapPanels.js +44 -9
- package/src/App/renderer/mapPanels.test.js +51 -2
- package/src/App/renderer/orderItems.js +28 -0
- package/src/App/renderer/orderItems.test.js +50 -0
- package/src/App/renderer/slotAggregator.js +2 -18
- package/src/App/renderer/slotHelpers.js +3 -1
- package/src/App/renderer/slotHelpers.test.js +5 -0
- package/src/App/renderer/slots.js +3 -0
- package/src/App/store/AppProvider.jsx +1 -0
- package/src/App/store/appDispatchMiddleware.js +1 -1
- package/src/App/store/appDispatchMiddleware.test.js +8 -0
- package/src/config/events.js +2 -0
- package/src/scss/settings/_colors.scss +1 -0
- package/src/scss/settings/_dimensions.scss +2 -3
- package/src/scss/settings/_transition.scss +1 -1
- package/src/services/eventBus.js +44 -0
- package/src/services/eventBus.test.js +83 -0
- package/src/services/symbolRegistry.js +1 -1
- package/src/types.js +11 -1
- package/webpack.umd.mjs +2 -0
- package/plugins/datasets/src/components/Key/EmptyKey.jsx +0 -7
- package/plugins/datasets/src/components/Key/Key.jsx +0 -50
- package/plugins/datasets/src/components/Key/KeyGroupItem.jsx +0 -18
- package/plugins/datasets/src/components/Key/KeyItem.jsx +0 -23
- package/plugins/datasets/src/components/Key/KeySvg.jsx +0 -22
- package/plugins/datasets/src/components/Key/KeySvgLine.jsx +0 -19
- package/plugins/datasets/src/components/Key/KeySvgPattern.jsx +0 -13
- package/plugins/datasets/src/components/Key/KeySvgRect.jsx +0 -22
- package/plugins/datasets/src/components/Key/KeySvgSymbol.jsx +0 -16
- package/plugins/datasets/src/components/LayersMenu/LayersRadioGroupWrapper.jsx +0 -41
- /package/plugins/{datasets → menu}/src/reducers/menuStateReducer.js +0 -0
- /package/{providers/maplibre/src → src}/utils/rasteriseToImageData.js +0 -0
- /package/{providers/maplibre/src → src}/utils/rasteriseToImageData.test.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"ol/Map.js";import t from"ol/View.js";import{getCenter as r}from"ol/extent.js";import n from"ol/format/GeoJSON.js";import o from"ol/format/MVT.js";import"ol/has.js";import"ol/layer/Group.js";import"ol/layer/Layer.js";import a from"ol/layer/Tile.js";import i from"ol/layer/Vector.js";import s from"ol/layer/VectorTile.js";import"ol/loadingstrategy.js";import{transformExtent as l}from"ol/proj.js";import"ol/proj/Units.js";import"ol/source/Source.js";import"ol/source/TileJSON.js";import u from"ol/source/Vector.js";import p from"ol/source/VectorTile.js";import"ol/tilegrid.js";import c from"ol/tilegrid/TileGrid.js";import{distance as f}from"ol/coordinate.js";import{toPromise as d}from"ol/functions.js";import m from"ol/render/Feature.js";import y from"ol/style/Circle.js";import h from"ol/style/Fill.js";import g from"ol/style/Icon.js";import v from"ol/style/Stroke.js";import b from"ol/style/Style.js";import x from"ol/style/Text.js";import"ol/events/Event.js";import"ol/events/EventType.js";import w from"@babel/runtime/helpers/asyncToGenerator";import{defaults as k}from"ol/interaction/defaults.js";import M from"proj4";import{register as z}from"ol/proj/proj4.js";import S from"@babel/runtime/helpers/defineProperty";import j from"ol/source/XYZ.js";import A from"ol/source/TileWMS.js";import _ from"ol/source/OGCVectorTile.js";import E from"ol/TileState.js";import{fromString as O}from"ol/color.js";import"ol/layer/Image.js";import"ol/source/Raster.js";import{checkedFonts as P}from"ol/render/canvas.js";import{getUid as C}from"ol/util.js";import $ from"ol/Feature.js";class I{isBaseMapReady(){throw new Error(this.name+" must implement isBaseMapReady()")}}var q=[896,448,224,112,56,28,14,7,3.5,1.75,.875,.4375,.21875,.109375],T=[156543.03392800014,78271.51696400007,39135.758482000034,19567.879241000017,9783.939620500008,4891.969810250004,2445.984905125002,1222.992452562501,611.4962262812505,305.74811314062526,152.87405657031263,76.43702828515632,38.21851414257816,19.10925707128908,9.55462853564454,4.77731426782227,2.388657133911135,1.1943285669555674,.5971642834777837,.29858214173889186,.14929107086944593,.07464553543472296,.03732276771736148,.01866138385868074],N=[-238375,1376256],F=300,D=2,L=["showKeyboardHelp","selectControl","moveLarge","nudgeMap","zoomLarge","nudgeZoom"],R="uk",G="world";var Z=(e,t)=>{var r=null,n=function(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];clearTimeout(r),r=setTimeout(()=>{e(...o)},t)};return n.cancel=()=>{r&&(clearTimeout(r),r=null)},n};function H(e){var{map:t,view:r,emit:n,eventBus:o,events:a,on:i,debouncers:s}=e,l=!1,u=Z(()=>{l=!1,n(a.MAP_MOVE_END)},500);s.push(u);var p,c,f,d=(p=()=>n(a.MAP_MOVE),c=10,f=0,function(){var e=Date.now();e-f>=c&&(f=e,p(...arguments))});i(r,"change",()=>{l||(l=!0,o.emit(a.MAP_MOVE_START)),u()}),i(t,"postrender",()=>{l&&d()})}function U(e){var{map:t,source:r,events:n,eventBus:o,getZoom:a,getCenter:i,getBounds:s,getResolution:l}=e,u=!1,p=[],c=[],f=[],d=t.getView(),m=e=>{var t=(()=>{if(u)return null;var e=a();return{center:i(),bounds:s(),resolution:l(),zoom:e,isAtMaxZoom:e+.01>=d.getMaxZoom(),isAtMinZoom:e-.01<=d.getMinZoom()}})();t&&o.emit(e,t)},y=(e,t,r)=>{e.on(t,r),p.push([e,t,r])},h=(e,t,r)=>{e.on(t,r),c.push([e,t,r])},g=!1,v=()=>{g||(g=!0,o.emit(n.MAP_LOADED))},b=Z(()=>m(n.MAP_DATA_CHANGE),500);f.push(b);var x=e=>{u||(c.forEach(e=>{var[t,r,n]=e;return t.un(r,n)}),c=[],h(e,"tileloadend",v),h(e,"tileloadend",b))};return H({map:t,view:t.getView(),emit:m,eventBus:o,events:n,on:y,debouncers:f}),x(r),t.once("rendercomplete",()=>m(n.MAP_FIRST_IDLE)),function(e){var{map:t,eventBus:r,events:n,on:o}=e,a=null;o(t,"pointerdown",e=>{a=e.pixel}),o(t,"click",e=>{if(a){var t=e.pixel[0]-a[0],o=e.pixel[1]-a[1];if(Math.hypot(t,o)>6)return}r.emit(n.MAP_CLICK,{point:{x:e.pixel[0],y:e.pixel[1]},coords:e.coordinate})})}({map:t,eventBus:o,events:n,on:y}),y(t,"postrender",()=>o.emit(n.MAP_RENDER)),{setSource:x,remove(){u=!0,f.forEach(e=>e.cancel()),p.forEach(e=>{var[t,r,n]=e;return t.un(r,n)}),c.forEach(e=>{var[t,r,n]=e;return t.un(r,n)})}}}var B={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}};const V=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function W(e,t){const r={};for(const t in e)"ref"!==t&&(r[t]=e[t]);return V.forEach(e=>{e in t&&(r[e]=t[e])}),r}class J extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class X{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[e,r]of t)this.bindings[e]=r}concat(e){return new X(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const Y={kind:"null"},K={kind:"number"},Q={kind:"string"},ee={kind:"boolean"},te={kind:"color"},re={kind:"projectionDefinition"},ne={kind:"object"},oe={kind:"value"},ae={kind:"collator"},ie={kind:"formatted"},se={kind:"padding"},le={kind:"colorArray"},ue={kind:"numberArray"},pe={kind:"resolvedImage"},ce={kind:"variableAnchorOffsetCollection"};function fe(e,t){return{kind:"array",itemType:e,N:t}}function de(e){if("array"===e.kind){const t=de(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const me=[Y,K,Q,ee,te,re,ie,ne,fe(oe),se,ue,le,pe,ce];function ye(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!ye(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(const e of me)if(!ye(e,t))return null}return`Expected ${de(e)} but found ${de(t)} instead.`}function he(e,t){return t.some(t=>t.kind===e.kind)}function ge(e,t){return t.some(t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e)}function ve(e,t){return"array"===e.kind&&"array"===t.kind?e.itemType.kind===t.itemType.kind&&"number"==typeof e.N:e.kind===t.kind}const be=.96422,xe=.82521,we=4/29,ke=6/29,Me=3*ke*ke,ze=ke*ke*ke,Se=Math.PI/180,je=180/Math.PI;function Ae(e){return(e%=360)<0&&(e+=360),e}function _e([e,t,r,n]){let o,a;const i=Oe((.2225045*(e=Ee(e))+.7168786*(t=Ee(t))+.0606169*(r=Ee(r)))/1);e===t&&t===r?o=a=i:(o=Oe((.4360747*e+.3850649*t+.1430804*r)/be),a=Oe((.0139322*e+.0971045*t+.7141733*r)/xe));const s=116*i-16;return[s<0?0:s,500*(o-i),200*(i-a),n]}function Ee(e){return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Oe(e){return e>ze?Math.pow(e,1/3):e/Me+we}function Pe([e,t,r,n]){let o=(e+16)/116,a=isNaN(t)?o:o+t/500,i=isNaN(r)?o:o-r/200;return o=1*$e(o),a=be*$e(a),i=xe*$e(i),[Ce(3.1338561*a-1.6168667*o-.4906146*i),Ce(-.9787684*a+1.9161415*o+.033454*i),Ce(.0719453*a-.2289914*o+1.4052427*i),n]}function Ce(e){return(e=e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055)<0?0:e>1?1:e}function $e(e){return e>ke?e*e*e:Me*(e-we)}const Ie=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function qe(e,t){return Ie(e,t)?e[t]:void 0}function Te(e){if("transparent"===(e=e.toLowerCase().trim()))return[0,0,0,0];const t=qe(Re,e);if(t){const[e,r,n]=t;return[e/255,r/255,n/255,1]}if(e.startsWith("#")){if(/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){const t=e.length<6?1:2;let r=1;return[Ne(e.slice(r,r+=t)),Ne(e.slice(r,r+=t)),Ne(e.slice(r,r+=t)),Ne(e.slice(r,r+t)||"ff")]}}if(e.startsWith("rgb")){const t=/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,r=e.match(t);if(r){const[e,t,n,o,a,i,s,l,u,p,c,f]=r,d=[o||" ",s||" ",p].join("");if(" "===d||" /"===d||",,"===d||",,,"===d){const e=[n,i,u].join(""),r="%%%"===e?100:""===e?255:0;if(r){const e=[De(+t/r,0,1),De(+a/r,0,1),De(+l/r,0,1),c?Fe(+c,f):1];if(Le(e))return e}}return}}const r=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){const[e,t,n,o,a,i,s,l,u]=r,p=[n||" ",a||" ",s].join("");if(" "===p||" /"===p||",,"===p||",,,"===p){const e=[+t,De(+o,0,100),De(+i,0,100),l?Fe(+l,u):1];if(Le(e))return function([e,t,r,n]){function o(n){const o=(n+e/30)%12,a=t*Math.min(r,1-r);return r-a*Math.max(-1,Math.min(o-3,9-o,1))}return e=Ae(e),t/=100,r/=100,[o(0),o(8),o(4),n]}(e)}}}function Ne(e){return parseInt(e.padEnd(2,e),16)/255}function Fe(e,t){return De(t?e/100:e,0,1)}function De(e,t,r){return Math.min(Math.max(t,e),r)}function Le(e){return!e.some(Number.isNaN)}const Re={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function Ge(e,t,r){return e+r*(t-e)}function Ze(e,t,r){return e.map((e,n)=>Ge(e,t[n],r))}class He{constructor(e,t,r,n=1,o=!0){this.r=e,this.g=t,this.b=r,this.a=n,o||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[e,t,r,n]))}static parse(e){if(e instanceof He)return e;if("string"!=typeof e)return;const t=Te(e);return t?new He(...t,!1):void 0}get rgb(){const{r:e,g:t,b:r,a:n}=this,o=n||1/0;return this.overwriteGetter("rgb",[e/o,t/o,r/o,n])}get hcl(){return this.overwriteGetter("hcl",function(e){const[t,r,n,o]=_e(e),a=Math.sqrt(r*r+n*n);return[Math.round(1e4*a)?Ae(Math.atan2(n,r)*je):NaN,a,t,o]}(this.rgb))}get lab(){return this.overwriteGetter("lab",_e(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){const[e,t,r,n]=this.rgb;return`rgba(${[e,t,r].map(e=>Math.round(255*e)).join(",")},${n})`}static interpolate(e,t,r,n="rgb"){switch(n){case"rgb":{const[n,o,a,i]=Ze(e.rgb,t.rgb,r);return new He(n,o,a,i,!1)}case"hcl":{const[n,o,a,i]=e.hcl,[s,l,u,p]=t.hcl;let c,f;if(isNaN(n)||isNaN(s))isNaN(n)?isNaN(s)?c=NaN:(c=s,1!==a&&0!==a||(f=l)):(c=n,1!==u&&0!==u||(f=o));else{let e=s-n;s>n&&e>180?e-=360:s<n&&n-s>180&&(e+=360),c=n+r*e}const[d,m,y,h]=function([e,t,r,n]){return e=isNaN(e)?0:e*Se,Pe([r,Math.cos(e)*t,Math.sin(e)*t,n])}([c,null!=f?f:Ge(o,l,r),Ge(a,u,r),Ge(i,p,r)]);return new He(d,m,y,h,!1)}case"lab":{const[n,o,a,i]=Pe(Ze(e.lab,t.lab,r));return new He(n,o,a,i,!1)}}}}He.black=new He(0,0,0,1),He.white=new He(1,1,1,1),He.transparent=new He(0,0,0,0),He.red=new He(1,0,0,1);class Ue{constructor(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}const Be=["bottom","center","top"];class Ve{constructor(e,t,r,n,o,a){this.text=e,this.image=t,this.scale=r,this.fontStack=n,this.textColor=o,this.verticalAlign=a}}class We{constructor(e){this.sections=e}static fromString(e){return new We([new Ve(e,null,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(e=>0!==e.text.length||e.image&&0!==e.image.name.length)}static factory(e){return e instanceof We?e:We.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map(e=>e.text).join("")}}class Je{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Je)return e;if("number"==typeof e)return new Je([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const t of e)if("number"!=typeof t)return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new Je(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){return new Je(Ze(e.values,t.values,r))}}class Xe{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Xe)return e;if("number"==typeof e)return new Xe([e]);if(Array.isArray(e)){for(const t of e)if("number"!=typeof t)return;return new Xe(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){return new Xe(Ze(e.values,t.values,r))}}class Ye{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Ye)return e;if("string"==typeof e){const t=He.parse(e);if(!t)return;return new Ye([t])}if(!Array.isArray(e))return;const t=[];for(const r of e){if("string"!=typeof r)return;const e=He.parse(r);if(!e)return;t.push(e)}return new Ye(t)}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r,n="rgb"){const o=[];if(e.values.length!=t.values.length)throw new Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${t.values.length}), cannot interpolate.`);for(let a=0;a<e.values.length;a++)o.push(He.interpolate(e.values[a],t.values[a],r,n));return new Ye(o)}}class Ke extends Error{constructor(e){super(e),this.name="RuntimeError"}toJSON(){return this.message}}const Qe=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class et{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof et)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let t=0;t<e.length;t+=2){const r=e[t],n=e[t+1];if("string"!=typeof r||!Qe.has(r))return;if(!Array.isArray(n)||2!==n.length||"number"!=typeof n[0]||"number"!=typeof n[1])return}return new et(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){const n=e.values,o=t.values;if(n.length!==o.length)throw new Ke(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${t.toString()}`);const a=[];for(let e=0;e<n.length;e+=2){if(n[e]!==o[e])throw new Ke(`Cannot interpolate values containing mismatched anchors. from[${e}]: ${n[e]}, to[${e}]: ${o[e]}`);a.push(n[e]);const[t,i]=n[e+1],[s,l]=o[e+1];a.push([Ge(t,s,r),Ge(i,l,r)])}return new et(a)}}class tt{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new tt({name:e,available:!1}):null}}class rt{constructor(e,t,r){this.from=e,this.to=t,this.transition=r}static interpolate(e,t,r){return new rt(e,t,r)}static parse(e){return e instanceof rt?e:Array.isArray(e)&&3===e.length&&"string"==typeof e[0]&&"string"==typeof e[1]&&"number"==typeof e[2]?new rt(e[0],e[1],e[2]):"object"==typeof e&&"string"==typeof e.from&&"string"==typeof e.to&&"number"==typeof e.transition?new rt(e.from,e.to,e.transition):"string"==typeof e?new rt(e,e,1):void 0}}function nt(e,t,r,n){if(!("number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255)){return`Invalid rgba value [${("number"==typeof n?[e,t,r,n]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}return void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[e,t,r,n].join(", ")}]: 'a' must be between 0 and 1.`}function ot(e){if(null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e||e instanceof rt||e instanceof He||e instanceof Ue||e instanceof We||e instanceof Je||e instanceof Xe||e instanceof Ye||e instanceof et||e instanceof tt)return!0;if(Array.isArray(e)){for(const t of e)if(!ot(t))return!1;return!0}if("object"==typeof e){for(const t in e)if(!ot(e[t]))return!1;return!0}return!1}function at(e){if(null===e)return Y;if("string"==typeof e)return Q;if("boolean"==typeof e)return ee;if("number"==typeof e)return K;if(e instanceof He)return te;if(e instanceof rt)return re;if(e instanceof Ue)return ae;if(e instanceof We)return ie;if(e instanceof Je)return se;if(e instanceof Xe)return ue;if(e instanceof Ye)return le;if(e instanceof et)return ce;if(e instanceof tt)return pe;if(Array.isArray(e)){const t=e.length;let r;for(const t of e){const e=at(t);if(r){if(r===e)continue;r=oe;break}r=e}return fe(r||oe,t)}return ne}function it(e){const t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof He||e instanceof rt||e instanceof We||e instanceof Je||e instanceof Xe||e instanceof Ye||e instanceof et||e instanceof tt?e.toString():JSON.stringify(e)}class st{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(2!==e.length)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!ot(e[1]))return t.error("invalid value");const r=e[1];let n=at(r);const o=t.expectedType;return"array"!==n.kind||0!==n.N||!o||"array"!==o.kind||"number"==typeof o.N&&0!==o.N||(n=o),new st(n,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const lt={string:Q,number:K,boolean:ee,object:ne};class ut{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r,n=1;const o=e[0];if("array"===o){let o,a;if(e.length>2){const r=e[1];if("string"!=typeof r||!(r in lt)||"object"===r)return t.error('The item type argument of "array" must be one of string, number, boolean',1);o=lt[r],n++}else o=oe;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);a=e[2],n++}r=fe(o,a)}else{if(!lt[o])throw new Error(`Types doesn't contain name = ${o}`);r=lt[o]}const a=[];for(;n<e.length;n++){const r=t.parse(e[n],n,oe);if(!r)return null;a.push(r)}return new ut(r,a)}evaluate(e){for(let t=0;t<this.args.length;t++){const r=this.args[t].evaluate(e);if(!ye(this.type,at(r)))return r;if(t===this.args.length-1)throw new Ke(`Expected value to be of type ${de(this.type)}, but found ${de(at(r))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const pt={"to-boolean":ee,"to-color":te,"to-number":K,"to-string":Q};class ct{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[0];if(!pt[r])throw new Error(`Can't parse ${r} as it is not part of the known types`);if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");const n=pt[r],o=[];for(let r=1;r<e.length;r++){const n=t.parse(e[r],r,oe);if(!n)return null;o.push(n)}return new ct(n,o)}evaluate(e){switch(this.type.kind){case"boolean":return Boolean(this.args[0].evaluate(e));case"color":{let t,r;for(const n of this.args){if(t=n.evaluate(e),r=null,t instanceof He)return t;if("string"==typeof t){const r=e.parseColor(t);if(r)return r}else if(Array.isArray(t)&&(r=t.length<3||t.length>4?`Invalid rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:nt(t[0],t[1],t[2],t[3]),!r))return new He(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Ke(r||`Could not parse color from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"padding":{let t;for(const r of this.args){t=r.evaluate(e);const n=Je.parse(t);if(n)return n}throw new Ke(`Could not parse padding from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"numberArray":{let t;for(const r of this.args){t=r.evaluate(e);const n=Xe.parse(t);if(n)return n}throw new Ke(`Could not parse numberArray from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"colorArray":{let t;for(const r of this.args){t=r.evaluate(e);const n=Ye.parse(t);if(n)return n}throw new Ke(`Could not parse colorArray from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"variableAnchorOffsetCollection":{let t;for(const r of this.args){t=r.evaluate(e);const n=et.parse(t);if(n)return n}throw new Ke(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"number":{let t=null;for(const r of this.args){if(t=r.evaluate(e),null===t)return 0;const n=Number(t);if(!isNaN(n))return n}throw new Ke(`Could not convert ${JSON.stringify(t)} to number.`)}case"formatted":return We.fromString(it(this.args[0].evaluate(e)));case"resolvedImage":return tt.fromString(it(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return it(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const ft=["Unknown","Point","LineString","Polygon"];class dt{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?ft[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let t=this._parseColorCache.get(e);return t||(t=He.parse(e),this._parseColorCache.set(e,t)),t}}class mt{constructor(e,t,r=[],n,o=new X,a=[]){this.registry=e,this.path=r,this.key=r.map(e=>`[${e}]`).join(""),this.scope=o,this.errors=a,this.expectedType=n,this._isConstant=t}parse(e,t,r,n,o={}){return t?this.concat(t,r,n)._parse(e,o):this._parse(e,o)}_parse(e,t){function r(e,t,r){return"assert"===r?new ut(t,[e]):"coerce"===r?new ct(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const n=e[0];if("string"!=typeof n)return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const o=this.registry[n];if(o){let n=o.parse(e,this);if(!n)return null;if(this.expectedType){const e=this.expectedType,o=n.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==o.kind){if("projectionDefinition"===e.kind&&["string","array"].includes(o.kind)||["color","formatted","resolvedImage"].includes(e.kind)&&["value","string"].includes(o.kind)||["padding","numberArray"].includes(e.kind)&&["value","number","array"].includes(o.kind)||"colorArray"===e.kind&&["value","string","array"].includes(o.kind)||"variableAnchorOffsetCollection"===e.kind&&["value","array"].includes(o.kind))n=r(n,e,t.typeAnnotation||"coerce");else if(this.checkSubtype(e,o))return null}else n=r(n,e,t.typeAnnotation||"assert")}if(!(n instanceof st)&&"resolvedImage"!==n.type.kind&&this._isConstant(n)){const e=new dt;try{n=new st(n.type,n.evaluate(e))}catch(e){return this.error(e.message),null}}return n}return this.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0)}return void 0===e?this.error("'undefined' value invalid. Use null instead."):"object"==typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,t,r){const n="number"==typeof e?this.path.concat(e):this.path,o=r?this.scope.concat(r):this.scope;return new mt(this.registry,this._isConstant,n,t||null,o,this.errors)}error(e,...t){const r=`${this.key}${t.map(e=>`[${e}]`).join("")}`;this.errors.push(new J(r,e))}checkSubtype(e,t){const r=ye(e,t);return r&&this.error(r),r}}class yt{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const r=[];for(let n=1;n<e.length-1;n+=2){const o=e[n];if("string"!=typeof o)return t.error(`Expected string, but found ${typeof o} instead.`,n);if(/[^a-zA-Z0-9_]/.test(o))return t.error("Variable names must contain only alphanumeric characters or '_'.",n);const a=t.parse(e[n+1],n+1);if(!a)return null;r.push([o,a])}const n=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return n?new yt(r,n):null}outputDefined(){return this.result.outputDefined()}}class ht{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");const r=e[1];return t.scope.has(r)?new ht(r,t.scope.get(r)):t.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class gt{constructor(e,t,r){this.type=e,this.index=t,this.input=r}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,K),n=t.parse(e[2],2,fe(t.expectedType||oe));if(!r||!n)return null;const o=n.type;return new gt(o.itemType,r,n)}evaluate(e){const t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new Ke(`Array index out of bounds: ${t} < 0.`);if(t>=r.length)throw new Ke(`Array index out of bounds: ${t} > ${r.length-1}.`);if(t!==Math.floor(t))throw new Ke(`Array index must be an integer, but found ${t} instead.`);return r[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class vt{constructor(e,t){this.type=ee,this.needle=e,this.haystack=t}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,oe),n=t.parse(e[2],2,oe);return r&&n?he(r.type,[ee,Q,K,Y,oe])?new vt(r,n):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${de(r.type)} instead`):null}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!ge(t,["boolean","string","number","null"]))throw new Ke(`Expected first argument to be of type boolean, string, number or null, but found ${de(at(t))} instead.`);if(!ge(r,["string","array"]))throw new Ke(`Expected second argument to be of type array or string, but found ${de(at(r))} instead.`);return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class bt{constructor(e,t,r){this.type=K,this.needle=e,this.haystack=t,this.fromIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,oe),n=t.parse(e[2],2,oe);if(!r||!n)return null;if(!he(r.type,[ee,Q,K,Y,oe]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${de(r.type)} instead`);if(4===e.length){const o=t.parse(e[3],3,K);return o?new bt(r,n,o):null}return new bt(r,n)}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!ge(t,["boolean","string","number","null"]))throw new Ke(`Expected first argument to be of type boolean, string, number or null, but found ${de(at(t))} instead.`);let n;if(this.fromIndex&&(n=this.fromIndex.evaluate(e)),ge(r,["string"])){const e=r.indexOf(t,n);return-1===e?-1:[...r.slice(0,e)].length}if(ge(r,["array"]))return r.indexOf(t,n);throw new Ke(`Expected second argument to be of type array or string, but found ${de(at(r))} instead.`)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class xt{constructor(e,t,r,n,o,a){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=o,this.otherwise=a}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return t.error("Expected an even number of arguments.");let r,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);const o={},a=[];for(let i=2;i<e.length-1;i+=2){let s=e[i];const l=e[i+1];Array.isArray(s)||(s=[s]);const u=t.concat(i);if(0===s.length)return u.error("Expected at least one branch label.");for(const e of s){if("number"!=typeof e&&"string"!=typeof e)return u.error("Branch labels must be numbers or strings.");if("number"==typeof e&&Math.abs(e)>Number.MAX_SAFE_INTEGER)return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,at(e)))return null}else r=at(e);if(void 0!==o[String(e)])return u.error("Branch labels must be unique.");o[String(e)]=a.length}const p=t.parse(l,i,n);if(!p)return null;n=n||p.type,a.push(p)}const i=t.parse(e[1],1,oe);if(!i)return null;const s=t.parse(e[e.length-1],e.length-1,n);return s?"value"!==i.type.kind&&t.concat(1).checkSubtype(r,i.type)?null:new xt(r,n,i,o,a,s):null}evaluate(e){const t=this.input.evaluate(e);return(at(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}}class wt{constructor(e,t,r){this.type=e,this.branches=t,this.otherwise=r}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return t.error("Expected an odd number of arguments.");let r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);const n=[];for(let o=1;o<e.length-1;o+=2){const a=t.parse(e[o],o,ee);if(!a)return null;const i=t.parse(e[o+1],o+1,r);if(!i)return null;n.push([a,i]),r=r||i.type}const o=t.parse(e[e.length-1],e.length-1,r);if(!o)return null;if(!r)throw new Error("Can't infer output type");return new wt(r,n,o)}evaluate(e){for(const[t,r]of this.branches)if(t.evaluate(e))return r.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[t,r]of this.branches)e(t),e(r);e(this.otherwise)}outputDefined(){return this.branches.every(([e,t])=>t.outputDefined())&&this.otherwise.outputDefined()}}class kt{constructor(e,t,r,n){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=n}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,oe),n=t.parse(e[2],2,K);if(!r||!n)return null;if(!he(r.type,[fe(oe),Q,oe]))return t.error(`Expected first argument to be of type array or string, but found ${de(r.type)} instead`);if(4===e.length){const o=t.parse(e[3],3,K);return o?new kt(r.type,r,n,o):null}return new kt(r.type,r,n)}evaluate(e){const t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);let n;if(this.endIndex&&(n=this.endIndex.evaluate(e)),ge(t,["string"]))return[...t].slice(r,n).join("");if(ge(t,["array"]))return t.slice(r,n);throw new Ke(`Expected first argument to be of type array or string, but found ${de(at(t))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function Mt(e,t){const r=e.length-1;let n,o,a=0,i=r,s=0;for(;a<=i;)if(s=Math.floor((a+i)/2),n=e[s],o=e[s+1],n<=t){if(s===r||t<o)return s;a=s+1}else{if(!(n>t))throw new Ke("Input is not a number.");i=s-1}return 0}class zt{constructor(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[e,t]of r)this.labels.push(e),this.outputs.push(t)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");const r=t.parse(e[1],1,K);if(!r)return null;const n=[];let o=null;t.expectedType&&"value"!==t.expectedType.kind&&(o=t.expectedType);for(let r=1;r<e.length;r+=2){const a=1===r?-1/0:e[r],i=e[r+1],s=r,l=r+1;if("number"!=typeof a)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',s);if(n.length&&n[n.length-1][0]>=a)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const u=t.parse(i,l,o);if(!u)return null;o=o||u.type,n.push([a,u])}return new zt(o,r,n)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const o=t.length;if(n>=t[o-1])return r[o-1].evaluate(e);return r[Mt(t,n)].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function St(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jt,At;var _t=function(){if(At)return jt;function e(e,t,r,n){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=n}return At=1,jt=e,e.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var r=e,n=0;n<8;n++){var o=this.sampleCurveX(r)-e;if(Math.abs(o)<t)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=o/a}var i=0,s=1;for(r=e,n=0;n<20&&(o=this.sampleCurveX(r),!(Math.abs(o-e)<t));n++)e>o?i=r:s=r,r=.5*(s-i)+i;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}},jt}(),Et=St(_t);class Ot{constructor(e,t,r,n,o){this.type=e,this.operator=t,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(const[e,t]of o)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,r,n){let o=0;if("exponential"===e.name)o=Pt(t,e.base,r,n);else if("linear"===e.name)o=Pt(t,1,r,n);else if("cubic-bezier"===e.name){const a=e.controlPoints;o=new Et(a[0],a[1],a[2],a[3]).solve(Pt(t,1,r,n))}return o}static parse(e,t){let[r,n,o,...a]=e;if(!Array.isArray(n)||0===n.length)return t.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const e=n[1];if("number"!=typeof e)return t.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:e}}else{if("cubic-bezier"!==n[0])return t.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const e=n.slice(1);if(4!==e.length||e.some(e=>"number"!=typeof e||e<0||e>1))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:e}}}if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(o=t.parse(o,2,K),!o)return null;const i=[];let s=null;"interpolate-hcl"!==r&&"interpolate-lab"!==r||t.expectedType==le?t.expectedType&&"value"!==t.expectedType.kind&&(s=t.expectedType):s=te;for(let e=0;e<a.length;e+=2){const r=a[e],n=a[e+1],o=e+3,l=e+4;if("number"!=typeof r)return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',o);if(i.length&&i[i.length-1][0]>=r)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',o);const u=t.parse(n,l,s);if(!u)return null;s=s||u.type,i.push([r,u])}return ve(s,K)||ve(s,re)||ve(s,te)||ve(s,se)||ve(s,ue)||ve(s,le)||ve(s,ce)||ve(s,fe(K))?new Ot(s,r,n,o,i):t.error(`Type ${de(s)} is not interpolatable.`)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const o=t.length;if(n>=t[o-1])return r[o-1].evaluate(e);const a=Mt(t,n),i=t[a],s=t[a+1],l=Ot.interpolationFactor(this.interpolation,n,i,s),u=r[a].evaluate(e),p=r[a+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Ge(u,p,l);case"color":return He.interpolate(u,p,l);case"padding":return Je.interpolate(u,p,l);case"colorArray":return Ye.interpolate(u,p,l);case"numberArray":return Xe.interpolate(u,p,l);case"variableAnchorOffsetCollection":return et.interpolate(u,p,l);case"array":return Ze(u,p,l);case"projectionDefinition":return rt.interpolate(u,p,l)}case"interpolate-hcl":switch(this.type.kind){case"color":return He.interpolate(u,p,l,"hcl");case"colorArray":return Ye.interpolate(u,p,l,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return He.interpolate(u,p,l,"lab");case"colorArray":return Ye.interpolate(u,p,l,"lab")}}}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Pt(e,t,r,n){const o=n-r,a=e-r;return 0===o?0:1===t?a/o:(Math.pow(t,a)-1)/(Math.pow(t,o)-1)}class Ct{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r=null;const n=t.expectedType;n&&"value"!==n.kind&&(r=n);const o=[];for(const n of e.slice(1)){const e=t.parse(n,1+o.length,r,void 0,{typeAnnotation:"omit"});if(!e)return null;r=r||e.type,o.push(e)}if(!r)throw new Error("No output type");const a=n&&o.some(e=>ye(n,e.type));return new Ct(a?oe:r,o)}evaluate(e){let t,r=null,n=0;for(const o of this.args)if(n++,r=o.evaluate(e),r&&r instanceof tt&&!r.available&&(t||(t=r.name),r=null,n===this.args.length&&(r=t)),null!==r)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}function $t(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function It(e,t,r,n){return 0===n.compare(t,r)}function qt(e,t,r){const n="=="!==e&&"!="!==e;return class o{constructor(e,t,r){this.type=ee,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");const r=e[0];let a=t.parse(e[1],1,oe);if(!a)return null;if(!$t(r,a.type))return t.concat(1).error(`"${r}" comparisons are not supported for type '${de(a.type)}'.`);let i=t.parse(e[2],2,oe);if(!i)return null;if(!$t(r,i.type))return t.concat(2).error(`"${r}" comparisons are not supported for type '${de(i.type)}'.`);if(a.type.kind!==i.type.kind&&"value"!==a.type.kind&&"value"!==i.type.kind)return t.error(`Cannot compare types '${de(a.type)}' and '${de(i.type)}'.`);n&&("value"===a.type.kind&&"value"!==i.type.kind?a=new ut(i.type,[a]):"value"!==a.type.kind&&"value"===i.type.kind&&(i=new ut(a.type,[i])));let s=null;if(4===e.length){if("string"!==a.type.kind&&"string"!==i.type.kind&&"value"!==a.type.kind&&"value"!==i.type.kind)return t.error("Cannot use collator to compare non-string types.");if(s=t.parse(e[3],3,ae),!s)return null}return new o(a,i,s)}evaluate(o){const a=this.lhs.evaluate(o),i=this.rhs.evaluate(o);if(n&&this.hasUntypedArgument){const t=at(a),r=at(i);if(t.kind!==r.kind||"string"!==t.kind&&"number"!==t.kind)throw new Ke(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${r.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const e=at(a),r=at(i);if("string"!==e.kind||"string"!==r.kind)return t(o,a,i)}return this.collator?r(o,a,i,this.collator.evaluate(o)):t(o,a,i)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}}}const Tt=qt("==",function(e,t,r){return t===r},It),Nt=qt("!=",function(e,t,r){return t!==r},function(e,t,r,n){return!It(0,t,r,n)}),Ft=qt("<",function(e,t,r){return t<r},function(e,t,r,n){return n.compare(t,r)<0}),Dt=qt(">",function(e,t,r){return t>r},function(e,t,r,n){return n.compare(t,r)>0}),Lt=qt("<=",function(e,t,r){return t<=r},function(e,t,r,n){return n.compare(t,r)<=0}),Rt=qt(">=",function(e,t,r){return t>=r},function(e,t,r,n){return n.compare(t,r)>=0});class Gt{constructor(e,t,r){this.type=ae,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(2!==e.length)return t.error("Expected one argument.");const r=e[1];if("object"!=typeof r||Array.isArray(r))return t.error("Collator options argument must be an object.");const n=t.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,ee);if(!n)return null;const o=t.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,ee);if(!o)return null;let a=null;return r.locale&&(a=t.parse(r.locale,1,Q),!a)?null:new Gt(n,o,a)}evaluate(e){return new Ue(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}class Zt{constructor(e,t,r,n,o,a){this.type=Q,this.number=e,this.locale=t,this.currency=r,this.unit=n,this.minFractionDigits=o,this.maxFractionDigits=a}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,K);if(!r)return null;const n=e[2];if("object"!=typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");let o=null;if(n.locale&&(o=t.parse(n.locale,1,Q),!o))return null;let a=null;if(n.currency&&(a=t.parse(n.currency,1,Q),!a))return null;let i=null;if(n.unit&&(i=t.parse(n.unit,1,Q),!i))return null;if(a&&i)return t.error("NumberFormat options `currency` and `unit` are mutually exclusive");let s=null;if(n["min-fraction-digits"]&&(s=t.parse(n["min-fraction-digits"],1,K),!s))return null;let l=null;return n["max-fraction-digits"]&&(l=t.parse(n["max-fraction-digits"],1,K),!l)?null:new Zt(r,o,a,i,s,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":this.unit?"unit":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class Ht{constructor(e){this.type=ie,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[1];if(!Array.isArray(r)&&"object"==typeof r)return t.error("First argument must be an image or text section.");const n=[];let o=!1;for(let r=1;r<=e.length-1;++r){const a=e[r];if(o&&"object"==typeof a&&!Array.isArray(a)){o=!1;let e=null;if(a["font-scale"]&&(e=t.parse(a["font-scale"],1,K),!e))return null;let r=null;if(a["text-font"]&&(r=t.parse(a["text-font"],1,fe(Q)),!r))return null;let i=null;if(a["text-color"]&&(i=t.parse(a["text-color"],1,te),!i))return null;let s=null;if(a["vertical-align"]){if("string"==typeof a["vertical-align"]&&!Be.includes(a["vertical-align"]))return t.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${a["vertical-align"]}' instead.`);if(s=t.parse(a["vertical-align"],1,Q),!s)return null}const l=n[n.length-1];l.scale=e,l.font=r,l.textColor=i,l.verticalAlign=s}else{const a=t.parse(e[r],1,oe);if(!a)return null;const i=a.type.kind;if("string"!==i&&"value"!==i&&"null"!==i&&"resolvedImage"!==i)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");o=!0,n.push({content:a,scale:null,font:null,textColor:null,verticalAlign:null})}}return new Ht(n)}evaluate(e){return new We(this.sections.map(t=>{const r=t.content.evaluate(e);return at(r)===pe?new Ve("",r,null,null,null,t.verticalAlign?t.verticalAlign.evaluate(e):null):new Ve(it(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null,t.verticalAlign?t.verticalAlign.evaluate(e):null)}))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor),t.verticalAlign&&e(t.verticalAlign)}outputDefined(){return!1}}class Ut{constructor(e){this.type=pe,this.input=e}static parse(e,t){if(2!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,Q);return r?new Ut(r):t.error("No image name provided.")}evaluate(e){const t=this.input.evaluate(e),r=tt.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r}eachChild(e){e(this.input)}outputDefined(){return!1}}class Bt{constructor(e){this.type=K,this.input=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error(`Expected argument of type string or array, but found ${de(r.type)} instead.`):new Bt(r):null}evaluate(e){const t=this.input.evaluate(e);if("string"==typeof t)return[...t].length;if(Array.isArray(t))return t.length;throw new Ke(`Expected value to be of type string or array, but found ${de(at(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const Vt=8192;function Wt(e,t){const r=(180+e[0])/360;const n=(o=e[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+o*Math.PI/360)))/360);var o;const a=Math.pow(2,t.z);return[Math.round(r*a*Vt),Math.round(n*a*Vt)]}function Jt(e,t){const r=Math.pow(2,t.z),n=(e[0]/Vt+t.x)/r,o=(e[1]/Vt+t.y)/r;return[(i=n,360*i-180),(a=o,360/Math.PI*Math.atan(Math.exp((180-360*a)*Math.PI/180))-90)];var a,i}function Xt(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function Yt(e,t){return!(e[0]<=t[0])&&(!(e[2]>=t[2])&&(!(e[1]<=t[1])&&!(e[3]>=t[3])))}function Kt(e,t,r){return t[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function Qt(e,t,r){const n=e[0]-t[0],o=e[1]-t[1],a=e[0]-r[0],i=e[1]-r[1];return n*i-a*o===0&&n*a<=0&&o*i<=0}function er(e,t,r,n){const o=[t[0]-e[0],t[1]-e[1]],a=[n[0]-r[0],n[1]-r[1]];return 0!==(i=a)[0]*(s=o)[1]-i[1]*s[0]&&!(!ir(e,t,r,n)||!ir(r,n,e,t));var i,s}function tr(e,t,r){for(const n of r)for(let r=0;r<n.length-1;++r)if(er(e,t,n[r],n[r+1]))return!0;return!1}function rr(e,t,r=!1){let n=!1;for(const o of t)for(let t=0;t<o.length-1;t++){if(Qt(e,o[t],o[t+1]))return r;Kt(e,o[t],o[t+1])&&(n=!n)}return n}function nr(e,t){for(const r of t)if(rr(e,r))return!0;return!1}function or(e,t){for(const r of e)if(!rr(r,t))return!1;for(let r=0;r<e.length-1;++r)if(tr(e[r],e[r+1],t))return!1;return!0}function ar(e,t){for(const r of t)if(or(e,r))return!0;return!1}function ir(e,t,r,n){const o=e[0]-r[0],a=e[1]-r[1],i=t[0]-r[0],s=t[1]-r[1],l=n[0]-r[0],u=n[1]-r[1],p=o*u-l*a,c=i*u-l*s;return p>0&&c<0||p<0&&c>0}function sr(e,t,r){const n=[];for(let o=0;o<e.length;o++){const a=[];for(let n=0;n<e[o].length;n++){const i=Wt(e[o][n],r);Xt(t,i),a.push(i)}n.push(a)}return n}function lr(e,t,r){const n=[];for(let o=0;o<e.length;o++){const a=sr(e[o],t,r);n.push(a)}return n}function ur(e,t,r,n){if(e[0]<r[0]||e[0]>r[2]){const t=.5*n;let o=e[0]-r[0]>t?-n:r[0]-e[0]>t?n:0;0===o&&(o=e[0]-r[2]>t?-n:r[2]-e[0]>t?n:0),e[0]+=o}Xt(t,e)}function pr(e,t,r,n){const o=Math.pow(2,n.z)*Vt,a=[n.x*Vt,n.y*Vt],i=[];for(const n of e)for(const e of n){const n=[e.x+a[0],e.y+a[1]];ur(n,t,r,o),i.push(n)}return i}function cr(e,t,r,n){const o=Math.pow(2,n.z)*Vt,a=[n.x*Vt,n.y*Vt],i=[];for(const r of e){const e=[];for(const n of r){const r=[n.x+a[0],n.y+a[1]];Xt(t,r),e.push(r)}i.push(e)}if(t[2]-t[0]<=o/2){!function(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}(t);for(const e of i)for(const n of e)ur(n,t,r,o)}return i}class fr{constructor(e,t){this.type=ee,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ot(e[1])){const t=e[1];if("FeatureCollection"===t.type){const e=[];for(const r of t.features){const{type:t,coordinates:n}=r.geometry;"Polygon"===t&&e.push(n),"MultiPolygon"===t&&e.push(...n)}if(e.length){return new fr(t,{type:"MultiPolygon",coordinates:e})}}else if("Feature"===t.type){const e=t.geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new fr(t,t.geometry)}else if("Polygon"===t.type||"MultiPolygon"===t.type)return new fr(t,t)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],o=e.canonicalID();if("Polygon"===t.type){const a=sr(t.coordinates,n,o),i=pr(e.geometry(),r,n,o);if(!Yt(r,n))return!1;for(const e of i)if(!rr(e,a))return!1}if("MultiPolygon"===t.type){const a=lr(t.coordinates,n,o),i=pr(e.geometry(),r,n,o);if(!Yt(r,n))return!1;for(const e of i)if(!nr(e,a))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],o=e.canonicalID();if("Polygon"===t.type){const a=sr(t.coordinates,n,o),i=cr(e.geometry(),r,n,o);if(!Yt(r,n))return!1;for(const e of i)if(!or(e,a))return!1}if("MultiPolygon"===t.type){const a=lr(t.coordinates,n,o),i=cr(e.geometry(),r,n,o);if(!Yt(r,n))return!1;for(const e of i)if(!ar(e,a))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class dr{constructor(e=[],t=(e,t)=>e<t?-1:e>t?1:0){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(0===this.length)return;const e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:r}=this,n=t[e];for(;e>0;){const o=e-1>>1,a=t[o];if(r(n,a)>=0)break;t[e]=a,e=o}t[e]=n}_down(e){const{data:t,compare:r}=this,n=this.length>>1,o=t[e];for(;e<n;){let n=1+(e<<1);const a=n+1;if(a<this.length&&r(t[a],t[n])<0&&(n=a),r(t[n],o)>=0)break;t[e]=t[n],e=n}t[e]=o}}function mr(e){let t=0;for(let r,n,o=0,a=e.length,i=a-1;o<a;i=o++)r=e[o],n=e[i],t+=(n.x-r.x)*(r.y+n.y);return t}const yr=1/298.257223563,hr=yr*(2-yr),gr=Math.PI/180;class vr{constructor(e){const t=6378.137*gr*1e3,r=Math.cos(e*gr),n=1/(1-hr*(1-r*r)),o=Math.sqrt(n);this.kx=t*o*r,this.ky=t*o*n*(1-hr)}distance(e,t){const r=this.wrap(e[0]-t[0])*this.kx,n=(e[1]-t[1])*this.ky;return Math.sqrt(r*r+n*n)}pointOnLine(e,t){let r,n,o,a,i=1/0;for(let s=0;s<e.length-1;s++){let l=e[s][0],u=e[s][1],p=this.wrap(e[s+1][0]-l)*this.kx,c=(e[s+1][1]-u)*this.ky,f=0;0===p&&0===c||(f=(this.wrap(t[0]-l)*this.kx*p+(t[1]-u)*this.ky*c)/(p*p+c*c),f>1?(l=e[s+1][0],u=e[s+1][1]):f>0&&(l+=p/this.kx*f,u+=c/this.ky*f)),p=this.wrap(t[0]-l)*this.kx,c=(t[1]-u)*this.ky;const d=p*p+c*c;d<i&&(i=d,r=l,n=u,o=s,a=f)}return{point:[r,n],index:o,t:Math.max(0,Math.min(1,a))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}}function br(e,t){return t[0]-e[0]}function xr(e){return e[1]-e[0]+1}function wr(e,t){return e[1]>=e[0]&&e[1]<t}function kr(e,t){if(e[0]>e[1])return[null,null];const r=xr(e);if(t){if(2===r)return[e,null];const t=Math.floor(r/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}if(1===r)return[e,null];const n=Math.floor(r/2)-1;return[[e[0],e[0]+n],[e[0]+n+1,e[1]]]}function Mr(e,t){if(!wr(t,e.length))return[1/0,1/0,-1/0,-1/0];const r=[1/0,1/0,-1/0,-1/0];for(let n=t[0];n<=t[1];++n)Xt(r,e[n]);return r}function zr(e){const t=[1/0,1/0,-1/0,-1/0];for(const r of e)for(const e of r)Xt(t,e);return t}function Sr(e){return e[0]!==-1/0&&e[1]!==-1/0&&e[2]!==1/0&&e[3]!==1/0}function jr(e,t,r){if(!Sr(e)||!Sr(t))return NaN;let n=0,o=0;return e[2]<t[0]&&(n=t[0]-e[2]),e[0]>t[2]&&(n=e[0]-t[2]),e[1]>t[3]&&(o=e[1]-t[3]),e[3]<t[1]&&(o=t[1]-e[3]),r.distance([0,0],[n,o])}function Ar(e,t,r){const n=r.pointOnLine(t,e);return r.distance(e,n.point)}function _r(e,t,r,n,o){const a=Math.min(Ar(e,[r,n],o),Ar(t,[r,n],o)),i=Math.min(Ar(r,[e,t],o),Ar(n,[e,t],o));return Math.min(a,i)}function Er(e,t,r,n,o){if(!(wr(t,e.length)&&wr(n,r.length)))return 1/0;let a=1/0;for(let i=t[0];i<t[1];++i){const t=e[i],s=e[i+1];for(let e=n[0];e<n[1];++e){const n=r[e],i=r[e+1];if(er(t,s,n,i))return 0;a=Math.min(a,_r(t,s,n,i,o))}}return a}function Or(e,t,r,n,o){if(!(wr(t,e.length)&&wr(n,r.length)))return NaN;let a=1/0;for(let i=t[0];i<=t[1];++i)for(let t=n[0];t<=n[1];++t)if(a=Math.min(a,o.distance(e[i],r[t])),0===a)return a;return a}function Pr(e,t,r){if(rr(e,t,!0))return 0;let n=1/0;for(const o of t){const t=o[0],a=o[o.length-1];if(t!==a&&(n=Math.min(n,Ar(e,[a,t],r)),0===n))return n;const i=r.pointOnLine(o,e);if(n=Math.min(n,r.distance(e,i.point)),0===n)return n}return n}function Cr(e,t,r,n){if(!wr(t,e.length))return NaN;for(let n=t[0];n<=t[1];++n)if(rr(e[n],r,!0))return 0;let o=1/0;for(let a=t[0];a<t[1];++a){const t=e[a],i=e[a+1];for(const e of r)for(let r=0,a=e.length,s=a-1;r<a;s=r++){const a=e[s],l=e[r];if(er(t,i,a,l))return 0;o=Math.min(o,_r(t,i,a,l,n))}}return o}function $r(e,t){for(const r of e)for(const e of r)if(rr(e,t,!0))return!0;return!1}function Ir(e,t,r,n=1/0){const o=zr(e),a=zr(t);if(n!==1/0&&jr(o,a,r)>=n)return n;if(Yt(o,a)){if($r(e,t))return 0}else if($r(t,e))return 0;let i=1/0;for(const n of e)for(let e=0,o=n.length,a=o-1;e<o;a=e++){const o=n[a],s=n[e];for(const e of t)for(let t=0,n=e.length,a=n-1;t<n;a=t++){const n=e[a],l=e[t];if(er(o,s,n,l))return 0;i=Math.min(i,_r(o,s,n,l,r))}}return i}function qr(e,t,r,n,o,a){if(!a)return;const i=jr(Mr(n,a),o,r);i<t&&e.push([i,a,[0,0]])}function Tr(e,t,r,n,o,a,i){if(!a||!i)return;const s=jr(Mr(n,a),Mr(o,i),r);s<t&&e.push([s,a,i])}function Nr(e,t,r,n,o=1/0){let a=Math.min(n.distance(e[0],r[0][0]),o);if(0===a)return a;const i=new dr([[0,[0,e.length-1],[0,0]]],br),s=zr(r);for(;i.length>0;){const o=i.pop();if(o[0]>=a)continue;const l=o[1],u=t?50:100;if(xr(l)<=u){if(!wr(l,e.length))return NaN;if(t){const t=Cr(e,l,r,n);if(isNaN(t)||0===t)return t;a=Math.min(a,t)}else for(let t=l[0];t<=l[1];++t){const o=Pr(e[t],r,n);if(a=Math.min(a,o),0===a)return 0}}else{const r=kr(l,t);qr(i,a,n,e,s,r[0]),qr(i,a,n,e,s,r[1])}}return a}function Fr(e,t,r,n,o,a=1/0){let i=Math.min(a,o.distance(e[0],r[0]));if(0===i)return i;const s=new dr([[0,[0,e.length-1],[0,r.length-1]]],br);for(;s.length>0;){const a=s.pop();if(a[0]>=i)continue;const l=a[1],u=a[2],p=t?50:100,c=n?50:100;if(xr(l)<=p&&xr(u)<=c){if(!wr(l,e.length)&&wr(u,r.length))return NaN;let a;if(t&&n)a=Er(e,l,r,u,o),i=Math.min(i,a);else if(t&&!n){const t=e.slice(l[0],l[1]+1);for(let e=u[0];e<=u[1];++e)if(a=Ar(r[e],t,o),i=Math.min(i,a),0===i)return i}else if(!t&&n){const t=r.slice(u[0],u[1]+1);for(let r=l[0];r<=l[1];++r)if(a=Ar(e[r],t,o),i=Math.min(i,a),0===i)return i}else a=Or(e,l,r,u,o),i=Math.min(i,a)}else{const a=kr(l,t),p=kr(u,n);Tr(s,i,o,e,r,a[0],p[0]),Tr(s,i,o,e,r,a[0],p[1]),Tr(s,i,o,e,r,a[1],p[0]),Tr(s,i,o,e,r,a[1],p[1])}}return i}function Dr(e,t){const r=e.geometry();if(0===r.length||0===r[0].length)return NaN;const n=function(e){if(e.length<=1)return[e];const t=[];let r,n;for(const o of e){const e=mr(o);0!==e&&(o.area=Math.abs(e),void 0===n&&(n=e<0),n===e<0?(r&&t.push(r),r=[o]):r.push(o))}return r&&t.push(r),t}(r).map(t=>t.map(t=>t.map(t=>Jt([t.x,t.y],e.canonical)))),o=new vr(n[0][0][0][1]);let a=1/0;for(const e of t)for(const t of n){switch(e.type){case"Point":a=Math.min(a,Nr([e.coordinates],!1,t,o,a));break;case"LineString":a=Math.min(a,Nr(e.coordinates,!0,t,o,a));break;case"Polygon":a=Math.min(a,Ir(t,e.coordinates,o,a))}if(0===a)return a}return a}function Lr(e){return"MultiPolygon"===e.type?e.coordinates.map(e=>({type:"Polygon",coordinates:e})):"MultiLineString"===e.type?e.coordinates.map(e=>({type:"LineString",coordinates:e})):"MultiPoint"===e.type?e.coordinates.map(e=>({type:"Point",coordinates:e})):[e]}class Rr{constructor(e,t){this.type=K,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ot(e[1])){const t=e[1];if("FeatureCollection"===t.type)return new Rr(t,t.features.map(e=>Lr(e.geometry)).flat());if("Feature"===t.type)return new Rr(t,Lr(t.geometry));if("type"in t&&"coordinates"in t)return new Rr(t,Lr(t))}return t.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){const r=e.geometry(),n=r.flat().map(t=>Jt([t.x,t.y],e.canonical));if(0===r.length)return NaN;const o=new vr(n[0][1]);let a=1/0;for(const e of t){switch(e.type){case"Point":a=Math.min(a,Fr(n,!1,[e.coordinates],!1,o,a));break;case"LineString":a=Math.min(a,Fr(n,!1,e.coordinates,!0,o,a));break;case"Polygon":a=Math.min(a,Nr(n,!1,e.coordinates,o,a))}if(0===a)return a}return a}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const r=e.geometry(),n=r.flat().map(t=>Jt([t.x,t.y],e.canonical));if(0===r.length)return NaN;const o=new vr(n[0][1]);let a=1/0;for(const e of t){switch(e.type){case"Point":a=Math.min(a,Fr(n,!0,[e.coordinates],!1,o,a));break;case"LineString":a=Math.min(a,Fr(n,!0,e.coordinates,!0,o,a));break;case"Polygon":a=Math.min(a,Nr(n,!0,e.coordinates,o,a))}if(0===a)return a}return a}(e,this.geometries);if("Polygon"===e.geometryType())return Dr(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class Gr{constructor(e){this.type=oe,this.key=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=e[1];return null==r?t.error("Global state property must be defined."):"string"!=typeof r?t.error(`Global state property must be string, but found ${typeof e[1]} instead.`):new Gr(r)}evaluate(e){var t;const r=null===(t=e.globals)||void 0===t?void 0:t.globalState;return r&&0!==Object.keys(r).length?qe(r,this.key):null}eachChild(){}outputDefined(){return!1}}const Zr={"==":Tt,"!=":Nt,">":Dt,"<":Ft,">=":Rt,"<=":Lt,array:ut,at:gt,boolean:ut,case:wt,coalesce:Ct,collator:Gt,format:Ht,image:Ut,in:vt,"index-of":bt,interpolate:Ot,"interpolate-hcl":Ot,"interpolate-lab":Ot,length:Bt,let:yt,literal:st,match:xt,number:ut,"number-format":Zt,object:ut,slice:kt,step:zt,string:ut,"to-boolean":ct,"to-color":ct,"to-number":ct,"to-string":ct,var:ht,within:fr,distance:Rr,"global-state":Gr};class Hr{constructor(e,t,r,n){this.name=e,this.type=t,this._evaluate=r,this.args=n}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,t){const r=e[0],n=Hr.definitions[r];if(!n)return t.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const o=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,i=a.filter(([t])=>!Array.isArray(t)||t.length===e.length-1);let s=null;for(const[n,a]of i){s=new mt(t.registry,Jr,t.path,null,t.scope);const i=[];let l=!1;for(let t=1;t<e.length;t++){const r=e[t],o=Array.isArray(n)?n[t-1]:n.type,a=s.parse(r,1+i.length,o);if(!a){l=!0;break}i.push(a)}if(!l)if(Array.isArray(n)&&n.length!==i.length)s.error(`Expected ${n.length} arguments, but found ${i.length} instead.`);else{for(let e=0;e<i.length;e++){const t=Array.isArray(n)?n[e]:n.type,r=i[e];s.concat(e+1).checkSubtype(t,r.type)}if(0===s.errors.length)return new Hr(r,o,a,i)}}if(1===i.length)t.errors.push(...s.errors);else{const r=(i.length?i:a).map(([e])=>{return t=e,Array.isArray(t)?`(${t.map(de).join(", ")})`:`(${de(t.type)}...)`;var t}).join(" | "),n=[];for(let r=1;r<e.length;r++){const o=t.parse(e[r],1+n.length);if(!o)return null;n.push(de(o.type))}t.error(`Expected arguments of type ${r}, but found (${n.join(", ")}) instead.`)}return null}static register(e,t){Hr.definitions=t;for(const r in t)e[r]=Hr}}function Ur(e,[t,r,n,o]){t=t.evaluate(e),r=r.evaluate(e),n=n.evaluate(e);const a=o?o.evaluate(e):1,i=nt(t,r,n,a);if(i)throw new Ke(i);return new He(t/255,r/255,n/255,a,!1)}function Br(e,t){return e in t}function Vr(e,t){const r=t[e];return void 0===r?null:r}function Wr(e){return{type:e}}function Jr(e){if(e instanceof ht)return Jr(e.boundExpression);if(e instanceof Hr&&"error"===e.name)return!1;if(e instanceof Gt)return!1;if(e instanceof fr)return!1;if(e instanceof Rr)return!1;if(e instanceof Gr)return!1;const t=e instanceof ct||e instanceof ut;let r=!0;return e.eachChild(e=>{r=t?r&&Jr(e):r&&e instanceof st}),!!r&&(Xr(e)&&Kr(e,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]))}function Xr(e){if(e instanceof Hr){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof fr)return!1;if(e instanceof Rr)return!1;let t=!0;return e.eachChild(e=>{t&&!Xr(e)&&(t=!1)}),t}function Yr(e){if(e instanceof Hr&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild(e=>{t&&!Yr(e)&&(t=!1)}),t}function Kr(e,t){if(e instanceof Hr&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild(e=>{r&&!Kr(e,t)&&(r=!1)}),r}function Qr(e){return{result:"success",value:e}}function en(e){return{result:"error",value:e}}function tn(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&at(e)===ne}Hr.register(Zr,{error:[{kind:"error"},[Q],(e,[t])=>{throw new Ke(t.evaluate(e))}],typeof:[Q,[oe],(e,[t])=>de(at(t.evaluate(e)))],"to-rgba":[fe(K,4),[te],(e,[t])=>{const[r,n,o,a]=t.evaluate(e).rgb;return[255*r,255*n,255*o,a]}],rgb:[te,[K,K,K],Ur],rgba:[te,[K,K,K,K],Ur],has:{type:ee,overloads:[[[Q],(e,[t])=>Br(t.evaluate(e),e.properties())],[[Q,ne],(e,[t,r])=>Br(t.evaluate(e),r.evaluate(e))]]},get:{type:oe,overloads:[[[Q],(e,[t])=>Vr(t.evaluate(e),e.properties())],[[Q,ne],(e,[t,r])=>Vr(t.evaluate(e),r.evaluate(e))]]},"feature-state":[oe,[Q],(e,[t])=>Vr(t.evaluate(e),e.featureState||{})],properties:[ne,[],e=>e.properties()],"geometry-type":[Q,[],e=>e.geometryType()],id:[oe,[],e=>e.id()],zoom:[K,[],e=>e.globals.zoom],"heatmap-density":[K,[],e=>e.globals.heatmapDensity||0],elevation:[K,[],e=>e.globals.elevation||0],"line-progress":[K,[],e=>e.globals.lineProgress||0],accumulated:[oe,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[K,Wr(K),(e,t)=>{let r=0;for(const n of t)r+=n.evaluate(e);return r}],"*":[K,Wr(K),(e,t)=>{let r=1;for(const n of t)r*=n.evaluate(e);return r}],"-":{type:K,overloads:[[[K,K],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[K],(e,[t])=>-t.evaluate(e)]]},"/":[K,[K,K],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[K,[K,K],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[K,[],()=>Math.LN2],pi:[K,[],()=>Math.PI],e:[K,[],()=>Math.E],"^":[K,[K,K],(e,[t,r])=>Math.pow(t.evaluate(e),r.evaluate(e))],sqrt:[K,[K],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[K,[K],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[K,[K],(e,[t])=>Math.log(t.evaluate(e))],log2:[K,[K],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[K,[K],(e,[t])=>Math.sin(t.evaluate(e))],cos:[K,[K],(e,[t])=>Math.cos(t.evaluate(e))],tan:[K,[K],(e,[t])=>Math.tan(t.evaluate(e))],asin:[K,[K],(e,[t])=>Math.asin(t.evaluate(e))],acos:[K,[K],(e,[t])=>Math.acos(t.evaluate(e))],atan:[K,[K],(e,[t])=>Math.atan(t.evaluate(e))],min:[K,Wr(K),(e,t)=>Math.min(...t.map(t=>t.evaluate(e)))],max:[K,Wr(K),(e,t)=>Math.max(...t.map(t=>t.evaluate(e)))],abs:[K,[K],(e,[t])=>Math.abs(t.evaluate(e))],round:[K,[K],(e,[t])=>{const r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[K,[K],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[K,[K],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[ee,[Q,oe],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[ee,[oe],(e,[t])=>e.id()===t.value],"filter-type-==":[ee,[Q],(e,[t])=>e.geometryType()===t.value],"filter-<":[ee,[Q,oe],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n<o}],"filter-id-<":[ee,[oe],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r<n}],"filter->":[ee,[Q,oe],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n>o}],"filter-id->":[ee,[oe],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>n}],"filter-<=":[ee,[Q,oe],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n<=o}],"filter-id-<=":[ee,[oe],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r<=n}],"filter->=":[ee,[Q,oe],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n>=o}],"filter-id->=":[ee,[oe],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>=n}],"filter-has":[ee,[oe],(e,[t])=>t.value in e.properties()],"filter-has-id":[ee,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[ee,[fe(Q)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[ee,[fe(oe)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[ee,[Q,fe(oe)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[ee,[Q,fe(oe)],(e,[t,r])=>function(e,t,r,n){for(;r<=n;){const o=r+n>>1;if(t[o]===e)return!0;t[o]>e?n=o-1:r=o+1}return!1}(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:ee,overloads:[[[ee,ee],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[Wr(ee),(e,t)=>{for(const r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:ee,overloads:[[[ee,ee],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[Wr(ee),(e,t)=>{for(const r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[ee,[ee],(e,[t])=>!t.evaluate(e)],"is-supported-script":[ee,[Q],(e,[t])=>{const r=e.globals&&e.globals.isSupportedScript;return!r||r(t.evaluate(e))}],upcase:[Q,[Q],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[Q,[Q],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[Q,Wr(oe),(e,t)=>t.map(t=>it(t.evaluate(e))).join("")],split:[fe(Q),[Q,Q],(e,[t,r])=>t.evaluate(e).split(r.evaluate(e))],join:[Q,[fe(Q),Q],(e,[t,r])=>t.evaluate(e).join(r.evaluate(e))],"resolved-locale":[Q,[ae],(e,[t])=>t.evaluate(e).resolvedLocale()]});class rn{constructor(e,t,r){this.expression=e,this._warningHistory={},this._evaluator=new dt,this._defaultValue=t?function(e){if("color"===e.type&&tn(e.default))return new He(0,0,0,0);switch(e.type){case"color":return He.parse(e.default)||null;case"padding":return Je.parse(e.default)||null;case"numberArray":return Xe.parse(e.default)||null;case"colorArray":return Ye.parse(e.default)||null;case"variableAnchorOffsetCollection":return et.parse(e.default)||null;case"projectionDefinition":return rt.parse(e.default)||null;default:return void 0===e.default?null:e.default}}(t):null,this._enumValues=t&&"enum"===t.type?t.values:null,this._globalState=r}evaluateWithoutErrorHandling(e,t,r,n,o,a){return this._globalState&&(e=cn(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,n,o,a){this._globalState&&(e=cn(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a||null;try{const e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new Ke(`Expected value to be one of ${Object.keys(this._enumValues).map(e=>JSON.stringify(e)).join(", ")}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(e.message)),this._defaultValue}}}function nn(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in Zr}function on(e,t,r){const n=new mt(Zr,Jr,[],t?function(e){const t={color:te,string:Q,number:K,enum:Q,boolean:ee,formatted:ie,padding:se,numberArray:ue,colorArray:le,projectionDefinition:re,resolvedImage:pe,variableAnchorOffsetCollection:ce};if("array"===e.type)return fe(t[e.value]||oe,e.length);return t[e.type]}(t):void 0),o=n.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return o?Qr(new rn(o,t,r)):en(n.errors)}class an{constructor(e,t,r){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!Yr(t.expression),this.globalStateRefs=pn(t.expression),this._globalState=r}evaluateWithoutErrorHandling(e,t,r,n,o,a){return this._globalState&&(e=cn(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,o,a)}evaluate(e,t,r,n,o,a){return this._globalState&&(e=cn(e,this._globalState)),this._styleExpression.evaluate(e,t,r,n,o,a)}}class sn{constructor(e,t,r,n,o){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!Yr(t.expression),this.globalStateRefs=pn(t.expression),this.interpolationType=n,this._globalState=o}evaluateWithoutErrorHandling(e,t,r,n,o,a){return this._globalState&&(e=cn(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,o,a)}evaluate(e,t,r,n,o,a){return this._globalState&&(e=cn(e,this._globalState)),this._styleExpression.evaluate(e,t,r,n,o,a)}interpolationFactor(e,t,r){return this.interpolationType?Ot.interpolationFactor(this.interpolationType,e,t,r):0}}function ln(e,t,r){const n=on(e,t,r);if("error"===n.result)return n;const o=n.value.expression,a=Xr(o);if(!a&&("data-driven"!==(i=t)["property-type"]&&"cross-faded-data-driven"!==i["property-type"]))return en([new J("","data expressions not supported")]);var i;const s=Kr(o,["zoom"]);if(!s&&!function(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}(t))return en([new J("","zoom expressions not supported")]);const l=un(o);if(!l&&!s)return en([new J("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(l instanceof J)return en([l]);if(l instanceof Ot&&!function(e){return!!e.expression&&e.expression.interpolated}(t))return en([new J("",'"interpolate" expressions cannot be used with this property')]);if(!l)return Qr(new an(a?"constant":"source",n.value,r));const u=l instanceof Ot?l.interpolation:void 0;return Qr(new sn(a?"camera":"composite",n.value,l.labels,u,r))}function un(e){let t=null;if(e instanceof yt)t=un(e.result);else if(e instanceof Ct){for(const r of e.args)if(t=un(r),t)break}else(e instanceof zt||e instanceof Ot)&&e.input instanceof Hr&&"zoom"===e.input.name&&(t=e);return t instanceof J||e.eachChild(e=>{const r=un(e);r instanceof J?t=r:!t&&r?t=new J("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&r&&t!==r&&(t=new J("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}function pn(e,t=new Set){return e instanceof Gr&&t.add(e.key),e.eachChild(e=>{pn(e,t)}),t}function cn(e,t){const{zoom:r,heatmapDensity:n,elevation:o,lineProgress:a,isSupportedScript:i,accumulated:s}=null!=e?e:{};return{zoom:r,heatmapDensity:n,elevation:o,lineProgress:a,isSupportedScript:i,accumulated:s,globalState:t}}function fn(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(const t of e.slice(1))if(!fn(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}const dn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function mn(e,t){if(null==e)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};fn(e)||(e=gn(e));const r=on(e,dn,t);if("error"===r.result)throw new Error(r.value.map(e=>`${e.key}: ${e.message}`).join(", "));return{filter:(e,t,n)=>r.value.evaluate(e,t,{},n),needGeometry:hn(e),getGlobalStateRefs:()=>pn(r.value.expression)}}function yn(e,t){return e<t?-1:e>t?1:0}function hn(e){if(!Array.isArray(e))return!1;if("within"===e[0]||"distance"===e[0])return!0;for(let t=1;t<e.length;t++)if(hn(e[t]))return!0;return!1}function gn(e){if(!e)return!0;const t=e[0];if(e.length<=1)return"any"!==t;var r;return"=="===t?vn(e[1],e[2],"=="):"!="===t?wn(vn(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?vn(e[1],e[2],t):"any"===t?(r=e.slice(1),["any"].concat(r.map(gn))):"all"===t?["all"].concat(e.slice(1).map(gn)):"none"===t?["all"].concat(e.slice(1).map(gn).map(wn)):"in"===t?bn(e[1],e.slice(2)):"!in"===t?wn(bn(e[1],e.slice(2))):"has"===t?xn(e[1]):"!has"!==t||wn(xn(e[1]))}function vn(e,t,r){switch(e){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,e,t]}}function bn(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(e=>typeof e!=typeof t[0])?["filter-in-large",e,["literal",t.sort(yn)]]:["filter-in-small",e,["literal",t]]}}function xn(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function wn(e){return["!",e]}function kn(e){return"object"==typeof e?["literal",e]:e}function Mn(e,t){let r=e.stops;if(!r)return function(e,t){const r=["get",e.property];if(void 0===e.default)return"string"===t.type?["string",r]:r;if("enum"===t.type)return["match",r,Object.keys(t.values),r,e.default];{const n=["color"===t.type?"to-color":t.type,r,kn(e.default)];return"array"===t.type&&n.splice(1,0,t.value,t.length||null),n}}(e,t);const n=r&&"object"==typeof r[0][0],o=n||void 0!==e.property,a=n||!o;return r=r.map(e=>!o&&t.tokens&&"string"==typeof e[1]?[e[0],On(e[1])]:[e[0],kn(e[1])]),n?function(e,t,r){const n={},o={},a=[];for(let t=0;t<r.length;t++){const i=r[t],s=i[0].zoom;void 0===n[s]&&(n[s]={zoom:s,type:e.type,property:e.property,default:e.default},o[s]=[],a.push(s)),o[s].push([i[0].value,i[1]])}const i=En({},t);if("exponential"===i){const r=[zn(e),["linear"],["zoom"]];for(const e of a){_n(r,e,jn(n[e],t,o[e]),!1)}return r}{const e=["step",["zoom"]];for(const r of a){_n(e,r,jn(n[r],t,o[r]),!0)}return An(e),e}}(e,t,r):a?function(e,t,r,n=["zoom"]){const o=En(e,t);let a,i=!1;if("interval"===o)a=["step",n],i=!0;else{if("exponential"!==o)throw new Error(`Unknown zoom function type "${o}"`);{const t=void 0!==e.base?e.base:1;a=[zn(e),1===t?["linear"]:["exponential",t],n]}}for(const e of r)_n(a,e[0],e[1],i);return An(a),a}(e,t,r):jn(e,t,r)}function zn(e){switch(e.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function Sn(e,t){const r=kn((n=e.default,o=t.default,void 0!==n?n:void 0!==o?o:void 0));var n,o;return void 0===r&&"resolvedImage"===t.type?"":r}function jn(e,t,r){const n=En(e,t),o=["get",e.property];if("categorical"===n&&"boolean"==typeof r[0][0]){const n=["case"];for(const e of r)n.push(["==",o,e[0]],e[1]);return n.push(Sn(e,t)),n}if("categorical"===n){const n=["match",o];for(const e of r)_n(n,e[0],e[1],!1);return n.push(Sn(e,t)),n}if("interval"===n){const t=["step",["number",o]];for(const e of r)_n(t,e[0],e[1],!0);return An(t),void 0===e.default?t:["case",["==",["typeof",o],"number"],t,kn(e.default)]}if("exponential"===n){const t=void 0!==e.base?e.base:1,n=[zn(e),1===t?["linear"]:["exponential",t],["number",o]];for(const e of r)_n(n,e[0],e[1],!1);return void 0===e.default?n:["case",["==",["typeof",o],"number"],n,kn(e.default)]}throw new Error(`Unknown property function type ${n}`)}function An(e){"step"===e[0]&&3===e.length&&(e.push(0),e.push(e[3]))}function _n(e,t,r,n){e.length>3&&t===e[e.length-2]||(n&&2===e.length||e.push(t),e.push(r))}function En(e,t){return e.type?e.type:t.expression.interpolated?"exponential":"interval"}function On(e){const t=["concat"],r=/{([^{}]+)}/g;let n=0;for(let o=r.exec(e);null!==o;o=r.exec(e)){const a=e.slice(n,r.lastIndex-o[0].length);n=r.lastIndex,a.length>0&&t.push(a),t.push(["get",o[1]])}if(1===t.length)return e;if(n<e.length)t.push(e.slice(n));else if(2===t.length)return["to-string",t[1]];return t}const Pn=B;function Cn(e,t){const r=t[0].evaluate(e),n=t[1].evaluate(e),o=t[2].evaluate(e),a=t[3]?t[3].evaluate(e):1;return He.parse(`hsla(${r}, ${n}%, ${o}%, ${a})`)}function $n(e){if(Array.isArray(e)){if(0===e.length)return e;const t=e[0];if("literal"===t)return e;if("image"===t&&3===e.length&&"object"==typeof e[2]&&null!==e[2]&&!Array.isArray(e[2])){return["image-config",$n(e[1]),["literal",e[2]]]}const r=e.length;for(let n=1;n<r;++n){const o=e[n],a=$n(o);if(a!==o){const o=[t];for(let t=1;t<n;++t)o.push(e[t]);o.push(a);for(let t=n+1;t<r;++t)o.push($n(e[t]));return o}}}return e}const In={},qn={zoom:0,distanceFromCenter:0};Hr.register(Zr,{...Hr.definitions,pitch:[{kind:"number"},[],e=>qn.pitch||0],"distance-from-center":[{kind:"number"},[],e=>qn.distanceFromCenter||0],"to-hsla":[{kind:"array",itemType:{kind:"number"},N:4},[{kind:"string"}],(e,[t])=>function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,o=e[3],a=Math.max(t,r,n),i=Math.min(t,r,n),s=(a+i)/2;let l,u;if(a===i)l=0,u=0;else{const e=a-i;switch(u=s>.5?e/(2-a-i):e/(a+i),a){case t:l=(r-n)/e+(r<n?6:0);break;case r:l=(n-t)/e+2;break;case n:l=(t-r)/e+4;break;default:l=0}l/=6}return[360*l,100*u,100*s,o]}(O(t.evaluate(e)))],hsl:[{kind:"color"},[{kind:"number"},{kind:"number"},{kind:"number"}],Cn],hsla:[{kind:"color"},[{kind:"number"},{kind:"number"},{kind:"number"},{kind:"number"}],Cn],"image-config":[{kind:"value"},[{kind:"string"},{kind:"value"}],(e,[t,r])=>t.evaluate(e)],"measure-light":[{kind:"number"},[{kind:"value"}],()=>1],config:[{kind:"value"},[{kind:"string"}],(e,[t])=>{const r=In[t.evaluate(e)];return void 0===r?{}:r}]});var Tn={thin:100,hairline:100,"ultra-light":200,"extra-light":200,light:300,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,"extra-bold":800,"ultra-bold":800,heavy:900,black:900,"heavy-black":900,fat:900,poster:900,"ultra-black":950,"extra-black":950},Nn=" ",Fn=/(italic|oblique)$/i,Dn={};function Ln(e,t,r){var n=Dn[e];if(!n){Array.isArray(e)||(e=[e]);for(var o,a,i=400,s="normal",l=[],u=0,p=e.length;u<p;++u){var c=e[u].split(" "),f=c[c.length-1].toLowerCase();for(var d in"normal"==f||"italic"==f||"oblique"==f?(s=a?s:f,a=!0,c.pop(),f=c[c.length-1].toLowerCase()):Fn.test(f)&&(f=f.replace(Fn,""),s=a?s:c[c.length-1].replace(f,""),a=!0),Tn){var m=c.length>1?c[c.length-2].toLowerCase():"";if(f==d||f==d.replace("-","")||m+"-"+f==d){i=o?i:Tn[d],c.pop(),m&&d.startsWith(m)&&c.pop();break}}o||"number"!=typeof f||(i=f,o=!0);var y=c.join(Nn).replace("Klokantech Noto Sans","Noto Sans").replace("DIN Pro","Barlow").replace("Arial Unicode MS","Arial");-1!==y.indexOf(Nn)&&(y='"'+y+'"'),l.push(y)}n=Dn[e]=[s,i,l]}return n[0]+Nn+n[1]+Nn+t+"px"+(r?"/"+r:"")+Nn+n[2]}const Rn=Object.freeze({}),Gn={},Zn={};let Hn=0;function Un(e){return e.id||(e.id=Hn++),e.id}function Bn(e){return e*Math.PI/180}const Vn=function(){const e=[];for(let t=78271.51696402048;e.length<=24;t/=2)e.push(t);return e}();function Wn(e,t){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(e,t);const r=document.createElement("canvas");return r.width=e,r.height=t,r}function Jn(e,t,r,n){const o=[2*r*t.pixelRatio+t.width,2*r*t.pixelRatio+t.height],a=Wn(o[0],o[1]),i=a.getContext("2d");i.drawImage(e,t.x,t.y,t.width,t.height,r*t.pixelRatio,r*t.pixelRatio,t.width,t.height);const s=i.getImageData(0,0,o[0],o[1]);i.globalCompositeOperation="destination-over",i.fillStyle=`rgba(${255*n.r},${255*n.g},${255*n.b},${n.a})`;const l=s.data;for(let e=0,n=s.width;e<n;++e)for(let o=0,a=s.height;o<a;++o){l[4*(o*n+e)+3]>0&&i.arc(e,o,r*t.pixelRatio,0,2*Math.PI)}return i.fill(),a}function Xn(e,t,r){const n=Math.max(0,Math.min(1,(r-e)/(t-e)));return n*n*(3-2*n)}function Yn(e,t,r){const n=Wn(t.width,t.height),o=n.getContext("2d");o.drawImage(e,t.x,t.y,t.width,t.height,0,0,t.width,t.height);const a=o.getImageData(0,0,t.width,t.height),i=a.data;for(let e=0,t=a.width;e<t;++e)for(let n=0,o=a.height;n<o;++n){const o=4*(n*t+e),a=.75,s=.1,l=Xn(a-s,a+s,i[o+3]/255);l>0?(i[o+0]=Math.round(255*r.r*l),i[o+1]=Math.round(255*r.g*l),i[o+2]=Math.round(255*r.b*l),i[o+3]=Math.round(255*l)):i[o+3]=0}return o.putImageData(a,0,0),n}const Kn=Array(256).join(" ");function Qn(e,t){if(t>=.05){let r="";const n=e.split("\n"),o=Kn.slice(0,Math.round(t/.1));for(let e=0,t=n.length;e<t;++e)e>0&&(r+="\n"),r+=n[e].split("").join(o);return r}return e}let eo;function to(){return eo||(eo=Wn(1,1).getContext("2d")),eo}function ro(e,t){return to().measureText(e).width+(e.length-1)*t}const no={};function oo(e,t,r,n){if(-1!==e.indexOf("\n")){const o=e.split("\n"),a=[];for(let e=0,i=o.length;e<i;++e)a.push(oo(o[e],t,r,n));return a.join("\n")}const o=r+","+t+","+e+","+n;let a=no[o];if(!a){const i=e.split(" ");if(i.length>1){const e=to();e.font=t;const o=e.measureText("M").width*r;let s="";const l=[];for(let e=0,t=i.length;e<t;++e){const t=i[e],r=s+(s?" ":"")+t;ro(r,n)<=o?s=r:(s&&l.push(s),s=t)}s&&l.push(s);for(let e=0,t=l.length;e<t&&t>1;++e){const r=l[e];if(ro(r,n)<.35*o){const o=e>0?ro(l[e-1],n):1/0,a=e<t-1?ro(l[e+1],n):1/0;l.splice(e,1),t-=1,o<a?(l[e-1]+=" "+r,e-=1):l[e]=r+" "+l[e]}}for(let e=0,t=l.length-1;e<t;++e){const r=l[e],a=l[e+1];if(ro(r,n)>.7*o&&ro(a,n)<.6*o){const i=r.split(" "),s=i.pop();ro(s,n)<.2*o&&(l[e]=i.join(" "),l[e+1]=s+" "+a),t-=1}}a=l.join("\n")}else a=e;a=Qn(a,n),no[o]=a}return a}P.on("propertychange",()=>{for(const e in no)delete no[e]});const ao={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},io={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},so=function(e,t){let r=ln(e,t);if("error"===r.result){const n=$n(e);n!==e&&(r=ln(n,t))}if("error"===r.result){const n=r.value[0];return console.error("Error parsing expression:",e,n.key,n.message),{evaluate:()=>t.default}}return r.value};let lo,uo;function po(e,t,r,n,o,a){const i=e.id;o||(o={},console.warn("No functionCache provided to getValue()")),o[i]||(o[i]={});const s=o[i];if(!s[r]){let n=(e[t]||Rn)[r];const o=Pn[`${t}_${e.type}`]&&Pn[`${t}_${e.type}`][r];void 0===n&&o&&(n=o.default);let a=nn(n);if(!a&&tn(n)&&(n=Mn(n,o),a=!0),a){const e=so(n,o);s[r]=e.evaluate.bind(e)}else{const e=o?o.type:typeof n;"color"!==e&&"colorArray"!==e||(n=He.parse(n));let t=!1;if("array"===e)for(let e=0;e<n.length;++e){const r=n[e];if(nn(r)||tn(r)){t=!0;break}}if(t){const e=Object.assign({},o,{type:o.value}),t=[];for(let r=0;r<n.length;++r){let o=n[r];if(!nn(o)&&tn(o)&&(o=Mn(o,e)),nn(o)){const r=so(o,e);t.push(r.evaluate.bind(r))}else t.push(function(){return o})}s[r]=function(e,r,n){const o=[];for(let a=0;a<t.length;++a)o[a]=t[a](e,r,n);return o}}else s[r]=function(){return n}}}return s[r](qn,n,a)}function co(e,t,r,n){if(!po(e,"layout",`${r}-allow-overlap`,t,n))return"declutter";return po(e,"layout",`${r}-ignore-placement`,t,n)?"none":"obstacle"}function fo(e,t,r,n){if(n||console.warn("No filterCache provided to evaluateFilter()"),!(e in n))try{n[e]=mn(t).filter}catch(t){console.warn("Filter will evaluate to false: "+t.message),n[e]=function(){return!1}}return n[e](qn,r)}function mo(e,t){if(e){if(0===e.a||0===t)return;const r=e.a;return t=void 0===t?1:t,0===r?"transparent":"rgba("+Math.round(255*e.r/r)+","+Math.round(255*e.g/r)+","+Math.round(255*e.b/r)+","+r*t+")"}return e}const yo=/\{[^{}}]*\}/g;function ho(e,t){return e.replace(yo,function(e){return t[e.slice(1,-1)]||""})}function go(e,t){let r=e.split(":")[0];return r===e&&(r="default"),t[r]}let vo=!1;const bo={};function xo(t,n,o,a=Vn,i=void 0,s=void 0,l=void 0,u=void 0){if("string"==typeof n&&(n=JSON.parse(n)),n.schema)for(const e in n.schema){const t=n.schema[e];"default"in t&&(In[e]=t.default)}if(8!=n.version)throw new Error("glStyle version 8 required.");bo[function(e,t){return Un(e)+"."+C(t)}(n,t)]=Array.from(arguments);const p={};("string"==typeof s||s instanceof Request||s instanceof Response||s instanceof Promise)&&(s={default:s});for(const e in s){const r=s[e];d(()=>r).then(async r=>{let n;if("undefined"!=typeof Image){const o=new Image;if("string"==typeof r)o.crossOrigin="anonymous",o.src=r;else{let e;r instanceof Request?e=await fetch(r):r instanceof Response&&(e=r);const t=await e.blob();n=URL.createObjectURL(t),o.src=n}o.addEventListener("load",function r(){o.removeEventListener("load",r),p[e]={image:o,size:[o.width,o.height]},t.changed(),n&&URL.revokeObjectURL(n)}),o.addEventListener("error",function e(){URL.revokeObjectURL(n),o.removeEventListener("error",e)})}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){const t=self;t.postMessage({action:"loadImage",src:r}),t.addEventListener("message",function(t){"imageLoaded"===t.data.action&&t.data.src===r&&(p[e]={image:t.data.image,size:[t.data.image.width,t.data.image.height]})})}})}const c=function(e){e=e.slice();const t=Object.create(null);for(let r=0;r<e.length;r++)t[e[r].id]=e[r];for(let r=0;r<e.length;r++)"ref"in e[r]&&(e[r]=W(e[r],t[e[r].ref]));return e}(n.layers),w={},k=[],M={},z={},S=function(e){let t=Gn[e.id];return t||(t={},Gn[Un(e)]=t),t}(n),j=function(e){let t=Zn[e.id];return t||(t={},Zn[Un(e)]=t),t}(n);let A;for(let e=0,t=c.length;e<t;++e){const t=c[e],r=t.id;if("string"==typeof o&&t.source==o||Array.isArray(o)&&-1!==o.indexOf(r)){const o=t["source-layer"];if(A){if(t.source!==A)throw new Error(`Layer "${r}" does not use source "${A}`)}else{A=t.source;const e=n.sources[A];if(!e)throw new Error(`Source "${A}" is not defined`);const r=e.type;if("vector"!==r&&"geojson"!==r)throw new Error(`Source "${A}" is not of type "vector" or "geojson", but "${r}"`)}let a=w[o];a||(a=[],w[o]=a),a.push({layer:t,index:e}),k.push(r)}}const _=[],E=function(o,s,c){const d=t.getSource?.()?.format_?.layerName_??"mvt:layer",k=o.getProperties(),A=w[k[d]];if(!A)return;let E=a.indexOf(s);-1==E&&(E=function(e,t){let r=0;const n=t.length;for(;r<n;++r)if(t[r]<e&&r+1<n){const n=t[r]/t[r+1];return r+Math.log(t[r]/e)/Math.log(n)}return n-1}(s,a)),qn.zoom=E,qn.distanceFromCenter=0;const O=o.getGeometry(),P=ao[O.getType()],C=t.get("map");if(C&&C instanceof e&&1===P){const e=C.getSize();if(e){const t=C.getView().getCenter(),n=r(O.getExtent());qn.distanceFromCenter=f(t,n)/s/e[1]}}const $={id:o.getId(),properties:k,type:P},I=t.get("mapbox-featurestate")[o.getId()];let q,T=-1;for(let e=0,r=A.length;e<r;++e){const r=A[e],a=r.layer,f=a.id;if(void 0!==c&&c!==f)continue;const d=a.layout||Rn,w=a.paint||Rn;if("none"===po(a,"layout","visibility",$,S,I)||"minzoom"in a&&E<a.minzoom||"maxzoom"in a&&E>=a.maxzoom)continue;const O=a.filter;if(!O||fo(f,O,$,j)){let e,c,f,j,A,E;q=a;const O=r.index;if(3==P&&("fill"==a.type||"fill-extrusion"==a.type))if(c=po(a,"paint",a.type+"-opacity",$,S,I),a.type+"-pattern"in w){const e=po(a,"paint",a.type+"-pattern",$,S,I);if(e){const t="string"==typeof e?ho(e,k):e.toString(),r=go(t,p);if(i&&i[t]&&r){++T,E=_[T],E&&E.getFill()&&!E.getStroke()&&!E.getText()||(E=new b({fill:new h}),_[T]=E),f=E.getFill(),E.setZIndex(O);const e=t+"."+c;let n=z[e];if(!n){const o=i[t],a=Wn(o.width,o.height),s=a.getContext("2d");s.globalAlpha=c,s.drawImage(r.image,o.x,o.y,o.width,o.height,0,0,o.width,o.height),n=s.createPattern(a,"repeat"),z[e]=n}f.setColor(n)}}}else if(e=mo(po(a,"paint",a.type+"-color",$,S,I),c),a.type+"-outline-color"in w&&(A=mo(po(a,"paint",a.type+"-outline-color",$,S,I),c)),A||(A=e),e||A){if(++T,E=_[T],(!E||e&&!E.getFill()||!e&&E.getFill()||A&&!E.getStroke()||!A&&E.getStroke()||E.getText())&&(E=new b({fill:e?new h:void 0,stroke:A?new v:void 0}),_[T]=E),e&&(f=E.getFill(),f.setColor(e)),"fill-extrusion"===a.type){const e=po(a,"paint","fill-extrusion-height",$,S,I);if(e>0){const t=Math.max(.1,.9-Math.min(e,225)/280);if(A&&"transparent"!==A){const e=He.parse(A);A=`rgba(${Math.round(255*e.r*t)},${Math.round(255*e.g*t)},${Math.round(255*e.b*t)},${e.a})`}}}A&&(j=E.getStroke(),j.setColor(A),j.setWidth(.5)),E.setZIndex(O)}if(1!=P&&"line"==a.type){e="line-pattern"in w?void 0:mo(po(a,"paint","line-color",$,S,I),po(a,"paint","line-opacity",$,S,I));const t=po(a,"paint","line-width",$,S,I);e&&t>0&&(++T,E=_[T],E&&E.getStroke()&&!E.getFill()&&!E.getText()||(E=new b({stroke:new v}),_[T]=E),j=E.getStroke(),j.setLineCap(po(a,"layout","line-cap",$,S,I)),j.setLineJoin(po(a,"layout","line-join",$,S,I)),j.setMiterLimit(po(a,"layout","line-miter-limit",$,S,I)),j.setColor(e),j.setWidth(t),j.setLineDash(w["line-dasharray"]?po(a,"paint","line-dasharray",$,S,I).map(function(e){return e*t}):null),"function"==typeof j.setOffset&&j.setOffset(po(a,"paint","line-offset",$,S,I)),E.setZIndex(O))}let C,N,F,D,L,R,G,Z,H,U=!1,B=null,V=0;if((1==P||2==P)&&"icon-image"in d){const e=po(a,"layout","icon-image",$,S,I);if(e){let r;C="string"==typeof e?ho(e,k):e.toString();const n=u?u(t,C):void 0,l=go(C,p);if(i&&i[C]&&l||n){const e=po(a,"layout","icon-rotation-alignment",$,S,I);if(2==P){const t=o.getGeometry();if(t.getFlatMidpoint||t.getFlatMidpoints){const n=t.getExtent();if(Math.sqrt(Math.max(Math.pow((n[2]-n[0])/s,2),Math.pow((n[3]-n[1])/s,2)))>150){const n="MultiLineString"===t.getType()?t.getFlatMidpoints():t.getFlatMidpoint();uo||(lo=[NaN,NaN],uo=new m("Point",lo,[],2,{},void 0)),r=uo,lo[0]=n[0],lo[1]=n[1];if("line"===po(a,"layout","symbol-placement",$,S,I)&&"map"===e){const e=t.getStride(),r=t.getFlatCoordinates();for(let t=0,o=r.length-e;t<o;t+=e){const o=r[t],a=r[t+1],i=r[t+e],s=r[t+e+1],l=Math.min(o,i),u=Math.max(o,i),p=n[0],c=(s-a)*(p-o)-(i-o)*(n[1]-a);if(Math.abs(c)<.001&&p<=u&&p>=l){V=Math.atan2(a-s,i-o);break}}}}}}if(2!==P||r){const t=po(a,"layout","icon-size",$,S,I),o=void 0!==w["icon-color"]?po(a,"paint","icon-color",$,S,I):null;if(!o||0!==o.a){const r=po(a,"paint","icon-halo-color",$,S,I),s=po(a,"paint","icon-halo-width",$,S,I);let u=`${C}.${t}.${s}.${r}`;if(null!==o&&(u+=`.${o}`),N=M[u],!N){const p=co(a,$,"icon",S);let c;"icon-offset"in d&&(c=po(a,"layout","icon-offset",$,S,I).slice(0),c[0]*=t,c[1]*=-t);let f=o?[255*o.r,255*o.g,255*o.b,o.a]:void 0;if(n){const r={color:f,rotateWithView:"map"===e,displacement:c,declutterMode:p,scale:t};"string"==typeof n?r.src=n:(r.img=n,r.imgSize=[n.width,n.height]),N=new g(r)}else{const n=i[C];let a,u,d;if(s)n.sdf?(a=Jn(Yn(l.image,n,o||[0,0,0,1]),{x:0,y:0,width:n.width,height:n.height,pixelRatio:n.pixelRatio},s,r),f=void 0):a=Jn(l.image,n,s,r);else{if(n.sdf&&!l.unSDFed){const e=Yn(l.image,{x:0,y:0,width:l.size[0],height:l.size[1]},{r:1,g:1,b:1});l.image=e,l.unSDFed=!0}a=l.image,u=[n.width,n.height],d=[n.x,n.y]}N=new g({color:f,img:a,imgSize:l.size,size:u,offset:d,rotateWithView:"map"===e,scale:t/n.pixelRatio,displacement:c,declutterMode:p})}M[u]=N}}N&&(++T,E=_[T],E&&E.getImage()&&!E.getFill()&&!E.getStroke()||(E=new b,_[T]=E),E.setGeometry(r),N.setRotation(V+Bn(po(a,"layout","icon-rotate",$,S,I))),N.setOpacity(po(a,"paint","icon-opacity",$,S,I)),N.setAnchor(io[po(a,"layout","icon-anchor",$,S,I)]),E.setImage(N),B=E.getText(),E.setText(void 0),E.setZIndex(O),U=!0,F=!1)}else F=!0}}}if(1==P&&"circle"===a.type){++T,E=_[T],E&&E.getImage()&&!E.getFill()&&!E.getStroke()||(E=new b,_[T]=E);const e="circle-radius"in w?po(a,"paint","circle-radius",$,S,I):5,t=mo(po(a,"paint","circle-stroke-color",$,S,I),po(a,"paint","circle-stroke-opacity",$,S,I)),r=po(a,"paint","circle-translate",$,S,I),n=mo(po(a,"paint","circle-color",$,S,I),po(a,"paint","circle-opacity",$,S,I)),o=po(a,"paint","circle-stroke-width",$,S,I),i=e+"."+t+"."+n+"."+o+"."+r[0]+"."+r[1];N=M[i],N||(N=new y({radius:e,displacement:[r[0],-r[1]],stroke:t&&o>0?new v({width:o,color:t}):void 0,fill:n?new h({color:n}):void 0,declutterMode:"none"}),M[i]=N),E.setImage(N),B=E.getText(),E.setText(void 0),E.setGeometry(void 0),E.setZIndex(O),U=!0}if("text-field"in d){G=Math.round(po(a,"layout","text-size",$,S,I));const e=po(a,"layout","text-font",$,S,I);R=po(a,"layout","text-line-height",$,S,I),L=Ln(l?l(e,n.metadata?n.metadata["ol:webfonts"]:void 0):e,G,R),L.includes("sans-serif")||(L+=",sans-serif"),Z=po(a,"layout","text-letter-spacing",$,S,I),H=po(a,"layout","text-max-width",$,S,I);const t=po(a,"layout","text-field",$,S,I);D="object"==typeof t&&t.sections?1===t.sections.length?t.toString():t.sections.reduce((t,r,n)=>{const o=r.fontStack?r.fontStack.split(","):e,a=Ln(l?l(o):o,G*(r.scale||1),R);let i=r.text;if("\n"===i)return t.push("\n",""),t;if(2==P)return t.push(Qn(i,Z),a),t;i=oo(i,a,H,Z).split("\n");for(let e=0,r=i.length;e<r;++e)e>0&&t.push("\n",""),t.push(i[e],a);return t},[]):ho(t,k).trim(),c=po(a,"paint","text-opacity",$,S,I)}if(D&&c&&!F){U||(++T,E=_[T],E&&E.getText()&&!E.getFill()&&!E.getStroke()||(E=new b,_[T]=E),E.setImage(void 0),E.setGeometry(void 0));const e=co(a,$,"text",S);E.getText()||E.setText(B),B=E.getText(),(!B||"getDeclutterMode"in B&&B.getDeclutterMode()!==e)&&(B=new x({padding:[2,2,2,2],declutterMode:e}),E.setText(B));const t=po(a,"layout","text-transform",$,S,I);"uppercase"==t?D=Array.isArray(D)?D.map((e,t)=>t%2?e:e.toUpperCase()):D.toUpperCase():"lowercase"==t&&(D=Array.isArray(D)?D.map((e,t)=>t%2?e:e.toLowerCase()):D.toLowerCase());const r=Array.isArray(D)?D:2==P?Qn(D,Z):oo(D,L,H,Z);if(B.setText(r),B.setFont(L),B.setRotation(Bn(po(a,"layout","text-rotate",$,S,I))),"function"==typeof B.setKeepUpright){const e=po(a,"layout","text-keep-upright",$,S,I);B.setKeepUpright(e)}const n=po(a,"layout","text-anchor",$,S,I),o=U||1==P?"point":po(a,"layout","symbol-placement",$,S,I);let i;if("line-center"===o?(B.setPlacement("line"),i="center"):B.setPlacement(o),"line"===o&&"function"==typeof B.setRepeat){const e=po(a,"layout","symbol-spacing",$,S,I);B.setRepeat(2*e)}B.setOverflow("point"===o);let s=po(a,"paint","text-halo-width",$,S,I);const l=po(a,"layout","text-offset",$,S,I),u=po(a,"paint","text-translate",$,S,I);let p=0,f=0;if("point"==o){i="center",-1!==n.indexOf("left")?(i="left",f=s):-1!==n.indexOf("right")&&(i="right",f=-s);const e=po(a,"layout","text-rotation-alignment",$,S,I);B.setRotateWithView("map"==e)}else B.setMaxAngle(Bn(po(a,"layout","text-max-angle",$,S,I))*D.length/r.length),B.setRotateWithView(!1);B.setTextAlign(i);let d="middle";0==n.indexOf("bottom")?(d="bottom",p=-s-.5*(R-1)*G):0==n.indexOf("top")&&(d="top",p=s+.5*(R-1)*G),B.setTextBaseline(d);const m=po(a,"layout","text-justify",$,S,I);B.setJustify("auto"===m?void 0:m),B.setOffsetX(l[0]*G+f+u[0]),B.setOffsetY(l[1]*G+p+u[1]);const y=B.getFill()||new h;y.setColor(mo(po(a,"paint","text-color",$,S,I),c)),B.setFill(y);const g=mo(po(a,"paint","text-halo-color",$,S,I),c);if(g&&s>0){const e=B.getStroke()||new v;e.setColor(g),s*=2;const t=.5*G;e.setWidth(s<=t?s:t),B.setStroke(e)}else B.setStroke(void 0);const w=po(a,"layout","text-padding",$,S,I),k=B.getPadding();w!==k[0]&&(k[0]=w,k[1]=w,k[2]=w,k[3]=w),E.setZIndex(O)}}}return T>-1?(_.length=T+1,vo&&("set"in o?o.set("mapbox-layer",q):o.getProperties()["mapbox-layer"]=q),_):void 0};return t.setStyle(E),t.set("mapbox-layers",k),t.set("mapbox-source",A),t.set("mapbox-featurestate",t.get("mapbox-featurestate")||{}),E}function wo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ko(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?wo(Object(r),!0).forEach(function(t){S(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wo(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}He.parse("#000000"),He.parse("#FFFFFF"),He.parse("#000000"),function(e=!1){vo=e}(!0);var Mo="EPSG:27700",zo=["vector","raster","wms","ogc-vt"];function So(e,t,r){var n=r&&r(e,t)||{};return fetch(n.url||e,{headers:n.headers||{}})}var jo=e=>(t,r)=>{var n=e(r,"Tile")||{},o=n.url||r,a=n.headers||{};fetch(o,{headers:a}).then(e=>e.blob()).then(e=>{t.getImage().src=URL.createObjectURL(e)}).catch(()=>t.setState(E.ERROR))};function Ao(){return new c({resolutions:q,origin:N,tileSize:256})}function _o(e,t){return Eo.apply(this,arguments)}function Eo(){return Eo=w(function*(e,t){if(e.type&&!zo.includes(e.type))throw new Error("Unsupported map style type: '".concat(e.type,"'"));if("wms"===e.type){var r=function(e,t,r){var n=Ao();return new A({url:e,params:t,projection:Mo,tileGrid:n,tileLoadFunction:r?jo(r):void 0})}(e.url,e.params||{},t);return{layer:new a({source:r}),source:r}}if("raster"===e.type){var n=function(e,t){var r=Ao();return new j({projection:Mo,tileGrid:r,tileUrlFunction:t=>{var[r,n,o]=t;return e.replace("{z}",r).replace("{x}",n).replace("{y}",o)},tileLoadFunction:t?jo(t):void 0})}(e.url,t);return{layer:new a({source:n}),source:n}}return"ogc-vt"===e.type?function(e,t){return Co.apply(this,arguments)}(e.url,t,e):function(e,t){return Po.apply(this,arguments)}(e.url,t,e)}),Eo.apply(this,arguments)}function Oo(e,t){var r=e.indexOf("?"),[n,o]=r>=0?[e.slice(0,r),e.slice(r)]:[e,""],a="".concat(n,".json").concat(o),i="".concat(n,".png").concat(o);return{jsonUrl:a,pngUrl:i,fetch:()=>So(a,"SpriteJSON",t).then(e=>e.json())}}function Po(){return Po=w(function*(e,t){var{renderMode:r}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=yield So(e,"Style",t).then(e=>e.json()),a=Object.keys(n.sources)[0],i=n.sources[a].url,l=yield So(i,"Source",t).then(e=>e.json()),u=[l.fullExtent.xmin,l.fullExtent.ymin,l.fullExtent.xmax,l.fullExtent.ymax],f=[l.tileInfo.origin.x,l.tileInfo.origin.y],d=l.tileInfo.lods.map(e=>e.resolution).slice(0,16),m=l.tileInfo.rows,y=l.tiles[0],h=Oo(n.sprite,t),g=yield h.fetch();!function(e){e.layers.forEach(e=>{var t;null!==(t=e.paint)&&void 0!==t&&t["icon-color"]&&(e.paint["icon-color"]=e.paint["icon-color"].replace(",0)",",1)"))})}(n);var v=new c({extent:u,origin:f,resolutions:d,tileSize:m}),b=new p({format:new o,url:y,projection:Mo,tileGrid:v}),x=new s(ko({source:b,declutter:!0},r&&{renderMode:r}));return xo(x,n,a,d,g,h.pngUrl),{layer:x,source:b}}),Po.apply(this,arguments)}function Co(){return Co=w(function*(e,t){var r,{renderMode:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=yield So(e,"Style",t).then(e=>e.json()),i=Object.keys(a.sources)[0],l=a.sources[i].url,u=Oo(a.sprite,t),p=null===(r=(yield So(l,"Source",t).then(e=>e.json())).links)||void 0===r?void 0:r.find(e=>"http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme"===e.rel),[f,d]=yield Promise.all([So(p.href,"Source",t).then(e=>e.json()),u.fetch()]),m=f.tileMatrices.map(e=>e.cellSize),y=f.tileMatrices[0].pointOfOrigin,h=[f.tileMatrices[0].tileHeight,f.tileMatrices[0].tileWidth],g=new o;g.supportedMediaTypes.push("application/octet-stream");var v=new c({resolutions:m,origin:y,tileSize:h}),b=new _({url:l,format:g,tileGrid:v,projection:Mo}),x=new s(ko({source:b,declutter:!0},n&&{renderMode:n}));return xo(x,a,i,m,d,u.pngUrl),{layer:x,source:b}}),Co.apply(this,arguments)}function $o(e,t,r){if(null!==e)for(var n,o,a,i,s,l,u,p,c=0,f=0,d=e.type,m="FeatureCollection"===d,y="Feature"===d,h=m?e.features.length:1,g=0;g<h;g++){s=(p=!!(u=m?e.features[g].geometry:y?e.geometry:e)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var v=0;v<s;v++){var b=0,x=0;if(null!==(i=p?u.geometries[v]:u)){l=i.coordinates;var w=i.type;switch(c=0,w){case null:break;case"Point":if(!1===t(l,f,g,b,x))return!1;f++,b++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(!1===t(l[n],f,g,b,x))return!1;f++,"MultiPoint"===w&&b++}"LineString"===w&&b++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(o=0;o<l[n].length-c;o++){if(!1===t(l[n][o],f,g,b,x))return!1;f++}"MultiLineString"===w&&b++,"Polygon"===w&&x++}"Polygon"===w&&b++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(x=0,o=0;o<l[n].length;o++){for(a=0;a<l[n][o].length-c;a++){if(!1===t(l[n][o][a],f,g,b,x))return!1;f++}x++}b++}break;case"GeometryCollection":for(n=0;n<i.geometries.length;n++)if(!1===$o(i.geometries[n],t))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}var Io=function(e,t={}){if(null!=e.bbox&&!0!==t.recompute)return e.bbox;const r=[1/0,1/0,-1/0,-1/0];return $o(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},qo=e=>{var t=e/1609.344;if(t<.5)return"".concat(Math.round(e),"m");if(t<10){var r=Number.parseFloat(t.toFixed(1)),n=1===r?"mile":"miles";return"".concat(r," ").concat(n)}var o=Math.round(t);return"".concat(o," miles")},To=(e,t,r)=>{var n=r.getTargetElement().getBoundingClientRect();if(!n.width||!n.height)return!1;var o=r.getViewport().getBoundingClientRect(),a=o.width/n.width,i=o.height/n.height,[s,l,u,p]=(e=>Io(e))(e),c=[[s,l],[s,p],[u,l],[u,p]].map(e=>r.getPixelFromCoordinate(e)).filter(Boolean);if(!c.length)return!1;var f=n.left+Math.min(...c.map(e=>e[0]))*a,d=n.left+Math.max(...c.map(e=>e[0]))*a,m=n.top+Math.min(...c.map(e=>e[1]))*i,y=n.top+Math.max(...c.map(e=>e[1]))*i;return f<t.right&&d>t.left&&m<t.bottom&&y>t.top},No=(e,t,r)=>{for(var n=[],o=t;o<r;o+=2)n.push([e[o],e[o+1]]);return n},Fo=e=>{var t=e.getType(),r=e.getFlatCoordinates();if("Point"===t)return{type:"Point",coordinates:[r[0],r[1]]};if("LineString"===t)return{type:"LineString",coordinates:No(r,0,r.length)};if("Polygon"===t){var n=e.getEnds(),o=0;return{type:"Polygon",coordinates:n.map(e=>{var t=No(r,o,e);return o=e,t})}}if("MultiPolygon"===t){var a=e.getEndss(),i=0,s=a.map(e=>{var t=i,n=e.map(e=>{var n=No(r,t,e);return t=e,n});return i=e[e.length-1],n});return{type:"MultiPolygon",coordinates:s}}return{type:t,coordinates:No(r,0,r.length)}},Do=(e,t,r,n)=>{var o=[];return e.getLayers().forEach(e=>{if(e instanceof s){var a=e.getSource(),i=null==a?void 0:a.sourceTiles_;i&&Object.values(i).forEach(e=>{e.getState()===E.LOADED&&e.getFeatures().forEach(e=>{var a;if((null===(a=e.get("mapbox-layer"))||void 0===a?void 0:a.id)===t){var i=n?e.get(n):e.getId();String(i)===String(r)&&o.push(Fo(e))}})})}}),o};function Lo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Ro(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Lo(Object(r),!0).forEach(function(t){S(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lo(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var Go="EPSG:27700",Zo=new n({dataProjection:Go,featureProjection:Go}),Ho="_highlight",Uo=999,Bo=(e,t)=>{if(!e)return[];var{stroke:r,selectionStroke:n,fill:o,strokeWidth:a,activeStrokeWidth:i}=e;if(t)return[new b({stroke:new v({color:r,width:i}),zIndex:Uo}),new b({stroke:new v({color:n,width:a}),zIndex:1e3})];var s=[new b({stroke:new v({color:n,width:a}),zIndex:Uo})];return o&&"transparent"!==o&&s.push(new b({fill:new h({color:o}),zIndex:Uo})),s},Vo=e=>{var t=new Set,r={};for(var{layerId:n,featureId:o,idProperty:a}of null!=e?e:[])t.add("".concat(n,":").concat(o)),a&&(r[n]=a);return{keys:t,idProps:r}},Wo=(e,t,r,n)=>{for(var{layerId:o,geometry:a}of null!=t?t:[])if(a){var i=Bo(null==n?void 0:n[o],r);if(i.length){var s=new $({geometry:Zo.readGeometry(a)});s.setStyle(i),e.addFeature(s)}}},Jo=(e,t)=>{var{type:r,coordinates:n}=e,o=e=>{var[r,n]=e;return t(r,n)},a=e=>e.forEach(o);"Point"===r?o(n):"MultiPoint"===r||"LineString"===r?n.forEach(o):"MultiLineString"===r||"Polygon"===r?n.forEach(a):"MultiPolygon"===r&&n.forEach(e=>e.forEach(a))},Xo=(e,t,r,n)=>{if(!e)return null;var o=new Set;e.getLayers().forEach(e=>{if(e instanceof i&&!e.get(Ho)){var t=e.get("layerId");t&&o.add(t)}});var{keys:a,idProps:l}=Vo(t),{keys:p,idProps:c}=Vo(r),f=Ro(Ro({},l),c);((e,t,r,n,o)=>{e.getLayers().forEach(e=>{if(e instanceof s)if(t.size>0||r.size>0){e._highlightOriginalStyle||(e._highlightOriginalStyle=e.getStyleFunction());var a=e._highlightOriginalStyle;e.setStyle((e,i)=>{var s,l=a(e,i),u=null===(s=e.get("mapbox-layer"))||void 0===s?void 0:s.id;if(!u)return l;var p=n[u],c=p?e.get(p):e.getId(),f="".concat(u,":").concat(c),d=r.has(f),m=!d&&t.has(f);if(!d&&!m)return l;var y=Bo(null==o?void 0:o[u],d);return y.length?[...l?Array.isArray(l)?l:[l]:[],...y]:l})}else e._highlightOriginalStyle&&(e.setStyle(e._highlightOriginalStyle),delete e._highlightOriginalStyle)})})(e,a,p,f,n);var d=(e=>{var t=null;return e.getLayers().forEach(e=>{e.get(Ho)&&(t=e)}),t||((t=new i({source:new u,zIndex:1001})).set(Ho,!0),e.addLayer(t)),t})(e),m=d.getSource();m.clear();var y=(null!=t?t:[]).filter(e=>o.has(e.layerId)),h=(null!=r?r:[]).filter(e=>o.has(e.layerId));Wo(m,h,!0,n),Wo(m,y,!1,n);var g=(null!=t?t:[]).flatMap(t=>((e,t)=>{var{layerId:r,featureId:n,idProperty:o,geometry:a}=t;if(null!=n){var i=Do(e,r,n,o);if(i.length>0)return i}return a?[a]:[]})(e,t));return(e=>{if(!e.length)return null;var t=1/0,r=1/0,n=-1/0,o=-1/0;for(var a of e)Jo(a,(e,a)=>{e<t&&(t=e),a<r&&(r=a),e>n&&(n=e),a>o&&(o=a)});return t===1/0?null:[t,r,n,o]})(g)};function Yo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var Ko="EPSG:27700",Qo=new n({dataProjection:Ko,featureProjection:Ko}),ea=e=>{var t=e.getId();if(null!=t)return t;var r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Yo(Object(r),!0).forEach(function(t){S(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yo(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},e.getProperties());return delete r["mapbox-layer"],JSON.stringify(r)},ta=(e,t,r)=>{var n=e.getViewport();if(r&&e.un("pointermove",r),null==t||!t.length)return n.style.cursor="",null;var o=new Set(t),a=null,l=t=>{var r;if("mouse"===(null===(r=t.originalEvent)||void 0===r?void 0:r.pointerType)){var l=t.pixel;null!==a&&cancelAnimationFrame(a),a=requestAnimationFrame(()=>{a=null;var t=e.forEachFeatureAtPixel(l,(e,t)=>((e,t,r)=>{if(t instanceof s){var n,o=null===(n=e.get("mapbox-layer"))||void 0===n?void 0:n.id;return Boolean(o&&r.has(o))}if(t instanceof i&&!t.get("_highlight")){var a=t.get("layerId");return Boolean(a&&r.has(a))}return!1})(e,t,o),{hitTolerance:8});n.style.cursor=t?"pointer":""})}};return e.on("pointermove",l),l};function ra(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function na(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ra(Object(r),!0).forEach(function(t){S(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ra(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}(()=>{if("undefined"!=typeof HTMLCanvasElement){var e=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=function(t,r){for(var n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];return e.call(this,t,"2d"===t?na(na({},r),{},{willReadFrequently:!0}):r,...o)}}})();var oa="EPSG:27700",aa=e=>{if(e){var{top:t=0,right:r=0,bottom:n=0,left:o=0}=e;return[t,r,n,o]}};M.defs(oa,"+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 +units=m +no_defs"),z(M);class ia extends I{constructor(e){var{mapProviderConfig:t={},events:r,eventBus:n}=e;super(),this.events=r,this.eventBus=n,this.capabilities={supportedShortcuts:L,supportsMapSizes:!0},Object.assign(this,t)}get name(){return"OpenLayersProvider"}initMap(r){var n=this;return w(function*(){var o,{container:a,padding:i,mapStyle:s,mapSize:l,center:u,zoom:p,bounds:c,minZoom:f,maxZoom:d,transformRequest:m,pixelRatio:y}=r;n.mapStyleId=null==s?void 0:s.id,n.mapSize=l;var{events:h,eventBus:g}=n,{layer:v,source:b}=yield _o(s,m),x=(null!==(o=n.zoomAlignment)&&void 0!==o?o:R)===G?{resolutions:T,defaultMinZoom:6,maxZoom:20}:{resolutions:q,defaultMinZoom:0,maxZoom:q.length-1},M=new t({projection:oa,center:u,zoom:null!=p?p:x.defaultMinZoom,minZoom:Math.max(null!=f?f:x.defaultMinZoom,x.defaultMinZoom),maxZoom:null!=d?d:x.maxZoom,resolutions:x.resolutions,constrainResolution:!1,padding:aa(i)}),z=new e({target:a,layers:[v],view:M,controls:[],interactions:k({doubleClickZoom:!1}),pixelRatio:y});c&&z.once("rendercomplete",()=>{M.fit(c,{size:z.getSize(),duration:0})}),n.mapEventHandles=U({map:z,source:b,events:h,eventBus:g,getZoom:n.getZoom.bind(n),getCenter:n.getCenter.bind(n),getBounds:n.getBounds.bind(n),getResolution:n.getResolution.bind(n)}),n.appEventHandles=function(e){var{mapProvider:t,transformRequest:r,events:n,eventBus:o,map:a,onBaseSourceChange:i}=e,s=function(){var e=w(function*(e){var{layer:s,source:l}=yield _o(e,r);a.getLayers().setAt(0,s),i(l),o.emit(n.MAP_STYLE_CHANGE,{mapStyleId:e.id}),t.reapplyHighlights()});return function(t){return e.apply(this,arguments)}}(),l=e=>{a.setPixelRatio(e)},u=e=>{var{mapSize:r}=e;t.mapSize=r};return o.on(n.MAP_SET_STYLE,s),o.on(n.MAP_SET_PIXEL_RATIO,l),o.on(n.MAP_SIZE_CHANGE,u),{remove(){o.off(n.MAP_SET_STYLE,s),o.off(n.MAP_SET_PIXEL_RATIO,l),o.off(n.MAP_SIZE_CHANGE,u)}}}({mapProvider:n,transformRequest:m,events:h,eventBus:g,map:z,onBaseSourceChange:n.mapEventHandles.setSource})||[],n.map=z,n.view=M,g.emit(h.MAP_READY,{map:n.map,mapStyleId:n.mapStyleId,mapSize:n.mapSize,crs:n.crs})})()}destroyMap(){var e,t;null===(e=this.mapEventHandles)||void 0===e||e.remove(),null===(t=this.appEventHandles)||void 0===t||t.remove(),this.mapEventHandles=null,this.appEventHandles=null,this.map&&(this._onHoverMove&&(this.map.un("pointermove",this._onHoverMove),this._onHoverMove=null),this.map.setTarget(null),this.map=null),this.view=null}setView(e){var{center:t,zoom:r}=e;this.view.animate({center:null!=t?t:this.view.getCenter(),zoom:null!=r?r:this.view.getZoom(),duration:F})}zoomIn(e){this.view.animate({zoom:this.view.getZoom()+e,duration:F})}zoomOut(e){this.view.animate({zoom:this.view.getZoom()-e,duration:F})}panBy(e){var t=this.view.getCenter(),r=this.view.getResolution();this.view.animate({center:[t[0]+e[0]*r,t[1]-e[1]*r],duration:F})}fitToBounds(e){var t,r=Array.isArray(e)?e:(t=Io(e),l(t,"EPSG:4326","EPSG:27700"));this.view.fit(r,{duration:F})}setPadding(e){this.view.padding=aa(e)}getCenter(){var e=this.view.getCenter(),t=D;return[Math.round(e[0]*Math.pow(10,t))/Math.pow(10,t),Math.round(e[1]*Math.pow(10,t))/Math.pow(10,t)]}getZoom(){return this.view.getZoom()}getBounds(){return this.view.calculateExtent(this.map.getSize()).map(e=>Math.round(100*e)/100)}getFeaturesAtPoint(e,t){return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)return[];var{radius:n=10}=r,o=[t.x,t.y],a=[],l=new Set;return e.forEachFeatureAtPixel(o,(e,t)=>{if(t instanceof s){var r=e.get("mapbox-layer"),n=null==r?void 0:r.id;if(!n||"background"===(null==r?void 0:r.type))return;var o="".concat(n,":").concat(ea(e));if(l.has(o))return;l.add(o),a.push({id:e.getId(),layer:{id:n},geometry:Fo(e),properties:e.getProperties()})}else if(t instanceof i){var u=t.get("layerId");if(!u||t.get("_highlight"))return;var p=e.getId(),c="".concat(u,":").concat(p);if(l.has(c))return;l.add(c),a.push({id:p,layer:{id:u},geometry:Qo.writeGeometryObject(e.getGeometry()),properties:e.getProperties()})}},{hitTolerance:n}),a}(this.map,e,t)}getFeatureGeometry(e,t,r){var n=Do(this.map,e,t,r);return 0===n.length?null:1===n.length?n[0]:{type:"MultiPolygon",coordinates:n.flatMap(e=>"MultiPolygon"===e.type?e.coordinates:[e.coordinates])}}setHoverCursor(e){this.map&&(this._onHoverMove=ta(this.map,e,this._onHoverMove))}getVisibleFeatures(e){return[]}updateHighlightedFeatures(e,t,r){return this._lastHighlightArgs={selectedFeatures:e,activeFeatures:t,stylesMap:r},Xo(this.map,e,t,r)}reapplyHighlights(){if(this._lastHighlightArgs){var{selectedFeatures:e,activeFeatures:t,stylesMap:r}=this._lastHighlightArgs;Xo(this.map,e,t,r)}}getAreaDimensions(){return(e=>{if(!e)return"";var[t,r,n,o]=e,a=n-t;return"".concat(qo(o-r)," by ").concat(qo(a))})((e=>{var t=e.getSize(),r=e.getView().padding||[0,0,0,0],[n,o,a,i]=r,s=[i,t[1]-a],l=[t[0]-o,n],u=e.getCoordinateFromPixel(s),p=e.getCoordinateFromPixel(l);return u&&p?[u[0],u[1],p[0],p[1]]:null})(this.map))}getCardinalMove(e,t){return((e,t)=>{var r=t[0]-e[0],n=t[1]-e[1],o=[];return Math.abs(n)>1&&o.push("".concat(n>0?"north":"south"," ").concat(qo(Math.abs(n)))),Math.abs(r)>1&&o.push("".concat(r>0?"east":"west"," ").concat(qo(Math.abs(r)))),o.join(", ")})(e,t)}getResolution(){return this.view.getResolution()}mapToScreen(e){if(!this.map)return{x:0,y:0};var t=this.map.getPixelFromCoordinate(e);return t?{x:t[0],y:t[1]}:{x:0,y:0}}screenToMap(e){return this.map.getCoordinateFromPixel([e.x,e.y])}isGeometryObscured(e,t){return To(e,t,this.map)}}export{ia as default};
|
|
1
|
+
import e from"ol/Map.js";import t from"ol/View.js";import{getCenter as r}from"ol/extent.js";import n from"ol/format/GeoJSON.js";import o from"ol/format/MVT.js";import"ol/has.js";import"ol/layer/Group.js";import"ol/layer/Layer.js";import a from"ol/layer/Tile.js";import i from"ol/layer/Vector.js";import s from"ol/layer/VectorTile.js";import"ol/loadingstrategy.js";import{transformExtent as l}from"ol/proj.js";import"ol/proj/Units.js";import"ol/source/Source.js";import"ol/source/TileJSON.js";import u from"ol/source/Vector.js";import p from"ol/source/VectorTile.js";import"ol/tilegrid.js";import c from"ol/tilegrid/TileGrid.js";import{distance as f}from"ol/coordinate.js";import{toPromise as d}from"ol/functions.js";import m from"ol/render/Feature.js";import y from"ol/style/Circle.js";import h from"ol/style/Fill.js";import g from"ol/style/Icon.js";import v from"ol/style/Stroke.js";import b from"ol/style/Style.js";import x from"ol/style/Text.js";import"ol/events/Event.js";import"ol/events/EventType.js";import w from"@babel/runtime/helpers/asyncToGenerator";import{defaults as k}from"ol/interaction/defaults.js";import M from"proj4";import{register as S}from"ol/proj/proj4.js";import z from"@babel/runtime/helpers/defineProperty";import j from"ol/source/XYZ.js";import C from"ol/source/TileWMS.js";import A from"ol/source/OGCVectorTile.js";import O from"ol/TileState.js";import{fromString as E}from"ol/color.js";import"ol/layer/Image.js";import"ol/source/Raster.js";import{checkedFonts as _}from"ol/render/canvas.js";import{getUid as P}from"ol/util.js";import I from"ol/Feature.js";class ${isBaseMapReady(){throw new Error(this.name+" must implement isBaseMapReady()")}}var q=[896,448,224,112,56,28,14,7,3.5,1.75,.875,.4375,.21875,.109375],D=[156543.03392800014,78271.51696400007,39135.758482000034,19567.879241000017,9783.939620500008,4891.969810250004,2445.984905125002,1222.992452562501,611.4962262812505,305.74811314062526,152.87405657031263,76.43702828515632,38.21851414257816,19.10925707128908,9.55462853564454,4.77731426782227,2.388657133911135,1.1943285669555674,.5971642834777837,.29858214173889186,.14929107086944593,.07464553543472296,.03732276771736148,.01866138385868074],T=[-238375,1376256],N=300,F=2,L=["showKeyboardHelp","selectControl","moveLarge","nudgeMap","zoomLarge","nudgeZoom"],R="uk",G="world";var H=(e,t)=>{var r=null,n=function(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];clearTimeout(r),r=setTimeout(()=>{e(...o)},t)};return n.cancel=()=>{r&&(clearTimeout(r),r=null)},n};function B(e){var{map:t,view:r,emit:n,eventBus:o,events:a,on:i,debouncers:s}=e,l=!1,u=H(()=>{l=!1,n(a.MAP_MOVE_END)},500);s.push(u);var p,c,f,d=(p=()=>n(a.MAP_MOVE),c=10,f=0,function(){var e=Date.now();e-f>=c&&(f=e,p(...arguments))});i(r,"change",()=>{l||(l=!0,o.emit(a.MAP_MOVE_START)),u()}),i(t,"postrender",()=>{l&&d()})}function V(e){var{map:t,source:r,events:n,eventBus:o,getZoom:a,getCenter:i,getBounds:s,getResolution:l}=e,u=!1,p=[],c=[],f=[],d=t.getView(),m=e=>{var t=(()=>{if(u)return null;var e=a();return{center:i(),bounds:s(),resolution:l(),zoom:e,isAtMaxZoom:e+.01>=d.getMaxZoom(),isAtMinZoom:e-.01<=d.getMinZoom()}})();t&&o.emit(e,t)},y=(e,t,r)=>{e.on(t,r),p.push([e,t,r])},h=(e,t,r)=>{e.on(t,r),c.push([e,t,r])},g=!1,v=()=>{g||(g=!0,o.emit(n.MAP_LOADED))},b=H(()=>m(n.MAP_DATA_CHANGE),500);f.push(b);var x=e=>{u||(c.forEach(e=>{var[t,r,n]=e;return t.un(r,n)}),c=[],h(e,"tileloadend",v),h(e,"tileloadend",b))};return B({map:t,view:t.getView(),emit:m,eventBus:o,events:n,on:y,debouncers:f}),x(r),t.once("rendercomplete",()=>m(n.MAP_FIRST_IDLE)),function(e){var{map:t,eventBus:r,events:n,on:o}=e,a=null;o(t,"pointerdown",e=>{a=e.pixel}),o(t,"click",e=>{if(a){var t=e.pixel[0]-a[0],o=e.pixel[1]-a[1];if(Math.hypot(t,o)>6)return}r.emit(n.MAP_CLICK,{point:{x:e.pixel[0],y:e.pixel[1]},coords:e.coordinate})})}({map:t,eventBus:o,events:n,on:y}),y(t,"postrender",()=>o.emit(n.MAP_RENDER)),{setSource:x,remove(){u=!0,f.forEach(e=>e.cancel()),p.forEach(e=>{var[t,r,n]=e;return t.un(r,n)}),c.forEach(e=>{var[t,r,n]=e;return t.un(r,n)})}}}var Z={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}};const U=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function W(e,t){const r={};for(const t in e)"ref"!==t&&(r[t]=e[t]);return U.forEach(e=>{e in t&&(r[e]=t[e])}),r}class J extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class X{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[e,r]of t)this.bindings[e]=r}concat(e){return new X(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const Y={kind:"null"},K={kind:"number"},Q={kind:"string"},ee={kind:"boolean"},te={kind:"color"},re={kind:"projectionDefinition"},ne={kind:"object"},oe={kind:"value"},ae={kind:"collator"},ie={kind:"formatted"},se={kind:"padding"},le={kind:"colorArray"},ue={kind:"numberArray"},pe={kind:"resolvedImage"},ce={kind:"variableAnchorOffsetCollection"};function fe(e,t){return{kind:"array",itemType:e,N:t}}function de(e){if("array"===e.kind){const t=de(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const me=[Y,K,Q,ee,te,re,ie,ne,fe(oe),se,ue,le,pe,ce];function ye(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!ye(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(const e of me)if(!ye(e,t))return null}return`Expected ${de(e)} but found ${de(t)} instead.`}function he(e,t){return t.some(t=>t.kind===e.kind)}function ge(e,t){return t.some(t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e)}function ve(e,t){return"array"===e.kind&&"array"===t.kind?e.itemType.kind===t.itemType.kind&&"number"==typeof e.N:e.kind===t.kind}const be=.96422,xe=.82521,we=4/29,ke=6/29,Me=3*ke*ke,Se=ke*ke*ke,ze=Math.PI/180,je=180/Math.PI;function Ce(e){return(e%=360)<0&&(e+=360),e}function Ae([e,t,r,n]){let o,a;const i=Ee((.2225045*(e=Oe(e))+.7168786*(t=Oe(t))+.0606169*(r=Oe(r)))/1);e===t&&t===r?o=a=i:(o=Ee((.4360747*e+.3850649*t+.1430804*r)/be),a=Ee((.0139322*e+.0971045*t+.7141733*r)/xe));const s=116*i-16;return[s<0?0:s,500*(o-i),200*(i-a),n]}function Oe(e){return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Ee(e){return e>Se?Math.pow(e,1/3):e/Me+we}function _e([e,t,r,n]){let o=(e+16)/116,a=isNaN(t)?o:o+t/500,i=isNaN(r)?o:o-r/200;return o=1*Ie(o),a=be*Ie(a),i=xe*Ie(i),[Pe(3.1338561*a-1.6168667*o-.4906146*i),Pe(-.9787684*a+1.9161415*o+.033454*i),Pe(.0719453*a-.2289914*o+1.4052427*i),n]}function Pe(e){return(e=e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055)<0?0:e>1?1:e}function Ie(e){return e>ke?e*e*e:Me*(e-we)}const $e=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function qe(e,t){return $e(e,t)?e[t]:void 0}function De(e){if("transparent"===(e=e.toLowerCase().trim()))return[0,0,0,0];const t=qe(Re,e);if(t){const[e,r,n]=t;return[e/255,r/255,n/255,1]}if(e.startsWith("#")){if(/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){const t=e.length<6?1:2;let r=1;return[Te(e.slice(r,r+=t)),Te(e.slice(r,r+=t)),Te(e.slice(r,r+=t)),Te(e.slice(r,r+t)||"ff")]}}if(e.startsWith("rgb")){const t=/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,r=e.match(t);if(r){const[e,t,n,o,a,i,s,l,u,p,c,f]=r,d=[o||" ",s||" ",p].join("");if(" "===d||" /"===d||",,"===d||",,,"===d){const e=[n,i,u].join(""),r="%%%"===e?100:""===e?255:0;if(r){const e=[Fe(+t/r,0,1),Fe(+a/r,0,1),Fe(+l/r,0,1),c?Ne(+c,f):1];if(Le(e))return e}}return}}const r=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){const[e,t,n,o,a,i,s,l,u]=r,p=[n||" ",a||" ",s].join("");if(" "===p||" /"===p||",,"===p||",,,"===p){const e=[+t,Fe(+o,0,100),Fe(+i,0,100),l?Ne(+l,u):1];if(Le(e))return function([e,t,r,n]){function o(n){const o=(n+e/30)%12,a=t*Math.min(r,1-r);return r-a*Math.max(-1,Math.min(o-3,9-o,1))}return e=Ce(e),t/=100,r/=100,[o(0),o(8),o(4),n]}(e)}}}function Te(e){return parseInt(e.padEnd(2,e),16)/255}function Ne(e,t){return Fe(t?e/100:e,0,1)}function Fe(e,t,r){return Math.min(Math.max(t,e),r)}function Le(e){return!e.some(Number.isNaN)}const Re={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function Ge(e,t,r){return e+r*(t-e)}function He(e,t,r){return e.map((e,n)=>Ge(e,t[n],r))}class Be{constructor(e,t,r,n=1,o=!0){this.r=e,this.g=t,this.b=r,this.a=n,o||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[e,t,r,n]))}static parse(e){if(e instanceof Be)return e;if("string"!=typeof e)return;const t=De(e);return t?new Be(...t,!1):void 0}get rgb(){const{r:e,g:t,b:r,a:n}=this,o=n||1/0;return this.overwriteGetter("rgb",[e/o,t/o,r/o,n])}get hcl(){return this.overwriteGetter("hcl",function(e){const[t,r,n,o]=Ae(e),a=Math.sqrt(r*r+n*n);return[Math.round(1e4*a)?Ce(Math.atan2(n,r)*je):NaN,a,t,o]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Ae(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){const[e,t,r,n]=this.rgb;return`rgba(${[e,t,r].map(e=>Math.round(255*e)).join(",")},${n})`}static interpolate(e,t,r,n="rgb"){switch(n){case"rgb":{const[n,o,a,i]=He(e.rgb,t.rgb,r);return new Be(n,o,a,i,!1)}case"hcl":{const[n,o,a,i]=e.hcl,[s,l,u,p]=t.hcl;let c,f;if(isNaN(n)||isNaN(s))isNaN(n)?isNaN(s)?c=NaN:(c=s,1!==a&&0!==a||(f=l)):(c=n,1!==u&&0!==u||(f=o));else{let e=s-n;s>n&&e>180?e-=360:s<n&&n-s>180&&(e+=360),c=n+r*e}const[d,m,y,h]=function([e,t,r,n]){return e=isNaN(e)?0:e*ze,_e([r,Math.cos(e)*t,Math.sin(e)*t,n])}([c,null!=f?f:Ge(o,l,r),Ge(a,u,r),Ge(i,p,r)]);return new Be(d,m,y,h,!1)}case"lab":{const[n,o,a,i]=_e(He(e.lab,t.lab,r));return new Be(n,o,a,i,!1)}}}}Be.black=new Be(0,0,0,1),Be.white=new Be(1,1,1,1),Be.transparent=new Be(0,0,0,0),Be.red=new Be(1,0,0,1);class Ve{constructor(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}const Ze=["bottom","center","top"];class Ue{constructor(e,t,r,n,o,a){this.text=e,this.image=t,this.scale=r,this.fontStack=n,this.textColor=o,this.verticalAlign=a}}class We{constructor(e){this.sections=e}static fromString(e){return new We([new Ue(e,null,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(e=>0!==e.text.length||e.image&&0!==e.image.name.length)}static factory(e){return e instanceof We?e:We.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map(e=>e.text).join("")}}class Je{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Je)return e;if("number"==typeof e)return new Je([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const t of e)if("number"!=typeof t)return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new Je(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){return new Je(He(e.values,t.values,r))}}class Xe{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Xe)return e;if("number"==typeof e)return new Xe([e]);if(Array.isArray(e)){for(const t of e)if("number"!=typeof t)return;return new Xe(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){return new Xe(He(e.values,t.values,r))}}class Ye{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Ye)return e;if("string"==typeof e){const t=Be.parse(e);if(!t)return;return new Ye([t])}if(!Array.isArray(e))return;const t=[];for(const r of e){if("string"!=typeof r)return;const e=Be.parse(r);if(!e)return;t.push(e)}return new Ye(t)}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r,n="rgb"){const o=[];if(e.values.length!=t.values.length)throw new Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${t.values.length}), cannot interpolate.`);for(let a=0;a<e.values.length;a++)o.push(Be.interpolate(e.values[a],t.values[a],r,n));return new Ye(o)}}class Ke extends Error{constructor(e){super(e),this.name="RuntimeError"}toJSON(){return this.message}}const Qe=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class et{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof et)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let t=0;t<e.length;t+=2){const r=e[t],n=e[t+1];if("string"!=typeof r||!Qe.has(r))return;if(!Array.isArray(n)||2!==n.length||"number"!=typeof n[0]||"number"!=typeof n[1])return}return new et(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){const n=e.values,o=t.values;if(n.length!==o.length)throw new Ke(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${t.toString()}`);const a=[];for(let e=0;e<n.length;e+=2){if(n[e]!==o[e])throw new Ke(`Cannot interpolate values containing mismatched anchors. from[${e}]: ${n[e]}, to[${e}]: ${o[e]}`);a.push(n[e]);const[t,i]=n[e+1],[s,l]=o[e+1];a.push([Ge(t,s,r),Ge(i,l,r)])}return new et(a)}}class tt{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new tt({name:e,available:!1}):null}}class rt{constructor(e,t,r){this.from=e,this.to=t,this.transition=r}static interpolate(e,t,r){return new rt(e,t,r)}static parse(e){return e instanceof rt?e:Array.isArray(e)&&3===e.length&&"string"==typeof e[0]&&"string"==typeof e[1]&&"number"==typeof e[2]?new rt(e[0],e[1],e[2]):"object"==typeof e&&"string"==typeof e.from&&"string"==typeof e.to&&"number"==typeof e.transition?new rt(e.from,e.to,e.transition):"string"==typeof e?new rt(e,e,1):void 0}}function nt(e,t,r,n){if(!("number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255)){return`Invalid rgba value [${("number"==typeof n?[e,t,r,n]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}return void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[e,t,r,n].join(", ")}]: 'a' must be between 0 and 1.`}function ot(e){if(null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e||e instanceof rt||e instanceof Be||e instanceof Ve||e instanceof We||e instanceof Je||e instanceof Xe||e instanceof Ye||e instanceof et||e instanceof tt)return!0;if(Array.isArray(e)){for(const t of e)if(!ot(t))return!1;return!0}if("object"==typeof e){for(const t in e)if(!ot(e[t]))return!1;return!0}return!1}function at(e){if(null===e)return Y;if("string"==typeof e)return Q;if("boolean"==typeof e)return ee;if("number"==typeof e)return K;if(e instanceof Be)return te;if(e instanceof rt)return re;if(e instanceof Ve)return ae;if(e instanceof We)return ie;if(e instanceof Je)return se;if(e instanceof Xe)return ue;if(e instanceof Ye)return le;if(e instanceof et)return ce;if(e instanceof tt)return pe;if(Array.isArray(e)){const t=e.length;let r;for(const t of e){const e=at(t);if(r){if(r===e)continue;r=oe;break}r=e}return fe(r||oe,t)}return ne}function it(e){const t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof Be||e instanceof rt||e instanceof We||e instanceof Je||e instanceof Xe||e instanceof Ye||e instanceof et||e instanceof tt?e.toString():JSON.stringify(e)}class st{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(2!==e.length)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!ot(e[1]))return t.error("invalid value");const r=e[1];let n=at(r);const o=t.expectedType;return"array"!==n.kind||0!==n.N||!o||"array"!==o.kind||"number"==typeof o.N&&0!==o.N||(n=o),new st(n,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const lt={string:Q,number:K,boolean:ee,object:ne};class ut{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r,n=1;const o=e[0];if("array"===o){let o,a;if(e.length>2){const r=e[1];if("string"!=typeof r||!(r in lt)||"object"===r)return t.error('The item type argument of "array" must be one of string, number, boolean',1);o=lt[r],n++}else o=oe;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);a=e[2],n++}r=fe(o,a)}else{if(!lt[o])throw new Error(`Types doesn't contain name = ${o}`);r=lt[o]}const a=[];for(;n<e.length;n++){const r=t.parse(e[n],n,oe);if(!r)return null;a.push(r)}return new ut(r,a)}evaluate(e){for(let t=0;t<this.args.length;t++){const r=this.args[t].evaluate(e);if(!ye(this.type,at(r)))return r;if(t===this.args.length-1)throw new Ke(`Expected value to be of type ${de(this.type)}, but found ${de(at(r))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const pt={"to-boolean":ee,"to-color":te,"to-number":K,"to-string":Q};class ct{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[0];if(!pt[r])throw new Error(`Can't parse ${r} as it is not part of the known types`);if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");const n=pt[r],o=[];for(let r=1;r<e.length;r++){const n=t.parse(e[r],r,oe);if(!n)return null;o.push(n)}return new ct(n,o)}evaluate(e){switch(this.type.kind){case"boolean":return Boolean(this.args[0].evaluate(e));case"color":{let t,r;for(const n of this.args){if(t=n.evaluate(e),r=null,t instanceof Be)return t;if("string"==typeof t){const r=e.parseColor(t);if(r)return r}else if(Array.isArray(t)&&(r=t.length<3||t.length>4?`Invalid rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:nt(t[0],t[1],t[2],t[3]),!r))return new Be(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Ke(r||`Could not parse color from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"padding":{let t;for(const r of this.args){t=r.evaluate(e);const n=Je.parse(t);if(n)return n}throw new Ke(`Could not parse padding from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"numberArray":{let t;for(const r of this.args){t=r.evaluate(e);const n=Xe.parse(t);if(n)return n}throw new Ke(`Could not parse numberArray from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"colorArray":{let t;for(const r of this.args){t=r.evaluate(e);const n=Ye.parse(t);if(n)return n}throw new Ke(`Could not parse colorArray from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"variableAnchorOffsetCollection":{let t;for(const r of this.args){t=r.evaluate(e);const n=et.parse(t);if(n)return n}throw new Ke(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"number":{let t=null;for(const r of this.args){if(t=r.evaluate(e),null===t)return 0;const n=Number(t);if(!isNaN(n))return n}throw new Ke(`Could not convert ${JSON.stringify(t)} to number.`)}case"formatted":return We.fromString(it(this.args[0].evaluate(e)));case"resolvedImage":return tt.fromString(it(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return it(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const ft=["Unknown","Point","LineString","Polygon"];class dt{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?ft[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let t=this._parseColorCache.get(e);return t||(t=Be.parse(e),this._parseColorCache.set(e,t)),t}}class mt{constructor(e,t,r=[],n,o=new X,a=[]){this.registry=e,this.path=r,this.key=r.map(e=>`[${e}]`).join(""),this.scope=o,this.errors=a,this.expectedType=n,this._isConstant=t}parse(e,t,r,n,o={}){return t?this.concat(t,r,n)._parse(e,o):this._parse(e,o)}_parse(e,t){function r(e,t,r){return"assert"===r?new ut(t,[e]):"coerce"===r?new ct(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const n=e[0];if("string"!=typeof n)return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const o=this.registry[n];if(o){let n=o.parse(e,this);if(!n)return null;if(this.expectedType){const e=this.expectedType,o=n.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==o.kind){if("projectionDefinition"===e.kind&&["string","array"].includes(o.kind)||["color","formatted","resolvedImage"].includes(e.kind)&&["value","string"].includes(o.kind)||["padding","numberArray"].includes(e.kind)&&["value","number","array"].includes(o.kind)||"colorArray"===e.kind&&["value","string","array"].includes(o.kind)||"variableAnchorOffsetCollection"===e.kind&&["value","array"].includes(o.kind))n=r(n,e,t.typeAnnotation||"coerce");else if(this.checkSubtype(e,o))return null}else n=r(n,e,t.typeAnnotation||"assert")}if(!(n instanceof st)&&"resolvedImage"!==n.type.kind&&this._isConstant(n)){const e=new dt;try{n=new st(n.type,n.evaluate(e))}catch(e){return this.error(e.message),null}}return n}return this.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0)}return void 0===e?this.error("'undefined' value invalid. Use null instead."):"object"==typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,t,r){const n="number"==typeof e?this.path.concat(e):this.path,o=r?this.scope.concat(r):this.scope;return new mt(this.registry,this._isConstant,n,t||null,o,this.errors)}error(e,...t){const r=`${this.key}${t.map(e=>`[${e}]`).join("")}`;this.errors.push(new J(r,e))}checkSubtype(e,t){const r=ye(e,t);return r&&this.error(r),r}}class yt{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const r=[];for(let n=1;n<e.length-1;n+=2){const o=e[n];if("string"!=typeof o)return t.error(`Expected string, but found ${typeof o} instead.`,n);if(/[^a-zA-Z0-9_]/.test(o))return t.error("Variable names must contain only alphanumeric characters or '_'.",n);const a=t.parse(e[n+1],n+1);if(!a)return null;r.push([o,a])}const n=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return n?new yt(r,n):null}outputDefined(){return this.result.outputDefined()}}class ht{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");const r=e[1];return t.scope.has(r)?new ht(r,t.scope.get(r)):t.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class gt{constructor(e,t,r){this.type=e,this.index=t,this.input=r}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,K),n=t.parse(e[2],2,fe(t.expectedType||oe));if(!r||!n)return null;const o=n.type;return new gt(o.itemType,r,n)}evaluate(e){const t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new Ke(`Array index out of bounds: ${t} < 0.`);if(t>=r.length)throw new Ke(`Array index out of bounds: ${t} > ${r.length-1}.`);if(t!==Math.floor(t))throw new Ke(`Array index must be an integer, but found ${t} instead.`);return r[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class vt{constructor(e,t){this.type=ee,this.needle=e,this.haystack=t}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,oe),n=t.parse(e[2],2,oe);return r&&n?he(r.type,[ee,Q,K,Y,oe])?new vt(r,n):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${de(r.type)} instead`):null}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!ge(t,["boolean","string","number","null"]))throw new Ke(`Expected first argument to be of type boolean, string, number or null, but found ${de(at(t))} instead.`);if(!ge(r,["string","array"]))throw new Ke(`Expected second argument to be of type array or string, but found ${de(at(r))} instead.`);return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class bt{constructor(e,t,r){this.type=K,this.needle=e,this.haystack=t,this.fromIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,oe),n=t.parse(e[2],2,oe);if(!r||!n)return null;if(!he(r.type,[ee,Q,K,Y,oe]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${de(r.type)} instead`);if(4===e.length){const o=t.parse(e[3],3,K);return o?new bt(r,n,o):null}return new bt(r,n)}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!ge(t,["boolean","string","number","null"]))throw new Ke(`Expected first argument to be of type boolean, string, number or null, but found ${de(at(t))} instead.`);let n;if(this.fromIndex&&(n=this.fromIndex.evaluate(e)),ge(r,["string"])){const e=r.indexOf(t,n);return-1===e?-1:[...r.slice(0,e)].length}if(ge(r,["array"]))return r.indexOf(t,n);throw new Ke(`Expected second argument to be of type array or string, but found ${de(at(r))} instead.`)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class xt{constructor(e,t,r,n,o,a){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=o,this.otherwise=a}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return t.error("Expected an even number of arguments.");let r,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);const o={},a=[];for(let i=2;i<e.length-1;i+=2){let s=e[i];const l=e[i+1];Array.isArray(s)||(s=[s]);const u=t.concat(i);if(0===s.length)return u.error("Expected at least one branch label.");for(const e of s){if("number"!=typeof e&&"string"!=typeof e)return u.error("Branch labels must be numbers or strings.");if("number"==typeof e&&Math.abs(e)>Number.MAX_SAFE_INTEGER)return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,at(e)))return null}else r=at(e);if(void 0!==o[String(e)])return u.error("Branch labels must be unique.");o[String(e)]=a.length}const p=t.parse(l,i,n);if(!p)return null;n=n||p.type,a.push(p)}const i=t.parse(e[1],1,oe);if(!i)return null;const s=t.parse(e[e.length-1],e.length-1,n);return s?"value"!==i.type.kind&&t.concat(1).checkSubtype(r,i.type)?null:new xt(r,n,i,o,a,s):null}evaluate(e){const t=this.input.evaluate(e);return(at(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}}class wt{constructor(e,t,r){this.type=e,this.branches=t,this.otherwise=r}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return t.error("Expected an odd number of arguments.");let r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);const n=[];for(let o=1;o<e.length-1;o+=2){const a=t.parse(e[o],o,ee);if(!a)return null;const i=t.parse(e[o+1],o+1,r);if(!i)return null;n.push([a,i]),r=r||i.type}const o=t.parse(e[e.length-1],e.length-1,r);if(!o)return null;if(!r)throw new Error("Can't infer output type");return new wt(r,n,o)}evaluate(e){for(const[t,r]of this.branches)if(t.evaluate(e))return r.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[t,r]of this.branches)e(t),e(r);e(this.otherwise)}outputDefined(){return this.branches.every(([e,t])=>t.outputDefined())&&this.otherwise.outputDefined()}}class kt{constructor(e,t,r,n){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=n}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,oe),n=t.parse(e[2],2,K);if(!r||!n)return null;if(!he(r.type,[fe(oe),Q,oe]))return t.error(`Expected first argument to be of type array or string, but found ${de(r.type)} instead`);if(4===e.length){const o=t.parse(e[3],3,K);return o?new kt(r.type,r,n,o):null}return new kt(r.type,r,n)}evaluate(e){const t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);let n;if(this.endIndex&&(n=this.endIndex.evaluate(e)),ge(t,["string"]))return[...t].slice(r,n).join("");if(ge(t,["array"]))return t.slice(r,n);throw new Ke(`Expected first argument to be of type array or string, but found ${de(at(t))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function Mt(e,t){const r=e.length-1;let n,o,a=0,i=r,s=0;for(;a<=i;)if(s=Math.floor((a+i)/2),n=e[s],o=e[s+1],n<=t){if(s===r||t<o)return s;a=s+1}else{if(!(n>t))throw new Ke("Input is not a number.");i=s-1}return 0}class St{constructor(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[e,t]of r)this.labels.push(e),this.outputs.push(t)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");const r=t.parse(e[1],1,K);if(!r)return null;const n=[];let o=null;t.expectedType&&"value"!==t.expectedType.kind&&(o=t.expectedType);for(let r=1;r<e.length;r+=2){const a=1===r?-1/0:e[r],i=e[r+1],s=r,l=r+1;if("number"!=typeof a)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',s);if(n.length&&n[n.length-1][0]>=a)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const u=t.parse(i,l,o);if(!u)return null;o=o||u.type,n.push([a,u])}return new St(o,r,n)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const o=t.length;if(n>=t[o-1])return r[o-1].evaluate(e);return r[Mt(t,n)].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function zt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jt,Ct;var At=function(){if(Ct)return jt;function e(e,t,r,n){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=n}return Ct=1,jt=e,e.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var r=e,n=0;n<8;n++){var o=this.sampleCurveX(r)-e;if(Math.abs(o)<t)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=o/a}var i=0,s=1;for(r=e,n=0;n<20&&(o=this.sampleCurveX(r),!(Math.abs(o-e)<t));n++)e>o?i=r:s=r,r=.5*(s-i)+i;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}},jt}(),Ot=zt(At);class Et{constructor(e,t,r,n,o){this.type=e,this.operator=t,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(const[e,t]of o)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,r,n){let o=0;if("exponential"===e.name)o=_t(t,e.base,r,n);else if("linear"===e.name)o=_t(t,1,r,n);else if("cubic-bezier"===e.name){const a=e.controlPoints;o=new Ot(a[0],a[1],a[2],a[3]).solve(_t(t,1,r,n))}return o}static parse(e,t){let[r,n,o,...a]=e;if(!Array.isArray(n)||0===n.length)return t.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const e=n[1];if("number"!=typeof e)return t.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:e}}else{if("cubic-bezier"!==n[0])return t.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const e=n.slice(1);if(4!==e.length||e.some(e=>"number"!=typeof e||e<0||e>1))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:e}}}if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(o=t.parse(o,2,K),!o)return null;const i=[];let s=null;"interpolate-hcl"!==r&&"interpolate-lab"!==r||t.expectedType==le?t.expectedType&&"value"!==t.expectedType.kind&&(s=t.expectedType):s=te;for(let e=0;e<a.length;e+=2){const r=a[e],n=a[e+1],o=e+3,l=e+4;if("number"!=typeof r)return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',o);if(i.length&&i[i.length-1][0]>=r)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',o);const u=t.parse(n,l,s);if(!u)return null;s=s||u.type,i.push([r,u])}return ve(s,K)||ve(s,re)||ve(s,te)||ve(s,se)||ve(s,ue)||ve(s,le)||ve(s,ce)||ve(s,fe(K))?new Et(s,r,n,o,i):t.error(`Type ${de(s)} is not interpolatable.`)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const o=t.length;if(n>=t[o-1])return r[o-1].evaluate(e);const a=Mt(t,n),i=t[a],s=t[a+1],l=Et.interpolationFactor(this.interpolation,n,i,s),u=r[a].evaluate(e),p=r[a+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Ge(u,p,l);case"color":return Be.interpolate(u,p,l);case"padding":return Je.interpolate(u,p,l);case"colorArray":return Ye.interpolate(u,p,l);case"numberArray":return Xe.interpolate(u,p,l);case"variableAnchorOffsetCollection":return et.interpolate(u,p,l);case"array":return He(u,p,l);case"projectionDefinition":return rt.interpolate(u,p,l)}case"interpolate-hcl":switch(this.type.kind){case"color":return Be.interpolate(u,p,l,"hcl");case"colorArray":return Ye.interpolate(u,p,l,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return Be.interpolate(u,p,l,"lab");case"colorArray":return Ye.interpolate(u,p,l,"lab")}}}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function _t(e,t,r,n){const o=n-r,a=e-r;return 0===o?0:1===t?a/o:(Math.pow(t,a)-1)/(Math.pow(t,o)-1)}class Pt{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r=null;const n=t.expectedType;n&&"value"!==n.kind&&(r=n);const o=[];for(const n of e.slice(1)){const e=t.parse(n,1+o.length,r,void 0,{typeAnnotation:"omit"});if(!e)return null;r=r||e.type,o.push(e)}if(!r)throw new Error("No output type");const a=n&&o.some(e=>ye(n,e.type));return new Pt(a?oe:r,o)}evaluate(e){let t,r=null,n=0;for(const o of this.args)if(n++,r=o.evaluate(e),r&&r instanceof tt&&!r.available&&(t||(t=r.name),r=null,n===this.args.length&&(r=t)),null!==r)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}function It(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function $t(e,t,r,n){return 0===n.compare(t,r)}function qt(e,t,r){const n="=="!==e&&"!="!==e;return class o{constructor(e,t,r){this.type=ee,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");const r=e[0];let a=t.parse(e[1],1,oe);if(!a)return null;if(!It(r,a.type))return t.concat(1).error(`"${r}" comparisons are not supported for type '${de(a.type)}'.`);let i=t.parse(e[2],2,oe);if(!i)return null;if(!It(r,i.type))return t.concat(2).error(`"${r}" comparisons are not supported for type '${de(i.type)}'.`);if(a.type.kind!==i.type.kind&&"value"!==a.type.kind&&"value"!==i.type.kind)return t.error(`Cannot compare types '${de(a.type)}' and '${de(i.type)}'.`);n&&("value"===a.type.kind&&"value"!==i.type.kind?a=new ut(i.type,[a]):"value"!==a.type.kind&&"value"===i.type.kind&&(i=new ut(a.type,[i])));let s=null;if(4===e.length){if("string"!==a.type.kind&&"string"!==i.type.kind&&"value"!==a.type.kind&&"value"!==i.type.kind)return t.error("Cannot use collator to compare non-string types.");if(s=t.parse(e[3],3,ae),!s)return null}return new o(a,i,s)}evaluate(o){const a=this.lhs.evaluate(o),i=this.rhs.evaluate(o);if(n&&this.hasUntypedArgument){const t=at(a),r=at(i);if(t.kind!==r.kind||"string"!==t.kind&&"number"!==t.kind)throw new Ke(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${r.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const e=at(a),r=at(i);if("string"!==e.kind||"string"!==r.kind)return t(o,a,i)}return this.collator?r(o,a,i,this.collator.evaluate(o)):t(o,a,i)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}}}const Dt=qt("==",function(e,t,r){return t===r},$t),Tt=qt("!=",function(e,t,r){return t!==r},function(e,t,r,n){return!$t(0,t,r,n)}),Nt=qt("<",function(e,t,r){return t<r},function(e,t,r,n){return n.compare(t,r)<0}),Ft=qt(">",function(e,t,r){return t>r},function(e,t,r,n){return n.compare(t,r)>0}),Lt=qt("<=",function(e,t,r){return t<=r},function(e,t,r,n){return n.compare(t,r)<=0}),Rt=qt(">=",function(e,t,r){return t>=r},function(e,t,r,n){return n.compare(t,r)>=0});class Gt{constructor(e,t,r){this.type=ae,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(2!==e.length)return t.error("Expected one argument.");const r=e[1];if("object"!=typeof r||Array.isArray(r))return t.error("Collator options argument must be an object.");const n=t.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,ee);if(!n)return null;const o=t.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,ee);if(!o)return null;let a=null;return r.locale&&(a=t.parse(r.locale,1,Q),!a)?null:new Gt(n,o,a)}evaluate(e){return new Ve(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}class Ht{constructor(e,t,r,n,o,a){this.type=Q,this.number=e,this.locale=t,this.currency=r,this.unit=n,this.minFractionDigits=o,this.maxFractionDigits=a}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,K);if(!r)return null;const n=e[2];if("object"!=typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");let o=null;if(n.locale&&(o=t.parse(n.locale,1,Q),!o))return null;let a=null;if(n.currency&&(a=t.parse(n.currency,1,Q),!a))return null;let i=null;if(n.unit&&(i=t.parse(n.unit,1,Q),!i))return null;if(a&&i)return t.error("NumberFormat options `currency` and `unit` are mutually exclusive");let s=null;if(n["min-fraction-digits"]&&(s=t.parse(n["min-fraction-digits"],1,K),!s))return null;let l=null;return n["max-fraction-digits"]&&(l=t.parse(n["max-fraction-digits"],1,K),!l)?null:new Ht(r,o,a,i,s,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":this.unit?"unit":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class Bt{constructor(e){this.type=ie,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[1];if(!Array.isArray(r)&&"object"==typeof r)return t.error("First argument must be an image or text section.");const n=[];let o=!1;for(let r=1;r<=e.length-1;++r){const a=e[r];if(o&&"object"==typeof a&&!Array.isArray(a)){o=!1;let e=null;if(a["font-scale"]&&(e=t.parse(a["font-scale"],1,K),!e))return null;let r=null;if(a["text-font"]&&(r=t.parse(a["text-font"],1,fe(Q)),!r))return null;let i=null;if(a["text-color"]&&(i=t.parse(a["text-color"],1,te),!i))return null;let s=null;if(a["vertical-align"]){if("string"==typeof a["vertical-align"]&&!Ze.includes(a["vertical-align"]))return t.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${a["vertical-align"]}' instead.`);if(s=t.parse(a["vertical-align"],1,Q),!s)return null}const l=n[n.length-1];l.scale=e,l.font=r,l.textColor=i,l.verticalAlign=s}else{const a=t.parse(e[r],1,oe);if(!a)return null;const i=a.type.kind;if("string"!==i&&"value"!==i&&"null"!==i&&"resolvedImage"!==i)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");o=!0,n.push({content:a,scale:null,font:null,textColor:null,verticalAlign:null})}}return new Bt(n)}evaluate(e){return new We(this.sections.map(t=>{const r=t.content.evaluate(e);return at(r)===pe?new Ue("",r,null,null,null,t.verticalAlign?t.verticalAlign.evaluate(e):null):new Ue(it(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null,t.verticalAlign?t.verticalAlign.evaluate(e):null)}))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor),t.verticalAlign&&e(t.verticalAlign)}outputDefined(){return!1}}class Vt{constructor(e){this.type=pe,this.input=e}static parse(e,t){if(2!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,Q);return r?new Vt(r):t.error("No image name provided.")}evaluate(e){const t=this.input.evaluate(e),r=tt.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r}eachChild(e){e(this.input)}outputDefined(){return!1}}class Zt{constructor(e){this.type=K,this.input=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error(`Expected argument of type string or array, but found ${de(r.type)} instead.`):new Zt(r):null}evaluate(e){const t=this.input.evaluate(e);if("string"==typeof t)return[...t].length;if(Array.isArray(t))return t.length;throw new Ke(`Expected value to be of type string or array, but found ${de(at(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const Ut=8192;function Wt(e,t){const r=(180+e[0])/360;const n=(o=e[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+o*Math.PI/360)))/360);var o;const a=Math.pow(2,t.z);return[Math.round(r*a*Ut),Math.round(n*a*Ut)]}function Jt(e,t){const r=Math.pow(2,t.z),n=(e[0]/Ut+t.x)/r,o=(e[1]/Ut+t.y)/r;return[(i=n,360*i-180),(a=o,360/Math.PI*Math.atan(Math.exp((180-360*a)*Math.PI/180))-90)];var a,i}function Xt(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function Yt(e,t){return!(e[0]<=t[0])&&(!(e[2]>=t[2])&&(!(e[1]<=t[1])&&!(e[3]>=t[3])))}function Kt(e,t,r){return t[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function Qt(e,t,r){const n=e[0]-t[0],o=e[1]-t[1],a=e[0]-r[0],i=e[1]-r[1];return n*i-a*o===0&&n*a<=0&&o*i<=0}function er(e,t,r,n){const o=[t[0]-e[0],t[1]-e[1]],a=[n[0]-r[0],n[1]-r[1]];return 0!==(i=a)[0]*(s=o)[1]-i[1]*s[0]&&!(!ir(e,t,r,n)||!ir(r,n,e,t));var i,s}function tr(e,t,r){for(const n of r)for(let r=0;r<n.length-1;++r)if(er(e,t,n[r],n[r+1]))return!0;return!1}function rr(e,t,r=!1){let n=!1;for(const o of t)for(let t=0;t<o.length-1;t++){if(Qt(e,o[t],o[t+1]))return r;Kt(e,o[t],o[t+1])&&(n=!n)}return n}function nr(e,t){for(const r of t)if(rr(e,r))return!0;return!1}function or(e,t){for(const r of e)if(!rr(r,t))return!1;for(let r=0;r<e.length-1;++r)if(tr(e[r],e[r+1],t))return!1;return!0}function ar(e,t){for(const r of t)if(or(e,r))return!0;return!1}function ir(e,t,r,n){const o=e[0]-r[0],a=e[1]-r[1],i=t[0]-r[0],s=t[1]-r[1],l=n[0]-r[0],u=n[1]-r[1],p=o*u-l*a,c=i*u-l*s;return p>0&&c<0||p<0&&c>0}function sr(e,t,r){const n=[];for(let o=0;o<e.length;o++){const a=[];for(let n=0;n<e[o].length;n++){const i=Wt(e[o][n],r);Xt(t,i),a.push(i)}n.push(a)}return n}function lr(e,t,r){const n=[];for(let o=0;o<e.length;o++){const a=sr(e[o],t,r);n.push(a)}return n}function ur(e,t,r,n){if(e[0]<r[0]||e[0]>r[2]){const t=.5*n;let o=e[0]-r[0]>t?-n:r[0]-e[0]>t?n:0;0===o&&(o=e[0]-r[2]>t?-n:r[2]-e[0]>t?n:0),e[0]+=o}Xt(t,e)}function pr(e,t,r,n){const o=Math.pow(2,n.z)*Ut,a=[n.x*Ut,n.y*Ut],i=[];for(const n of e)for(const e of n){const n=[e.x+a[0],e.y+a[1]];ur(n,t,r,o),i.push(n)}return i}function cr(e,t,r,n){const o=Math.pow(2,n.z)*Ut,a=[n.x*Ut,n.y*Ut],i=[];for(const r of e){const e=[];for(const n of r){const r=[n.x+a[0],n.y+a[1]];Xt(t,r),e.push(r)}i.push(e)}if(t[2]-t[0]<=o/2){!function(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}(t);for(const e of i)for(const n of e)ur(n,t,r,o)}return i}class fr{constructor(e,t){this.type=ee,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ot(e[1])){const t=e[1];if("FeatureCollection"===t.type){const e=[];for(const r of t.features){const{type:t,coordinates:n}=r.geometry;"Polygon"===t&&e.push(n),"MultiPolygon"===t&&e.push(...n)}if(e.length){return new fr(t,{type:"MultiPolygon",coordinates:e})}}else if("Feature"===t.type){const e=t.geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new fr(t,t.geometry)}else if("Polygon"===t.type||"MultiPolygon"===t.type)return new fr(t,t)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],o=e.canonicalID();if("Polygon"===t.type){const a=sr(t.coordinates,n,o),i=pr(e.geometry(),r,n,o);if(!Yt(r,n))return!1;for(const e of i)if(!rr(e,a))return!1}if("MultiPolygon"===t.type){const a=lr(t.coordinates,n,o),i=pr(e.geometry(),r,n,o);if(!Yt(r,n))return!1;for(const e of i)if(!nr(e,a))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],o=e.canonicalID();if("Polygon"===t.type){const a=sr(t.coordinates,n,o),i=cr(e.geometry(),r,n,o);if(!Yt(r,n))return!1;for(const e of i)if(!or(e,a))return!1}if("MultiPolygon"===t.type){const a=lr(t.coordinates,n,o),i=cr(e.geometry(),r,n,o);if(!Yt(r,n))return!1;for(const e of i)if(!ar(e,a))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class dr{constructor(e=[],t=(e,t)=>e<t?-1:e>t?1:0){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(0===this.length)return;const e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:r}=this,n=t[e];for(;e>0;){const o=e-1>>1,a=t[o];if(r(n,a)>=0)break;t[e]=a,e=o}t[e]=n}_down(e){const{data:t,compare:r}=this,n=this.length>>1,o=t[e];for(;e<n;){let n=1+(e<<1);const a=n+1;if(a<this.length&&r(t[a],t[n])<0&&(n=a),r(t[n],o)>=0)break;t[e]=t[n],e=n}t[e]=o}}function mr(e){let t=0;for(let r,n,o=0,a=e.length,i=a-1;o<a;i=o++)r=e[o],n=e[i],t+=(n.x-r.x)*(r.y+n.y);return t}const yr=1/298.257223563,hr=yr*(2-yr),gr=Math.PI/180;class vr{constructor(e){const t=6378.137*gr*1e3,r=Math.cos(e*gr),n=1/(1-hr*(1-r*r)),o=Math.sqrt(n);this.kx=t*o*r,this.ky=t*o*n*(1-hr)}distance(e,t){const r=this.wrap(e[0]-t[0])*this.kx,n=(e[1]-t[1])*this.ky;return Math.sqrt(r*r+n*n)}pointOnLine(e,t){let r,n,o,a,i=1/0;for(let s=0;s<e.length-1;s++){let l=e[s][0],u=e[s][1],p=this.wrap(e[s+1][0]-l)*this.kx,c=(e[s+1][1]-u)*this.ky,f=0;0===p&&0===c||(f=(this.wrap(t[0]-l)*this.kx*p+(t[1]-u)*this.ky*c)/(p*p+c*c),f>1?(l=e[s+1][0],u=e[s+1][1]):f>0&&(l+=p/this.kx*f,u+=c/this.ky*f)),p=this.wrap(t[0]-l)*this.kx,c=(t[1]-u)*this.ky;const d=p*p+c*c;d<i&&(i=d,r=l,n=u,o=s,a=f)}return{point:[r,n],index:o,t:Math.max(0,Math.min(1,a))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}}function br(e,t){return t[0]-e[0]}function xr(e){return e[1]-e[0]+1}function wr(e,t){return e[1]>=e[0]&&e[1]<t}function kr(e,t){if(e[0]>e[1])return[null,null];const r=xr(e);if(t){if(2===r)return[e,null];const t=Math.floor(r/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}if(1===r)return[e,null];const n=Math.floor(r/2)-1;return[[e[0],e[0]+n],[e[0]+n+1,e[1]]]}function Mr(e,t){if(!wr(t,e.length))return[1/0,1/0,-1/0,-1/0];const r=[1/0,1/0,-1/0,-1/0];for(let n=t[0];n<=t[1];++n)Xt(r,e[n]);return r}function Sr(e){const t=[1/0,1/0,-1/0,-1/0];for(const r of e)for(const e of r)Xt(t,e);return t}function zr(e){return e[0]!==-1/0&&e[1]!==-1/0&&e[2]!==1/0&&e[3]!==1/0}function jr(e,t,r){if(!zr(e)||!zr(t))return NaN;let n=0,o=0;return e[2]<t[0]&&(n=t[0]-e[2]),e[0]>t[2]&&(n=e[0]-t[2]),e[1]>t[3]&&(o=e[1]-t[3]),e[3]<t[1]&&(o=t[1]-e[3]),r.distance([0,0],[n,o])}function Cr(e,t,r){const n=r.pointOnLine(t,e);return r.distance(e,n.point)}function Ar(e,t,r,n,o){const a=Math.min(Cr(e,[r,n],o),Cr(t,[r,n],o)),i=Math.min(Cr(r,[e,t],o),Cr(n,[e,t],o));return Math.min(a,i)}function Or(e,t,r,n,o){if(!(wr(t,e.length)&&wr(n,r.length)))return 1/0;let a=1/0;for(let i=t[0];i<t[1];++i){const t=e[i],s=e[i+1];for(let e=n[0];e<n[1];++e){const n=r[e],i=r[e+1];if(er(t,s,n,i))return 0;a=Math.min(a,Ar(t,s,n,i,o))}}return a}function Er(e,t,r,n,o){if(!(wr(t,e.length)&&wr(n,r.length)))return NaN;let a=1/0;for(let i=t[0];i<=t[1];++i)for(let t=n[0];t<=n[1];++t)if(a=Math.min(a,o.distance(e[i],r[t])),0===a)return a;return a}function _r(e,t,r){if(rr(e,t,!0))return 0;let n=1/0;for(const o of t){const t=o[0],a=o[o.length-1];if(t!==a&&(n=Math.min(n,Cr(e,[a,t],r)),0===n))return n;const i=r.pointOnLine(o,e);if(n=Math.min(n,r.distance(e,i.point)),0===n)return n}return n}function Pr(e,t,r,n){if(!wr(t,e.length))return NaN;for(let n=t[0];n<=t[1];++n)if(rr(e[n],r,!0))return 0;let o=1/0;for(let a=t[0];a<t[1];++a){const t=e[a],i=e[a+1];for(const e of r)for(let r=0,a=e.length,s=a-1;r<a;s=r++){const a=e[s],l=e[r];if(er(t,i,a,l))return 0;o=Math.min(o,Ar(t,i,a,l,n))}}return o}function Ir(e,t){for(const r of e)for(const e of r)if(rr(e,t,!0))return!0;return!1}function $r(e,t,r,n=1/0){const o=Sr(e),a=Sr(t);if(n!==1/0&&jr(o,a,r)>=n)return n;if(Yt(o,a)){if(Ir(e,t))return 0}else if(Ir(t,e))return 0;let i=1/0;for(const n of e)for(let e=0,o=n.length,a=o-1;e<o;a=e++){const o=n[a],s=n[e];for(const e of t)for(let t=0,n=e.length,a=n-1;t<n;a=t++){const n=e[a],l=e[t];if(er(o,s,n,l))return 0;i=Math.min(i,Ar(o,s,n,l,r))}}return i}function qr(e,t,r,n,o,a){if(!a)return;const i=jr(Mr(n,a),o,r);i<t&&e.push([i,a,[0,0]])}function Dr(e,t,r,n,o,a,i){if(!a||!i)return;const s=jr(Mr(n,a),Mr(o,i),r);s<t&&e.push([s,a,i])}function Tr(e,t,r,n,o=1/0){let a=Math.min(n.distance(e[0],r[0][0]),o);if(0===a)return a;const i=new dr([[0,[0,e.length-1],[0,0]]],br),s=Sr(r);for(;i.length>0;){const o=i.pop();if(o[0]>=a)continue;const l=o[1],u=t?50:100;if(xr(l)<=u){if(!wr(l,e.length))return NaN;if(t){const t=Pr(e,l,r,n);if(isNaN(t)||0===t)return t;a=Math.min(a,t)}else for(let t=l[0];t<=l[1];++t){const o=_r(e[t],r,n);if(a=Math.min(a,o),0===a)return 0}}else{const r=kr(l,t);qr(i,a,n,e,s,r[0]),qr(i,a,n,e,s,r[1])}}return a}function Nr(e,t,r,n,o,a=1/0){let i=Math.min(a,o.distance(e[0],r[0]));if(0===i)return i;const s=new dr([[0,[0,e.length-1],[0,r.length-1]]],br);for(;s.length>0;){const a=s.pop();if(a[0]>=i)continue;const l=a[1],u=a[2],p=t?50:100,c=n?50:100;if(xr(l)<=p&&xr(u)<=c){if(!wr(l,e.length)&&wr(u,r.length))return NaN;let a;if(t&&n)a=Or(e,l,r,u,o),i=Math.min(i,a);else if(t&&!n){const t=e.slice(l[0],l[1]+1);for(let e=u[0];e<=u[1];++e)if(a=Cr(r[e],t,o),i=Math.min(i,a),0===i)return i}else if(!t&&n){const t=r.slice(u[0],u[1]+1);for(let r=l[0];r<=l[1];++r)if(a=Cr(e[r],t,o),i=Math.min(i,a),0===i)return i}else a=Er(e,l,r,u,o),i=Math.min(i,a)}else{const a=kr(l,t),p=kr(u,n);Dr(s,i,o,e,r,a[0],p[0]),Dr(s,i,o,e,r,a[0],p[1]),Dr(s,i,o,e,r,a[1],p[0]),Dr(s,i,o,e,r,a[1],p[1])}}return i}function Fr(e,t){const r=e.geometry();if(0===r.length||0===r[0].length)return NaN;const n=function(e){if(e.length<=1)return[e];const t=[];let r,n;for(const o of e){const e=mr(o);0!==e&&(o.area=Math.abs(e),void 0===n&&(n=e<0),n===e<0?(r&&t.push(r),r=[o]):r.push(o))}return r&&t.push(r),t}(r).map(t=>t.map(t=>t.map(t=>Jt([t.x,t.y],e.canonical)))),o=new vr(n[0][0][0][1]);let a=1/0;for(const e of t)for(const t of n){switch(e.type){case"Point":a=Math.min(a,Tr([e.coordinates],!1,t,o,a));break;case"LineString":a=Math.min(a,Tr(e.coordinates,!0,t,o,a));break;case"Polygon":a=Math.min(a,$r(t,e.coordinates,o,a))}if(0===a)return a}return a}function Lr(e){return"MultiPolygon"===e.type?e.coordinates.map(e=>({type:"Polygon",coordinates:e})):"MultiLineString"===e.type?e.coordinates.map(e=>({type:"LineString",coordinates:e})):"MultiPoint"===e.type?e.coordinates.map(e=>({type:"Point",coordinates:e})):[e]}class Rr{constructor(e,t){this.type=K,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ot(e[1])){const t=e[1];if("FeatureCollection"===t.type)return new Rr(t,t.features.map(e=>Lr(e.geometry)).flat());if("Feature"===t.type)return new Rr(t,Lr(t.geometry));if("type"in t&&"coordinates"in t)return new Rr(t,Lr(t))}return t.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){const r=e.geometry(),n=r.flat().map(t=>Jt([t.x,t.y],e.canonical));if(0===r.length)return NaN;const o=new vr(n[0][1]);let a=1/0;for(const e of t){switch(e.type){case"Point":a=Math.min(a,Nr(n,!1,[e.coordinates],!1,o,a));break;case"LineString":a=Math.min(a,Nr(n,!1,e.coordinates,!0,o,a));break;case"Polygon":a=Math.min(a,Tr(n,!1,e.coordinates,o,a))}if(0===a)return a}return a}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const r=e.geometry(),n=r.flat().map(t=>Jt([t.x,t.y],e.canonical));if(0===r.length)return NaN;const o=new vr(n[0][1]);let a=1/0;for(const e of t){switch(e.type){case"Point":a=Math.min(a,Nr(n,!0,[e.coordinates],!1,o,a));break;case"LineString":a=Math.min(a,Nr(n,!0,e.coordinates,!0,o,a));break;case"Polygon":a=Math.min(a,Tr(n,!0,e.coordinates,o,a))}if(0===a)return a}return a}(e,this.geometries);if("Polygon"===e.geometryType())return Fr(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class Gr{constructor(e){this.type=oe,this.key=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=e[1];return null==r?t.error("Global state property must be defined."):"string"!=typeof r?t.error(`Global state property must be string, but found ${typeof e[1]} instead.`):new Gr(r)}evaluate(e){var t;const r=null===(t=e.globals)||void 0===t?void 0:t.globalState;return r&&0!==Object.keys(r).length?qe(r,this.key):null}eachChild(){}outputDefined(){return!1}}const Hr={"==":Dt,"!=":Tt,">":Ft,"<":Nt,">=":Rt,"<=":Lt,array:ut,at:gt,boolean:ut,case:wt,coalesce:Pt,collator:Gt,format:Bt,image:Vt,in:vt,"index-of":bt,interpolate:Et,"interpolate-hcl":Et,"interpolate-lab":Et,length:Zt,let:yt,literal:st,match:xt,number:ut,"number-format":Ht,object:ut,slice:kt,step:St,string:ut,"to-boolean":ct,"to-color":ct,"to-number":ct,"to-string":ct,var:ht,within:fr,distance:Rr,"global-state":Gr};class Br{constructor(e,t,r,n){this.name=e,this.type=t,this._evaluate=r,this.args=n}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,t){const r=e[0],n=Br.definitions[r];if(!n)return t.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const o=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,i=a.filter(([t])=>!Array.isArray(t)||t.length===e.length-1);let s=null;for(const[n,a]of i){s=new mt(t.registry,Jr,t.path,null,t.scope);const i=[];let l=!1;for(let t=1;t<e.length;t++){const r=e[t],o=Array.isArray(n)?n[t-1]:n.type,a=s.parse(r,1+i.length,o);if(!a){l=!0;break}i.push(a)}if(!l)if(Array.isArray(n)&&n.length!==i.length)s.error(`Expected ${n.length} arguments, but found ${i.length} instead.`);else{for(let e=0;e<i.length;e++){const t=Array.isArray(n)?n[e]:n.type,r=i[e];s.concat(e+1).checkSubtype(t,r.type)}if(0===s.errors.length)return new Br(r,o,a,i)}}if(1===i.length)t.errors.push(...s.errors);else{const r=(i.length?i:a).map(([e])=>{return t=e,Array.isArray(t)?`(${t.map(de).join(", ")})`:`(${de(t.type)}...)`;var t}).join(" | "),n=[];for(let r=1;r<e.length;r++){const o=t.parse(e[r],1+n.length);if(!o)return null;n.push(de(o.type))}t.error(`Expected arguments of type ${r}, but found (${n.join(", ")}) instead.`)}return null}static register(e,t){Br.definitions=t;for(const r in t)e[r]=Br}}function Vr(e,[t,r,n,o]){t=t.evaluate(e),r=r.evaluate(e),n=n.evaluate(e);const a=o?o.evaluate(e):1,i=nt(t,r,n,a);if(i)throw new Ke(i);return new Be(t/255,r/255,n/255,a,!1)}function Zr(e,t){return e in t}function Ur(e,t){const r=t[e];return void 0===r?null:r}function Wr(e){return{type:e}}function Jr(e){if(e instanceof ht)return Jr(e.boundExpression);if(e instanceof Br&&"error"===e.name)return!1;if(e instanceof Gt)return!1;if(e instanceof fr)return!1;if(e instanceof Rr)return!1;if(e instanceof Gr)return!1;const t=e instanceof ct||e instanceof ut;let r=!0;return e.eachChild(e=>{r=t?r&&Jr(e):r&&e instanceof st}),!!r&&(Xr(e)&&Kr(e,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]))}function Xr(e){if(e instanceof Br){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof fr)return!1;if(e instanceof Rr)return!1;let t=!0;return e.eachChild(e=>{t&&!Xr(e)&&(t=!1)}),t}function Yr(e){if(e instanceof Br&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild(e=>{t&&!Yr(e)&&(t=!1)}),t}function Kr(e,t){if(e instanceof Br&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild(e=>{r&&!Kr(e,t)&&(r=!1)}),r}function Qr(e){return{result:"success",value:e}}function en(e){return{result:"error",value:e}}function tn(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&at(e)===ne}Br.register(Hr,{error:[{kind:"error"},[Q],(e,[t])=>{throw new Ke(t.evaluate(e))}],typeof:[Q,[oe],(e,[t])=>de(at(t.evaluate(e)))],"to-rgba":[fe(K,4),[te],(e,[t])=>{const[r,n,o,a]=t.evaluate(e).rgb;return[255*r,255*n,255*o,a]}],rgb:[te,[K,K,K],Vr],rgba:[te,[K,K,K,K],Vr],has:{type:ee,overloads:[[[Q],(e,[t])=>Zr(t.evaluate(e),e.properties())],[[Q,ne],(e,[t,r])=>Zr(t.evaluate(e),r.evaluate(e))]]},get:{type:oe,overloads:[[[Q],(e,[t])=>Ur(t.evaluate(e),e.properties())],[[Q,ne],(e,[t,r])=>Ur(t.evaluate(e),r.evaluate(e))]]},"feature-state":[oe,[Q],(e,[t])=>Ur(t.evaluate(e),e.featureState||{})],properties:[ne,[],e=>e.properties()],"geometry-type":[Q,[],e=>e.geometryType()],id:[oe,[],e=>e.id()],zoom:[K,[],e=>e.globals.zoom],"heatmap-density":[K,[],e=>e.globals.heatmapDensity||0],elevation:[K,[],e=>e.globals.elevation||0],"line-progress":[K,[],e=>e.globals.lineProgress||0],accumulated:[oe,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[K,Wr(K),(e,t)=>{let r=0;for(const n of t)r+=n.evaluate(e);return r}],"*":[K,Wr(K),(e,t)=>{let r=1;for(const n of t)r*=n.evaluate(e);return r}],"-":{type:K,overloads:[[[K,K],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[K],(e,[t])=>-t.evaluate(e)]]},"/":[K,[K,K],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[K,[K,K],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[K,[],()=>Math.LN2],pi:[K,[],()=>Math.PI],e:[K,[],()=>Math.E],"^":[K,[K,K],(e,[t,r])=>Math.pow(t.evaluate(e),r.evaluate(e))],sqrt:[K,[K],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[K,[K],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[K,[K],(e,[t])=>Math.log(t.evaluate(e))],log2:[K,[K],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[K,[K],(e,[t])=>Math.sin(t.evaluate(e))],cos:[K,[K],(e,[t])=>Math.cos(t.evaluate(e))],tan:[K,[K],(e,[t])=>Math.tan(t.evaluate(e))],asin:[K,[K],(e,[t])=>Math.asin(t.evaluate(e))],acos:[K,[K],(e,[t])=>Math.acos(t.evaluate(e))],atan:[K,[K],(e,[t])=>Math.atan(t.evaluate(e))],min:[K,Wr(K),(e,t)=>Math.min(...t.map(t=>t.evaluate(e)))],max:[K,Wr(K),(e,t)=>Math.max(...t.map(t=>t.evaluate(e)))],abs:[K,[K],(e,[t])=>Math.abs(t.evaluate(e))],round:[K,[K],(e,[t])=>{const r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[K,[K],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[K,[K],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[ee,[Q,oe],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[ee,[oe],(e,[t])=>e.id()===t.value],"filter-type-==":[ee,[Q],(e,[t])=>e.geometryType()===t.value],"filter-<":[ee,[Q,oe],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n<o}],"filter-id-<":[ee,[oe],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r<n}],"filter->":[ee,[Q,oe],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n>o}],"filter-id->":[ee,[oe],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>n}],"filter-<=":[ee,[Q,oe],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n<=o}],"filter-id-<=":[ee,[oe],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r<=n}],"filter->=":[ee,[Q,oe],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n>=o}],"filter-id->=":[ee,[oe],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>=n}],"filter-has":[ee,[oe],(e,[t])=>t.value in e.properties()],"filter-has-id":[ee,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[ee,[fe(Q)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[ee,[fe(oe)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[ee,[Q,fe(oe)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[ee,[Q,fe(oe)],(e,[t,r])=>function(e,t,r,n){for(;r<=n;){const o=r+n>>1;if(t[o]===e)return!0;t[o]>e?n=o-1:r=o+1}return!1}(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:ee,overloads:[[[ee,ee],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[Wr(ee),(e,t)=>{for(const r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:ee,overloads:[[[ee,ee],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[Wr(ee),(e,t)=>{for(const r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[ee,[ee],(e,[t])=>!t.evaluate(e)],"is-supported-script":[ee,[Q],(e,[t])=>{const r=e.globals&&e.globals.isSupportedScript;return!r||r(t.evaluate(e))}],upcase:[Q,[Q],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[Q,[Q],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[Q,Wr(oe),(e,t)=>t.map(t=>it(t.evaluate(e))).join("")],split:[fe(Q),[Q,Q],(e,[t,r])=>t.evaluate(e).split(r.evaluate(e))],join:[Q,[fe(Q),Q],(e,[t,r])=>t.evaluate(e).join(r.evaluate(e))],"resolved-locale":[Q,[ae],(e,[t])=>t.evaluate(e).resolvedLocale()]});class rn{constructor(e,t,r){this.expression=e,this._warningHistory={},this._evaluator=new dt,this._defaultValue=t?function(e){if("color"===e.type&&tn(e.default))return new Be(0,0,0,0);switch(e.type){case"color":return Be.parse(e.default)||null;case"padding":return Je.parse(e.default)||null;case"numberArray":return Xe.parse(e.default)||null;case"colorArray":return Ye.parse(e.default)||null;case"variableAnchorOffsetCollection":return et.parse(e.default)||null;case"projectionDefinition":return rt.parse(e.default)||null;default:return void 0===e.default?null:e.default}}(t):null,this._enumValues=t&&"enum"===t.type?t.values:null,this._globalState=r}evaluateWithoutErrorHandling(e,t,r,n,o,a){return this._globalState&&(e=cn(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,n,o,a){this._globalState&&(e=cn(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a||null;try{const e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new Ke(`Expected value to be one of ${Object.keys(this._enumValues).map(e=>JSON.stringify(e)).join(", ")}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(e.message)),this._defaultValue}}}function nn(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in Hr}function on(e,t,r){const n=new mt(Hr,Jr,[],t?function(e){const t={color:te,string:Q,number:K,enum:Q,boolean:ee,formatted:ie,padding:se,numberArray:ue,colorArray:le,projectionDefinition:re,resolvedImage:pe,variableAnchorOffsetCollection:ce};if("array"===e.type)return fe(t[e.value]||oe,e.length);return t[e.type]}(t):void 0),o=n.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return o?Qr(new rn(o,t,r)):en(n.errors)}class an{constructor(e,t,r){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!Yr(t.expression),this.globalStateRefs=pn(t.expression),this._globalState=r}evaluateWithoutErrorHandling(e,t,r,n,o,a){return this._globalState&&(e=cn(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,o,a)}evaluate(e,t,r,n,o,a){return this._globalState&&(e=cn(e,this._globalState)),this._styleExpression.evaluate(e,t,r,n,o,a)}}class sn{constructor(e,t,r,n,o){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!Yr(t.expression),this.globalStateRefs=pn(t.expression),this.interpolationType=n,this._globalState=o}evaluateWithoutErrorHandling(e,t,r,n,o,a){return this._globalState&&(e=cn(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,o,a)}evaluate(e,t,r,n,o,a){return this._globalState&&(e=cn(e,this._globalState)),this._styleExpression.evaluate(e,t,r,n,o,a)}interpolationFactor(e,t,r){return this.interpolationType?Et.interpolationFactor(this.interpolationType,e,t,r):0}}function ln(e,t,r){const n=on(e,t,r);if("error"===n.result)return n;const o=n.value.expression,a=Xr(o);if(!a&&("data-driven"!==(i=t)["property-type"]&&"cross-faded-data-driven"!==i["property-type"]))return en([new J("","data expressions not supported")]);var i;const s=Kr(o,["zoom"]);if(!s&&!function(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}(t))return en([new J("","zoom expressions not supported")]);const l=un(o);if(!l&&!s)return en([new J("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(l instanceof J)return en([l]);if(l instanceof Et&&!function(e){return!!e.expression&&e.expression.interpolated}(t))return en([new J("",'"interpolate" expressions cannot be used with this property')]);if(!l)return Qr(new an(a?"constant":"source",n.value,r));const u=l instanceof Et?l.interpolation:void 0;return Qr(new sn(a?"camera":"composite",n.value,l.labels,u,r))}function un(e){let t=null;if(e instanceof yt)t=un(e.result);else if(e instanceof Pt){for(const r of e.args)if(t=un(r),t)break}else(e instanceof St||e instanceof Et)&&e.input instanceof Br&&"zoom"===e.input.name&&(t=e);return t instanceof J||e.eachChild(e=>{const r=un(e);r instanceof J?t=r:!t&&r?t=new J("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&r&&t!==r&&(t=new J("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}function pn(e,t=new Set){return e instanceof Gr&&t.add(e.key),e.eachChild(e=>{pn(e,t)}),t}function cn(e,t){const{zoom:r,heatmapDensity:n,elevation:o,lineProgress:a,isSupportedScript:i,accumulated:s}=null!=e?e:{};return{zoom:r,heatmapDensity:n,elevation:o,lineProgress:a,isSupportedScript:i,accumulated:s,globalState:t}}function fn(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(const t of e.slice(1))if(!fn(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}const dn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function mn(e,t){if(null==e)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};fn(e)||(e=gn(e));const r=on(e,dn,t);if("error"===r.result)throw new Error(r.value.map(e=>`${e.key}: ${e.message}`).join(", "));return{filter:(e,t,n)=>r.value.evaluate(e,t,{},n),needGeometry:hn(e),getGlobalStateRefs:()=>pn(r.value.expression)}}function yn(e,t){return e<t?-1:e>t?1:0}function hn(e){if(!Array.isArray(e))return!1;if("within"===e[0]||"distance"===e[0])return!0;for(let t=1;t<e.length;t++)if(hn(e[t]))return!0;return!1}function gn(e){if(!e)return!0;const t=e[0];if(e.length<=1)return"any"!==t;var r;return"=="===t?vn(e[1],e[2],"=="):"!="===t?wn(vn(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?vn(e[1],e[2],t):"any"===t?(r=e.slice(1),["any"].concat(r.map(gn))):"all"===t?["all"].concat(e.slice(1).map(gn)):"none"===t?["all"].concat(e.slice(1).map(gn).map(wn)):"in"===t?bn(e[1],e.slice(2)):"!in"===t?wn(bn(e[1],e.slice(2))):"has"===t?xn(e[1]):"!has"!==t||wn(xn(e[1]))}function vn(e,t,r){switch(e){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,e,t]}}function bn(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(e=>typeof e!=typeof t[0])?["filter-in-large",e,["literal",t.sort(yn)]]:["filter-in-small",e,["literal",t]]}}function xn(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function wn(e){return["!",e]}function kn(e){return"object"==typeof e?["literal",e]:e}function Mn(e,t){let r=e.stops;if(!r)return function(e,t){const r=["get",e.property];if(void 0===e.default)return"string"===t.type?["string",r]:r;if("enum"===t.type)return["match",r,Object.keys(t.values),r,e.default];{const n=["color"===t.type?"to-color":t.type,r,kn(e.default)];return"array"===t.type&&n.splice(1,0,t.value,t.length||null),n}}(e,t);const n=r&&"object"==typeof r[0][0],o=n||void 0!==e.property,a=n||!o;return r=r.map(e=>!o&&t.tokens&&"string"==typeof e[1]?[e[0],En(e[1])]:[e[0],kn(e[1])]),n?function(e,t,r){const n={},o={},a=[];for(let t=0;t<r.length;t++){const i=r[t],s=i[0].zoom;void 0===n[s]&&(n[s]={zoom:s,type:e.type,property:e.property,default:e.default},o[s]=[],a.push(s)),o[s].push([i[0].value,i[1]])}const i=On({},t);if("exponential"===i){const r=[Sn(e),["linear"],["zoom"]];for(const e of a){An(r,e,jn(n[e],t,o[e]),!1)}return r}{const e=["step",["zoom"]];for(const r of a){An(e,r,jn(n[r],t,o[r]),!0)}return Cn(e),e}}(e,t,r):a?function(e,t,r,n=["zoom"]){const o=On(e,t);let a,i=!1;if("interval"===o)a=["step",n],i=!0;else{if("exponential"!==o)throw new Error(`Unknown zoom function type "${o}"`);{const t=void 0!==e.base?e.base:1;a=[Sn(e),1===t?["linear"]:["exponential",t],n]}}for(const e of r)An(a,e[0],e[1],i);return Cn(a),a}(e,t,r):jn(e,t,r)}function Sn(e){switch(e.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function zn(e,t){const r=kn((n=e.default,o=t.default,void 0!==n?n:void 0!==o?o:void 0));var n,o;return void 0===r&&"resolvedImage"===t.type?"":r}function jn(e,t,r){const n=On(e,t),o=["get",e.property];if("categorical"===n&&"boolean"==typeof r[0][0]){const n=["case"];for(const e of r)n.push(["==",o,e[0]],e[1]);return n.push(zn(e,t)),n}if("categorical"===n){const n=["match",o];for(const e of r)An(n,e[0],e[1],!1);return n.push(zn(e,t)),n}if("interval"===n){const t=["step",["number",o]];for(const e of r)An(t,e[0],e[1],!0);return Cn(t),void 0===e.default?t:["case",["==",["typeof",o],"number"],t,kn(e.default)]}if("exponential"===n){const t=void 0!==e.base?e.base:1,n=[Sn(e),1===t?["linear"]:["exponential",t],["number",o]];for(const e of r)An(n,e[0],e[1],!1);return void 0===e.default?n:["case",["==",["typeof",o],"number"],n,kn(e.default)]}throw new Error(`Unknown property function type ${n}`)}function Cn(e){"step"===e[0]&&3===e.length&&(e.push(0),e.push(e[3]))}function An(e,t,r,n){e.length>3&&t===e[e.length-2]||(n&&2===e.length||e.push(t),e.push(r))}function On(e,t){return e.type?e.type:t.expression.interpolated?"exponential":"interval"}function En(e){const t=["concat"],r=/{([^{}]+)}/g;let n=0;for(let o=r.exec(e);null!==o;o=r.exec(e)){const a=e.slice(n,r.lastIndex-o[0].length);n=r.lastIndex,a.length>0&&t.push(a),t.push(["get",o[1]])}if(1===t.length)return e;if(n<e.length)t.push(e.slice(n));else if(2===t.length)return["to-string",t[1]];return t}const _n=Z;function Pn(e,t){const r=t[0].evaluate(e),n=t[1].evaluate(e),o=t[2].evaluate(e),a=t[3]?t[3].evaluate(e):1;return Be.parse(`hsla(${r}, ${n}%, ${o}%, ${a})`)}function In(e){if(Array.isArray(e)){if(0===e.length)return e;const t=e[0];if("literal"===t)return e;if("image"===t&&3===e.length&&"object"==typeof e[2]&&null!==e[2]&&!Array.isArray(e[2])){return["image-config",In(e[1]),["literal",e[2]]]}const r=e.length;for(let n=1;n<r;++n){const o=e[n],a=In(o);if(a!==o){const o=[t];for(let t=1;t<n;++t)o.push(e[t]);o.push(a);for(let t=n+1;t<r;++t)o.push(In(e[t]));return o}}}return e}const $n={},qn={zoom:0,distanceFromCenter:0};Br.register(Hr,{...Br.definitions,pitch:[{kind:"number"},[],e=>qn.pitch||0],"distance-from-center":[{kind:"number"},[],e=>qn.distanceFromCenter||0],"to-hsla":[{kind:"array",itemType:{kind:"number"},N:4},[{kind:"string"}],(e,[t])=>function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,o=e[3],a=Math.max(t,r,n),i=Math.min(t,r,n),s=(a+i)/2;let l,u;if(a===i)l=0,u=0;else{const e=a-i;switch(u=s>.5?e/(2-a-i):e/(a+i),a){case t:l=(r-n)/e+(r<n?6:0);break;case r:l=(n-t)/e+2;break;case n:l=(t-r)/e+4;break;default:l=0}l/=6}return[360*l,100*u,100*s,o]}(E(t.evaluate(e)))],hsl:[{kind:"color"},[{kind:"number"},{kind:"number"},{kind:"number"}],Pn],hsla:[{kind:"color"},[{kind:"number"},{kind:"number"},{kind:"number"},{kind:"number"}],Pn],"image-config":[{kind:"value"},[{kind:"string"},{kind:"value"}],(e,[t,r])=>t.evaluate(e)],"measure-light":[{kind:"number"},[{kind:"value"}],()=>1],config:[{kind:"value"},[{kind:"string"}],(e,[t])=>{const r=$n[t.evaluate(e)];return void 0===r?{}:r}]});var Dn={thin:100,hairline:100,"ultra-light":200,"extra-light":200,light:300,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,"extra-bold":800,"ultra-bold":800,heavy:900,black:900,"heavy-black":900,fat:900,poster:900,"ultra-black":950,"extra-black":950},Tn=" ",Nn=/(italic|oblique)$/i,Fn={};function Ln(e,t,r){var n=Fn[e];if(!n){Array.isArray(e)||(e=[e]);for(var o,a,i=400,s="normal",l=[],u=0,p=e.length;u<p;++u){var c=e[u].split(" "),f=c[c.length-1].toLowerCase();for(var d in"normal"==f||"italic"==f||"oblique"==f?(s=a?s:f,a=!0,c.pop(),f=c[c.length-1].toLowerCase()):Nn.test(f)&&(f=f.replace(Nn,""),s=a?s:c[c.length-1].replace(f,""),a=!0),Dn){var m=c.length>1?c[c.length-2].toLowerCase():"";if(f==d||f==d.replace("-","")||m+"-"+f==d){i=o?i:Dn[d],c.pop(),m&&d.startsWith(m)&&c.pop();break}}o||"number"!=typeof f||(i=f,o=!0);var y=c.join(Tn).replace("Klokantech Noto Sans","Noto Sans").replace("DIN Pro","Barlow").replace("Arial Unicode MS","Arial");-1!==y.indexOf(Tn)&&(y='"'+y+'"'),l.push(y)}n=Fn[e]=[s,i,l]}return n[0]+Tn+n[1]+Tn+t+"px"+(r?"/"+r:"")+Tn+n[2]}const Rn=Object.freeze({}),Gn={},Hn={};let Bn=0;function Vn(e){return e.id||(e.id=Bn++),e.id}function Zn(e){return e*Math.PI/180}const Un=function(){const e=[];for(let t=78271.51696402048;e.length<=24;t/=2)e.push(t);return e}();function Wn(e,t){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(e,t);const r=document.createElement("canvas");return r.width=e,r.height=t,r}function Jn(e,t,r,n){const o=[2*r*t.pixelRatio+t.width,2*r*t.pixelRatio+t.height],a=Wn(o[0],o[1]),i=a.getContext("2d");i.drawImage(e,t.x,t.y,t.width,t.height,r*t.pixelRatio,r*t.pixelRatio,t.width,t.height);const s=i.getImageData(0,0,o[0],o[1]);i.globalCompositeOperation="destination-over",i.fillStyle=`rgba(${255*n.r},${255*n.g},${255*n.b},${n.a})`;const l=s.data;for(let e=0,n=s.width;e<n;++e)for(let o=0,a=s.height;o<a;++o){l[4*(o*n+e)+3]>0&&i.arc(e,o,r*t.pixelRatio,0,2*Math.PI)}return i.fill(),a}function Xn(e,t,r){const n=Math.max(0,Math.min(1,(r-e)/(t-e)));return n*n*(3-2*n)}function Yn(e,t,r){const n=Wn(t.width,t.height),o=n.getContext("2d");o.drawImage(e,t.x,t.y,t.width,t.height,0,0,t.width,t.height);const a=o.getImageData(0,0,t.width,t.height),i=a.data;for(let e=0,t=a.width;e<t;++e)for(let n=0,o=a.height;n<o;++n){const o=4*(n*t+e),a=.75,s=.1,l=Xn(a-s,a+s,i[o+3]/255);l>0?(i[o+0]=Math.round(255*r.r*l),i[o+1]=Math.round(255*r.g*l),i[o+2]=Math.round(255*r.b*l),i[o+3]=Math.round(255*l)):i[o+3]=0}return o.putImageData(a,0,0),n}const Kn=Array(256).join(" ");function Qn(e,t){if(t>=.05){let r="";const n=e.split("\n"),o=Kn.slice(0,Math.round(t/.1));for(let e=0,t=n.length;e<t;++e)e>0&&(r+="\n"),r+=n[e].split("").join(o);return r}return e}let eo;function to(){return eo||(eo=Wn(1,1).getContext("2d")),eo}function ro(e,t){return to().measureText(e).width+(e.length-1)*t}const no={};function oo(e,t,r,n){if(-1!==e.indexOf("\n")){const o=e.split("\n"),a=[];for(let e=0,i=o.length;e<i;++e)a.push(oo(o[e],t,r,n));return a.join("\n")}const o=r+","+t+","+e+","+n;let a=no[o];if(!a){const i=e.split(" ");if(i.length>1){const e=to();e.font=t;const o=e.measureText("M").width*r;let s="";const l=[];for(let e=0,t=i.length;e<t;++e){const t=i[e],r=s+(s?" ":"")+t;ro(r,n)<=o?s=r:(s&&l.push(s),s=t)}s&&l.push(s);for(let e=0,t=l.length;e<t&&t>1;++e){const r=l[e];if(ro(r,n)<.35*o){const o=e>0?ro(l[e-1],n):1/0,a=e<t-1?ro(l[e+1],n):1/0;l.splice(e,1),t-=1,o<a?(l[e-1]+=" "+r,e-=1):l[e]=r+" "+l[e]}}for(let e=0,t=l.length-1;e<t;++e){const r=l[e],a=l[e+1];if(ro(r,n)>.7*o&&ro(a,n)<.6*o){const i=r.split(" "),s=i.pop();ro(s,n)<.2*o&&(l[e]=i.join(" "),l[e+1]=s+" "+a),t-=1}}a=l.join("\n")}else a=e;a=Qn(a,n),no[o]=a}return a}_.on("propertychange",()=>{for(const e in no)delete no[e]});const ao={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},io={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},so=function(e,t){let r=ln(e,t);if("error"===r.result){const n=In(e);n!==e&&(r=ln(n,t))}if("error"===r.result){const n=r.value[0];return console.error("Error parsing expression:",e,n.key,n.message),{evaluate:()=>t.default}}return r.value};let lo,uo;function po(e,t,r,n,o,a){const i=e.id;o||(o={},console.warn("No functionCache provided to getValue()")),o[i]||(o[i]={});const s=o[i];if(!s[r]){let n=(e[t]||Rn)[r];const o=_n[`${t}_${e.type}`]&&_n[`${t}_${e.type}`][r];void 0===n&&o&&(n=o.default);let a=nn(n);if(!a&&tn(n)&&(n=Mn(n,o),a=!0),a){const e=so(n,o);s[r]=e.evaluate.bind(e)}else{const e=o?o.type:typeof n;"color"!==e&&"colorArray"!==e||(n=Be.parse(n));let t=!1;if("array"===e)for(let e=0;e<n.length;++e){const r=n[e];if(nn(r)||tn(r)){t=!0;break}}if(t){const e=Object.assign({},o,{type:o.value}),t=[];for(let r=0;r<n.length;++r){let o=n[r];if(!nn(o)&&tn(o)&&(o=Mn(o,e)),nn(o)){const r=so(o,e);t.push(r.evaluate.bind(r))}else t.push(function(){return o})}s[r]=function(e,r,n){const o=[];for(let a=0;a<t.length;++a)o[a]=t[a](e,r,n);return o}}else s[r]=function(){return n}}}return s[r](qn,n,a)}function co(e,t,r,n){if(!po(e,"layout",`${r}-allow-overlap`,t,n))return"declutter";return po(e,"layout",`${r}-ignore-placement`,t,n)?"none":"obstacle"}function fo(e,t,r,n){if(n||console.warn("No filterCache provided to evaluateFilter()"),!(e in n))try{n[e]=mn(t).filter}catch(t){console.warn("Filter will evaluate to false: "+t.message),n[e]=function(){return!1}}return n[e](qn,r)}function mo(e,t){if(e){if(0===e.a||0===t)return;const r=e.a;return t=void 0===t?1:t,0===r?"transparent":"rgba("+Math.round(255*e.r/r)+","+Math.round(255*e.g/r)+","+Math.round(255*e.b/r)+","+r*t+")"}return e}const yo=/\{[^{}}]*\}/g;function ho(e,t){return e.replace(yo,function(e){return t[e.slice(1,-1)]||""})}function go(e,t){let r=e.split(":")[0];return r===e&&(r="default"),t[r]}let vo=!1;const bo={};function xo(t,n,o,a=Un,i=void 0,s=void 0,l=void 0,u=void 0){if("string"==typeof n&&(n=JSON.parse(n)),n.schema)for(const e in n.schema){const t=n.schema[e];"default"in t&&($n[e]=t.default)}if(8!=n.version)throw new Error("glStyle version 8 required.");bo[function(e,t){return Vn(e)+"."+P(t)}(n,t)]=Array.from(arguments);const p={};("string"==typeof s||s instanceof Request||s instanceof Response||s instanceof Promise)&&(s={default:s});for(const e in s){const r=s[e];d(()=>r).then(async r=>{let n;if("undefined"!=typeof Image){const o=new Image;if("string"==typeof r)o.crossOrigin="anonymous",o.src=r;else{let e;r instanceof Request?e=await fetch(r):r instanceof Response&&(e=r);const t=await e.blob();n=URL.createObjectURL(t),o.src=n}o.addEventListener("load",function r(){o.removeEventListener("load",r),p[e]={image:o,size:[o.width,o.height]},t.changed(),n&&URL.revokeObjectURL(n)}),o.addEventListener("error",function e(){URL.revokeObjectURL(n),o.removeEventListener("error",e)})}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){const t=self;t.postMessage({action:"loadImage",src:r}),t.addEventListener("message",function(t){"imageLoaded"===t.data.action&&t.data.src===r&&(p[e]={image:t.data.image,size:[t.data.image.width,t.data.image.height]})})}})}const c=function(e){e=e.slice();const t=Object.create(null);for(let r=0;r<e.length;r++)t[e[r].id]=e[r];for(let r=0;r<e.length;r++)"ref"in e[r]&&(e[r]=W(e[r],t[e[r].ref]));return e}(n.layers),w={},k=[],M={},S={},z=function(e){let t=Gn[e.id];return t||(t={},Gn[Vn(e)]=t),t}(n),j=function(e){let t=Hn[e.id];return t||(t={},Hn[Vn(e)]=t),t}(n);let C;for(let e=0,t=c.length;e<t;++e){const t=c[e],r=t.id;if("string"==typeof o&&t.source==o||Array.isArray(o)&&-1!==o.indexOf(r)){const o=t["source-layer"];if(C){if(t.source!==C)throw new Error(`Layer "${r}" does not use source "${C}`)}else{C=t.source;const e=n.sources[C];if(!e)throw new Error(`Source "${C}" is not defined`);const r=e.type;if("vector"!==r&&"geojson"!==r)throw new Error(`Source "${C}" is not of type "vector" or "geojson", but "${r}"`)}let a=w[o];a||(a=[],w[o]=a),a.push({layer:t,index:e}),k.push(r)}}const A=[],O=function(o,s,c){const d=t.getSource?.()?.format_?.layerName_??"mvt:layer",k=o.getProperties(),C=w[k[d]];if(!C)return;let O=a.indexOf(s);-1==O&&(O=function(e,t){let r=0;const n=t.length;for(;r<n;++r)if(t[r]<e&&r+1<n){const n=t[r]/t[r+1];return r+Math.log(t[r]/e)/Math.log(n)}return n-1}(s,a)),qn.zoom=O,qn.distanceFromCenter=0;const E=o.getGeometry(),_=ao[E.getType()],P=t.get("map");if(P&&P instanceof e&&1===_){const e=P.getSize();if(e){const t=P.getView().getCenter(),n=r(E.getExtent());qn.distanceFromCenter=f(t,n)/s/e[1]}}const I={id:o.getId(),properties:k,type:_},$=t.get("mapbox-featurestate")[o.getId()];let q,D=-1;for(let e=0,r=C.length;e<r;++e){const r=C[e],a=r.layer,f=a.id;if(void 0!==c&&c!==f)continue;const d=a.layout||Rn,w=a.paint||Rn;if("none"===po(a,"layout","visibility",I,z,$)||"minzoom"in a&&O<a.minzoom||"maxzoom"in a&&O>=a.maxzoom)continue;const E=a.filter;if(!E||fo(f,E,I,j)){let e,c,f,j,C,O;q=a;const E=r.index;if(3==_&&("fill"==a.type||"fill-extrusion"==a.type))if(c=po(a,"paint",a.type+"-opacity",I,z,$),a.type+"-pattern"in w){const e=po(a,"paint",a.type+"-pattern",I,z,$);if(e){const t="string"==typeof e?ho(e,k):e.toString(),r=go(t,p);if(i&&i[t]&&r){++D,O=A[D],O&&O.getFill()&&!O.getStroke()&&!O.getText()||(O=new b({fill:new h}),A[D]=O),f=O.getFill(),O.setZIndex(E);const e=t+"."+c;let n=S[e];if(!n){const o=i[t],a=Wn(o.width,o.height),s=a.getContext("2d");s.globalAlpha=c,s.drawImage(r.image,o.x,o.y,o.width,o.height,0,0,o.width,o.height),n=s.createPattern(a,"repeat"),S[e]=n}f.setColor(n)}}}else if(e=mo(po(a,"paint",a.type+"-color",I,z,$),c),a.type+"-outline-color"in w&&(C=mo(po(a,"paint",a.type+"-outline-color",I,z,$),c)),C||(C=e),e||C){if(++D,O=A[D],(!O||e&&!O.getFill()||!e&&O.getFill()||C&&!O.getStroke()||!C&&O.getStroke()||O.getText())&&(O=new b({fill:e?new h:void 0,stroke:C?new v:void 0}),A[D]=O),e&&(f=O.getFill(),f.setColor(e)),"fill-extrusion"===a.type){const e=po(a,"paint","fill-extrusion-height",I,z,$);if(e>0){const t=Math.max(.1,.9-Math.min(e,225)/280);if(C&&"transparent"!==C){const e=Be.parse(C);C=`rgba(${Math.round(255*e.r*t)},${Math.round(255*e.g*t)},${Math.round(255*e.b*t)},${e.a})`}}}C&&(j=O.getStroke(),j.setColor(C),j.setWidth(.5)),O.setZIndex(E)}if(1!=_&&"line"==a.type){e="line-pattern"in w?void 0:mo(po(a,"paint","line-color",I,z,$),po(a,"paint","line-opacity",I,z,$));const t=po(a,"paint","line-width",I,z,$);e&&t>0&&(++D,O=A[D],O&&O.getStroke()&&!O.getFill()&&!O.getText()||(O=new b({stroke:new v}),A[D]=O),j=O.getStroke(),j.setLineCap(po(a,"layout","line-cap",I,z,$)),j.setLineJoin(po(a,"layout","line-join",I,z,$)),j.setMiterLimit(po(a,"layout","line-miter-limit",I,z,$)),j.setColor(e),j.setWidth(t),j.setLineDash(w["line-dasharray"]?po(a,"paint","line-dasharray",I,z,$).map(function(e){return e*t}):null),"function"==typeof j.setOffset&&j.setOffset(po(a,"paint","line-offset",I,z,$)),O.setZIndex(E))}let P,T,N,F,L,R,G,H,B,V=!1,Z=null,U=0;if((1==_||2==_)&&"icon-image"in d){const e=po(a,"layout","icon-image",I,z,$);if(e){let r;P="string"==typeof e?ho(e,k):e.toString();const n=u?u(t,P):void 0,l=go(P,p);if(i&&i[P]&&l||n){const e=po(a,"layout","icon-rotation-alignment",I,z,$);if(2==_){const t=o.getGeometry();if(t.getFlatMidpoint||t.getFlatMidpoints){const n=t.getExtent();if(Math.sqrt(Math.max(Math.pow((n[2]-n[0])/s,2),Math.pow((n[3]-n[1])/s,2)))>150){const n="MultiLineString"===t.getType()?t.getFlatMidpoints():t.getFlatMidpoint();uo||(lo=[NaN,NaN],uo=new m("Point",lo,[],2,{},void 0)),r=uo,lo[0]=n[0],lo[1]=n[1];if("line"===po(a,"layout","symbol-placement",I,z,$)&&"map"===e){const e=t.getStride(),r=t.getFlatCoordinates();for(let t=0,o=r.length-e;t<o;t+=e){const o=r[t],a=r[t+1],i=r[t+e],s=r[t+e+1],l=Math.min(o,i),u=Math.max(o,i),p=n[0],c=(s-a)*(p-o)-(i-o)*(n[1]-a);if(Math.abs(c)<.001&&p<=u&&p>=l){U=Math.atan2(a-s,i-o);break}}}}}}if(2!==_||r){const t=po(a,"layout","icon-size",I,z,$),o=void 0!==w["icon-color"]?po(a,"paint","icon-color",I,z,$):null;if(!o||0!==o.a){const r=po(a,"paint","icon-halo-color",I,z,$),s=po(a,"paint","icon-halo-width",I,z,$);let u=`${P}.${t}.${s}.${r}`;if(null!==o&&(u+=`.${o}`),T=M[u],!T){const p=co(a,I,"icon",z);let c;"icon-offset"in d&&(c=po(a,"layout","icon-offset",I,z,$).slice(0),c[0]*=t,c[1]*=-t);let f=o?[255*o.r,255*o.g,255*o.b,o.a]:void 0;if(n){const r={color:f,rotateWithView:"map"===e,displacement:c,declutterMode:p,scale:t};"string"==typeof n?r.src=n:(r.img=n,r.imgSize=[n.width,n.height]),T=new g(r)}else{const n=i[P];let a,u,d;if(s)n.sdf?(a=Jn(Yn(l.image,n,o||[0,0,0,1]),{x:0,y:0,width:n.width,height:n.height,pixelRatio:n.pixelRatio},s,r),f=void 0):a=Jn(l.image,n,s,r);else{if(n.sdf&&!l.unSDFed){const e=Yn(l.image,{x:0,y:0,width:l.size[0],height:l.size[1]},{r:1,g:1,b:1});l.image=e,l.unSDFed=!0}a=l.image,u=[n.width,n.height],d=[n.x,n.y]}T=new g({color:f,img:a,imgSize:l.size,size:u,offset:d,rotateWithView:"map"===e,scale:t/n.pixelRatio,displacement:c,declutterMode:p})}M[u]=T}}T&&(++D,O=A[D],O&&O.getImage()&&!O.getFill()&&!O.getStroke()||(O=new b,A[D]=O),O.setGeometry(r),T.setRotation(U+Zn(po(a,"layout","icon-rotate",I,z,$))),T.setOpacity(po(a,"paint","icon-opacity",I,z,$)),T.setAnchor(io[po(a,"layout","icon-anchor",I,z,$)]),O.setImage(T),Z=O.getText(),O.setText(void 0),O.setZIndex(E),V=!0,N=!1)}else N=!0}}}if(1==_&&"circle"===a.type){++D,O=A[D],O&&O.getImage()&&!O.getFill()&&!O.getStroke()||(O=new b,A[D]=O);const e="circle-radius"in w?po(a,"paint","circle-radius",I,z,$):5,t=mo(po(a,"paint","circle-stroke-color",I,z,$),po(a,"paint","circle-stroke-opacity",I,z,$)),r=po(a,"paint","circle-translate",I,z,$),n=mo(po(a,"paint","circle-color",I,z,$),po(a,"paint","circle-opacity",I,z,$)),o=po(a,"paint","circle-stroke-width",I,z,$),i=e+"."+t+"."+n+"."+o+"."+r[0]+"."+r[1];T=M[i],T||(T=new y({radius:e,displacement:[r[0],-r[1]],stroke:t&&o>0?new v({width:o,color:t}):void 0,fill:n?new h({color:n}):void 0,declutterMode:"none"}),M[i]=T),O.setImage(T),Z=O.getText(),O.setText(void 0),O.setGeometry(void 0),O.setZIndex(E),V=!0}if("text-field"in d){G=Math.round(po(a,"layout","text-size",I,z,$));const e=po(a,"layout","text-font",I,z,$);R=po(a,"layout","text-line-height",I,z,$),L=Ln(l?l(e,n.metadata?n.metadata["ol:webfonts"]:void 0):e,G,R),L.includes("sans-serif")||(L+=",sans-serif"),H=po(a,"layout","text-letter-spacing",I,z,$),B=po(a,"layout","text-max-width",I,z,$);const t=po(a,"layout","text-field",I,z,$);F="object"==typeof t&&t.sections?1===t.sections.length?t.toString():t.sections.reduce((t,r,n)=>{const o=r.fontStack?r.fontStack.split(","):e,a=Ln(l?l(o):o,G*(r.scale||1),R);let i=r.text;if("\n"===i)return t.push("\n",""),t;if(2==_)return t.push(Qn(i,H),a),t;i=oo(i,a,B,H).split("\n");for(let e=0,r=i.length;e<r;++e)e>0&&t.push("\n",""),t.push(i[e],a);return t},[]):ho(t,k).trim(),c=po(a,"paint","text-opacity",I,z,$)}if(F&&c&&!N){V||(++D,O=A[D],O&&O.getText()&&!O.getFill()&&!O.getStroke()||(O=new b,A[D]=O),O.setImage(void 0),O.setGeometry(void 0));const e=co(a,I,"text",z);O.getText()||O.setText(Z),Z=O.getText(),(!Z||"getDeclutterMode"in Z&&Z.getDeclutterMode()!==e)&&(Z=new x({padding:[2,2,2,2],declutterMode:e}),O.setText(Z));const t=po(a,"layout","text-transform",I,z,$);"uppercase"==t?F=Array.isArray(F)?F.map((e,t)=>t%2?e:e.toUpperCase()):F.toUpperCase():"lowercase"==t&&(F=Array.isArray(F)?F.map((e,t)=>t%2?e:e.toLowerCase()):F.toLowerCase());const r=Array.isArray(F)?F:2==_?Qn(F,H):oo(F,L,B,H);if(Z.setText(r),Z.setFont(L),Z.setRotation(Zn(po(a,"layout","text-rotate",I,z,$))),"function"==typeof Z.setKeepUpright){const e=po(a,"layout","text-keep-upright",I,z,$);Z.setKeepUpright(e)}const n=po(a,"layout","text-anchor",I,z,$),o=V||1==_?"point":po(a,"layout","symbol-placement",I,z,$);let i;if("line-center"===o?(Z.setPlacement("line"),i="center"):Z.setPlacement(o),"line"===o&&"function"==typeof Z.setRepeat){const e=po(a,"layout","symbol-spacing",I,z,$);Z.setRepeat(2*e)}Z.setOverflow("point"===o);let s=po(a,"paint","text-halo-width",I,z,$);const l=po(a,"layout","text-offset",I,z,$),u=po(a,"paint","text-translate",I,z,$);let p=0,f=0;if("point"==o){i="center",-1!==n.indexOf("left")?(i="left",f=s):-1!==n.indexOf("right")&&(i="right",f=-s);const e=po(a,"layout","text-rotation-alignment",I,z,$);Z.setRotateWithView("map"==e)}else Z.setMaxAngle(Zn(po(a,"layout","text-max-angle",I,z,$))*F.length/r.length),Z.setRotateWithView(!1);Z.setTextAlign(i);let d="middle";0==n.indexOf("bottom")?(d="bottom",p=-s-.5*(R-1)*G):0==n.indexOf("top")&&(d="top",p=s+.5*(R-1)*G),Z.setTextBaseline(d);const m=po(a,"layout","text-justify",I,z,$);Z.setJustify("auto"===m?void 0:m),Z.setOffsetX(l[0]*G+f+u[0]),Z.setOffsetY(l[1]*G+p+u[1]);const y=Z.getFill()||new h;y.setColor(mo(po(a,"paint","text-color",I,z,$),c)),Z.setFill(y);const g=mo(po(a,"paint","text-halo-color",I,z,$),c);if(g&&s>0){const e=Z.getStroke()||new v;e.setColor(g),s*=2;const t=.5*G;e.setWidth(s<=t?s:t),Z.setStroke(e)}else Z.setStroke(void 0);const w=po(a,"layout","text-padding",I,z,$),k=Z.getPadding();w!==k[0]&&(k[0]=w,k[1]=w,k[2]=w,k[3]=w),O.setZIndex(E)}}}return D>-1?(A.length=D+1,vo&&("set"in o?o.set("mapbox-layer",q):o.getProperties()["mapbox-layer"]=q),A):void 0};return t.setStyle(O),t.set("mapbox-layers",k),t.set("mapbox-source",C),t.set("mapbox-featurestate",t.get("mapbox-featurestate")||{}),O}function wo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ko(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?wo(Object(r),!0).forEach(function(t){z(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wo(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}Be.parse("#000000"),Be.parse("#FFFFFF"),Be.parse("#000000"),function(e=!1){vo=e}(!0);var Mo="EPSG:27700",So=["vector","raster","wms","ogc-vt"];function zo(e,t,r){var n=r&&r(e,t)||{};return fetch(n.url||e,{headers:n.headers||{}})}var jo=e=>(t,r)=>{var n=e(r,"Tile")||{},o=n.url||r,a=n.headers||{};fetch(o,{headers:a}).then(e=>e.blob()).then(e=>{t.getImage().src=URL.createObjectURL(e)}).catch(()=>t.setState(O.ERROR))};function Co(){return new c({resolutions:q,origin:T,tileSize:256})}function Ao(e,t){return Oo.apply(this,arguments)}function Oo(){return Oo=w(function*(e,t){if(e.type&&!So.includes(e.type))throw new Error("Unsupported map style type: '".concat(e.type,"'"));if("wms"===e.type){var r=function(e,t,r){var n=Co();return new C({url:e,params:t,projection:Mo,tileGrid:n,tileLoadFunction:r?jo(r):void 0})}(e.url,e.params||{},t);return{layer:new a({source:r}),source:r}}if("raster"===e.type){var n=function(e,t){var r=Co();return new j({projection:Mo,tileGrid:r,tileUrlFunction:t=>{var[r,n,o]=t;return e.replace("{z}",r).replace("{x}",n).replace("{y}",o)},tileLoadFunction:t?jo(t):void 0})}(e.url,t);return{layer:new a({source:n}),source:n}}return"ogc-vt"===e.type?function(e,t){return Po.apply(this,arguments)}(e.url,t,e):function(e,t){return _o.apply(this,arguments)}(e.url,t,e)}),Oo.apply(this,arguments)}function Eo(e,t){var r=e.indexOf("?"),[n,o]=r>=0?[e.slice(0,r),e.slice(r)]:[e,""],a="".concat(n,".json").concat(o),i="".concat(n,".png").concat(o);return{jsonUrl:a,pngUrl:i,fetch:()=>zo(a,"SpriteJSON",t).then(e=>e.json())}}function _o(){return _o=w(function*(e,t){var{renderMode:r}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=yield zo(e,"Style",t).then(e=>e.json()),a=Object.keys(n.sources)[0],i=n.sources[a].url,l=yield zo(i,"Source",t).then(e=>e.json()),u=[l.fullExtent.xmin,l.fullExtent.ymin,l.fullExtent.xmax,l.fullExtent.ymax],f=[l.tileInfo.origin.x,l.tileInfo.origin.y],d=l.tileInfo.lods.map(e=>e.resolution).slice(0,16),m=l.tileInfo.rows,y=l.tiles[0],h=Eo(n.sprite,t),g=yield h.fetch();!function(e){e.layers.forEach(e=>{var t;null!==(t=e.paint)&&void 0!==t&&t["icon-color"]&&(e.paint["icon-color"]=e.paint["icon-color"].replace(",0)",",1)"))})}(n);var v=new c({extent:u,origin:f,resolutions:d,tileSize:m}),b=new p({format:new o,url:y,projection:Mo,tileGrid:v}),x=new s(ko({source:b,declutter:!0},r&&{renderMode:r}));return xo(x,n,a,d,g,h.pngUrl),{layer:x,source:b}}),_o.apply(this,arguments)}function Po(){return Po=w(function*(e,t){var r,{renderMode:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=yield zo(e,"Style",t).then(e=>e.json()),i=Object.keys(a.sources)[0],l=a.sources[i].url,u=Eo(a.sprite,t),p=null===(r=(yield zo(l,"Source",t).then(e=>e.json())).links)||void 0===r?void 0:r.find(e=>"http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme"===e.rel),[f,d]=yield Promise.all([zo(p.href,"Source",t).then(e=>e.json()),u.fetch()]),m=f.tileMatrices.map(e=>e.cellSize),y=f.tileMatrices[0].pointOfOrigin,h=[f.tileMatrices[0].tileHeight,f.tileMatrices[0].tileWidth],g=new o;g.supportedMediaTypes.push("application/octet-stream");var v=new c({resolutions:m,origin:y,tileSize:h}),b=new A({url:l,format:g,tileGrid:v,projection:Mo}),x=new s(ko({source:b,declutter:!0},n&&{renderMode:n}));return xo(x,a,i,m,d,u.pngUrl),{layer:x,source:b}}),Po.apply(this,arguments)}function Io(e,t,r){if(null!==e)for(var n,o,a,i,s,l,u,p,c=0,f=0,d=e.type,m="FeatureCollection"===d,y="Feature"===d,h=m?e.features.length:1,g=0;g<h;g++){s=(p=!!(u=m?e.features[g].geometry:y?e.geometry:e)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var v=0;v<s;v++){var b=0,x=0;if(null!==(i=p?u.geometries[v]:u)){l=i.coordinates;var w=i.type;switch(c=0,w){case null:break;case"Point":if(!1===t(l,f,g,b,x))return!1;f++,b++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(!1===t(l[n],f,g,b,x))return!1;f++,"MultiPoint"===w&&b++}"LineString"===w&&b++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(o=0;o<l[n].length-c;o++){if(!1===t(l[n][o],f,g,b,x))return!1;f++}"MultiLineString"===w&&b++,"Polygon"===w&&x++}"Polygon"===w&&b++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(x=0,o=0;o<l[n].length;o++){for(a=0;a<l[n][o].length-c;a++){if(!1===t(l[n][o][a],f,g,b,x))return!1;f++}x++}b++}break;case"GeometryCollection":for(n=0;n<i.geometries.length;n++)if(!1===Io(i.geometries[n],t))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}var $o=function(e,t={}){if(null!=e.bbox&&!0!==t.recompute)return e.bbox;const r=[1/0,1/0,-1/0,-1/0];return Io(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},qo=e=>{var t=e/1609.344;if(t<.5)return"".concat(Math.round(e),"m");if(t<10){var r=Number.parseFloat(t.toFixed(1)),n=1===r?"mile":"miles";return"".concat(r," ").concat(n)}var o=Math.round(t);return"".concat(o," miles")},Do=(e,t,r)=>{var n=r.getTargetElement().getBoundingClientRect();if(!n.width||!n.height)return!1;var o=r.getViewport().getBoundingClientRect(),a=o.width/n.width,i=o.height/n.height,[s,l,u,p]=(e=>$o(e))(e),c=[[s,l],[s,p],[u,l],[u,p]].map(e=>r.getPixelFromCoordinate(e)).filter(Boolean);if(!c.length)return!1;var f=n.left+Math.min(...c.map(e=>e[0]))*a,d=n.left+Math.max(...c.map(e=>e[0]))*a,m=n.top+Math.min(...c.map(e=>e[1]))*i,y=n.top+Math.max(...c.map(e=>e[1]))*i;return f<t.right&&d>t.left&&m<t.bottom&&y>t.top},To=(e,t,r)=>{for(var n=[],o=t;o<r;o+=2)n.push([e[o],e[o+1]]);return n},No=e=>{var t=e.getType(),r=e.getFlatCoordinates();if("Point"===t)return{type:"Point",coordinates:[r[0],r[1]]};if("LineString"===t)return{type:"LineString",coordinates:To(r,0,r.length)};if("Polygon"===t){var n=e.getEnds(),o=0;return{type:"Polygon",coordinates:n.map(e=>{var t=To(r,o,e);return o=e,t})}}if("MultiPolygon"===t){var a=e.getEndss(),i=0,s=a.map(e=>{var t=i,n=e.map(e=>{var n=To(r,t,e);return t=e,n});return i=e[e.length-1],n});return{type:"MultiPolygon",coordinates:s}}return{type:t,coordinates:To(r,0,r.length)}},Fo=(e,t,r,n)=>{var o=[];return e.getLayers().forEach(e=>{if(e instanceof s){var a=e.getSource(),i=null==a?void 0:a.sourceTiles_;i&&Object.values(i).forEach(e=>{e.getState()===O.LOADED&&e.getFeatures().forEach(e=>{var a;if((null===(a=e.get("mapbox-layer"))||void 0===a?void 0:a.id)===t){var i=n?e.get(n):e.getId();String(i)===String(r)&&o.push(No(e))}})})}}),o},Lo=new Map,Ro=(e,t)=>{if(!e)return null;if("string"==typeof e)return e.trim();if("object"==typeof e){if(t&&e[t])return e[t];var r=Object.values(e)[0];return null!=r?r:null}return null},Go={symbol:"pin",backgroundColor:"#ca3535",foregroundColor:"#ffffff"},Ho={dot:"M8 3c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.241 5-5-2.24-5-5-5z",cross:"M6 3H10V6H13V10H10V13H6V10H3V6H6Z",diamond:"M8 2L14 8L8 14L2 8Z",triangle:"M8 2L14 14H2Z",square:"M3 3H13V13H3Z"},Bo={id:"pin",viewBox:"0 0 44 44",anchor:[.5,.9],graphic:Ho.dot,svg:'<path d="M22 40.999c-3.621 0-8.306-5.864-10.258-8.3C9.02 29.302 6 23.66 6 19.002a16.01 16.01 0 0 1 16-16 16.01 16.01 0 0 1 16 16c0 4.658-3.02 10.3-5.742 13.697-1.952 2.437-6.637 8.3-10.258 8.3z" fill="{{selectedColor}}" stroke="{{activeColor}}" stroke-width="6" paint-order="stroke fill"/>\n <path d="M22 7.001a12.01 12.01 0 0 1 12 12c0 7.623-10.377 17.998-12 17.998S10 26.624 10 19.001a12.01 12.01 0 0 1 12-12z" fill="{{backgroundColor}}" stroke="{{haloColor}}" stroke-width="2" paint-order="stroke fill"/>\n <g transform="translate(22, 19) scale(0.8) translate(-8, -8)"><path d="{{graphic}}" fill="{{foregroundColor}}"/></g>'},Vo={id:"circle",viewBox:"0 0 44 44",anchor:[.5,.5],graphic:Ho.dot,svg:'<circle cx="22" cy="22" r="16" fill="{{selectedColor}}" stroke="{{activeColor}}" stroke-width="6" paint-order="stroke fill"/>\n <circle cx="22" cy="22" r="12" fill="{{backgroundColor}}" stroke="{{haloColor}}" stroke-width="2" paint-order="stroke fill"/>\n <g transform="translate(22, 22) scale(0.8) translate(-8, -8)"><path d="{{graphic}}" fill="{{foregroundColor}}"/></g>'},Zo={id:"square",viewBox:"0 0 44 44",anchor:[.5,.5],graphic:Ho.dot,svg:'<path d="M13 6h18c3.863 0 7 3.137 7 7v18c0 3.863-3.137 7-7 7H13c-3.863 0-7-3.137-7-7V13c0-3.863 3.137-7 7-7" fill="{{selectedColor}}" stroke="{{activeColor}}" stroke-width="6" paint-order="stroke fill"/>\n <path d="M13 34a3 3 0 0 1-3-3V13a3 3 0 0 1 3-3h18a3 3 0 0 1 3 3v18a3 3 0 0 1-3 3H13z" fill-rule="nonzero" fill="{{backgroundColor}}" stroke="{{haloColor}}" stroke-width="2" paint-order="stroke fill"/>\n <g transform="translate(22, 22) scale(0.8) translate(-8, -8)"><path d="{{graphic}}" fill="{{foregroundColor}}"/></g>'},Uo=new Set(["symbolBackgroundColor","symbolForegroundColor","symbolHaloWidth","symbolGraphic"]),Wo=e=>{if(!(e=>!(!e.symbol&&!e.symbolSvgContent))(e))return{};var t={};return Uo.forEach(r=>{if(null!=e[r]){var n=r.charAt(6).toLowerCase()+r.slice(7);t[n]=e[r]}}),t},Jo={light:{haloColor:"#ffffff",selectedColor:"#0b0c0c",activeColor:"#ffdd00",foregroundColor:"#0b0c0c"},dark:{haloColor:"#0b0c0c",selectedColor:"#ffffff",activeColor:"#ffdd00",foregroundColor:"#ffffff"}};function Xo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Yo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xo(Object(r),!0).forEach(function(t){z(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xo(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var Ko=new Map,Qo=new Map,ea={},ta=e=>{var t=0;for(var r of e)t=Math.trunc((t<<5)-t+r.codePointAt(0));return Math.abs(t).toString(36)},ra=new Set(["id","svg","viewBox","anchor","symbol","symbolSvgContent"]);function na(e,t,r){var n,o,a,i,s=null==r?void 0:r.id,l=Object.fromEntries(Object.entries(e||{}).filter(e=>{var[t]=e;return!ra.has(t)})),u=Object.fromEntries(Object.entries(ea).filter(e=>{var[t]=e;return!ra.has(t)})),p=Object.fromEntries(Object.entries(t).filter(e=>{var[,t]=e;return null!=t})),c=Yo(Yo(Yo(Yo({},Go),u),l),p),f=null!==(n=Jo[null==r?void 0:r.mapColorScheme])&&void 0!==n?n:Jo.light;return c.haloColor=null!==(o=null==r?void 0:r.haloColor)&&void 0!==o?o:f.haloColor,c.selectedColor=null!==(a=null==r?void 0:r.selectedColor)&&void 0!==a?a:f.selectedColor,c.activeColor=null!==(i=null==r?void 0:r.activeColor)&&void 0!==i?i:f.activeColor,"string"==typeof c.graphic&&Ho[c.graphic]&&(c.graphic=Ho[c.graphic]),Object.fromEntries(Object.entries(c).map(e=>{var[t,r]=e;return[t,Ro(r,s)||""]}))}function oa(e,t){return Object.entries(t).reduce((e,t)=>{var[r,n]=t;return e.replaceAll("{{".concat(r,"}}"),n)},e)}var aa={setDefaults(e){ea=e||{}},getDefaults:()=>Yo(Yo({},Go),ea),register(e){Ko.set(e.id,e)},get:e=>Ko.get(e),list:()=>[...Ko.values()],clear(){Ko.clear()},initialise(){this.register(Bo),this.register(Vo),this.register(Zo)},resolve(e,t,r){var n=na(e,t||{},r);return e?(n.selectedColor="none",n.activeColor="none",oa(e.svg,n)):""},resolveActive(e,t,r){var n=na(e,t||{},r);return e?oa(e.svg,n):""},resolveSelected(e,t,r){var n=na(e,t||{},r);return e?(n.activeColor="none",oa(e.svg,n)):""},getSymbolImageId(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2,o=this.getSymbolDef(e);if(!o)return null;var a=Wo(e),i=r?this.resolveActive(o,a,t):this.resolve(o,a,t);return"symbol-".concat(r?"act-":"").concat(ta(i),"-").concat(n,"x")},getSymbolDef(e){return e.symbolSvgContent?{svg:e.symbolSvgContent}:e.symbol?this.get(e.symbol):void 0},rasteriseSymbolImage(e,t,r,n){var o=this;return w(function*(){var a=o.getSymbolDef(e);if(!a)return null;var i,s,l=Wo(e);"active"===r?(i=o.resolveActive(a,l,t),s="act-"):"selected"===r?(i=o.resolveSelected(a,l,t),s="sel-"):(i=o.resolve(a,l,t),s="");var u="symbol-".concat(s).concat(ta(i),"-").concat(n,"x"),p=Qo.get(u);if(!p){var c=((e,t)=>{var r;return e.symbolViewBox?e.symbolViewBox:null!==(r=null==t?void 0:t.viewBox)&&void 0!==r?r:"0 0 38 38"})(e,a),[,,f,d]=c.split(" ").map(Number),m='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(f*n,'" height="').concat(d*n,'" viewBox="').concat(c,'">').concat(i,"</svg>");p=yield((e,t,r)=>new Promise((n,o)=>{var a="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(e)),i=new Image(t,r);i.onload=()=>{var e=document.createElement("canvas");e.width=t,e.height=r;var o=e.getContext("2d");o.drawImage(i,0,0,t,r),n(o.getImageData(0,0,t,r))},i.onerror=()=>{o(new Error("Failed to rasterise SVG: ".concat(e.slice(0,80))))},i.src=a}))(m,f*n,d*n),Qo.set(u,p)}return{imageId:u,imageData:p}})()}};function ia(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function sa(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ia(Object(r),!0).forEach(function(t){z(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ia(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}aa.initialise();var la="EPSG:27700",ua=new n({dataProjection:la,featureProjection:la}),pa="_highlight",ca=999,fa=(e,t)=>{if(!e)return[];var{stroke:r,selectionStroke:n,fill:o,strokeWidth:a,activeStrokeWidth:i}=e;if(t)return[new b({stroke:new v({color:r,width:i}),zIndex:ca}),new b({stroke:new v({color:n,width:a}),zIndex:1e3})];var s=[new b({stroke:new v({color:n,width:a}),zIndex:ca})];return o&&"transparent"!==o&&s.push(new b({fill:new h({color:o}),zIndex:ca})),s},da=(e,t)=>{if(!(e=>!!(null!=e&&e.symbol||null!=e&&e.symbolSvgContent))(e))return null;var r=t?e.symbolActiveImageId:e.symbolSelectedImageId,n=r&&(e=>Lo.get(e))(r);if(!n)return null;var o=((e,t)=>{var r;return e.symbolAnchor?e.symbolAnchor:null!==(r=null==t?void 0:t.anchor)&&void 0!==r?r:[.5,.5]})(e,aa.getSymbolDef(e)),a=1/(e.symbolPixelRatio||1);return[new b({image:new g({img:n,anchor:o,scale:a}),zIndex:ca})]},ma=e=>{var t=new Set,r={};for(var{layerId:n,featureId:o,idProperty:a}of null!=e?e:[])t.add("".concat(n,":").concat(o)),a&&(r[n]=a);return{keys:t,idProps:r}},ya=(e,t,r)=>{var n;if(null!=r)return e.getLayers().forEach(e=>{var o;if(!n&&e instanceof i&&!e.get(pa)&&e.get("layerId")===t){var a=null===(o=e.getSource())||void 0===o?void 0:o.getFeatureById(String(r));a&&(n=a.getProperties())}}),n},ha=(e,t,r,n,o)=>{for(var{layerId:a,featureId:i,geometry:s}of null!=r?r:[]){var l;if(s){var u=ya(e,a,i),p=null!==(l=da(u,n))&&void 0!==l?l:fa(null==o?void 0:o[a],n);if(p.length){var c=new I({geometry:ua.readGeometry(s)});c.setStyle(p),t.addFeature(c)}}}},ga=(e,t)=>{var{type:r,coordinates:n}=e,o=e=>{var[r,n]=e;return t(r,n)},a=e=>e.forEach(o);"Point"===r?o(n):"MultiPoint"===r||"LineString"===r?n.forEach(o):"MultiLineString"===r||"Polygon"===r?n.forEach(a):"MultiPolygon"===r&&n.forEach(e=>e.forEach(a))},va=(e,t,r,n)=>{if(!e)return null;var o=new Set;e.getLayers().forEach(e=>{if(e instanceof i&&!e.get(pa)){var t=e.get("layerId");t&&o.add(t)}});var{keys:a,idProps:l}=ma(t),{keys:p,idProps:c}=ma(r),f=sa(sa({},l),c);((e,t,r,n,o)=>{e.getLayers().forEach(e=>{if(e instanceof s)if(t.size>0||r.size>0){e._highlightOriginalStyle||(e._highlightOriginalStyle=e.getStyleFunction());var a=e._highlightOriginalStyle;e.setStyle((e,i)=>{var s,l=a(e,i),u=null===(s=e.get("mapbox-layer"))||void 0===s?void 0:s.id;if(!u)return l;var p=n[u],c=p?e.get(p):e.getId(),f="".concat(u,":").concat(c),d=r.has(f),m=!d&&t.has(f);if(!d&&!m)return l;var y=fa(null==o?void 0:o[u],d);return y.length?[...l?Array.isArray(l)?l:[l]:[],...y]:l})}else e._highlightOriginalStyle&&(e.setStyle(e._highlightOriginalStyle),delete e._highlightOriginalStyle)})})(e,a,p,f,n);var d=(e=>{var t=null;return e.getLayers().forEach(e=>{e.get(pa)&&(t=e)}),t||((t=new i({source:new u,zIndex:1001})).set(pa,!0),e.addLayer(t)),t})(e),m=d.getSource();m.clear();var y=(null!=t?t:[]).filter(e=>o.has(e.layerId)),h=(null!=r?r:[]).filter(e=>o.has(e.layerId));ha(e,m,h,!0,n),ha(e,m,y,!1,n);var g=(null!=t?t:[]).flatMap(t=>((e,t)=>{var{layerId:r,featureId:n,idProperty:o,geometry:a}=t;if(null!=n){var i=Fo(e,r,n,o);if(i.length>0)return i}return a?[a]:[]})(e,t));return(e=>{if(!e.length)return null;var t=1/0,r=1/0,n=-1/0,o=-1/0;for(var a of e)ga(a,(e,a)=>{e<t&&(t=e),a<r&&(r=a),e>n&&(n=e),a>o&&(o=a)});return t===1/0?null:[t,r,n,o]})(g)};function ba(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var xa="EPSG:27700",wa=new n({dataProjection:xa,featureProjection:xa}),ka=e=>{var t=e.getId();if(null!=t)return t;var r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ba(Object(r),!0).forEach(function(t){z(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ba(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},e.getProperties());return delete r["mapbox-layer"],JSON.stringify(r)},Ma=(e,t,r)=>{var n=e.getViewport();if(r&&e.un("pointermove",r),null==t||!t.length)return n.style.cursor="",null;var o=new Set(t),a=null,l=t=>{var r;if("mouse"===(null===(r=t.originalEvent)||void 0===r?void 0:r.pointerType)){var l=t.pixel;null!==a&&cancelAnimationFrame(a),a=requestAnimationFrame(()=>{a=null;var t=e.forEachFeatureAtPixel(l,(e,t)=>((e,t,r)=>{if(t instanceof s){var n,o=null===(n=e.get("mapbox-layer"))||void 0===n?void 0:n.id;return Boolean(o&&r.has(o))}if(t instanceof i&&!t.get("_highlight")){var a=t.get("layerId");return Boolean(a&&r.has(a))}return!1})(e,t,o),{hitTolerance:8});n.style.cursor=t?"pointer":""})}};return e.on("pointermove",l),l};function Sa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function za(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Sa(Object(r),!0).forEach(function(t){z(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Sa(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}(()=>{if("undefined"!=typeof HTMLCanvasElement){var e=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=function(t,r){for(var n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];return e.call(this,t,"2d"===t?za(za({},r),{},{willReadFrequently:!0}):r,...o)}}})();var ja="EPSG:27700",Ca=e=>{if(e){var{top:t=0,right:r=0,bottom:n=0,left:o=0}=e;return[t,r,n,o]}};M.defs(ja,"+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 +units=m +no_defs"),S(M);class Aa extends ${constructor(e){var{mapProviderConfig:t={},events:r,eventBus:n}=e;super(),this.events=r,this.eventBus=n,this.capabilities={supportedShortcuts:L,supportsMapSizes:!0},Object.assign(this,t)}get name(){return"OpenLayersProvider"}initMap(n){var o=this;return w(function*(){var a,{container:i,padding:s,mapStyle:l,mapSize:u,center:p,zoom:c,bounds:f,minZoom:d,maxZoom:m,transformRequest:y,pixelRatio:h}=n;o.mapStyleId=null==l?void 0:l.id,o.mapSize=u;var{events:g,eventBus:v}=o,{layer:b,source:x}=yield Ao(l,y),M=(null!==(a=o.zoomAlignment)&&void 0!==a?a:R)===G?{resolutions:D,defaultMinZoom:6,maxZoom:20}:{resolutions:q,defaultMinZoom:0,maxZoom:q.length-1},S=new t({projection:ja,center:null!=p?p:f?r(f):void 0,zoom:null!=c?c:M.defaultMinZoom,minZoom:Math.max(null!=d?d:M.defaultMinZoom,M.defaultMinZoom),maxZoom:null!=m?m:M.maxZoom,resolutions:M.resolutions,constrainResolution:!1,padding:Ca(s)}),z=new e({target:i,layers:[b],view:S,controls:[],interactions:k({doubleClickZoom:!1}),pixelRatio:h});f&&z.once("rendercomplete",()=>{S.fit(f,{size:z.getSize(),duration:0})}),o.mapEventHandles=V({map:z,source:x,events:g,eventBus:v,getZoom:o.getZoom.bind(o),getCenter:o.getCenter.bind(o),getBounds:o.getBounds.bind(o),getResolution:o.getResolution.bind(o)}),o.appEventHandles=function(e){var{mapProvider:t,transformRequest:r,events:n,eventBus:o,map:a,onBaseSourceChange:i}=e,s=function(){var e=w(function*(e){var{layer:s,source:l}=yield Ao(e,r);a.getLayers().setAt(0,s),i(l),o.emit(n.MAP_STYLE_CHANGE,{mapStyleId:e.id}),t.reapplyHighlights()});return function(t){return e.apply(this,arguments)}}(),l=e=>{a.setPixelRatio(e)},u=e=>{var{mapSize:r}=e;t.mapSize=r};return o.on(n.MAP_SET_STYLE,s),o.on(n.MAP_SET_PIXEL_RATIO,l),o.on(n.MAP_SIZE_CHANGE,u),{remove(){o.off(n.MAP_SET_STYLE,s),o.off(n.MAP_SET_PIXEL_RATIO,l),o.off(n.MAP_SIZE_CHANGE,u)}}}({mapProvider:o,transformRequest:y,events:g,eventBus:v,map:z,onBaseSourceChange:o.mapEventHandles.setSource})||[],o.map=z,o.view=S,v.emit(g.MAP_READY,{map:o.map,mapStyleId:o.mapStyleId,mapSize:o.mapSize,crs:o.crs})})()}destroyMap(){var e,t;null===(e=this.mapEventHandles)||void 0===e||e.remove(),null===(t=this.appEventHandles)||void 0===t||t.remove(),this.mapEventHandles=null,this.appEventHandles=null,this.map&&(this._onHoverMove&&(this.map.un("pointermove",this._onHoverMove),this._onHoverMove=null),this.map.setTarget(null),this.map=null),this.view=null}setView(e){var{center:t,zoom:r}=e;this.view.animate({center:null!=t?t:this.view.getCenter(),zoom:null!=r?r:this.view.getZoom(),duration:N})}zoomIn(e){this.view.animate({zoom:this.view.getZoom()+e,duration:N})}zoomOut(e){this.view.animate({zoom:this.view.getZoom()-e,duration:N})}panBy(e){var t=this.view.getCenter(),r=this.view.getResolution();this.view.animate({center:[t[0]+e[0]*r,t[1]-e[1]*r],duration:N})}fitToBounds(e){var t,r=Array.isArray(e)?e:(t=$o(e),l(t,"EPSG:4326","EPSG:27700"));this.view.fit(r,{duration:N})}setPadding(e){this.view.padding=Ca(e)}getCenter(){var e=this.view.getCenter(),t=F;return[Math.round(e[0]*Math.pow(10,t))/Math.pow(10,t),Math.round(e[1]*Math.pow(10,t))/Math.pow(10,t)]}getZoom(){return this.view.getZoom()}getBounds(){return this.view.calculateExtent(this.map.getSize()).map(e=>Math.round(100*e)/100)}getFeaturesAtPoint(e,t){return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)return[];var{radius:n=10}=r,o=[t.x,t.y],a=[],l=new Set;return e.forEachFeatureAtPixel(o,(e,t)=>{if(t instanceof s){var r=e.get("mapbox-layer"),n=null==r?void 0:r.id;if(!n||"background"===(null==r?void 0:r.type))return;var o="".concat(n,":").concat(ka(e));if(l.has(o))return;l.add(o),a.push({id:e.getId(),layer:{id:n},geometry:No(e),properties:e.getProperties()})}else if(t instanceof i){var u=t.get("layerId");if(!u||t.get("_highlight"))return;var p=e.getId(),c="".concat(u,":").concat(p);if(l.has(c))return;l.add(c),a.push({id:p,layer:{id:u},geometry:wa.writeGeometryObject(e.getGeometry()),properties:e.getProperties()})}},{hitTolerance:n}),a}(this.map,e,t)}getFeatureGeometry(e,t,r){var n=Fo(this.map,e,t,r);return 0===n.length?null:1===n.length?n[0]:{type:"MultiPolygon",coordinates:n.flatMap(e=>"MultiPolygon"===e.type?e.coordinates:[e.coordinates])}}setHoverCursor(e){this.map&&(this._onHoverMove=Ma(this.map,e,this._onHoverMove))}getVisibleFeatures(e){return[]}updateHighlightedFeatures(e,t,r){return this._lastHighlightArgs={selectedFeatures:e,activeFeatures:t,stylesMap:r},va(this.map,e,t,r)}reapplyHighlights(){if(this._lastHighlightArgs){var{selectedFeatures:e,activeFeatures:t,stylesMap:r}=this._lastHighlightArgs;va(this.map,e,t,r)}}getAreaDimensions(){return(e=>{if(!e)return"";var[t,r,n,o]=e,a=n-t;return"".concat(qo(o-r)," by ").concat(qo(a))})((e=>{var t=e.getSize(),r=e.getView().padding||[0,0,0,0],[n,o,a,i]=r,s=[i,t[1]-a],l=[t[0]-o,n],u=e.getCoordinateFromPixel(s),p=e.getCoordinateFromPixel(l);return u&&p?[u[0],u[1],p[0],p[1]]:null})(this.map))}getCardinalMove(e,t){return((e,t)=>{var r=t[0]-e[0],n=t[1]-e[1],o=[];return Math.abs(n)>1&&o.push("".concat(n>0?"north":"south"," ").concat(qo(Math.abs(n)))),Math.abs(r)>1&&o.push("".concat(r>0?"east":"west"," ").concat(qo(Math.abs(r)))),o.join(", ")})(e,t)}getResolution(){return this.view.getResolution()}mapToScreen(e){if(!this.map)return{x:0,y:0};var t=this.map.getPixelFromCoordinate(e);return t?{x:t[0],y:t[1]}:{x:0,y:0}}screenToMap(e){return this.map.getCoordinateFromPixel([e.x,e.y])}isGeometryObscured(e,t){return Do(e,t,this.map)}}export{Aa as default};
|