@defra/interactive-map 0.0.54-alpha → 0.0.56-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/templates/add-polygons.njk +1 -1
- package/assets/templates/add-symbols.njk +4 -4
- package/assets/templates/draw-tools.njk +7 -7
- package/assets/templates/marker-panel.njk +5 -5
- package/assets/templates/place-marker.njk +8 -8
- package/assets/templates/search-control.njk +1 -1
- package/assets/templates/select-feature.njk +7 -7
- package/assets/templates/style-switcher.njk +6 -6
- package/assets/templates/toggle-marker-label.njk +3 -3
- package/dist/esm/im-core.js +1 -1
- package/dist/esm/im-shell.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/umd/im-core.js +1 -1
- package/dist/umd/im-core.js.LICENSE.txt +0 -30
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.LICENSE.txt +0 -20
- package/docs/api/context.md +2 -0
- package/docs/api.md +20 -14
- package/docs/architecture/interactive-map.likec4 +4 -4
- package/docs/building-a-plugin.md +2 -2
- package/docs/examples/add-marker-with-panel.mdx +46 -44
- package/docs/examples/add-polygons.mdx +100 -98
- package/docs/examples/add-symbols.mdx +75 -73
- package/docs/examples/basic-map.mdx +16 -14
- package/docs/examples/button-map.mdx +16 -14
- package/docs/examples/draw-tools.mdx +119 -117
- package/docs/examples/place-marker.mdx +51 -49
- package/docs/examples/search-control.mdx +22 -20
- package/docs/examples/select-feature.mdx +107 -105
- package/docs/examples/style-switcher.mdx +47 -45
- package/docs/examples/toggle-marker-label.mdx +30 -28
- package/docs/getting-started.md +26 -24
- package/docs/plugins/datasets.md +11 -0
- package/docs/plugins/draw.md +18 -12
- package/docs/plugins/interact.md +33 -10
- package/docs/plugins/plugin-descriptor.md +1 -1
- package/docs/plugins/search.md +5 -5
- package/docusaurus.config.cjs +48 -3
- package/govuk-prototype-kit.config.json +6 -7
- package/package.json +22 -29
- package/plugins/datasets/dist/esm/im-datasets-esri-adapter.js +1 -1
- package/plugins/datasets/dist/esm/im-datasets-ml-adapter.js +1 -1
- package/plugins/datasets/dist/esm/im-datasets-ol-adapter.js +1 -1
- package/plugins/datasets/dist/esm/im-datasets-plugin.js +1 -1
- package/plugins/datasets/dist/esm/index.js +1 -1
- package/plugins/datasets/dist/esm/layerAdapter.js +1 -1
- package/plugins/datasets/dist/esm/mapboxStyleLayerAdapter.js +1 -1
- package/plugins/datasets/dist/umd/im-datasets-ml-adapter.js +1 -1
- package/plugins/datasets/dist/umd/im-datasets-ol-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.js +18 -16
- package/plugins/datasets/src/adapters/esri/esriLayerAdapter.test.js +2 -2
- package/plugins/datasets/src/adapters/esri/registry/esriDataset.js +2 -3
- package/plugins/datasets/src/adapters/esri/registry/esriDataset.test.js +1 -1
- package/plugins/datasets/src/adapters/loadLayerAdapter.js +2 -20
- package/plugins/datasets/src/adapters/loadLayerAdapter.test.js +9 -9
- package/plugins/datasets/src/adapters/mapboxStyleLayerAdapter.js +7 -7
- package/plugins/datasets/src/adapters/maplibre/maplibreLayerAdapter.js +19 -19
- package/plugins/datasets/src/adapters/maplibre/maplibreLayerAdapter.test.js +1 -1
- package/plugins/datasets/src/adapters/maplibre/registry/mapLibreDataset.test.js +1 -1
- package/plugins/datasets/src/adapters/openlayers/canvasPatternStyle.test.js +2 -2
- package/plugins/datasets/src/adapters/openlayers/layerBuilders.test.js +1 -1
- package/plugins/datasets/src/adapters/openlayers/openlayersLayerAdapter.js +21 -21
- package/plugins/datasets/src/adapters/openlayers/openlayersLayerAdapter.test.js +5 -5
- package/plugins/datasets/src/adapters/openlayers/registry/openLayersDataset.js +2 -3
- package/plugins/datasets/src/adapters/openlayers/registry/openLayersDataset.test.js +2 -2
- package/plugins/datasets/src/api/getOpacity.js +1 -2
- package/plugins/datasets/src/api/getOpacity.test.js +9 -12
- package/plugins/datasets/src/api/getStyle.js +1 -2
- package/plugins/datasets/src/api/getStyle.test.js +5 -8
- package/plugins/datasets/src/api/removeDataset.js +2 -4
- package/plugins/datasets/src/api/removeDataset.test.js +5 -10
- package/plugins/datasets/src/api/setData.js +2 -4
- package/plugins/datasets/src/api/setData.test.js +6 -14
- package/plugins/datasets/src/api/setFeatureVisibility.js +1 -2
- package/plugins/datasets/src/api/setFeatureVisibility.test.js +8 -11
- package/plugins/datasets/src/components/LayersMenu/LayersMenu.jsx +1 -0
- package/plugins/datasets/src/components/LayersMenu/LayersMenuCheckbox.jsx +1 -3
- package/plugins/datasets/src/components/LayersMenu/LayersMenuCheckbox.test.jsx +13 -18
- package/plugins/datasets/src/index.js +2 -2
- package/plugins/datasets/src/index.test.js +8 -1
- package/plugins/datasets/src/initialise/DatasetsInit.jsx +48 -26
- package/plugins/datasets/src/initialise/DatasetsInit.test.jsx +160 -89
- package/plugins/datasets/src/initialise/initialiseDatasets.js +2 -3
- package/plugins/datasets/src/initialise/initialiseDatasets.test.js +23 -10
- package/plugins/datasets/src/manifest.js +53 -44
- package/plugins/datasets/src/manifest.test.js +36 -4
- package/plugins/datasets/src/reducers/pluginState.js +5 -5
- package/plugins/datasets/src/reducers/pluginState.test.js +21 -20
- package/plugins/datasets/src/registry/__mocks__/datasetRegistry.js +7 -6
- package/plugins/datasets/src/registry/createDataset.js +2 -2
- package/plugins/datasets/src/registry/dataset.js +9 -10
- package/plugins/datasets/src/registry/dataset.test.js +63 -64
- package/plugins/datasets/src/registry/datasetRegistry.js +39 -10
- package/plugins/datasets/src/registry/datasetRegistry.test.js +83 -1
- package/plugins/datasets/src/registry/globalDataset.js +9 -17
- package/plugins/datasets/src/registry/isVisibleWhen.js +9 -17
- package/plugins/datasets/src/registry/isVisibleWhen.test.js +27 -20
- package/plugins/datasets/src/registry/mapboxStyleDataset.test.js +26 -27
- package/plugins/datasets/src/utils/hasLayersMenu.js +13 -0
- package/plugins/datasets/src/utils/hasLayersMenu.test.js +25 -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/esm/liveDrawChecks.js +1 -1
- package/plugins/draw/dist/umd/im-draw-ml-adapter.js +1 -1
- 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 +47 -26
- package/plugins/draw/src/DrawInit.test.jsx +90 -2
- package/plugins/draw/src/adapters/maplibre/styles.js +3 -2
- package/plugins/draw/src/adapters/maplibre/styles.test.js +3 -3
- package/plugins/draw/src/adapters/openlayers/core/styles.test.js +1 -1
- package/plugins/draw/src/adapters/openlayers/point/pointSymbolImages.test.js +1 -1
- package/plugins/draw/src/manifest.js +3 -2
- package/plugins/draw/src/manifest.test.js +13 -1
- package/plugins/draw/src/utils/needsDrawTarget.js +22 -0
- package/plugins/draw/src/utils/needsDrawTarget.test.js +42 -0
- package/plugins/draw-es/dist/esm/im-draw-es-plugin.js +1 -0
- package/plugins/draw-es/dist/esm/index.js +1 -0
- package/plugins/{beta/draw-es → draw-es}/src/DrawInit.jsx +1 -1
- package/plugins/{beta/draw-es → draw-es}/src/events.test.js +1 -1
- package/plugins/{beta/draw-es → draw-es}/src/graphic.js +1 -1
- package/plugins/frame/dist/esm/im-frame-plugin.js +1 -0
- package/plugins/frame/dist/esm/index.js +1 -0
- package/plugins/frame/dist/umd/im-frame-plugin.js +1 -0
- package/plugins/frame/dist/umd/index.js +2 -0
- package/plugins/{beta/frame → frame}/package.json +2 -2
- package/plugins/interact/dist/esm/im-interact-plugin.js +1 -1
- package/plugins/interact/dist/esm/index.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/InteractInit.jsx +3 -3
- package/plugins/interact/src/api/enable.test.js +13 -0
- package/plugins/interact/src/defaults.js +1 -0
- package/plugins/interact/src/hooks/useCrossHairVisibility.js +27 -17
- package/plugins/interact/src/hooks/useCrossHairVisibility.test.js +72 -7
- package/plugins/interact/src/manifest.js +4 -4
- package/plugins/interact/src/manifest.test.js +29 -0
- package/plugins/interact/src/reducer.js +7 -2
- package/plugins/interact/src/reducer.test.js +12 -2
- package/plugins/interact/src/utils/needsTarget.js +20 -0
- package/plugins/interact/src/utils/needsTarget.test.js +36 -0
- package/plugins/map-key/dist/esm/im-map-key-plugin.js +1 -1
- package/plugins/map-key/dist/esm/index.js +1 -1
- package/plugins/map-key/dist/umd/im-map-key-plugin.js +1 -1
- package/plugins/map-key/dist/umd/index.js +1 -1
- package/plugins/map-key/src/components/Key/KeySvgSymbol.jsx +4 -0
- package/plugins/map-key/src/components/Key/MapKey.jsx +15 -15
- package/plugins/map-key/src/components/Key/MapKey.test.jsx +29 -15
- package/plugins/map-key/src/initialise/MapKeyInit.jsx +5 -8
- package/plugins/map-key/src/initialise/MapKeyInit.test.jsx +9 -7
- package/plugins/map-key/src/manifest.test.js +0 -1
- package/plugins/map-key/src/reducers/mergeKeyGroupItems.js +14 -33
- package/plugins/map-key/src/reducers/mergeKeyGroupItems.test.js +34 -50
- package/plugins/map-key/src/reducers/pluginState.js +6 -1
- package/plugins/map-key/src/reducers/pluginState.test.js +13 -4
- package/plugins/map-styles/dist/esm/im-map-styles-plugin.js +1 -0
- package/plugins/map-styles/dist/esm/index.js +1 -0
- package/plugins/map-styles/dist/umd/im-map-styles-plugin.js +1 -0
- package/plugins/map-styles/dist/umd/index.js +2 -0
- package/plugins/{beta/map-styles → map-styles}/src/MapStyles.jsx +2 -2
- package/plugins/{beta/map-styles → map-styles}/src/MapStylesInit.jsx +1 -1
- package/plugins/menu/dist/esm/im-menu-plugin.js +1 -1
- package/plugins/menu/dist/esm/index.js +1 -1
- package/plugins/menu/dist/umd/im-menu-plugin.js +1 -1
- package/plugins/menu/dist/umd/index.js +1 -1
- package/plugins/scale-bar/dist/esm/im-scale-bar-plugin.js +1 -0
- package/plugins/scale-bar/dist/esm/index.js +1 -0
- package/plugins/scale-bar/dist/umd/im-scale-bar-plugin.js +1 -0
- package/plugins/scale-bar/dist/umd/index.js +2 -0
- package/plugins/{beta/scale-bar → scale-bar}/package.json +2 -2
- 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/components/Suggestions/Suggestions.jsx +3 -1
- package/plugins/search/src/components/Suggestions/Suggestions.test.jsx +11 -0
- package/plugins/search/src/utils/markedToElements.jsx +25 -0
- package/plugins/search/src/utils/markedToElements.test.jsx +49 -0
- package/plugins/search/src/utils/parseOsNamesResults.js +6 -4
- package/plugins/search/src/utils/parseOsNamesResults.test.js +18 -0
- package/plugins/use-location/dist/esm/im-use-location-plugin.js +1 -0
- package/plugins/use-location/dist/esm/index.js +1 -0
- package/plugins/use-location/dist/umd/im-use-location-plugin.js +1 -0
- package/plugins/use-location/dist/umd/index.js +2 -0
- package/providers/esri/dist/esm/im-esri-provider.js +1 -0
- package/providers/esri/dist/esm/index.js +1 -0
- package/providers/{beta/esri → esri}/src/esriProvider.js +1 -1
- package/providers/{beta/esri → esri}/src/mapEvents.js +2 -2
- package/providers/maplibre/dist/esm/im-maplibre-provider.js +1 -1
- package/providers/maplibre/dist/esm/index.js +1 -1
- package/providers/maplibre/dist/umd/im-maplibre-framework.js +1 -1
- package/providers/maplibre/dist/umd/im-maplibre-framework.js.LICENSE.txt +3 -3
- package/providers/maplibre/dist/umd/im-maplibre-provider.js +1 -1
- package/providers/maplibre/dist/umd/im-maplibre-worker.js +2 -0
- package/providers/maplibre/dist/umd/im-maplibre-worker.js.LICENSE.txt +4 -0
- package/providers/maplibre/dist/umd/index.js +1 -1
- package/providers/maplibre/src/index.js +41 -12
- package/providers/maplibre/src/index.test.js +43 -12
- package/providers/maplibre/src/utils/detectModuleWorker.js +25 -0
- package/providers/maplibre/src/utils/detectModuleWorker.test.js +40 -0
- package/providers/maplibre/src/utils/spatial.js +22 -12
- package/providers/maplibre/src/utils/spatial.test.js +6 -6
- package/providers/maplibre/src/utils/workerUrl.js +15 -0
- package/providers/maplibre/src/utils/workerUrl.test.js +14 -0
- package/providers/open-names/dist/esm/im-reverse-geocode.js +1 -0
- package/providers/open-names/dist/esm/index.js +1 -0
- package/providers/open-names/dist/umd/im-reverse-geocode.js +2 -0
- package/providers/open-names/dist/umd/index.js +2 -0
- package/providers/openlayers/dist/esm/im-openlayers-provider.js +1 -0
- package/providers/openlayers/dist/esm/index.js +1 -0
- package/providers/openlayers/dist/umd/im-openlayers-provider.js +2 -0
- package/providers/openlayers/dist/umd/index.js +2 -0
- package/providers/openlayers/src/index.js +60 -0
- package/providers/openlayers/src/index.test.js +47 -0
- package/providers/{beta/openlayers → openlayers}/src/mapEvents.js +2 -2
- package/providers/{beta/openlayers → openlayers}/src/mapEvents.test.js +2 -2
- package/providers/{beta/openlayers → openlayers}/src/openlayersProvider.js +3 -3
- package/providers/{beta/openlayers → openlayers}/src/utils/highlightFeatures.js +1 -1
- package/providers/{beta/openlayers → openlayers}/src/utils/patternImages.js +1 -1
- package/providers/{beta/openlayers → openlayers}/src/utils/symbolImages.js +1 -1
- package/rollup.esm.mjs +79 -46
- package/sonar-project.properties +1 -1
- package/src/App/App.jsx +4 -1
- package/src/App/App.test.jsx +6 -0
- package/src/App/renderer/PluginInits.jsx +8 -7
- package/src/App/renderer/PluginInits.test.jsx +20 -5
- package/src/App/renderer/SlotItemsProvider.jsx +33 -0
- package/src/App/renderer/SlotItemsProvider.test.jsx +59 -0
- package/src/App/renderer/SlotRenderer.jsx +3 -14
- package/src/App/renderer/SlotRenderer.test.jsx +11 -44
- package/src/App/renderer/mapButtons.js +22 -11
- package/src/App/renderer/mapButtons.test.js +23 -1
- package/src/App/renderer/mapControls.js +6 -8
- package/src/App/renderer/mapControls.test.js +10 -0
- package/src/App/renderer/mapPanels.js +16 -19
- package/src/App/renderer/mapPanels.test.js +37 -9
- package/src/App/renderer/pluginWrapper.js +10 -8
- package/src/App/renderer/pluginWrapper.test.js +23 -9
- package/src/App/renderer/slotAggregator.js +18 -5
- package/src/App/renderer/slotAggregator.test.js +68 -25
- package/src/App/renderer/slotHelpers.js +13 -0
- package/src/App/renderer/slotHelpers.test.js +16 -1
- package/src/App/store/AppProvider.jsx +19 -1
- package/src/App/store/AppProvider.test.jsx +41 -0
- package/src/App/store/appActionsMap.js +10 -1
- package/src/App/store/appActionsMap.test.js +21 -0
- package/src/App/store/appDispatchMiddleware.js +29 -17
- package/src/App/store/appDispatchMiddleware.test.js +31 -0
- package/src/InteractiveMap/InteractiveMap.js +2 -1
- package/src/InteractiveMap/InteractiveMap.test.js +9 -2
- package/src/InteractiveMap/domStateManager.js +21 -1
- package/src/InteractiveMap/domStateManager.test.js +48 -1
- package/src/InteractiveMap/parseDataProperties.js +4 -4
- package/src/InteractiveMap/parseDataProperties.test.js +62 -6
- package/src/InteractiveMap/polyfills.js +4 -3
- package/src/InteractiveMap/polyfills.test.js +12 -0
- package/src/config/events.js +4 -2
- package/src/scss/tools/_govuk-content.scss +4 -3
- package/src/types.js +3 -5
- package/webpack.dev.mjs +11 -3
- package/webpack.prod.mjs +11 -4
- package/webpack.umd.mjs +34 -14
- package/plugins/beta/draw-es/dist/esm/im-draw-es-plugin.js +0 -1
- package/plugins/beta/draw-es/dist/esm/index.js +0 -1
- package/plugins/beta/draw-ml/dist/esm/im-draw-ml-plugin.js +0 -1
- package/plugins/beta/draw-ml/dist/esm/index.js +0 -1
- package/plugins/beta/draw-ml/dist/umd/im-draw-ml-plugin.js +0 -1
- package/plugins/beta/draw-ml/dist/umd/index.js +0 -2
- package/plugins/beta/draw-ml/src/DrawInit.jsx +0 -85
- package/plugins/beta/draw-ml/src/api/addFeature.js +0 -27
- package/plugins/beta/draw-ml/src/api/deleteFeature.js +0 -13
- package/plugins/beta/draw-ml/src/api/editFeature.js +0 -75
- package/plugins/beta/draw-ml/src/api/merge.js +0 -9
- package/plugins/beta/draw-ml/src/api/newLine.js +0 -68
- package/plugins/beta/draw-ml/src/api/newPolygon.js +0 -68
- package/plugins/beta/draw-ml/src/api/split.js +0 -81
- package/plugins/beta/draw-ml/src/defaults.js +0 -17
- package/plugins/beta/draw-ml/src/draw.scss +0 -26
- package/plugins/beta/draw-ml/src/events.js +0 -185
- package/plugins/beta/draw-ml/src/index.js +0 -13
- package/plugins/beta/draw-ml/src/manifest.js +0 -110
- package/plugins/beta/draw-ml/src/mapboxDraw.js +0 -143
- package/plugins/beta/draw-ml/src/mapboxSnap.js +0 -321
- package/plugins/beta/draw-ml/src/modes/createDrawMode.js +0 -552
- package/plugins/beta/draw-ml/src/modes/disabledMode.js +0 -23
- package/plugins/beta/draw-ml/src/modes/drawLineMode.js +0 -18
- package/plugins/beta/draw-ml/src/modes/drawPolygonMode.js +0 -16
- package/plugins/beta/draw-ml/src/modes/editVertex/geometryHelpers.js +0 -135
- package/plugins/beta/draw-ml/src/modes/editVertex/helpers.js +0 -2
- package/plugins/beta/draw-ml/src/modes/editVertex/touchHandlers.js +0 -142
- package/plugins/beta/draw-ml/src/modes/editVertex/undoHandlers.js +0 -133
- package/plugins/beta/draw-ml/src/modes/editVertex/vertexOperations.js +0 -142
- package/plugins/beta/draw-ml/src/modes/editVertex/vertexQueries.js +0 -121
- package/plugins/beta/draw-ml/src/modes/editVertexMode.js +0 -495
- package/plugins/beta/draw-ml/src/reducer.js +0 -90
- package/plugins/beta/draw-ml/src/styles.js +0 -190
- package/plugins/beta/draw-ml/src/undoStack.js +0 -50
- package/plugins/beta/draw-ml/src/utils/debounce.js +0 -16
- package/plugins/beta/draw-ml/src/utils/flattenStyleProperties.js +0 -49
- package/plugins/beta/draw-ml/src/utils/snapHelpers.js +0 -200
- package/plugins/beta/draw-ml/src/utils/spatial.js +0 -258
- package/plugins/beta/draw-ol/dist/css/index.css +0 -1
- package/plugins/beta/draw-ol/dist/esm/DrawMode.js +0 -1
- package/plugins/beta/draw-ol/dist/esm/EditMode.js +0 -1
- package/plugins/beta/draw-ol/dist/esm/geometryHelpers.js +0 -1
- package/plugins/beta/draw-ol/dist/esm/im-draw-ol-plugin.js +0 -1
- package/plugins/beta/draw-ol/dist/esm/index.js +0 -1
- package/plugins/beta/draw-ol/src/DrawInit.jsx +0 -65
- package/plugins/beta/draw-ol/src/api/addFeature.js +0 -29
- package/plugins/beta/draw-ol/src/api/deleteFeature.js +0 -11
- package/plugins/beta/draw-ol/src/api/editFeature.js +0 -50
- package/plugins/beta/draw-ol/src/api/newLine.js +0 -44
- package/plugins/beta/draw-ol/src/api/newPolygon.js +0 -44
- package/plugins/beta/draw-ol/src/core/OLDrawManager.js +0 -153
- package/plugins/beta/draw-ol/src/core/featureStore.js +0 -65
- package/plugins/beta/draw-ol/src/core/styles.js +0 -98
- package/plugins/beta/draw-ol/src/core/undoStack.js +0 -31
- package/plugins/beta/draw-ol/src/defaults.js +0 -16
- package/plugins/beta/draw-ol/src/draw/DrawMode.js +0 -121
- package/plugins/beta/draw-ol/src/draw/drawInput.js +0 -243
- package/plugins/beta/draw-ol/src/draw.scss +0 -17
- package/plugins/beta/draw-ol/src/edit/EditMode.js +0 -424
- package/plugins/beta/draw-ol/src/edit/keyboardHandler.js +0 -229
- package/plugins/beta/draw-ol/src/edit/midpointLayer.js +0 -57
- package/plugins/beta/draw-ol/src/edit/touchHandler.js +0 -171
- package/plugins/beta/draw-ol/src/edit/undoOps.js +0 -95
- package/plugins/beta/draw-ol/src/edit/vertexHitTest.js +0 -72
- package/plugins/beta/draw-ol/src/edit/vertexLayer.js +0 -49
- package/plugins/beta/draw-ol/src/edit/vertexOps.js +0 -99
- package/plugins/beta/draw-ol/src/events.js +0 -114
- package/plugins/beta/draw-ol/src/index.js +0 -12
- package/plugins/beta/draw-ol/src/manifest.js +0 -125
- package/plugins/beta/draw-ol/src/olDraw.js +0 -38
- package/plugins/beta/draw-ol/src/reducer.js +0 -41
- package/plugins/beta/draw-ol/src/snap/snapEngine.js +0 -153
- package/plugins/beta/draw-ol/src/snap/snapGeometry.js +0 -177
- package/plugins/beta/draw-ol/src/snap/snapIndicator.js +0 -81
- package/plugins/beta/draw-ol/src/snap/snapInteraction.js +0 -57
- package/plugins/beta/draw-ol/src/snap/snapManager.js +0 -99
- package/plugins/beta/draw-ol/src/utils/flattenStyleProperties.js +0 -47
- package/plugins/beta/draw-ol/src/utils/geometryHelpers.js +0 -103
- package/plugins/beta/draw-ol/src/utils/olCoords.js +0 -35
- package/plugins/beta/draw-ol/src/utils/resolveColors.js +0 -39
- package/plugins/beta/draw-ol/src/utils/spatial.js +0 -24
- package/plugins/beta/draw-ol/src/utils/touchTarget.js +0 -61
- package/plugins/beta/frame/dist/esm/im-frame-plugin.js +0 -1
- package/plugins/beta/frame/dist/esm/index.js +0 -1
- package/plugins/beta/frame/dist/umd/im-frame-plugin.js +0 -1
- package/plugins/beta/frame/dist/umd/index.js +0 -2
- package/plugins/beta/map-styles/dist/esm/im-map-styles-plugin.js +0 -1
- package/plugins/beta/map-styles/dist/esm/index.js +0 -1
- package/plugins/beta/map-styles/dist/umd/im-map-styles-plugin.js +0 -1
- package/plugins/beta/map-styles/dist/umd/index.js +0 -2
- package/plugins/beta/scale-bar/dist/esm/im-scale-bar-plugin.js +0 -1
- package/plugins/beta/scale-bar/dist/esm/index.js +0 -1
- package/plugins/beta/scale-bar/dist/umd/im-scale-bar-plugin.js +0 -1
- package/plugins/beta/scale-bar/dist/umd/index.js +0 -2
- package/plugins/beta/use-location/dist/esm/im-use-location-plugin.js +0 -1
- package/plugins/beta/use-location/dist/esm/index.js +0 -1
- package/plugins/beta/use-location/dist/umd/im-use-location-plugin.js +0 -1
- package/plugins/beta/use-location/dist/umd/index.js +0 -2
- package/plugins/map-key/src/registry/getDatasetRegistry.js +0 -6
- package/plugins/map-key/src/registry/getDatasetRegistry.test.js +0 -23
- package/plugins/map-key/src/registry/index.js +0 -1
- package/plugins/map-key/src/registry/index.test.js +0 -7
- package/providers/beta/esri/dist/esm/im-esri-provider.js +0 -1
- package/providers/beta/esri/dist/esm/index.js +0 -1
- package/providers/beta/open-names/dist/esm/im-reverse-geocode.js +0 -1
- package/providers/beta/open-names/dist/esm/index.js +0 -1
- package/providers/beta/open-names/dist/umd/im-reverse-geocode.js +0 -2
- package/providers/beta/open-names/dist/umd/index.js +0 -2
- package/providers/beta/openlayers/dist/esm/im-openlayers-provider.js +0 -1
- package/providers/beta/openlayers/dist/esm/index.js +0 -1
- package/providers/beta/openlayers/dist/umd/im-openlayers-provider.js +0 -2
- package/providers/beta/openlayers/dist/umd/index.js +0 -2
- package/providers/beta/openlayers/dist/umd/index.js.LICENSE.txt +0 -1
- package/providers/beta/openlayers/src/index.js +0 -37
- /package/plugins/{beta/draw-es → draw-es}/src/api/addFeature.js +0 -0
- /package/plugins/{beta/draw-es → draw-es}/src/api/deleteFeature.js +0 -0
- /package/plugins/{beta/draw-es → draw-es}/src/api/editFeature.js +0 -0
- /package/plugins/{beta/draw-es → draw-es}/src/api/newPolygon.js +0 -0
- /package/plugins/{beta/draw-es → draw-es}/src/api/removeSafeZone.js +0 -0
- /package/plugins/{beta/draw-es → draw-es}/src/events.js +0 -0
- /package/plugins/{beta/draw-es → draw-es}/src/index.js +0 -0
- /package/plugins/{beta/draw-es → draw-es}/src/manifest.js +0 -0
- /package/plugins/{beta/draw-es → draw-es}/src/reducer.js +0 -0
- /package/plugins/{beta/draw-es → draw-es}/src/sketchViewModel.js +0 -0
- /package/plugins/{beta/frame → frame}/dist/css/index.css +0 -0
- /package/plugins/{beta/draw-ml → frame}/dist/umd/index.js.LICENSE.txt +0 -0
- /package/plugins/{beta/frame → frame}/src/Frame.jsx +0 -0
- /package/plugins/{beta/frame → frame}/src/FrameInit.jsx +0 -0
- /package/plugins/{beta/frame → frame}/src/api/addFrame.js +0 -0
- /package/plugins/{beta/frame → frame}/src/api/editFeature.js +0 -0
- /package/plugins/{beta/frame → frame}/src/config.js +0 -0
- /package/plugins/{beta/frame → frame}/src/frame.scss +0 -0
- /package/plugins/{beta/frame → frame}/src/index.js +0 -0
- /package/plugins/{beta/frame → frame}/src/manifest.js +0 -0
- /package/plugins/{beta/frame → frame}/src/reducer.js +0 -0
- /package/plugins/{beta/frame → frame}/src/utils.js +0 -0
- /package/plugins/{beta/map-styles → map-styles}/dist/css/index.css +0 -0
- /package/plugins/{beta/frame → map-styles}/dist/umd/index.js.LICENSE.txt +0 -0
- /package/plugins/{beta/map-styles → map-styles}/src/config.js +0 -0
- /package/plugins/{beta/map-styles → map-styles}/src/index.js +0 -0
- /package/plugins/{beta/map-styles → map-styles}/src/manifest.js +0 -0
- /package/plugins/{beta/map-styles → map-styles}/src/mapStyles.scss +0 -0
- /package/plugins/{beta/scale-bar → scale-bar}/dist/css/index.css +0 -0
- /package/plugins/{beta/map-styles → scale-bar}/dist/umd/index.js.LICENSE.txt +0 -0
- /package/plugins/{beta/scale-bar → scale-bar}/src/ScaleBar.jsx +0 -0
- /package/plugins/{beta/scale-bar → scale-bar}/src/ScaleBar.test.jsx +0 -0
- /package/plugins/{beta/scale-bar → scale-bar}/src/index.js +0 -0
- /package/plugins/{beta/scale-bar → scale-bar}/src/index.test.js +0 -0
- /package/plugins/{beta/scale-bar → scale-bar}/src/manifest.js +0 -0
- /package/plugins/{beta/scale-bar → scale-bar}/src/scaleBar.scss +0 -0
- /package/plugins/{beta/scale-bar → scale-bar}/src/utils.js +0 -0
- /package/plugins/{beta/scale-bar → scale-bar}/src/utils.test.js +0 -0
- /package/plugins/{beta/scale-bar → use-location}/dist/umd/index.js.LICENSE.txt +0 -0
- /package/plugins/{beta/use-location → use-location}/src/UseLocation.jsx +0 -0
- /package/plugins/{beta/use-location → use-location}/src/UseLocationInit.jsx +0 -0
- /package/plugins/{beta/use-location → use-location}/src/defaults.js +0 -0
- /package/plugins/{beta/use-location → use-location}/src/events.js +0 -0
- /package/plugins/{beta/use-location → use-location}/src/index.js +0 -0
- /package/plugins/{beta/use-location → use-location}/src/manifest.js +0 -0
- /package/plugins/{beta/use-location → use-location}/src/reducer.js +0 -0
- /package/providers/{beta/esri → esri}/dist/css/index.css +0 -0
- /package/providers/{beta/esri → esri}/src/appEvents.js +0 -0
- /package/providers/{beta/esri → esri}/src/defaults.js +0 -0
- /package/providers/{beta/esri → esri}/src/esriProvider.scss +0 -0
- /package/providers/{beta/esri → esri}/src/index.js +0 -0
- /package/providers/{beta/esri → esri}/src/utils/coords.js +0 -0
- /package/providers/{beta/esri → esri}/src/utils/coords.test.js +0 -0
- /package/providers/{beta/esri → esri}/src/utils/detectWebGL.js +0 -0
- /package/providers/{beta/esri → esri}/src/utils/esriFixes.js +0 -0
- /package/providers/{beta/esri → esri}/src/utils/query.js +0 -0
- /package/providers/{beta/esri → esri}/src/utils/spatial.js +0 -0
- /package/providers/{beta/esri → esri}/src/utils/spatial.test.js +0 -0
- /package/providers/{beta/open-names → open-names}/dist/umd/im-reverse-geocode.js.LICENSE.txt +0 -0
- /package/{plugins/beta/use-location → providers/open-names}/dist/umd/index.js.LICENSE.txt +0 -0
- /package/providers/{beta/open-names → open-names}/src/index.js +0 -0
- /package/providers/{beta/open-names → open-names}/src/reverseGeocode.js +0 -0
- /package/providers/{beta/open-names → open-names}/src/utils/mapToLocationModel.js +0 -0
- /package/providers/{beta/open-names → open-names}/src/utils/mapToLocationModel.test.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/dist/umd/im-openlayers-provider.js.LICENSE.txt +0 -0
- /package/providers/{beta/open-names → openlayers}/dist/umd/index.js.LICENSE.txt +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/appEvents.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/appEvents.test.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/defaults.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/openlayersProvider.test.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/bngProjection.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/filterEvaluator.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/filterEvaluator.test.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/highlightFeatures.test.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/hoverCursor.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/hoverCursor.test.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/openLayersFixes.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/openLayersFixes.test.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/patternImages.test.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/queryFeatures.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/queryFeatures.test.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/spatial.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/spatial.test.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/symbolImages.test.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/tileLayers.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/tileLayers.test.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/vtTileFragments.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/vtTileFragments.test.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/zoom.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/zoom.test.js +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see im-search-plugin.js.LICENSE.txt */
|
|
2
|
-
"use strict";(this.webpackChunkdefra_DefraMap=this.webpackChunkdefra_DefraMap||[]).push([[254],{323(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){a(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function a(t,e,r){return(e=function(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}r.r(e),r.d(e,{manifest:()=>jt});var s={TOGGLE_EXPANDED:function(t,e){return i(i({},t),{},{isExpanded:e,areSuggestionsVisible:e,hasFetchedSuggestions:!1,hasSearchError:!1})},SET_KEYBOARD_FOCUS_WITHIN:function(t,e){return i(i({},t),{},{hasKeyboardFocusWithin:e,areSuggestionsVisible:!0})},INPUT_BLUR:function(t,e){return i(i({},t),{},{hasKeyboardFocusWithin:!1,areSuggestionsVisible:t.areSuggestionsVisible&&"keyboard"!==e,selectedIndex:-1})},SET_VALUE:function(t,e){return i(i({},t),{},{value:e})},UPDATE_SUGGESTIONS:function(t,e){return i(i({},t),{},{suggestions:e.results,hasFetchedSuggestions:!0,hasSearchError:e.hasError})},SHOW_SUGGESTIONS:function(t){return i(i({},t),{},{areSuggestionsVisible:!0,hasFetchedSuggestions:!1,hasSearchError:!1})},HIDE_SUGGESTIONS:function(t){return i(i({},t),{},{areSuggestionsVisible:!1,hasFetchedSuggestions:!1,hasSearchError:!1})},SET_SELECTED:function(t,e){return i(i({},t),{},{selectedIndex:e,areSuggestionsVisible:e>=0})}},u=r(738),c=r(287),l=function(t){var e=t.id,r=t.pluginState,n=t.handleSuggestionClick;return(0,c.jsx)("ul",{id:"".concat(e,"-search-suggestions"),role:"listbox","aria-labelledby":"".concat(e,"-search-input"),className:"im-c-search-suggestions",style:r.areSuggestionsVisible&&r.suggestions.length?void 0:{display:"none"},onMouseDown:function(t){return t.preventDefault()},children:r.suggestions.map(function(t,o){return(0,c.jsx)("li",{id:"".concat(e,"-search-suggestion-").concat(o),className:"im-c-search-suggestions__item",role:"option","aria-selected":r.selectedIndex===o,"aria-setsize":r.suggestions.length,"aria-posinset":o+1,onClick:function(){return n(t)},children:(0,c.jsx)("span",{className:"im-c-search-suggestions__label",dangerouslySetInnerHTML:{__html:t.marked}})},"".concat(e,"-").concat(t.type,"-").concat(t.id))})})};function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function d(t,e,r){return(e=function(t){var e=function(t){if("object"!=f(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=f(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==f(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var h=function(t,e,r){return function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(Object(r),!0).forEach(function(e){d(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({display:t.expanded||e.isExpanded?"flex":void 0},"mobile"!==r.breakpoint&&(null==t?void 0:t.width)&&{width:t.width})},y=function(t){var e=t.id,r=t.pluginState,n=t.pluginConfig,o=t.appState,i=t.inputRef,a=t.events,s=t.services,f=t.children,p=r.areSuggestionsVisible,d=r.hasFetchedSuggestions,y=r.hasSearchError,m=r.suggestions,b=void 0===m?[]:m,g=n.noResultsMessage,v=n.searchErrorMessage;(0,u.useEffect)(function(){p&&d&&s.announce(function(t,e,r,n){if(e)return r;if(0===t)return n;var o=1===t?"result":"results";return"".concat(t," ").concat(o," available")}(b.length,y,v,g))},[b,d]);var w=["im-c-search-form",n.expanded&&"im-c-search-form--default-expanded","im-c-panel"].filter(Boolean).join(" "),S=p&&d&&(y||!b.length);return(0,c.jsxs)("form",{id:"".concat(e,"-search-form"),role:"search",className:w,style:h(n,r,o),"aria-controls":"".concat(e,"-viewport"),onSubmit:function(t){return a.handleSubmit(t,o,r)},children:[(0,c.jsx)("button",{type:"submit",style:{display:"none"},"aria-hidden":"true",tabIndex:-1,children:"Submit"}),(0,c.jsxs)("div",{className:"im-c-search__input-container".concat(r.hasKeyboardFocusWithin?" im-c-search__input-container--keyboard-focus-within":""),children:[(0,c.jsx)("label",{htmlFor:"".concat(e,"-search-input"),className:"im-u-visually-hidden",children:n.placeholder}),(0,c.jsx)("input",{id:"".concat(e,"-search-input"),className:"im-c-search__input",type:"search",role:"combobox","aria-expanded":r.suggestionsVisible,"aria-controls":"".concat(e,"-search-suggestions"),"aria-activedescendant":r.selectedIndex>=0?"".concat(e,"-search-suggestion-").concat(r.selectedIndex):void 0,"aria-describedby":r.value?void 0:"".concat(e,"-search-hint"),"aria-autocomplete":"list",autoComplete:"off",placeholder:n.placeholder,name:"".concat(e,"-search-input"),spellCheck:!1,enterKeyHint:"search",value:r.value,onClick:a.handleInputClick,onChange:function(t){return a.handleInputChange(t,r)},onFocus:function(){return a.handleInputFocus(o.interfaceType)},onBlur:function(){return a.handleInputBlur(o.interfaceType)},onKeyDown:function(t){return a.handleInputKeyDown(t,r)},ref:i}),(0,c.jsx)("span",{id:"".concat(e,"-search-hint"),className:"im-c-search__hint",children:"When search results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures."}),f]}),S&&(0,c.jsx)("div",{className:"im-c-search__status","aria-hidden":"true",children:y?v:g}),(0,c.jsx)(l,{id:e,appState:o,pluginState:r,handleSuggestionClick:function(t){return a.handleSuggestionClick(t,o)}})]})},m=function(t){var e=t.defaultExpanded,r=t.onClick,n=t.closeIcon;return(0,c.jsx)("button",{"aria-label":"Close search",className:"im-c-map-button im-c-search-close-button",type:"button",onClick:r,style:e?{display:"none"}:void 0,children:n&&(0,c.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:n}})})},b=function(t){var e=t.defaultExpanded,r=t.submitIcon;return(0,c.jsx)("button",{"aria-label":"Search",className:"im-c-map-button im-c-search-submit-button",type:"submit",style:e?void 0:{display:"none"},children:r&&(0,c.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:r}})})};let g=" ";class v{static get separator(){return g}static set separator(t){g=t}static parse(t){if(!isNaN(parseFloat(t))&&isFinite(t))return Number(t);const e=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==e[e.length-1]&&e.splice(e.length-1),""==e)return NaN;let r=null;switch(e.length){case 3:r=e[0]/1+e[1]/60+e[2]/3600;break;case 2:r=e[0]/1+e[1]/60;break;case 1:r=e[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(r=-r),Number(r)}static toDms(t,e="d",r=void 0){if(isNaN(t))return null;if("string"==typeof t&&""==t.trim())return null;if("boolean"==typeof t)return null;if(t==1/0)return null;if(null==t)return null;if(void 0===r)switch(e){case"d":case"deg":r=4;break;case"dm":case"deg+min":r=2;break;case"dms":case"deg+min+sec":r=0;break;default:e="d",r=4}t=Math.abs(t);let n=null,o=null,i=null,a=null;switch(e){default:case"d":case"deg":o=t.toFixed(r),o<100&&(o="0"+o),o<10&&(o="0"+o),n=o+"°";break;case"dm":case"deg+min":o=Math.floor(t),i=(60*t%60).toFixed(r),60==i&&(i=(0).toFixed(r),o++),o=("000"+o).slice(-3),i<10&&(i="0"+i),n=o+"°"+v.separator+i+"′";break;case"dms":case"deg+min+sec":o=Math.floor(t),i=Math.floor(3600*t/60)%60,a=(3600*t%60).toFixed(r),60==a&&(a=(0).toFixed(r),i++),60==i&&(i=0,o++),o=("000"+o).slice(-3),i=("00"+i).slice(-2),a<10&&(a="0"+a),n=o+"°"+v.separator+i+"′"+v.separator+a+"″"}return n}static toLat(t,e,r){const n=v.toDms(v.wrap90(t),e,r);return null===n?"–":n.slice(1)+v.separator+(t<0?"S":"N")}static toLon(t,e,r){const n=v.toDms(v.wrap180(t),e,r);return null===n?"–":n+v.separator+(t<0?"W":"E")}static toBrng(t,e,r){const n=v.toDms(v.wrap360(t),e,r);return null===n?"–":n.replace("360","0")}static fromLocale(t){const e=123456.789.toLocaleString(),r={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(r.thousands,"⁜").replace(r.decimal,".").replace("⁜",",")}static toLocale(t){const e=123456.789.toLocaleString(),r={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(/,([0-9])/,"⁜$1").replace(".",r.decimal).replace("⁜",r.thousands)}static compassPoint(t,e=3){if(![1,2,3].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);t=v.wrap360(t);const r=4*2**(e-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*r/360)%r*16/r]}static wrap90(t){if(-90<=t&&t<=90)return t;const e=t;return 1*Math.abs(((e-90)%360+360)%360-180)-90}static wrap180(t){if(-180<=t&&t<=180)return t;const e=360;return((360*t/e-180)%e+e)%e-180}static wrap360(t){if(0<=t&&t<360)return t;const e=360;return(360*t/e%e+e)%e}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const w=v;class S{constructor(t,e,r){if(isNaN(t)||isNaN(e)||isNaN(r))throw new TypeError(`invalid vector [${t},${e},${r}]`);this.x=Number(t),this.y=Number(e),this.z=Number(r)}get length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}plus(t){if(!(t instanceof S))throw new TypeError("v is not Vector3d object");return new S(this.x+t.x,this.y+t.y,this.z+t.z)}minus(t){if(!(t instanceof S))throw new TypeError("v is not Vector3d object");return new S(this.x-t.x,this.y-t.y,this.z-t.z)}times(t){if(isNaN(t))throw new TypeError(`invalid scalar value ‘${t}’`);return new S(this.x*t,this.y*t,this.z*t)}dividedBy(t){if(isNaN(t))throw new TypeError(`invalid scalar value ‘${t}’`);return new S(this.x/t,this.y/t,this.z/t)}dot(t){if(!(t instanceof S))throw new TypeError("v is not Vector3d object");return this.x*t.x+this.y*t.y+this.z*t.z}cross(t){if(!(t instanceof S))throw new TypeError("v is not Vector3d object");const e=this.y*t.z-this.z*t.y,r=this.z*t.x-this.x*t.z,n=this.x*t.y-this.y*t.x;return new S(e,r,n)}negate(){return new S(-this.x,-this.y,-this.z)}unit(){const t=this.length;if(1==t)return this;if(0==t)return this;const e=this.x/t,r=this.y/t,n=this.z/t;return new S(e,r,n)}angleTo(t,e=void 0){if(!(t instanceof S))throw new TypeError("v is not Vector3d object");if(!(e instanceof S||null==e))throw new TypeError("n is not Vector3d object");const r=null==e||this.cross(t).dot(e)>=0?1:-1,n=this.cross(t).length*r,o=this.dot(t);return Math.atan2(n,o)}rotateAround(t,e){if(!(t instanceof S))throw new TypeError("axis is not Vector3d object");const r=e.toRadians(),n=this.unit(),o=t.unit(),i=Math.sin(r),a=Math.cos(r),s=1-a,u=o.x,c=o.y,l=o.z,f=[[s*u*u+a,s*u*c-i*l,s*u*l+i*c],[s*u*c+i*l,s*c*c+a,s*c*l-i*u],[s*u*l-i*c,s*c*l+i*u,s*l*l+a]],p=[f[0][0]*n.x+f[0][1]*n.y+f[0][2]*n.z,f[1][0]*n.x+f[1][1]*n.y+f[1][2]*n.z,f[2][0]*n.x+f[2][1]*n.y+f[2][2]*n.z];return new S(p[0],p[1],p[2])}toString(t=3){return`[${this.x.toFixed(t)},${this.y.toFixed(t)},${this.z.toFixed(t)}]`}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const E=S,O={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563}},N={WGS84:{ellipsoid:O.WGS84}};Object.freeze(O.WGS84),Object.freeze(N.WGS84);class T{constructor(t,e,r=0){if(isNaN(t)||null==t)throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e)||null==e)throw new TypeError(`invalid lon ‘${e}’`);if(isNaN(r)||null==r)throw new TypeError(`invalid height ‘${r}’`);this._lat=w.wrap90(Number(t)),this._lon=w.wrap180(Number(e)),this._height=Number(r)}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?w.wrap90(w.parse(t)):w.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?w.wrap90(w.parse(t)):w.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${t}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(t){if(this._lon=isNaN(t)?w.wrap180(w.parse(t)):w.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?w.wrap180(w.parse(t)):w.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?w.wrap180(w.parse(t)):w.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${t}’`)}get height(){return this._height}set height(t){if(this._height=Number(t),isNaN(this._height))throw new TypeError(`invalid height ‘${t}’`)}get datum(){return this._datum}set datum(t){this._datum=t}static get ellipsoids(){return O}static get datums(){return N}static parse(...t){if(0==t.length)throw new TypeError("invalid (empty) point");let e,r,n;if("object"==typeof t[0]&&(1==t.length||!isNaN(parseFloat(t[1])))){const o=t[0];if("Point"==o.type&&Array.isArray(o.coordinates)?([r,e,n]=o.coordinates,n=n||0):(null!=o.latitude&&(e=o.latitude),null!=o.lat&&(e=o.lat),null!=o.longitude&&(r=o.longitude),null!=o.lng&&(r=o.lng),null!=o.lon&&(r=o.lon),null!=o.height&&(n=o.height),e=w.wrap90(w.parse(e)),r=w.wrap180(w.parse(r))),null!=t[1]&&(n=t[1]),isNaN(e)||isNaN(r))throw new TypeError(`invalid point ‘${JSON.stringify(t[0])}’`)}if("string"==typeof t[0]&&2==t[0].split(",").length&&([e,r]=t[0].split(","),e=w.wrap90(w.parse(e)),r=w.wrap180(w.parse(r)),n=t[1]||0,isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t[0]}’`);if(null==e&&null==r&&([e,r]=t,e=w.wrap90(w.parse(e)),r=w.wrap180(w.parse(r)),n=t[2]||0,isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t.toString()}’`);return new this(e,r,n)}toCartesian(){const t=this.datum?this.datum.ellipsoid:this.referenceFrame?this.referenceFrame.ellipsoid:O.WGS84,e=this.lat.toRadians(),r=this.lon.toRadians(),n=this.height,{a:o,f:i}=t,a=Math.sin(e),s=Math.cos(e),u=Math.sin(r),c=Math.cos(r),l=2*i-i*i,f=o/Math.sqrt(1-l*a*a);return new j((f+n)*s*c,(f+n)*s*u,(f*(1-l)+n)*a)}equals(t){if(!(t instanceof T))throw new TypeError(`invalid point ‘${t}’`);return!(Math.abs(this.lat-t.lat)>Number.EPSILON||Math.abs(this.lon-t.lon)>Number.EPSILON||Math.abs(this.height-t.height)>Number.EPSILON||this.datum!=t.datum||this.referenceFrame!=t.referenceFrame||this.epoch!=t.epoch)}toString(t="d",e=void 0,r=null){if(!["d","dm","dms","n"].includes(t))throw new RangeError(`invalid format ‘${t}’`);const n=(this.height>=0?" +":" ")+this.height.toFixed(r)+"m";return"n"==t?(null==e&&(e=4),`${this.lat.toFixed(e)}, ${this.lon.toFixed(e)}${null==r?"":n}`):`${w.toLat(this.lat,t,e)}, ${w.toLon(this.lon,t,e)}${null==r?"":n}`}}class j extends E{constructor(t,e,r){super(t,e,r)}toLatLon(t=O.WGS84){if(!t||!t.a)throw new TypeError(`invalid ellipsoid ‘${t}’`);const{x:e,y:r,z:n}=this,{a:o,b:i,f:a}=t,s=2*a-a*a,u=s/(1-s),c=Math.sqrt(e*e+r*r),l=i*n/(o*c)*(1+u*i/Math.sqrt(c*c+n*n)),f=l/Math.sqrt(1+l*l),p=f/l,d=isNaN(p)?0:Math.atan2(n+u*i*f*f*f,c-s*o*p*p*p),h=Math.atan2(r,e),y=Math.sin(d),m=c*Math.cos(d)+n*y-o*o/(o/Math.sqrt(1-s*y*y));return new T(d.toDegrees(),h.toDegrees(),m)}toString(t=0){return`[${this.x.toFixed(t)},${this.y.toFixed(t)},${this.z.toFixed(t)}]`}}const x={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563},Airy1830:{a:6377563.396,b:6356256.909,f:1/299.3249646},AiryModified:{a:6377340.189,b:6356034.448,f:1/299.3249646},Bessel1841:{a:6377397.155,b:6356078.962818,f:1/299.1528128},Clarke1866:{a:6378206.4,b:6356583.8,f:1/294.978698214},Clarke1880IGN:{a:6378249.2,b:6356515,f:1/293.466021294},GRS80:{a:6378137,b:6356752.31414,f:1/298.257222101},Intl1924:{a:6378388,b:6356911.946,f:1/297},WGS72:{a:6378135,b:6356750.5,f:1/298.26}},_={ED50:{ellipsoid:x.Intl1924,transform:[89.5,93.8,123.1,-1.2,0,0,.156]},ETRS89:{ellipsoid:x.GRS80,transform:[0,0,0,0,0,0,0]},Irl1975:{ellipsoid:x.AiryModified,transform:[-482.53,130.596,-564.557,-8.15,1.042,.214,.631]},NAD27:{ellipsoid:x.Clarke1866,transform:[8,-160,-176,0,0,0,0]},NAD83:{ellipsoid:x.GRS80,transform:[.9956,-1.9103,-.5215,-62e-5,.025915,.009426,.011599]},NTF:{ellipsoid:x.Clarke1880IGN,transform:[168,60,-320,0,0,0,0]},OSGB36:{ellipsoid:x.Airy1830,transform:[-446.448,125.157,-542.06,20.4894,-.1502,-.247,-.8421]},Potsdam:{ellipsoid:x.Bessel1841,transform:[-582,-105,-414,-8.3,1.04,.35,-3.08]},TokyoJapan:{ellipsoid:x.Bessel1841,transform:[148,-507,-685,0,0,0,0]},WGS72:{ellipsoid:x.WGS72,transform:[0,0,-4.5,-.22,0,0,.554]},WGS84:{ellipsoid:x.WGS84,transform:[0,0,0,0,0,0,0]}};Object.keys(x).forEach(t=>Object.freeze(x[t])),Object.keys(_).forEach(t=>{Object.freeze(_[t]),Object.freeze(_[t].transform)});class P extends T{constructor(t,e,r=0,n=_.WGS84){if(!n||null==n.ellipsoid)throw new TypeError(`unrecognised datum ‘${n}’`);super(t,e,r),this._datum=n}get datum(){return this._datum}static get ellipsoids(){return x}static get datums(){return _}static parse(...t){let e=_.WGS84;if((4==t.length||3==t.length&&"object"==typeof t[2])&&(e=t.pop()),!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);const r=super.parse(...t);return r._datum=e,r}convertDatum(t){if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);return this.toCartesian().convertDatum(t).toLatLon()}toCartesian(){const t=super.toCartesian();return new k(t.x,t.y,t.z,this.datum)}}class k extends j{constructor(t,e,r,n=void 0){if(n&&null==n.ellipsoid)throw new TypeError(`unrecognised datum ‘${n}’`);super(t,e,r),n&&(this._datum=n)}get datum(){return this._datum}set datum(t){if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);this._datum=t}toLatLon(t=void 0){t&&(console.info("datum parameter to Cartesian_Datum.toLatLon is deprecated: set datum before calling toLatLon()"),this.datum=t);const e=this.datum||_.WGS84;if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);const r=super.toLatLon(e.ellipsoid);return new P(r.lat,r.lon,r.height,this.datum)}convertDatum(t){if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);if(!this.datum)throw new TypeError("cartesian coordinate has no datum");let e=null,r=null;null!=this.datum&&this.datum!=_.WGS84||(e=this,r=t.transform),t==_.WGS84&&(e=this,r=this.datum.transform.map(t=>-t)),null==r&&(e=this.convertDatum(_.WGS84),r=t.transform);const n=e.applyTransform(r);return n.datum=t,n}applyTransform(t){const{x:e,y:r,z:n}=this,o=t[0],i=t[1],a=t[2],s=t[3]/1e6+1,u=(t[4]/3600).toRadians(),c=(t[5]/3600).toRadians(),l=(t[6]/3600).toRadians();return new k(o+e*s-r*l+n*c,i+e*l+r*s-n*u,a-e*c+r*u+n*s)}}const M={trueOrigin:{lat:49,lon:-2},falseOrigin:{easting:-4e5,northing:1e5},scaleFactor:.9996012717,ellipsoid:P.ellipsoids.Airy1830};class D{constructor(t,e){if(this.easting=Number(t),this.northing=Number(e),isNaN(t)||this.easting<0||this.easting>7e5)throw new RangeError(`invalid easting ‘${t}’`);if(isNaN(e)||this.northing<0||this.northing>13e5)throw new RangeError(`invalid northing ‘${e}’`)}toLatLon(t=P.datums.WGS84){const{easting:e,northing:r}=this,{a:n,b:o}=M.ellipsoid,i=M.trueOrigin.lat.toRadians(),a=M.trueOrigin.lon.toRadians(),s=-M.falseOrigin.easting,u=-M.falseOrigin.northing,c=M.scaleFactor,l=1-o*o/(n*n),f=(n-o)/(n+o),p=f*f,d=f*f*f;let h=i,y=0;do{h=(r-u-y)/(n*c)+h,y=o*c*((1+f+5/4*p+5/4*d)*(h-i)-(3*f+3*f*f+21/8*d)*Math.sin(h-i)*Math.cos(h+i)+(15/8*p+15/8*d)*Math.sin(2*(h-i))*Math.cos(2*(h+i))-35/24*d*Math.sin(3*(h-i))*Math.cos(3*(h+i)))}while(Math.abs(r-u-y)>=1e-5);const m=Math.cos(h),b=Math.sin(h),g=n*c/Math.sqrt(1-l*b*b),v=n*c*(1-l)/Math.pow(1-l*b*b,1.5),w=g/v-1,S=Math.tan(h),E=S*S,O=E*E,N=1/m,T=g*g*g,j=T*g*g,x=e-s,_=x*x,k=_*x,D=_*_,A=k*_;h=h-S/(2*v*g)*_+S/(24*v*T)*(5+3*E+w-9*E*w)*D-S/(720*v*j)*(61+90*E+45*O)*(D*_);const R=a+N/g*x-N/(6*T)*(g/v+2*E)*k+N/(120*j)*(5+28*E+24*O)*A-N/(j*g*g*5040)*(61+662*E+1320*O+O*E*720)*(A*_);let I=new G(h.toDegrees(),R.toDegrees(),0,P.datums.OSGB36);return t!=P.datums.OSGB36&&(I=I.convertDatum(t),I=new G(I.lat,I.lon,I.height,I.datum)),I}static parse(t){let e=(t=String(t).trim()).match(/^(\d+),\s*(\d+)$/);if(e)return new D(e[1],e[2]);if(e=t.match(/^[HNST][ABCDEFGHJKLMNOPQRSTUVWXYZ]\s*[0-9]+\s*[0-9]+$/i),!e)throw new Error(`invalid grid reference ‘${t}’`);let r=t.toUpperCase().charCodeAt(0)-"A".charCodeAt(0),n=t.toUpperCase().charCodeAt(1)-"A".charCodeAt(0);r>7&&r--,n>7&&n--;const o=(r-2)%5*5+n%5,i=19-5*Math.floor(r/5)-Math.floor(n/5);let a=t.slice(2).trim().split(/\s+/);if(1==a.length&&(a=[a[0].slice(0,a[0].length/2),a[0].slice(a[0].length/2)]),a[0].length!=a[1].length)throw new Error(`invalid grid reference ‘${t}’`);a[0]=a[0].padEnd(5,"0"),a[1]=a[1].padEnd(5,"0");const s=o+a[0],u=i+a[1];return new D(s,u)}toString(t=10){if(![0,2,4,6,8,10,12,14,16].includes(Number(t)))throw new RangeError(`invalid precision ‘${t}’`);let{easting:e,northing:r}=this;if(0==t){const t={useGrouping:!1,minimumIntegerDigits:6,maximumFractionDigits:3};return`${e.toLocaleString("en",t)},${r.toLocaleString("en",t)}`}const n=Math.floor(e/1e5),o=Math.floor(r/1e5);let i=19-o-(19-o)%5+Math.floor((n+10)/5),a=5*(19-o)%25+n%5;i>7&&i++,a>7&&a++;const s=String.fromCharCode(i+"A".charCodeAt(0),a+"A".charCodeAt(0));return e=Math.floor(e%1e5/Math.pow(10,5-t/2)),r=Math.floor(r%1e5/Math.pow(10,5-t/2)),e=e.toString().padStart(t/2,"0"),r=r.toString().padStart(t/2,"0"),`${s} ${e} ${r}`}}class G extends P{toOsGrid(){const t=this.datum==P.datums.OSGB36?this:this.convertDatum(P.datums.OSGB36),e=t.lat.toRadians(),r=t.lon.toRadians(),{a:n,b:o}=M.ellipsoid,i=M.trueOrigin.lat.toRadians(),a=M.trueOrigin.lon.toRadians(),s=-M.falseOrigin.easting,u=-M.falseOrigin.northing,c=M.scaleFactor,l=1-o*o/(n*n),f=(n-o)/(n+o),p=f*f,d=f*f*f,h=Math.cos(e),y=Math.sin(e),m=n*c/Math.sqrt(1-l*y*y),b=n*c*(1-l)/Math.pow(1-l*y*y,1.5),g=m/b-1,v=o*c*((1+f+5/4*p+5/4*d)*(e-i)-(3*f+3*f*f+21/8*d)*Math.sin(e-i)*Math.cos(e+i)+(15/8*p+15/8*d)*Math.sin(2*(e-i))*Math.cos(2*(e+i))-35/24*d*Math.sin(3*(e-i))*Math.cos(3*(e+i))),w=h*h*h,S=w*h*h,E=Math.tan(e)*Math.tan(e),O=E*E,N=r-a,T=N*N,j=T*N,x=j*N,_=x*N;let k=v+u+m/2*y*h*T+m/24*y*w*(5-E+9*g)*x+m/720*y*S*(61-58*E+O)*(_*N),G=s+m*h*N+m/6*w*(m/b-E)*j+m/120*S*(5-18*E+O+14*g-58*E*g)*_;k=Number(k.toFixed(3)),G=Number(G.toFixed(3));try{return new D(G,k)}catch(e){throw new Error(`${e.message} from (${t.lat.toFixed(6)},${t.lon.toFixed(6)}).toOsGrid()`)}}convertDatum(t){const e=super.convertDatum(t);return new G(e.lat,e.lon,e.height,e.datum)}}function A(t){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},A(t)}var R;function I(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function C(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?I(Object(r),!0).forEach(function(e){L(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):I(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function L(t,e,r){return(e=function(t){var e=function(t){if("object"!=A(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=A(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==A(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var F=500,$=function(t){var e=t.GAZETTEER_ENTRY,r="eng"===e.NAME2_LANG?e.NAME2:e.NAME1;return t.GAZETTEER_ENTRY.NAME1=r,t.GAZETTEER_ENTRY.NAME1_LANG="eng",t},W=function(t,e){var r,n,o=e.replace(/\s+/g,"").split("").join(String.raw(R||(r=["s*"],(n=["\\s*"])||(n=r.slice(0)),R=Object.freeze(Object.defineProperties(r,{raw:{value:Object.freeze(n)}}))))),i=new RegExp("(".concat(o,")"),"i");return t.replace(i,"<mark>$1</mark>")},U=function(t,e){var r,n,o,i,a=e.MBR_XMIN,s=e.MBR_YMIN,u=e.MBR_XMAX,c=e.MBR_YMAX,l=e.GEOMETRY_X,f=e.GEOMETRY_Y;if(null==a?(r=l-F,n=f-F,o=l+F,i=f+F):(r=a,n=s,o=u,i=c),"EPSG:27700"===t)return[r,n,o,i];if("EPSG:4326"===t){var p=new D(r,n).toLatLon(),d=new D(o,i).toLatLon();return[p.lon,p.lat,d.lon,d.lat].map(function(t){return Math.round(1e6*t)/1e6})}throw new Error("Unsupported CRS: ".concat(t))},B=function(t,e){var r=e.GEOMETRY_X,n=e.GEOMETRY_Y;if("EPSG:27700"===t)return[r,n];if("EPSG:4326"===t){var o=new D(r,n).toLatLon();return[Math.round(1e6*o.lon)/1e6,Math.round(1e6*o.lat)/1e6]}throw new Error("Unsupported CRS: ".concat(t))};function z(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Y(t){return function(t){if(Array.isArray(t))return H(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||q(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function V(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=q(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function q(t,e){if(t){if("string"==typeof t)return H(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?H(t,e):void 0}}function H(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function K(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,c=Object.create(u.prototype);return Z(c,"_invoke",function(r,n,o){var i,s,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return i=e,s=0,u=t,p.n=r,a}};function d(r,n){for(s=r,u=n,e=0;!f&&c&&!o&&e<l.length;e++){var o,i=l[e],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,u=h;(e=s<2?t:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(c=2,i){if(s||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,s<2&&(s=0)}else 1===s&&(e=i.return)&&e.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((e=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(e){i=t,s=1,u=e}finally{c=1}}return{value:e,done:f}}}(r,o,i),!0),c}var a={};function s(){}function u(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(Z(e={},n,function(){return this}),e),f=c.prototype=s.prototype=Object.create(l);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,Z(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=c,Z(f,"constructor",c),Z(c,"constructor",u),u.displayName="GeneratorFunction",Z(c,o,"GeneratorFunction"),Z(f),Z(f,o,"Generator"),Z(f,n,function(){return this}),Z(f,"toString",function(){return"[object Generator]"}),(K=function(){return{w:i,m:p}})()}function Z(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Z=function(t,e,r,n){function i(e,r){Z(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},Z(t,e,r,n)}function X(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function J(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){X(i,n,o,a,s,"next",t)}function s(t){X(i,n,o,a,s,"throw",t)}a(void 0)})}}var Q=function(t){return t.replaceAll(/[^a-zA-Z0-9\s\-.,]/g,"").trim()},tt=function(t){var e=t.url,r=t.options;return new Request(e,r)},et=function(){var t=J(K().m(function t(e,r,n){var o,i,a,s;return K().w(function(t){for(;;)switch(t.n){case 0:if(i={url:null===(o=e.urlTemplate)||void 0===o?void 0:o.replace("{query}",encodeURIComponent(r)),options:{method:"GET"}},!e.buildRequest){t.n=1;break}return a=e.buildRequest(r,function(){return i}),t.a(2,a instanceof Request?a:tt(a));case 1:if(!n){t.n=3;break}return s=tt,t.n=2,n(i,r);case 2:return t.a(2,s(t.v));case 3:return t.a(2,tt(i))}},t)}));return function(e,r,n){return t.apply(this,arguments)}}(),rt=function(){var t=J(K().m(function t(e,r,n){var o,i,a;return K().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,fetch(r);case 1:if((o=t.v).ok){t.n=2;break}return console.error("Fetch error for ".concat(e.label||"dataset",": ").concat(o.status)),t.a(2,{error:!0});case 2:return t.n=3,o.json();case 3:return i=t.v,t.a(2,e.parseResults(i,n));case 4:return t.p=4,a=t.v,console.error("Network error for ".concat(e.label||"dataset",":"),a),t.a(2,{error:!0})}},t,null,[[0,4]])}));return function(e,r,n){return t.apply(this,arguments)}}(),nt=function(){var t=J(K().m(function t(e,r,n,o){var i,a,s,u,c,l,f,p,d,h;return K().w(function(t){for(;;)switch(t.p=t.n){case 0:i=Q(e),a=r.filter(function(t){var r=!t.includeRegex||t.includeRegex.test(e),n=!!t.excludeRegex&&t.excludeRegex.test(i);return r&&!n}),s=[],u=!1,c=V(a),t.p=1,c.s();case 2:if((l=c.n()).done){t.n=6;break}return f=l.value,t.n=3,et(f,i,o);case 3:return p=t.v,t.n=4,rt(f,p,i);case 4:if(null!=(d=t.v)&&d.error?u=!0:null!=d&&d.length&&(s=[].concat(Y(s),Y(d))),!f.exclusive||!s.length){t.n=5;break}return t.a(3,6);case 5:t.n=2;break;case 6:t.n=8;break;case 7:t.p=7,h=t.v,c.e(h);case 8:return t.p=8,c.f(),t.f(8);case 9:return n({type:"UPDATE_SUGGESTIONS",payload:{results:s,hasError:u}}),t.a(2,{results:s,sanitisedValue:i})}},t,null,[[1,7,8,9]])}));return function(e,r,n,o){return t.apply(this,arguments)}}(),ot=r(604);function it(t){return it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},it(t)}function at(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function st(t,e,r){return(e=function(t){var e=function(t){if("object"!=it(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=it(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==it(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var ut=function(t){var e=t.suggestion,r=t.query,n=t.services,o=t.mapProvider,i=t.markers,a=t.showMarker,s=t.markerOptions;n.focusMap({message:ot.cr.replace("{query}",r)}),function(t){var e=t.bounds,r=t.point,n=t.markers,o=t.showMarker,i=t.markerOptions;t.mapProvider.fitToBounds(e),o&&n.add("search",r,i)}({mapProvider:o,bounds:e.bounds,point:e.point,markers:i,showMarker:a,markerOptions:s}),n.eventBus.emit("search:match",function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?at(Object(r),!0).forEach(function(e){st(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):at(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({query:r},e))};function ct(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,c=Object.create(u.prototype);return lt(c,"_invoke",function(r,n,o){var i,s,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return i=e,s=0,u=t,p.n=r,a}};function d(r,n){for(s=r,u=n,e=0;!f&&c&&!o&&e<l.length;e++){var o,i=l[e],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,u=h;(e=s<2?t:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(c=2,i){if(s||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,s<2&&(s=0)}else 1===s&&(e=i.return)&&e.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((e=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(e){i=t,s=1,u=e}finally{c=1}}return{value:e,done:f}}}(r,o,i),!0),c}var a={};function s(){}function u(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(lt(e={},n,function(){return this}),e),f=c.prototype=s.prototype=Object.create(l);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,lt(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=c,lt(f,"constructor",c),lt(c,"constructor",u),u.displayName="GeneratorFunction",lt(c,o,"GeneratorFunction"),lt(f),lt(f,o,"Generator"),lt(f,n,function(){return this}),lt(f,"toString",function(){return"[object Generator]"}),(ct=function(){return{w:i,m:p}})()}function lt(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}lt=function(t,e,r,n){function i(e,r){lt(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},lt(t,e,r,n)}function ft(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}var pt=function(t){var e;return(null==t||null===(e=t.current)||void 0===e?void 0:e.search)||document.querySelector(".im-c-map-button--search")},dt=function(t){var e=t.dispatch,r=t.services,n=t.searchContainerRef,o=t.mapProvider,i=t.markers,a=t.datasets,s=t.transformRequest,u=t.showMarker,c=t.markerOptions,l="";return{handleTabOut:function(t,e){!function(t,e,r){var n,o=pt(e);if("Tab"===t.key&&o){var i=Array.from(document.querySelectorAll("input, button, select, textarea, a[href], [tabindex]")).filter(function(t){return t.tabIndex>=0&&!t.disabled&&t.getClientRects().length>0}),a=i[i.indexOf(t.target)+(t.shiftKey?-1:1)];if(null===(n=r.current)||void 0===n||!n.contains(a)){var s=t.shiftKey?o:i[i.indexOf(o)+1];s&&(t.preventDefault(),s.focus())}}}(t,e,n)},handleCloseClick:function(t,n){var o,a,s;e({type:"TOGGLE_EXPANDED",payload:!1}),e({type:"UPDATE_SUGGESTIONS",payload:{results:[],hasError:!1}}),e({type:"SET_VALUE",payload:""}),o=null==n?void 0:n.buttonRefs,a=0,s=function(){var t=pt(o);t&&(t.focus(),document.activeElement===t)||a<30&&(a+=1,requestAnimationFrame(s))},requestAnimationFrame(s),i.remove("search"),r.eventBus.emit("search:clear"),r.eventBus.emit("search:close")},handleSubmit:function(t,n,f){return(p=ct().m(function p(){var d,h,y,m,b,g,v,w,S;return ct().w(function(p){for(;;)switch(p.n){case 0:if(t.preventDefault(),d=f.suggestions,h=f.selectedIndex,y=f.value,m=null==y?void 0:y.trim(),e({type:"SET_SELECTED",payload:-1}),e({type:"HIDE_SUGGESTIONS"}),!(h>=0)){p.n=1;break}return b=d[h],e({type:"SET_VALUE",payload:b.text}),ut({suggestion:b,query:b.text,services:r,mapProvider:o,markers:i,showMarker:u,markerOptions:c}),p.a(2);case 1:if(!((null==m?void 0:m.length)<ot.zY.minSearchLength)){p.n=2;break}return p.a(2);case 2:if(g=d,d.length&&m===l){p.n=4;break}return p.n=3,nt(m,a,e,s);case 3:v=p.v,w=v.results,S=v.sanitisedValue,g=w,l=S;case 4:g.length&&("mobile"===n.breakpoint&&(e({type:"TOGGLE_EXPANDED",payload:!1}),r.eventBus.emit("search:close")),ut({suggestion:g[0],query:y,services:r,mapProvider:o,markers:i,showMarker:u,markerOptions:c}));case 5:return p.a(2)}},p)}),function(){var t=this,e=arguments;return new Promise(function(r,n){var o=p.apply(t,e);function i(t){ft(o,r,n,i,a,"next",t)}function a(t){ft(o,r,n,i,a,"throw",t)}i(void 0)})})();var p}}};function ht(t){return ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ht(t)}function yt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function mt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?yt(Object(r),!0).forEach(function(e){bt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):yt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function bt(t,e,r){return(e=function(t){var e=function(t){if("object"!=ht(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ht(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ht(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gt(t){return gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gt(t)}var vt=["marker"];function wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function St(t,e,r){return(e=function(t){var e=function(t){if("object"!=gt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=gt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==gt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Et(t){return Et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Et(t)}var Ot,Nt,Tt,jt={reducer:{initialState:{isExpanded:!1,hasKeyboardFocusWithin:!1,value:"",suggestions:[],areSuggestionsVisible:!1,hasFetchedSuggestions:!1,hasSearchError:!1,selectedIndex:-1},actions:s},applicationModes:(Ot={},Nt=ot.V3,Tt={},(Nt=function(t){var e=function(t){if("object"!=Et(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Et(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Et(e)?e:e+""}(Nt))in Ot?Object.defineProperty(Ot,Nt,{value:Tt,enumerable:!0,configurable:!0,writable:!0}):Ot[Nt]=Tt,Ot),buttons:[{id:"search",label:"Search",iconId:"search",ariaControls:function(t){var e=t.appConfig;return"".concat(e.id,"-search-form")},expandedWhen:function(t){return t.pluginState.isExpanded},excludeWhen:function(t){var e=t.pluginConfig;return Boolean(e.expanded)},keepFocus:!0,onClick:function(t,e){var r=e.pluginState,n=e.services;r.dispatch({type:"TOGGLE_EXPANDED",payload:!0}),n.eventBus.emit("search:open")},mobile:{slot:"top-right",showLabel:!1},tablet:{slot:"top-left",showLabel:!1},desktop:{slot:"top-left",showLabel:!1}}],controls:[{id:"search",mobile:{slot:"header"},tablet:{slot:"top-left"},desktop:{slot:"top-left"},render:function(t){var e=t.appConfig,r=t.iconRegistry,n=t.pluginState,o=t.pluginConfig,i=t.appState,a=t.mapState,s=t.services,l=t.mapProvider,f=t.setApplicationMode,p=t.clearApplicationMode,d=e.id,h=i.interfaceType,g=o.expanded,v=o.customDatasets,w=o.osNamesURL,S=o.regions,E=o.maxSuggestions,O=n.dispatch,N=n.isExpanded,T=n.areSuggestionsVisible,j=n.suggestions,x=r.close,_=r.search,P=(0,u.useRef)(null),k=(0,u.useRef)(null),M=i.layoutRefs.viewportRef,D=function(t){var e=t.customDatasets,r=void 0===e?[]:e,n=t.osNamesURL,o=t.crs,i=t.regions,a=void 0===i?["england","scotland","wales"]:i,s=t.maxSuggestions;return n?[].concat([{name:"osNames",urlTemplate:n,parseResults:function(t,e){return function(t,e,r,n){var o,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:8;if(!t||t.error||0===(null===(o=t.header)||void 0===o?void 0:o.totalresults))return[];var a=t.results;return a=function(t,e){var r=e.toLowerCase().replace(/,/g,"").split(" ");return t.map($).filter(function(t){return r.some(function(r){return t.GAZETTEER_ENTRY.NAME1.toLowerCase().includes(r)||(n=(n=e).replace(/\s/g,""),/^(([A-Z]{1,2}\d[A-Z\d]?|ASCN|STHL|TDCU|BBND|[BFS]IQQ|PCRN|TKCA) ?\d[A-Z]{2}|BFPO ?\d{1,4}|(KY\d|MSR|VG|AI)[ -]?\d{4}|[A-Z]{2} ?\d{2}|GE ?CX|GIR ?0A{2}|SAN ?TA1)$/i.test(n));var n})})}(a,e),a=function(t,e){return t.filter(function(t){var r,n=null==t||null===(r=t.GAZETTEER_ENTRY)||void 0===r||null===(r=r.COUNTRY)||void 0===r?void 0:r.toLowerCase();return n&&e.includes(n)})}(a=function(t){return Array.from(new Map(t.map(function(t){return[t.GAZETTEER_ENTRY.ID,t]})).values())}(a),r),(a=a.slice(0,i)).map(function(t){return C(C({id:t.GAZETTEER_ENTRY.ID,bounds:U(n,t.GAZETTEER_ENTRY),point:B(n,t.GAZETTEER_ENTRY)},function(t,e){var r=e.NAME1,n=e.COUNTY_UNITARY,o=e.DISTRICT_BOROUGH,i=e.POSTCODE_DISTRICT,a=e.LOCAL_TYPE,s="".concat(["City","Postcode"].includes(a)?"":i+", ").concat("City"===a?"":n||o),u="".concat(r).concat(s?", "+s:"");return{text:u,marked:W(u,t)}}(e,t.GAZETTEER_ENTRY)),{},{type:"os-names"})})}(t,e,a,o,s)},includeRegex:/[a-zA-Z0-9]/,excludeRegex:/^(?:[a-z]{2}\s*(?:\d{3}\s*\d{3}|\d{4}\s*\d{4}|\d{5}\s*\d{5})|\d+\s*,?\s*\d+)$/i}],function(t){return function(t){if(Array.isArray(t))return z(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return z(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?z(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(r)):r}({customDatasets:v,osNamesURL:w,regions:S,maxSuggestions:E,crs:l.crs}),G=(0,u.useRef)(null);if(!G.current){var A=o.marker,R=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],-1===e.indexOf(r)&&{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(o,vt);G.current=function(t){var e,r,n,o=t.dispatch,i=t.searchContainerRef,a=(e=function(e){return nt(e,t.datasets,o,t.transformRequest)},r=null,n=function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];clearTimeout(r),r=setTimeout(function(){e.apply(void 0,n)},350)},n.cancel=function(){r&&(clearTimeout(r),r=null)},n),s=dt(t),u=function(t){var e=t.dispatch,r=t.debouncedFetchSuggestions;return{handleInputClick:function(){e({type:"SHOW_SUGGESTIONS"})},handleInputFocus:function(t){e({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:"keyboard"===t})},handleInputBlur:function(t){e({type:"INPUT_BLUR",payload:t})},handleInputChange:function(t,n){var o=t.target.value;if(e({type:"SET_VALUE",payload:o}),(null==n?void 0:n.selectedIndex)>=0&&(e({type:"SET_SELECTED",payload:-1}),e({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:!0})),o.length<ot.zY.minSearchLength)return r.cancel(),e({type:"UPDATE_SUGGESTIONS",payload:{results:[],hasError:!1}}),void e({type:"HIDE_SUGGESTIONS"});e({type:"SHOW_SUGGESTIONS"}),r(o)}}}(mt(mt({},t),{},{debouncedFetchSuggestions:a})),c=function(t){var e=t.dispatch,r=t.services,n=t.mapProvider,o=t.markers,i=t.showMarker,a=t.markerOptions,s=function(t,e){var r;return e>=0?"".concat(null===(r=t[e])||void 0===r?void 0:r.text,". ").concat(e+1," of ").concat(t.length," is highlighted"):"".concat(t.length," suggestions available")};return{handleSuggestionClick:function(t,s){e({type:"SET_VALUE",payload:t.text}),e({type:"HIDE_SUGGESTIONS"}),e({type:"SET_SELECTED",payload:-1}),"mobile"===s.breakpoint&&(e({type:"TOGGLE_EXPANDED",payload:!1}),r.eventBus.emit("search:close")),ut({suggestion:t,query:t.text,services:r,mapProvider:n,markers:o,showMarker:i,markerOptions:a})},handleInputKeyDown:function(t,n){var o=n.suggestions,i=n.selectedIndex;switch(t.key){case"ArrowDown":if(null==o||!o.length)return;if(t.preventDefault(),i<o.length-1){var a=i+1;r.announce(s(o,a)),e({type:"SET_SELECTED",payload:a}),e({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:!1})}break;case"ArrowUp":if(null==o||!o.length)return;t.preventDefault();var u=i>0?i-1:-1;r.announce(s(o,u)),e({type:"SET_SELECTED",payload:u}),e({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:u<0});break;case"Escape":t.preventDefault(),e({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:!0}),e({type:"HIDE_SUGGESTIONS"}),e({type:"SET_SELECTED",payload:-1})}}}}(t);return mt(mt(mt(mt({},s),u),c),{},{handleOutside:function(e){i.current.contains(e.target)||(o({type:"TOGGLE_EXPANDED",payload:!1}),t.services.eventBus.emit("search:close"))}})}(function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?wt(Object(r),!0).forEach(function(e){St(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({dispatch:O,datasets:D,services:s,mapProvider:l,searchContainerRef:P,markers:a.markers,markerOptions:A},R))}var I=G.current,L=N||!!(g&&T&&j.length);(0,u.useEffect)(function(){var t;N&&(null===(t=k.current)||void 0===t||t.focus())},[N]),(0,u.useLayoutEffect)(function(){if(N)return f(ot.V3),function(){return p(ot.V3)}},[N]),(0,u.useLayoutEffect)(function(){if(L)return M.current.style.pointerEvents="none",document.addEventListener("focusin",I.handleOutside),document.addEventListener("pointerdown",I.handleOutside),function(){M.current.style.pointerEvents="auto",document.removeEventListener("focusin",I.handleOutside),document.removeEventListener("pointerdown",I.handleOutside)}},[N,h,T,j]);var F=g||N;return(0,c.jsx)("div",{className:"im-c-search".concat(F?"":" im-c-search--collapsed"),ref:P,onKeyDown:function(t){return I.handleTabOut(t,i.buttonRefs)},children:(0,c.jsxs)(y,{id:d,pluginState:n,pluginConfig:o,appState:i,inputRef:k,events:I,services:s,children:[(0,c.jsx)(m,{defaultExpanded:g,onClick:function(t){return I.handleCloseClick(t,i)},closeIcon:x}),(0,c.jsx)(b,{defaultExpanded:g,submitIcon:_})]})})}}],icons:[{id:"search",svgContent:'<path d="m21 21-4.34-4.34"></path><circle cx="11" cy="11" r="8"></circle>'}]}}}]);
|
|
2
|
+
"use strict";(Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap=Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap||[]).push([[254],{523:function(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){a(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function a(t,e,r){return(e=function(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}r.r(e),r.d(e,{manifest:function(){return Mt}});var s={TOGGLE_EXPANDED:function(t,e){return i(i({},t),{},{isExpanded:e,areSuggestionsVisible:e,hasFetchedSuggestions:!1,hasSearchError:!1})},SET_KEYBOARD_FOCUS_WITHIN:function(t,e){return i(i({},t),{},{hasKeyboardFocusWithin:e,areSuggestionsVisible:!0})},INPUT_BLUR:function(t,e){return i(i({},t),{},{hasKeyboardFocusWithin:!1,areSuggestionsVisible:t.areSuggestionsVisible&&"keyboard"!==e,selectedIndex:-1})},SET_VALUE:function(t,e){return i(i({},t),{},{value:e})},UPDATE_SUGGESTIONS:function(t,e){return i(i({},t),{},{suggestions:e.results,hasFetchedSuggestions:!0,hasSearchError:e.hasError})},SHOW_SUGGESTIONS:function(t){return i(i({},t),{},{areSuggestionsVisible:!0,hasFetchedSuggestions:!1,hasSearchError:!1})},HIDE_SUGGESTIONS:function(t){return i(i({},t),{},{areSuggestionsVisible:!1,hasFetchedSuggestions:!1,hasSearchError:!1})},SET_SELECTED:function(t,e){return i(i({},t),{},{selectedIndex:e,areSuggestionsVisible:e>=0})}},u=r(738),c=r(287),l=/^<\/?mark>$/i,f=function(){var t=!1,e=0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(/(<\/?mark>)/i).flatMap(function(r){var n=e;return e+=r.length,l.test(r)?(t="/"!==r[1],[]):r?[t?(0,c.jsx)("mark",{children:r},n):r]:[]})},p=function(t){var e=t.id,r=t.pluginState,n=t.handleSuggestionClick;return(0,c.jsx)("ul",{id:"".concat(e,"-search-suggestions"),role:"listbox","aria-labelledby":"".concat(e,"-search-input"),className:"im-c-search-suggestions",style:r.areSuggestionsVisible&&r.suggestions.length?void 0:{display:"none"},onMouseDown:function(t){return t.preventDefault()},children:r.suggestions.map(function(t,o){return(0,c.jsx)("li",{id:"".concat(e,"-search-suggestion-").concat(o),className:"im-c-search-suggestions__item",role:"option","aria-selected":r.selectedIndex===o,"aria-setsize":r.suggestions.length,"aria-posinset":o+1,onClick:function(){return n(t)},children:(0,c.jsx)("span",{className:"im-c-search-suggestions__label",children:f(t.marked)})},"".concat(e,"-").concat(t.type,"-").concat(t.id))})})};function d(t){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}function h(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function y(t,e,r){return(e=function(t){var e=function(t){if("object"!=d(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=d(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==d(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var m=function(t,e,r){return function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?h(Object(r),!0).forEach(function(e){y(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({display:t.expanded||e.isExpanded?"flex":void 0},"mobile"!==r.breakpoint&&(null==t?void 0:t.width)&&{width:t.width})},b=function(t){var e=t.id,r=t.pluginState,n=t.pluginConfig,o=t.appState,i=t.inputRef,a=t.events,s=t.services,l=t.children,f=r.areSuggestionsVisible,d=r.hasFetchedSuggestions,h=r.hasSearchError,y=r.suggestions,b=void 0===y?[]:y,g=n.noResultsMessage,v=n.searchErrorMessage;(0,u.useEffect)(function(){f&&d&&s.announce(function(t,e,r,n){if(e)return r;if(0===t)return n;var o=1===t?"result":"results";return"".concat(t," ").concat(o," available")}(b.length,h,v,g))},[b,d]);var S=["im-c-search-form",n.expanded&&"im-c-search-form--default-expanded","im-c-panel"].filter(Boolean).join(" "),w=f&&d&&(h||!b.length);return(0,c.jsxs)("form",{id:"".concat(e,"-search-form"),role:"search",className:S,style:m(n,r,o),"aria-controls":"".concat(e,"-viewport"),onSubmit:function(t){return a.handleSubmit(t,o,r)},children:[(0,c.jsx)("button",{type:"submit",style:{display:"none"},"aria-hidden":"true",tabIndex:-1,children:"Submit"}),(0,c.jsxs)("div",{className:"im-c-search__input-container".concat(r.hasKeyboardFocusWithin?" im-c-search__input-container--keyboard-focus-within":""),children:[(0,c.jsx)("label",{htmlFor:"".concat(e,"-search-input"),className:"im-u-visually-hidden",children:n.placeholder}),(0,c.jsx)("input",{id:"".concat(e,"-search-input"),className:"im-c-search__input",type:"search",role:"combobox","aria-expanded":r.suggestionsVisible,"aria-controls":"".concat(e,"-search-suggestions"),"aria-activedescendant":r.selectedIndex>=0?"".concat(e,"-search-suggestion-").concat(r.selectedIndex):void 0,"aria-describedby":r.value?void 0:"".concat(e,"-search-hint"),"aria-autocomplete":"list",autoComplete:"off",placeholder:n.placeholder,name:"".concat(e,"-search-input"),spellCheck:!1,enterKeyHint:"search",value:r.value,onClick:a.handleInputClick,onChange:function(t){return a.handleInputChange(t,r)},onFocus:function(){return a.handleInputFocus(o.interfaceType)},onBlur:function(){return a.handleInputBlur(o.interfaceType)},onKeyDown:function(t){return a.handleInputKeyDown(t,r)},ref:i}),(0,c.jsx)("span",{id:"".concat(e,"-search-hint"),className:"im-c-search__hint",children:"When search results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures."}),l]}),w&&(0,c.jsx)("div",{className:"im-c-search__status","aria-hidden":"true",children:h?v:g}),(0,c.jsx)(p,{id:e,appState:o,pluginState:r,handleSuggestionClick:function(t){return a.handleSuggestionClick(t,o)}})]})},g=function(t){var e=t.defaultExpanded,r=t.onClick,n=t.closeIcon;return(0,c.jsx)("button",{"aria-label":"Close search",className:"im-c-map-button im-c-search-close-button",type:"button",onClick:r,style:e?{display:"none"}:void 0,children:n&&(0,c.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:n}})})},v=function(t){var e=t.defaultExpanded,r=t.submitIcon;return(0,c.jsx)("button",{"aria-label":"Search",className:"im-c-map-button im-c-search-submit-button",type:"submit",style:e?void 0:{display:"none"},children:r&&(0,c.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:r}})})};let S=" ";class w{static get separator(){return S}static set separator(t){S=t}static parse(t){if(!isNaN(parseFloat(t))&&isFinite(t))return Number(t);const e=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==e[e.length-1]&&e.splice(e.length-1),""==e)return NaN;let r=null;switch(e.length){case 3:r=e[0]/1+e[1]/60+e[2]/3600;break;case 2:r=e[0]/1+e[1]/60;break;case 1:r=e[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(r=-r),Number(r)}static toDms(t,e="d",r=void 0){if(isNaN(t))return null;if("string"==typeof t&&""==t.trim())return null;if("boolean"==typeof t)return null;if(t==1/0)return null;if(null==t)return null;if(void 0===r)switch(e){case"d":case"deg":r=4;break;case"dm":case"deg+min":r=2;break;case"dms":case"deg+min+sec":r=0;break;default:e="d",r=4}t=Math.abs(t);let n=null,o=null,i=null,a=null;switch(e){default:case"d":case"deg":o=t.toFixed(r),o<100&&(o="0"+o),o<10&&(o="0"+o),n=o+"°";break;case"dm":case"deg+min":o=Math.floor(t),i=(60*t%60).toFixed(r),60==i&&(i=(0).toFixed(r),o++),o=("000"+o).slice(-3),i<10&&(i="0"+i),n=o+"°"+w.separator+i+"′";break;case"dms":case"deg+min+sec":o=Math.floor(t),i=Math.floor(3600*t/60)%60,a=(3600*t%60).toFixed(r),60==a&&(a=(0).toFixed(r),i++),60==i&&(i=0,o++),o=("000"+o).slice(-3),i=("00"+i).slice(-2),a<10&&(a="0"+a),n=o+"°"+w.separator+i+"′"+w.separator+a+"″"}return n}static toLat(t,e,r){const n=w.toDms(w.wrap90(t),e,r);return null===n?"–":n.slice(1)+w.separator+(t<0?"S":"N")}static toLon(t,e,r){const n=w.toDms(w.wrap180(t),e,r);return null===n?"–":n+w.separator+(t<0?"W":"E")}static toBrng(t,e,r){const n=w.toDms(w.wrap360(t),e,r);return null===n?"–":n.replace("360","0")}static fromLocale(t){const e=123456.789.toLocaleString(),r={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(r.thousands,"⁜").replace(r.decimal,".").replace("⁜",",")}static toLocale(t){const e=123456.789.toLocaleString(),r={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(/,([0-9])/,"⁜$1").replace(".",r.decimal).replace("⁜",r.thousands)}static compassPoint(t,e=3){if(![1,2,3].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);t=w.wrap360(t);const r=4*2**(e-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*r/360)%r*16/r]}static wrap90(t){if(-90<=t&&t<=90)return t;const e=t;return 1*Math.abs(((e-90)%360+360)%360-180)-90}static wrap180(t){if(-180<=t&&t<=180)return t;const e=360;return((360*t/e-180)%e+e)%e-180}static wrap360(t){if(0<=t&&t<360)return t;const e=360;return(360*t/e%e+e)%e}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};var E=w;class O{constructor(t,e,r){if(isNaN(t)||isNaN(e)||isNaN(r))throw new TypeError(`invalid vector [${t},${e},${r}]`);this.x=Number(t),this.y=Number(e),this.z=Number(r)}get length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}plus(t){if(!(t instanceof O))throw new TypeError("v is not Vector3d object");return new O(this.x+t.x,this.y+t.y,this.z+t.z)}minus(t){if(!(t instanceof O))throw new TypeError("v is not Vector3d object");return new O(this.x-t.x,this.y-t.y,this.z-t.z)}times(t){if(isNaN(t))throw new TypeError(`invalid scalar value ‘${t}’`);return new O(this.x*t,this.y*t,this.z*t)}dividedBy(t){if(isNaN(t))throw new TypeError(`invalid scalar value ‘${t}’`);return new O(this.x/t,this.y/t,this.z/t)}dot(t){if(!(t instanceof O))throw new TypeError("v is not Vector3d object");return this.x*t.x+this.y*t.y+this.z*t.z}cross(t){if(!(t instanceof O))throw new TypeError("v is not Vector3d object");const e=this.y*t.z-this.z*t.y,r=this.z*t.x-this.x*t.z,n=this.x*t.y-this.y*t.x;return new O(e,r,n)}negate(){return new O(-this.x,-this.y,-this.z)}unit(){const t=this.length;if(1==t)return this;if(0==t)return this;const e=this.x/t,r=this.y/t,n=this.z/t;return new O(e,r,n)}angleTo(t,e=void 0){if(!(t instanceof O))throw new TypeError("v is not Vector3d object");if(!(e instanceof O||null==e))throw new TypeError("n is not Vector3d object");const r=null==e||this.cross(t).dot(e)>=0?1:-1,n=this.cross(t).length*r,o=this.dot(t);return Math.atan2(n,o)}rotateAround(t,e){if(!(t instanceof O))throw new TypeError("axis is not Vector3d object");const r=e.toRadians(),n=this.unit(),o=t.unit(),i=Math.sin(r),a=Math.cos(r),s=1-a,u=o.x,c=o.y,l=o.z,f=[[s*u*u+a,s*u*c-i*l,s*u*l+i*c],[s*u*c+i*l,s*c*c+a,s*c*l-i*u],[s*u*l-i*c,s*c*l+i*u,s*l*l+a]],p=[f[0][0]*n.x+f[0][1]*n.y+f[0][2]*n.z,f[1][0]*n.x+f[1][1]*n.y+f[1][2]*n.z,f[2][0]*n.x+f[2][1]*n.y+f[2][2]*n.z];return new O(p[0],p[1],p[2])}toString(t=3){return`[${this.x.toFixed(t)},${this.y.toFixed(t)},${this.z.toFixed(t)}]`}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};var N=O;const T={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563}},j={WGS84:{ellipsoid:T.WGS84}};Object.freeze(T.WGS84),Object.freeze(j.WGS84);class x{constructor(t,e,r=0){if(isNaN(t)||null==t)throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e)||null==e)throw new TypeError(`invalid lon ‘${e}’`);if(isNaN(r)||null==r)throw new TypeError(`invalid height ‘${r}’`);this._lat=E.wrap90(Number(t)),this._lon=E.wrap180(Number(e)),this._height=Number(r)}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?E.wrap90(E.parse(t)):E.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?E.wrap90(E.parse(t)):E.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${t}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(t){if(this._lon=isNaN(t)?E.wrap180(E.parse(t)):E.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?E.wrap180(E.parse(t)):E.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?E.wrap180(E.parse(t)):E.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${t}’`)}get height(){return this._height}set height(t){if(this._height=Number(t),isNaN(this._height))throw new TypeError(`invalid height ‘${t}’`)}get datum(){return this._datum}set datum(t){this._datum=t}static get ellipsoids(){return T}static get datums(){return j}static parse(...t){if(0==t.length)throw new TypeError("invalid (empty) point");let e,r,n;if("object"==typeof t[0]&&(1==t.length||!isNaN(parseFloat(t[1])))){const o=t[0];if("Point"==o.type&&Array.isArray(o.coordinates)?([r,e,n]=o.coordinates,n=n||0):(null!=o.latitude&&(e=o.latitude),null!=o.lat&&(e=o.lat),null!=o.longitude&&(r=o.longitude),null!=o.lng&&(r=o.lng),null!=o.lon&&(r=o.lon),null!=o.height&&(n=o.height),e=E.wrap90(E.parse(e)),r=E.wrap180(E.parse(r))),null!=t[1]&&(n=t[1]),isNaN(e)||isNaN(r))throw new TypeError(`invalid point ‘${JSON.stringify(t[0])}’`)}if("string"==typeof t[0]&&2==t[0].split(",").length&&([e,r]=t[0].split(","),e=E.wrap90(E.parse(e)),r=E.wrap180(E.parse(r)),n=t[1]||0,isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t[0]}’`);if(null==e&&null==r&&([e,r]=t,e=E.wrap90(E.parse(e)),r=E.wrap180(E.parse(r)),n=t[2]||0,isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t.toString()}’`);return new this(e,r,n)}toCartesian(){const t=this.datum?this.datum.ellipsoid:this.referenceFrame?this.referenceFrame.ellipsoid:T.WGS84,e=this.lat.toRadians(),r=this.lon.toRadians(),n=this.height,{a:o,f:i}=t,a=Math.sin(e),s=Math.cos(e),u=Math.sin(r),c=Math.cos(r),l=2*i-i*i,f=o/Math.sqrt(1-l*a*a);return new _((f+n)*s*c,(f+n)*s*u,(f*(1-l)+n)*a)}equals(t){if(!(t instanceof x))throw new TypeError(`invalid point ‘${t}’`);return!(Math.abs(this.lat-t.lat)>Number.EPSILON||Math.abs(this.lon-t.lon)>Number.EPSILON||Math.abs(this.height-t.height)>Number.EPSILON||this.datum!=t.datum||this.referenceFrame!=t.referenceFrame||this.epoch!=t.epoch)}toString(t="d",e=void 0,r=null){if(!["d","dm","dms","n"].includes(t))throw new RangeError(`invalid format ‘${t}’`);const n=(this.height>=0?" +":" ")+this.height.toFixed(r)+"m";return"n"==t?(null==e&&(e=4),`${this.lat.toFixed(e)}, ${this.lon.toFixed(e)}${null==r?"":n}`):`${E.toLat(this.lat,t,e)}, ${E.toLon(this.lon,t,e)}${null==r?"":n}`}}class _ extends N{constructor(t,e,r){super(t,e,r)}toLatLon(t=T.WGS84){if(!t||!t.a)throw new TypeError(`invalid ellipsoid ‘${t}’`);const{x:e,y:r,z:n}=this,{a:o,b:i,f:a}=t,s=2*a-a*a,u=s/(1-s),c=Math.sqrt(e*e+r*r),l=i*n/(o*c)*(1+u*i/Math.sqrt(c*c+n*n)),f=l/Math.sqrt(1+l*l),p=f/l,d=isNaN(p)?0:Math.atan2(n+u*i*f*f*f,c-s*o*p*p*p),h=Math.atan2(r,e),y=Math.sin(d),m=c*Math.cos(d)+n*y-o*o/(o/Math.sqrt(1-s*y*y));return new x(d.toDegrees(),h.toDegrees(),m)}toString(t=0){return`[${this.x.toFixed(t)},${this.y.toFixed(t)},${this.z.toFixed(t)}]`}}const P={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563},Airy1830:{a:6377563.396,b:6356256.909,f:1/299.3249646},AiryModified:{a:6377340.189,b:6356034.448,f:1/299.3249646},Bessel1841:{a:6377397.155,b:6356078.962818,f:1/299.1528128},Clarke1866:{a:6378206.4,b:6356583.8,f:1/294.978698214},Clarke1880IGN:{a:6378249.2,b:6356515,f:1/293.466021294},GRS80:{a:6378137,b:6356752.31414,f:1/298.257222101},Intl1924:{a:6378388,b:6356911.946,f:1/297},WGS72:{a:6378135,b:6356750.5,f:1/298.26}},k={ED50:{ellipsoid:P.Intl1924,transform:[89.5,93.8,123.1,-1.2,0,0,.156]},ETRS89:{ellipsoid:P.GRS80,transform:[0,0,0,0,0,0,0]},Irl1975:{ellipsoid:P.AiryModified,transform:[-482.53,130.596,-564.557,-8.15,1.042,.214,.631]},NAD27:{ellipsoid:P.Clarke1866,transform:[8,-160,-176,0,0,0,0]},NAD83:{ellipsoid:P.GRS80,transform:[.9956,-1.9103,-.5215,-62e-5,.025915,.009426,.011599]},NTF:{ellipsoid:P.Clarke1880IGN,transform:[168,60,-320,0,0,0,0]},OSGB36:{ellipsoid:P.Airy1830,transform:[-446.448,125.157,-542.06,20.4894,-.1502,-.247,-.8421]},Potsdam:{ellipsoid:P.Bessel1841,transform:[-582,-105,-414,-8.3,1.04,.35,-3.08]},TokyoJapan:{ellipsoid:P.Bessel1841,transform:[148,-507,-685,0,0,0,0]},WGS72:{ellipsoid:P.WGS72,transform:[0,0,-4.5,-.22,0,0,.554]},WGS84:{ellipsoid:P.WGS84,transform:[0,0,0,0,0,0,0]}};Object.keys(P).forEach(t=>Object.freeze(P[t])),Object.keys(k).forEach(t=>{Object.freeze(k[t]),Object.freeze(k[t].transform)});class A extends x{constructor(t,e,r=0,n=k.WGS84){if(!n||null==n.ellipsoid)throw new TypeError(`unrecognised datum ‘${n}’`);super(t,e,r),this._datum=n}get datum(){return this._datum}static get ellipsoids(){return P}static get datums(){return k}static parse(...t){let e=k.WGS84;if((4==t.length||3==t.length&&"object"==typeof t[2])&&(e=t.pop()),!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);const r=super.parse(...t);return r._datum=e,r}convertDatum(t){if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);return this.toCartesian().convertDatum(t).toLatLon()}toCartesian(){const t=super.toCartesian();return new M(t.x,t.y,t.z,this.datum)}}class M extends _{constructor(t,e,r,n=void 0){if(n&&null==n.ellipsoid)throw new TypeError(`unrecognised datum ‘${n}’`);super(t,e,r),n&&(this._datum=n)}get datum(){return this._datum}set datum(t){if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);this._datum=t}toLatLon(t=void 0){t&&(console.info("datum parameter to Cartesian_Datum.toLatLon is deprecated: set datum before calling toLatLon()"),this.datum=t);const e=this.datum||k.WGS84;if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);const r=super.toLatLon(e.ellipsoid);return new A(r.lat,r.lon,r.height,this.datum)}convertDatum(t){if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);if(!this.datum)throw new TypeError("cartesian coordinate has no datum");let e=null,r=null;null!=this.datum&&this.datum!=k.WGS84||(e=this,r=t.transform),t==k.WGS84&&(e=this,r=this.datum.transform.map(t=>-t)),null==r&&(e=this.convertDatum(k.WGS84),r=t.transform);const n=e.applyTransform(r);return n.datum=t,n}applyTransform(t){const{x:e,y:r,z:n}=this,o=t[0],i=t[1],a=t[2],s=t[3]/1e6+1,u=(t[4]/3600).toRadians(),c=(t[5]/3600).toRadians(),l=(t[6]/3600).toRadians();return new M(o+e*s-r*l+n*c,i+e*l+r*s-n*u,a-e*c+r*u+n*s)}}const D={trueOrigin:{lat:49,lon:-2},falseOrigin:{easting:-4e5,northing:1e5},scaleFactor:.9996012717,ellipsoid:A.ellipsoids.Airy1830};class G{constructor(t,e){if(this.easting=Number(t),this.northing=Number(e),isNaN(t)||this.easting<0||this.easting>7e5)throw new RangeError(`invalid easting ‘${t}’`);if(isNaN(e)||this.northing<0||this.northing>13e5)throw new RangeError(`invalid northing ‘${e}’`)}toLatLon(t=A.datums.WGS84){const{easting:e,northing:r}=this,{a:n,b:o}=D.ellipsoid,i=D.trueOrigin.lat.toRadians(),a=D.trueOrigin.lon.toRadians(),s=-D.falseOrigin.easting,u=-D.falseOrigin.northing,c=D.scaleFactor,l=1-o*o/(n*n),f=(n-o)/(n+o),p=f*f,d=f*f*f;let h=i,y=0;do{h=(r-u-y)/(n*c)+h,y=o*c*((1+f+5/4*p+5/4*d)*(h-i)-(3*f+3*f*f+21/8*d)*Math.sin(h-i)*Math.cos(h+i)+(15/8*p+15/8*d)*Math.sin(2*(h-i))*Math.cos(2*(h+i))-35/24*d*Math.sin(3*(h-i))*Math.cos(3*(h+i)))}while(Math.abs(r-u-y)>=1e-5);const m=Math.cos(h),b=Math.sin(h),g=n*c/Math.sqrt(1-l*b*b),v=n*c*(1-l)/Math.pow(1-l*b*b,1.5),S=g/v-1,w=Math.tan(h),E=w*w,O=E*E,N=1/m,T=g*g*g,j=T*g*g,x=e-s,_=x*x,P=_*x,k=_*_,M=P*_;h=h-w/(2*v*g)*_+w/(24*v*T)*(5+3*E+S-9*E*S)*k-w/(720*v*j)*(61+90*E+45*O)*(k*_);const G=a+N/g*x-N/(6*T)*(g/v+2*E)*P+N/(120*j)*(5+28*E+24*O)*M-N/(j*g*g*5040)*(61+662*E+1320*O+O*E*720)*(M*_);let I=new R(h.toDegrees(),G.toDegrees(),0,A.datums.OSGB36);return t!=A.datums.OSGB36&&(I=I.convertDatum(t),I=new R(I.lat,I.lon,I.height,I.datum)),I}static parse(t){let e=(t=String(t).trim()).match(/^(\d+),\s*(\d+)$/);if(e)return new G(e[1],e[2]);if(e=t.match(/^[HNST][ABCDEFGHJKLMNOPQRSTUVWXYZ]\s*[0-9]+\s*[0-9]+$/i),!e)throw new Error(`invalid grid reference ‘${t}’`);let r=t.toUpperCase().charCodeAt(0)-"A".charCodeAt(0),n=t.toUpperCase().charCodeAt(1)-"A".charCodeAt(0);r>7&&r--,n>7&&n--;const o=(r-2)%5*5+n%5,i=19-5*Math.floor(r/5)-Math.floor(n/5);let a=t.slice(2).trim().split(/\s+/);if(1==a.length&&(a=[a[0].slice(0,a[0].length/2),a[0].slice(a[0].length/2)]),a[0].length!=a[1].length)throw new Error(`invalid grid reference ‘${t}’`);a[0]=a[0].padEnd(5,"0"),a[1]=a[1].padEnd(5,"0");const s=o+a[0],u=i+a[1];return new G(s,u)}toString(t=10){if(![0,2,4,6,8,10,12,14,16].includes(Number(t)))throw new RangeError(`invalid precision ‘${t}’`);let{easting:e,northing:r}=this;if(0==t){const t={useGrouping:!1,minimumIntegerDigits:6,maximumFractionDigits:3};return`${e.toLocaleString("en",t)},${r.toLocaleString("en",t)}`}const n=Math.floor(e/1e5),o=Math.floor(r/1e5);let i=19-o-(19-o)%5+Math.floor((n+10)/5),a=5*(19-o)%25+n%5;i>7&&i++,a>7&&a++;const s=String.fromCharCode(i+"A".charCodeAt(0),a+"A".charCodeAt(0));return e=Math.floor(e%1e5/Math.pow(10,5-t/2)),r=Math.floor(r%1e5/Math.pow(10,5-t/2)),e=e.toString().padStart(t/2,"0"),r=r.toString().padStart(t/2,"0"),`${s} ${e} ${r}`}}class R extends A{toOsGrid(){const t=this.datum==A.datums.OSGB36?this:this.convertDatum(A.datums.OSGB36),e=t.lat.toRadians(),r=t.lon.toRadians(),{a:n,b:o}=D.ellipsoid,i=D.trueOrigin.lat.toRadians(),a=D.trueOrigin.lon.toRadians(),s=-D.falseOrigin.easting,u=-D.falseOrigin.northing,c=D.scaleFactor,l=1-o*o/(n*n),f=(n-o)/(n+o),p=f*f,d=f*f*f,h=Math.cos(e),y=Math.sin(e),m=n*c/Math.sqrt(1-l*y*y),b=n*c*(1-l)/Math.pow(1-l*y*y,1.5),g=m/b-1,v=o*c*((1+f+5/4*p+5/4*d)*(e-i)-(3*f+3*f*f+21/8*d)*Math.sin(e-i)*Math.cos(e+i)+(15/8*p+15/8*d)*Math.sin(2*(e-i))*Math.cos(2*(e+i))-35/24*d*Math.sin(3*(e-i))*Math.cos(3*(e+i))),S=h*h*h,w=S*h*h,E=Math.tan(e)*Math.tan(e),O=E*E,N=r-a,T=N*N,j=T*N,x=j*N,_=x*N;let P=v+u+m/2*y*h*T+m/24*y*S*(5-E+9*g)*x+m/720*y*w*(61-58*E+O)*(_*N),k=s+m*h*N+m/6*S*(m/b-E)*j+m/120*w*(5-18*E+O+14*g-58*E*g)*_;P=Number(P.toFixed(3)),k=Number(k.toFixed(3));try{return new G(k,P)}catch(e){throw new Error(`${e.message} from (${t.lat.toFixed(6)},${t.lon.toFixed(6)}).toOsGrid()`)}}convertDatum(t){const e=super.convertDatum(t);return new R(e.lat,e.lon,e.height,e.datum)}}function I(t){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},I(t)}var C,L;function $(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function F(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?$(Object(r),!0).forEach(function(e){W(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function W(t,e,r){return(e=function(t){var e=function(t){if("object"!=I(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=I(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==I(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function U(t){return function(t){if(Array.isArray(t))return B(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return B(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?B(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function B(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function z(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var Y=500,V=function(t){var e=t.GAZETTEER_ENTRY,r="eng"===e.NAME2_LANG?e.NAME2:e.NAME1;return t.GAZETTEER_ENTRY.NAME1=r,t.GAZETTEER_ENTRY.NAME1_LANG="eng",t},q=function(t){return t.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw(C||(C=z(["$&"],["\\$&"]))))},H=function(t,e){var r,n,o,i,a=e.MBR_XMIN,s=e.MBR_YMIN,u=e.MBR_XMAX,c=e.MBR_YMAX,l=e.GEOMETRY_X,f=e.GEOMETRY_Y;if(null==a?(r=l-Y,n=f-Y,o=l+Y,i=f+Y):(r=a,n=s,o=u,i=c),"EPSG:27700"===t)return[r,n,o,i];if("EPSG:4326"===t){var p=new G(r,n).toLatLon(),d=new G(o,i).toLatLon();return[p.lon,p.lat,d.lon,d.lat].map(function(t){return Math.round(1e6*t)/1e6})}throw new Error("Unsupported CRS: ".concat(t))},K=function(t,e){var r=e.GEOMETRY_X,n=e.GEOMETRY_Y;if("EPSG:27700"===t)return[r,n];if("EPSG:4326"===t){var o=new G(r,n).toLatLon();return[Math.round(1e6*o.lon)/1e6,Math.round(1e6*o.lat)/1e6]}throw new Error("Unsupported CRS: ".concat(t))};function Z(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function X(t){return function(t){if(Array.isArray(t))return tt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Q(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function J(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Q(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function Q(t,e){if(t){if("string"==typeof t)return tt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?tt(t,e):void 0}}function tt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function et(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,c=Object.create(u.prototype);return rt(c,"_invoke",function(r,n,o){var i,s,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return i=e,s=0,u=t,p.n=r,a}};function d(r,n){for(s=r,u=n,e=0;!f&&c&&!o&&e<l.length;e++){var o,i=l[e],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,u=h;(e=s<2?t:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(c=2,i){if(s||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,s<2&&(s=0)}else 1===s&&(e=i.return)&&e.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((e=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(e){i=t,s=1,u=e}finally{c=1}}return{value:e,done:f}}}(r,o,i),!0),c}var a={};function s(){}function u(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(rt(e={},n,function(){return this}),e),f=c.prototype=s.prototype=Object.create(l);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,rt(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=c,rt(f,"constructor",c),rt(c,"constructor",u),u.displayName="GeneratorFunction",rt(c,o,"GeneratorFunction"),rt(f),rt(f,o,"Generator"),rt(f,n,function(){return this}),rt(f,"toString",function(){return"[object Generator]"}),(et=function(){return{w:i,m:p}})()}function rt(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}rt=function(t,e,r,n){function i(e,r){rt(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},rt(t,e,r,n)}function nt(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function ot(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){nt(i,n,o,a,s,"next",t)}function s(t){nt(i,n,o,a,s,"throw",t)}a(void 0)})}}var it=function(t){return t.replaceAll(/[^a-zA-Z0-9\s\-.,]/g,"").trim()},at=function(t){var e=t.url,r=t.options;return new Request(e,r)},st=function(){var t=ot(et().m(function t(e,r,n){var o,i,a,s;return et().w(function(t){for(;;)switch(t.n){case 0:if(i={url:null===(o=e.urlTemplate)||void 0===o?void 0:o.replace("{query}",encodeURIComponent(r)),options:{method:"GET"}},!e.buildRequest){t.n=1;break}return a=e.buildRequest(r,function(){return i}),t.a(2,a instanceof Request?a:at(a));case 1:if(!n){t.n=3;break}return s=at,t.n=2,n(i,r);case 2:return t.a(2,s(t.v));case 3:return t.a(2,at(i))}},t)}));return function(e,r,n){return t.apply(this,arguments)}}(),ut=function(){var t=ot(et().m(function t(e,r,n){var o,i,a;return et().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,fetch(r);case 1:if((o=t.v).ok){t.n=2;break}return console.error("Fetch error for ".concat(e.label||"dataset",": ").concat(o.status)),t.a(2,{error:!0});case 2:return t.n=3,o.json();case 3:return i=t.v,t.a(2,e.parseResults(i,n));case 4:return t.p=4,a=t.v,console.error("Network error for ".concat(e.label||"dataset",":"),a),t.a(2,{error:!0})}},t,null,[[0,4]])}));return function(e,r,n){return t.apply(this,arguments)}}(),ct=function(){var t=ot(et().m(function t(e,r,n,o){var i,a,s,u,c,l,f,p,d,h;return et().w(function(t){for(;;)switch(t.p=t.n){case 0:i=it(e),a=r.filter(function(t){var r=!t.includeRegex||t.includeRegex.test(e),n=!!t.excludeRegex&&t.excludeRegex.test(i);return r&&!n}),s=[],u=!1,c=J(a),t.p=1,c.s();case 2:if((l=c.n()).done){t.n=6;break}return f=l.value,t.n=3,st(f,i,o);case 3:return p=t.v,t.n=4,ut(f,p,i);case 4:if(null!=(d=t.v)&&d.error?u=!0:null!=d&&d.length&&(s=[].concat(X(s),X(d))),!f.exclusive||!s.length){t.n=5;break}return t.a(3,6);case 5:t.n=2;break;case 6:t.n=8;break;case 7:t.p=7,h=t.v,c.e(h);case 8:return t.p=8,c.f(),t.f(8);case 9:return n({type:"UPDATE_SUGGESTIONS",payload:{results:s,hasError:u}}),t.a(2,{results:s,sanitisedValue:i})}},t,null,[[1,7,8,9]])}));return function(e,r,n,o){return t.apply(this,arguments)}}(),lt=r(604);function ft(t){return ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ft(t)}function pt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function dt(t,e,r){return(e=function(t){var e=function(t){if("object"!=ft(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ft(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ft(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var ht=function(t){var e=t.suggestion,r=t.query,n=t.services,o=t.mapProvider,i=t.markers,a=t.showMarker,s=t.markerOptions;n.focusMap({message:lt.cr.replace("{query}",r)}),function(t){var e=t.bounds,r=t.point,n=t.markers,o=t.showMarker,i=t.markerOptions;t.mapProvider.fitToBounds(e),o&&n.add("search",r,i)}({mapProvider:o,bounds:e.bounds,point:e.point,markers:i,showMarker:a,markerOptions:s}),n.eventBus.emit("search:match",function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?pt(Object(r),!0).forEach(function(e){dt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):pt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({query:r},e))};function yt(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,c=Object.create(u.prototype);return mt(c,"_invoke",function(r,n,o){var i,s,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return i=e,s=0,u=t,p.n=r,a}};function d(r,n){for(s=r,u=n,e=0;!f&&c&&!o&&e<l.length;e++){var o,i=l[e],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,u=h;(e=s<2?t:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(c=2,i){if(s||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,s<2&&(s=0)}else 1===s&&(e=i.return)&&e.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((e=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(e){i=t,s=1,u=e}finally{c=1}}return{value:e,done:f}}}(r,o,i),!0),c}var a={};function s(){}function u(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(mt(e={},n,function(){return this}),e),f=c.prototype=s.prototype=Object.create(l);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,mt(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=c,mt(f,"constructor",c),mt(c,"constructor",u),u.displayName="GeneratorFunction",mt(c,o,"GeneratorFunction"),mt(f),mt(f,o,"Generator"),mt(f,n,function(){return this}),mt(f,"toString",function(){return"[object Generator]"}),(yt=function(){return{w:i,m:p}})()}function mt(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}mt=function(t,e,r,n){function i(e,r){mt(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},mt(t,e,r,n)}function bt(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}var gt=function(t){var e;return(null==t||null===(e=t.current)||void 0===e?void 0:e.search)||document.querySelector(".im-c-map-button--search")},vt=function(t){var e=t.dispatch,r=t.services,n=t.searchContainerRef,o=t.mapProvider,i=t.markers,a=t.datasets,s=t.transformRequest,u=t.showMarker,c=t.markerOptions,l="";return{handleTabOut:function(t,e){!function(t,e,r){var n,o=gt(e);if("Tab"===t.key&&o){var i=Array.from(document.querySelectorAll("input, button, select, textarea, a[href], [tabindex]")).filter(function(t){return t.tabIndex>=0&&!t.disabled&&t.getClientRects().length>0}),a=i[i.indexOf(t.target)+(t.shiftKey?-1:1)];if(null===(n=r.current)||void 0===n||!n.contains(a)){var s=t.shiftKey?o:i[i.indexOf(o)+1];s&&(t.preventDefault(),s.focus())}}}(t,e,n)},handleCloseClick:function(t,n){var o,a,s;e({type:"TOGGLE_EXPANDED",payload:!1}),e({type:"UPDATE_SUGGESTIONS",payload:{results:[],hasError:!1}}),e({type:"SET_VALUE",payload:""}),o=null==n?void 0:n.buttonRefs,a=0,s=function(){var t=gt(o);t&&(t.focus(),document.activeElement===t)||a<30&&(a+=1,requestAnimationFrame(s))},requestAnimationFrame(s),i.remove("search"),r.eventBus.emit("search:clear"),r.eventBus.emit("search:close")},handleSubmit:function(t,n,f){return(p=yt().m(function p(){var d,h,y,m,b,g,v,S,w;return yt().w(function(p){for(;;)switch(p.n){case 0:if(t.preventDefault(),d=f.suggestions,h=f.selectedIndex,y=f.value,m=null==y?void 0:y.trim(),e({type:"SET_SELECTED",payload:-1}),e({type:"HIDE_SUGGESTIONS"}),!(h>=0)){p.n=1;break}return b=d[h],e({type:"SET_VALUE",payload:b.text}),ht({suggestion:b,query:b.text,services:r,mapProvider:o,markers:i,showMarker:u,markerOptions:c}),p.a(2);case 1:if(!((null==m?void 0:m.length)<lt.zY.minSearchLength)){p.n=2;break}return p.a(2);case 2:if(g=d,d.length&&m===l){p.n=4;break}return p.n=3,ct(m,a,e,s);case 3:v=p.v,S=v.results,w=v.sanitisedValue,g=S,l=w;case 4:g.length&&("mobile"===n.breakpoint&&(e({type:"TOGGLE_EXPANDED",payload:!1}),r.eventBus.emit("search:close")),ht({suggestion:g[0],query:y,services:r,mapProvider:o,markers:i,showMarker:u,markerOptions:c}));case 5:return p.a(2)}},p)}),function(){var t=this,e=arguments;return new Promise(function(r,n){var o=p.apply(t,e);function i(t){bt(o,r,n,i,a,"next",t)}function a(t){bt(o,r,n,i,a,"throw",t)}i(void 0)})})();var p}}};function St(t){return St="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},St(t)}function wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Et(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?wt(Object(r),!0).forEach(function(e){Ot(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Ot(t,e,r){return(e=function(t){var e=function(t){if("object"!=St(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=St(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==St(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Nt(t){return Nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nt(t)}var Tt=["marker"];function jt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function xt(t,e,r){return(e=function(t){var e=function(t){if("object"!=Nt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Nt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Nt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _t(t){return _t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_t(t)}var Pt,kt,At,Mt={reducer:{initialState:{isExpanded:!1,hasKeyboardFocusWithin:!1,value:"",suggestions:[],areSuggestionsVisible:!1,hasFetchedSuggestions:!1,hasSearchError:!1,selectedIndex:-1},actions:s},applicationModes:(Pt={},kt=lt.V3,At={},(kt=function(t){var e=function(t){if("object"!=_t(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=_t(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==_t(e)?e:e+""}(kt))in Pt?Object.defineProperty(Pt,kt,{value:At,enumerable:!0,configurable:!0,writable:!0}):Pt[kt]=At,Pt),buttons:[{id:"search",label:"Search",iconId:"search",ariaControls:function(t){var e=t.appConfig;return"".concat(e.id,"-search-form")},expandedWhen:function(t){return t.pluginState.isExpanded},excludeWhen:function(t){var e=t.pluginConfig;return Boolean(e.expanded)},keepFocus:!0,onClick:function(t,e){var r=e.pluginState,n=e.services;r.dispatch({type:"TOGGLE_EXPANDED",payload:!0}),n.eventBus.emit("search:open")},mobile:{slot:"top-right",showLabel:!1},tablet:{slot:"top-left",showLabel:!1},desktop:{slot:"top-left",showLabel:!1}}],controls:[{id:"search",mobile:{slot:"header"},tablet:{slot:"top-left"},desktop:{slot:"top-left"},render:function(t){var e=t.appConfig,r=t.iconRegistry,n=t.pluginState,o=t.pluginConfig,i=t.appState,a=t.mapState,s=t.services,l=t.mapProvider,f=t.setApplicationMode,p=t.clearApplicationMode,d=e.id,h=i.interfaceType,y=o.expanded,m=o.customDatasets,S=o.osNamesURL,w=o.regions,E=o.maxSuggestions,O=n.dispatch,N=n.isExpanded,T=n.areSuggestionsVisible,j=n.suggestions,x=r.close,_=r.search,P=(0,u.useRef)(null),k=(0,u.useRef)(null),A=i.layoutRefs.viewportRef,M=function(t){var e=t.customDatasets,r=void 0===e?[]:e,n=t.osNamesURL,o=t.crs,i=t.regions,a=void 0===i?["england","scotland","wales"]:i,s=t.maxSuggestions;return n?[].concat([{name:"osNames",urlTemplate:n,parseResults:function(t,e){return function(t,e,r,n){var o,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:8;if(!t||t.error||0===(null===(o=t.header)||void 0===o?void 0:o.totalresults))return[];var a=t.results;return a=function(t,e){var r=e.toLowerCase().replaceAll(",","").split(" ");return t.map(V).filter(function(t){return r.some(function(r){return t.GAZETTEER_ENTRY.NAME1.toLowerCase().includes(r)||(n=(n=e).replaceAll(/\s/g,""),/^(([A-Z]{1,2}\d[A-Z\d]?|ASCN|STHL|TDCU|BBND|[BFS]IQQ|PCRN|TKCA) ?\d[A-Z]{2}|BFPO ?\d{1,4}|(KY\d|MSR|VG|AI)[ -]?\d{4}|[A-Z]{2} ?\d{2}|GE ?CX|GIR ?0A{2}|SAN ?TA1)$/i.test(n));var n})})}(a,e),a=function(t,e){return t.filter(function(t){var r,n=null==t||null===(r=t.GAZETTEER_ENTRY)||void 0===r||null===(r=r.COUNTRY)||void 0===r?void 0:r.toLowerCase();return n&&e.includes(n)})}(a=function(t){return Array.from(new Map(t.map(function(t){return[t.GAZETTEER_ENTRY.ID,t]})).values())}(a),r),(a=a.slice(0,i)).map(function(t){return F(F({id:t.GAZETTEER_ENTRY.ID,bounds:H(n,t.GAZETTEER_ENTRY),point:K(n,t.GAZETTEER_ENTRY)},function(t,e){var r,n,o,i,a=e.NAME1,s=e.COUNTY_UNITARY,u=e.DISTRICT_BOROUGH,c=e.POSTCODE_DISTRICT,l=e.LOCAL_TYPE,f="".concat(["City","Postcode"].includes(l)?"":c+", ").concat("City"===l?"":s||u),p="".concat(a).concat(f?", "+f:"");return{text:p,marked:(r=p,n=t,o=U(n.replaceAll(/\s+/g,"")).map(q).join(String.raw(L||(L=z(["s*"],["\\s*"])))),i=new RegExp("(".concat(o,")"),"i"),r.replace(i,"<mark>$1</mark>"))}}(e,t.GAZETTEER_ENTRY)),{},{type:"os-names"})})}(t,e,a,o,s)},includeRegex:/[a-zA-Z0-9]/,excludeRegex:/^(?:[a-z]{2}\s*(?:\d{3}\s*\d{3}|\d{4}\s*\d{4}|\d{5}\s*\d{5})|\d+\s*,?\s*\d+)$/i}],function(t){return function(t){if(Array.isArray(t))return Z(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return Z(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Z(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(r)):r}({customDatasets:m,osNamesURL:S,regions:w,maxSuggestions:E,crs:l.crs}),D=(0,u.useRef)(null);if(!D.current){var G=o.marker,R=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],-1===e.indexOf(r)&&{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(o,Tt);D.current=function(t){var e,r,n,o=t.dispatch,i=t.searchContainerRef,a=(e=function(e){return ct(e,t.datasets,o,t.transformRequest)},r=null,n=function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];clearTimeout(r),r=setTimeout(function(){e.apply(void 0,n)},350)},n.cancel=function(){r&&(clearTimeout(r),r=null)},n),s=vt(t),u=function(t){var e=t.dispatch,r=t.debouncedFetchSuggestions;return{handleInputClick:function(){e({type:"SHOW_SUGGESTIONS"})},handleInputFocus:function(t){e({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:"keyboard"===t})},handleInputBlur:function(t){e({type:"INPUT_BLUR",payload:t})},handleInputChange:function(t,n){var o=t.target.value;if(e({type:"SET_VALUE",payload:o}),(null==n?void 0:n.selectedIndex)>=0&&(e({type:"SET_SELECTED",payload:-1}),e({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:!0})),o.length<lt.zY.minSearchLength)return r.cancel(),e({type:"UPDATE_SUGGESTIONS",payload:{results:[],hasError:!1}}),void e({type:"HIDE_SUGGESTIONS"});e({type:"SHOW_SUGGESTIONS"}),r(o)}}}(Et(Et({},t),{},{debouncedFetchSuggestions:a})),c=function(t){var e=t.dispatch,r=t.services,n=t.mapProvider,o=t.markers,i=t.showMarker,a=t.markerOptions,s=function(t,e){var r;return e>=0?"".concat(null===(r=t[e])||void 0===r?void 0:r.text,". ").concat(e+1," of ").concat(t.length," is highlighted"):"".concat(t.length," suggestions available")};return{handleSuggestionClick:function(t,s){e({type:"SET_VALUE",payload:t.text}),e({type:"HIDE_SUGGESTIONS"}),e({type:"SET_SELECTED",payload:-1}),"mobile"===s.breakpoint&&(e({type:"TOGGLE_EXPANDED",payload:!1}),r.eventBus.emit("search:close")),ht({suggestion:t,query:t.text,services:r,mapProvider:n,markers:o,showMarker:i,markerOptions:a})},handleInputKeyDown:function(t,n){var o=n.suggestions,i=n.selectedIndex;switch(t.key){case"ArrowDown":if(null==o||!o.length)return;if(t.preventDefault(),i<o.length-1){var a=i+1;r.announce(s(o,a)),e({type:"SET_SELECTED",payload:a}),e({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:!1})}break;case"ArrowUp":if(null==o||!o.length)return;t.preventDefault();var u=i>0?i-1:-1;r.announce(s(o,u)),e({type:"SET_SELECTED",payload:u}),e({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:u<0});break;case"Escape":t.preventDefault(),e({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:!0}),e({type:"HIDE_SUGGESTIONS"}),e({type:"SET_SELECTED",payload:-1})}}}}(t);return Et(Et(Et(Et({},s),u),c),{},{handleOutside:function(e){i.current.contains(e.target)||(o({type:"TOGGLE_EXPANDED",payload:!1}),t.services.eventBus.emit("search:close"))}})}(function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?jt(Object(r),!0).forEach(function(e){xt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):jt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({dispatch:O,datasets:M,services:s,mapProvider:l,searchContainerRef:P,markers:a.markers,markerOptions:G},R))}var I=D.current,C=N||!!(y&&T&&j.length);(0,u.useEffect)(function(){var t;N&&(null===(t=k.current)||void 0===t||t.focus())},[N]),(0,u.useLayoutEffect)(function(){if(N)return f(lt.V3),function(){return p(lt.V3)}},[N]),(0,u.useLayoutEffect)(function(){if(C)return A.current.style.pointerEvents="none",document.addEventListener("focusin",I.handleOutside),document.addEventListener("pointerdown",I.handleOutside),function(){A.current.style.pointerEvents="auto",document.removeEventListener("focusin",I.handleOutside),document.removeEventListener("pointerdown",I.handleOutside)}},[N,h,T,j]);var $=y||N;return(0,c.jsx)("div",{className:"im-c-search".concat($?"":" im-c-search--collapsed"),ref:P,onKeyDown:function(t){return I.handleTabOut(t,i.buttonRefs)},children:(0,c.jsxs)(b,{id:d,pluginState:n,pluginConfig:o,appState:i,inputRef:k,events:I,services:s,children:[(0,c.jsx)(g,{defaultExpanded:y,onClick:function(t){return I.handleCloseClick(t,i)},closeIcon:x}),(0,c.jsx)(v,{defaultExpanded:y,submitIcon:_})]})})}}],icons:[{id:"search",svgContent:'<path d="m21 21-4.34-4.34"></path><circle cx="11" cy="11" r="8"></circle>'}]}}}]);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
!function(e,
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("defra",[],t):"object"==typeof exports?exports.defra=t():(e.defra=e.defra||{},e.defra.searchPlugin=t())}(Object("undefined"!=typeof self?self:this),function(){return function(){"use strict";var e,t,r={738:function(e){e.exports=preactCompat},287:function(e){e.exports=preactJsxRuntime},604:function(e,t,r){r.d(t,{V3:function(){return i},cr:function(){return o},zY:function(){return n}});var n={expanded:!1,showMarker:!0,placeholder:"Search",minSearchLength:3,maxSuggestions:8,noResultsMessage:"No results available",searchErrorMessage:"Sorry, there was a problem with search"},o="Map moved to {query}",i="search"}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,o.d=function(e,t){for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.f={},o.e=function(e){return Promise.all(Object.keys(o.f).reduce(function(t,r){return o.f[r](e,t),t},[]))},o.u=function(e){return"im-search-plugin.js"},o.miniCssF=function(e){},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e={},t="defra.searchPlugin:",o.l=function(r,n,i,u){if(e[r])e[r].push(n);else{var c,a;if(void 0!==i)for(var f=document.getElementsByTagName("script"),s=0;s<f.length;s++){var l=f[s];if(l.getAttribute("src")==r||l.getAttribute("data-webpack")==t+i){c=l;break}}c||(a=!0,(c=document.createElement("script")).charset="utf-8",o.nc&&c.setAttribute("nonce",o.nc),c.setAttribute("data-webpack",t+i),c.src=r),e[r]=[n];var p=function(t,n){c.onerror=c.onload=null,clearTimeout(d);var o=e[r];if(delete e[r],c.parentNode&&c.parentNode.removeChild(c),o&&o.forEach(function(e){return e(n)}),t)return t(n)},d=setTimeout(p.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=p.bind(null,c.onerror),c.onload=p.bind(null,c.onload),a&&document.head.appendChild(c)}},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e}(),function(){var e={57:0};o.f.j=function(t,r){var n=o.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise(function(r,o){n=e[t]=[r,o]});r.push(n[2]=i);var u=o.p+o.u(t),c=new Error;o.l(u,function(r){if(o.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+t+" failed.\n("+i+": "+u+")",c.name="ChunkLoadError",c.type=i,c.request=u,n[1](c)}},"chunk-"+t,t)}};var t=function(t,r){var n,i,u=r[0],c=r[1],a=r[2],f=0;if(u.some(function(t){return 0!==e[t]})){for(n in c)o.o(c,n)&&(o.m[n]=c[n]);a&&a(o)}for(t&&t(r);f<u.length;f++)i=u[f],o.o(e,i)&&e[i]&&e[i][0](),e[i]=0},r=Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap=Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}();var i={};o.d(i,{default:function(){return b}});var u=o(604);function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function a(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var a=n&&n.prototype instanceof c?n:c,s=Object.create(a.prototype);return f(s,"_invoke",function(r,n,o){var i,c,a,f=0,s=o||[],l=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,c=0,a=e,p.n=r,u}};function d(r,n){for(c=r,a=n,t=0;!l&&f&&!o&&t<s.length;t++){var o,i=s[t],d=p.p,b=i[2];r>3?(o=b===n)&&(a=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,p.v=n,p.n=i[1]):d<b&&(o=r<3||i[0]>n||n>b)&&(i[4]=r,i[5]=n,p.n=b,c=0))}if(o||r>1)return u;throw l=!0,n}return function(o,s,b){if(f>1)throw TypeError("Generator is already running");for(l&&1===s&&d(s,b),c=s,a=b;(t=c<2?e:a)||!l;){i||(c?c<3?(c>1&&(p.n=-1),d(c,a)):p.n=a:p.v=a);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(l=p.n<0)?a:r.call(n,p))!==u)break}catch(t){i=e,c=1,a=t}finally{f=1}}return{value:t,done:l}}}(r,o,i),!0),s}var u={};function c(){}function s(){}function l(){}t=Object.getPrototypeOf;var p=[][n]?t(t([][n]())):(f(t={},n,function(){return this}),t),d=l.prototype=c.prototype=Object.create(p);function b(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,f(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=l,f(d,"constructor",l),f(l,"constructor",s),s.displayName="GeneratorFunction",f(l,o,"GeneratorFunction"),f(d),f(d,o,"Generator"),f(d,n,function(){return this}),f(d,"toString",function(){return"[object Generator]"}),(a=function(){return{w:i,m:b}})()}function f(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}f=function(e,t,r,n){function i(t,r){f(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},f(e,t,r,n)}function s(e,t,r,n,o,i,u){try{var c=e[i](u),a=c.value}catch(e){return void r(e)}c.done?t(a):Promise.resolve(a).then(n,o)}function l(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 p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach(function(t){d(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function d(e,t,r){return(t=function(e){var t=function(e){if("object"!=c(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==c(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return p(p(p({},u.zY),r),{},{id:"search",load:(e=a().m(function e(){var t;return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,o.e(254).then(o.bind(o,523));case 1:return t=e.v.manifest,e.a(2,t)}},e)}),t=function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function u(e){s(i,n,o,u,c,"next",e)}function c(e){s(i,n,o,u,c,"throw",e)}u(void 0)})},function(){return t.apply(this,arguments)})})}return i.default}()});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
// src/plugins/search/Suggestions.jsx
|
|
2
|
+
import { markedToElements } from '../../utils/markedToElements'
|
|
3
|
+
|
|
2
4
|
export const Suggestions = ({ id, pluginState, handleSuggestionClick }) => {
|
|
3
5
|
return (
|
|
4
6
|
<ul // NOSONAR
|
|
@@ -21,7 +23,7 @@ export const Suggestions = ({ id, pluginState, handleSuggestionClick }) => {
|
|
|
21
23
|
aria-posinset={i + 1}
|
|
22
24
|
onClick={() => handleSuggestionClick(suggestion)} // NOSONAR
|
|
23
25
|
>
|
|
24
|
-
<span className='im-c-search-suggestions__label'
|
|
26
|
+
<span className='im-c-search-suggestions__label'>{markedToElements(suggestion.marked)}</span>
|
|
25
27
|
</li>
|
|
26
28
|
))}
|
|
27
29
|
</ul>
|
|
@@ -74,6 +74,17 @@ describe('Suggestions', () => {
|
|
|
74
74
|
expect(items[1]).toHaveAttribute('aria-selected', 'false')
|
|
75
75
|
})
|
|
76
76
|
|
|
77
|
+
it('renders mark tags in labels and other markup as text', () => {
|
|
78
|
+
const suggestions = [{ id: '1', marked: '<mark>Lon</mark>don <img src=x onerror="alert(1)">' }]
|
|
79
|
+
const { container } = render(
|
|
80
|
+
<Suggestions {...baseProps} pluginState={{ ...baseProps.pluginState, suggestions }} />
|
|
81
|
+
)
|
|
82
|
+
const label = container.querySelector('.im-c-search-suggestions__label')
|
|
83
|
+
expect(label.querySelector('mark').textContent).toBe('Lon')
|
|
84
|
+
expect(label.querySelector('img')).toBeNull()
|
|
85
|
+
expect(label.textContent).toBe('London <img src=x onerror="alert(1)">')
|
|
86
|
+
})
|
|
87
|
+
|
|
77
88
|
it('calls handleSuggestionClick when a suggestion is clicked', () => {
|
|
78
89
|
render(<Suggestions {...baseProps} />)
|
|
79
90
|
const items = screen.getAllByRole('option')
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// src/plugins/search/utils/markedToElements.jsx
|
|
2
|
+
|
|
3
|
+
const MARK_TAG = /^<\/?mark>$/i
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Converts a suggestion's `marked` string to React children. Bare `<mark>` and `</mark>` tags
|
|
7
|
+
* become `<mark>` elements; everything else, including any other markup, is rendered as text.
|
|
8
|
+
*/
|
|
9
|
+
export const markedToElements = (marked = '') => {
|
|
10
|
+
let isMarked = false
|
|
11
|
+
let offset = 0
|
|
12
|
+
return marked.split(/(<\/?mark>)/i).flatMap(part => {
|
|
13
|
+
const start = offset
|
|
14
|
+
offset += part.length
|
|
15
|
+
if (MARK_TAG.test(part)) {
|
|
16
|
+
isMarked = part[1] !== '/'
|
|
17
|
+
return []
|
|
18
|
+
}
|
|
19
|
+
if (!part) {
|
|
20
|
+
return []
|
|
21
|
+
}
|
|
22
|
+
// Keyed by the segment's offset in `marked`, which is unique per segment
|
|
23
|
+
return [isMarked ? <mark key={start}>{part}</mark> : part]
|
|
24
|
+
})
|
|
25
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { render } from '@testing-library/react'
|
|
2
|
+
import { markedToElements } from './markedToElements'
|
|
3
|
+
|
|
4
|
+
const renderMarked = (marked) => render(<span>{markedToElements(marked)}</span>).container.firstChild
|
|
5
|
+
|
|
6
|
+
describe('markedToElements', () => {
|
|
7
|
+
test('renders <mark> tags as mark elements', () => {
|
|
8
|
+
const label = renderMarked('<mark>NY 701 924</mark> (Grid reference)')
|
|
9
|
+
expect(label.innerHTML).toBe('<mark>NY 701 924</mark> (Grid reference)')
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
test('matches mark tags case-insensitively', () => {
|
|
13
|
+
const label = renderMarked('a <MARK>b</MARK> c')
|
|
14
|
+
expect(label.querySelector('mark').textContent).toBe('b')
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
test('renders other markup as text', () => {
|
|
18
|
+
const label = renderMarked('<img src=x onerror="alert(1)"> London')
|
|
19
|
+
expect(label.querySelector('img')).toBeNull()
|
|
20
|
+
expect(label.textContent).toBe('<img src=x onerror="alert(1)"> London')
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
test('renders markup inside a mark as text', () => {
|
|
24
|
+
const label = renderMarked('<mark><img src=x onerror="alert(1)"></mark>')
|
|
25
|
+
expect(label.querySelector('img')).toBeNull()
|
|
26
|
+
expect(label.querySelector('mark').textContent).toBe('<img src=x onerror="alert(1)">')
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
test('renders mark tags with attributes as text', () => {
|
|
30
|
+
const label = renderMarked('<mark onmouseover="alert(1)">London</mark>')
|
|
31
|
+
expect(label.querySelector('mark')).toBeNull()
|
|
32
|
+
expect(label.textContent).toBe('<mark onmouseover="alert(1)">London')
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
test('marks the rest of the text when a mark is not closed', () => {
|
|
36
|
+
const label = renderMarked('a <mark>b')
|
|
37
|
+
expect(label.innerHTML).toBe('a <mark>b</mark>')
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
test('renders entities as literal text', () => {
|
|
41
|
+
const label = renderMarked('Bob & Sons')
|
|
42
|
+
expect(label.textContent).toBe('Bob & Sons')
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
test('returns no children when marked is missing or empty', () => {
|
|
46
|
+
expect(markedToElements()).toEqual([])
|
|
47
|
+
expect(markedToElements('')).toEqual([])
|
|
48
|
+
})
|
|
49
|
+
})
|
|
@@ -5,7 +5,7 @@ const POINT_BUFFER = 500
|
|
|
5
5
|
const DEFAULT_MAX_RESULTS = 8
|
|
6
6
|
|
|
7
7
|
const isPostcode = (value) => {
|
|
8
|
-
value = value.
|
|
8
|
+
value = value.replaceAll(/\s/g, '')
|
|
9
9
|
const regex = /^(([A-Z]{1,2}\d[A-Z\d]?|ASCN|STHL|TDCU|BBND|[BFS]IQQ|PCRN|TKCA) ?\d[A-Z]{2}|BFPO ?\d{1,4}|(KY\d|MSR|VG|AI)[ -]?\d{4}|[A-Z]{2} ?\d{2}|GE ?CX|GIR ?0A{2}|SAN ?TA1)$/i // NOSONAR
|
|
10
10
|
return regex.test(value)
|
|
11
11
|
}
|
|
@@ -29,15 +29,17 @@ const transformGazetteerResult = (result) => {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
const removeTenuousResults = (results, query) => {
|
|
32
|
-
const words = query.toLowerCase().
|
|
32
|
+
const words = query.toLowerCase().replaceAll(',', '').split(' ')
|
|
33
33
|
return results.map(transformGazetteerResult).filter(l => words.some(w => l.GAZETTEER_ENTRY.NAME1.toLowerCase().includes(w) || isPostcode(query)))
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
const escapeRegExp = (value) => value.replaceAll(/[.*+?^${}()|[\]\\]/g, String.raw`\$&`)
|
|
37
|
+
|
|
36
38
|
const markString = (string, find) => {
|
|
37
|
-
const clean = find.
|
|
39
|
+
const clean = find.replaceAll(/\s+/g, '')
|
|
38
40
|
// Create a pattern where whitespace is optional between every character
|
|
39
41
|
// e.g. "ab12cd" -> "a\s* b\s* 1\s* 2\s* c\s* d"
|
|
40
|
-
const spacedPattern = clean.
|
|
42
|
+
const spacedPattern = [...clean].map(escapeRegExp).join(String.raw`\s*`)
|
|
41
43
|
const reg = new RegExp(`(${spacedPattern})`, 'i')
|
|
42
44
|
return string.replace(reg, '<mark>$1</mark>')
|
|
43
45
|
}
|
|
@@ -103,6 +103,24 @@ describe('osNamesUtils', () => {
|
|
|
103
103
|
expect(output[0].marked).toContain('<mark>')
|
|
104
104
|
})
|
|
105
105
|
|
|
106
|
+
test('treats regex characters in the query literally', () => {
|
|
107
|
+
const entry = {
|
|
108
|
+
GAZETTEER_ENTRY: { ...sampleEntry.GAZETTEER_ENTRY, NAME1: 'St. Ives', NAME2: 'St. Ives' }
|
|
109
|
+
}
|
|
110
|
+
const json = { results: [entry] }
|
|
111
|
+
const output = parseOsNamesResults(json, 'St.', regions, 'EPSG:27700')
|
|
112
|
+
expect(output[0].marked).toContain('<mark>St.</mark>')
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
test('does not throw on unbalanced regex characters in the query', () => {
|
|
116
|
+
const entry = {
|
|
117
|
+
GAZETTEER_ENTRY: { ...sampleEntry.GAZETTEER_ENTRY, NAME1: 'Newport (Gwent)', NAME2: 'Newport (Gwent)' }
|
|
118
|
+
}
|
|
119
|
+
const json = { results: [entry] }
|
|
120
|
+
const output = parseOsNamesResults(json, 'Newport (', regions, 'EPSG:27700')
|
|
121
|
+
expect(output[0].marked).toContain('<mark>Newport (</mark>')
|
|
122
|
+
})
|
|
123
|
+
|
|
106
124
|
test('handles MBR_XMIN null by using buffered GEOMETRY_X/Y', () => {
|
|
107
125
|
const entry = {
|
|
108
126
|
GAZETTEER_ENTRY: { ...sampleEntry.GAZETTEER_ENTRY, MBR_XMIN: null, MBR_YMIN: null }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useEffect as e}from"preact/compat";import{jsx as o}from"preact/jsx-runtime";const t={PERMISSION_DENIED:"Location permission denied. Please enable it in your browser settings.",POSITION_UNAVAILABLE:"Location information is unavailable.",TIMEOUT:"The location request timed out. Please try again.",FALLBACK:"Unable to get your location."};const n={slot:"right-top",showLabel:!1},i={InitComponent:function({appConfig:o,appState:n,pluginState:i,mapState:a,mapProvider:l,buttonConfig:r}){const{useLocation:s}=r;return e(()=>{if(a.isMapReady)return function({appState:e,pluginState:o,mapProvider:n,useLocationButton:i}){const{dispatch:a,buttonRefs:l}=e,{dispatch:r}=o,s=e=>e&&"number"==typeof e.code&&t[e.code]||t.FALLBACK;i.onClick=()=>{navigator.geolocation.getCurrentPosition(e=>{const{latitude:o,longitude:t}=e.coords;try{n.setView({center:[t,o],zoom:12})}catch(e){console.log("Map provider failed to pan:",e)}},e=>{const o=s(e),t=l.current[i.id];r({type:"SET_ERROR_MESSAGE",payload:o}),a({type:"OPEN_PANEL",payload:{panelId:"useLocation",props:{triggeringElement:t}}})},{enableHighAccuracy:!0,maximumAge:0,timeout:1e4})};let c=null}({appState:n,pluginState:i,mapProvider:l,useLocationButton:s}),()=>{s.onClick=null}},[a.isMapReady]),null},reducer:{initialState:{errorMessage:null},actions:{SET_ERROR_MESSAGE:(e,o)=>({...e,errorMessage:o})}},buttons:[{id:"useLocation",group:{label:"Location",slotOrder:0},label:"Use your location",iconId:"locateFixed",keepFocus:!0,hiddenWhen:()=>!navigator.geolocation,mobile:n,tablet:n,desktop:n}],panels:[{id:"useLocation",label:"Problem getting your location",mobile:{slot:"banner",open:!1,dismissible:!0,modal:!0},tablet:{slot:"banner",open:!1,dismissible:!0,modal:!0},desktop:{slot:"banner",open:!1,dismissible:!0,modal:!0},render:({pluginState:e})=>{const{errorMessage:t}=e;return o("div",{className:"im-c-use-location",children:o("p",{children:t})})}}],icons:[{id:"locateFixed",svgContent:'<line x1="2" x2="5" y1="12" y2="12"/><line x1="19" x2="22" y1="12" y2="12"/><line x1="12" x2="12" y1="2" y2="5"/><line x1="12" x2="12" y1="19" y2="22"/><circle cx="12" cy="12" r="7"/><circle cx="12" cy="12" r="3"/>'}]};export{i as manifest};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import r from"@babel/runtime/helpers/regenerator";import e from"@babel/runtime/helpers/asyncToGenerator";function n(){return{id:"useLocation",load:(n=e(r().m(function e(){var n;return r().w(function(r){for(;;)switch(r.n){case 0:return r.n=1,import(/* webpackChunkName: "im-use-location-plugin" */ "./im-use-location-plugin.js");case 1:return n=r.v.manifest,r.a(2,n)}},e)})),function(){return n.apply(this,arguments)})};var n}export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap=Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap||[]).push([[419],{157:function(e,t,n){function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach(function(t){a(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function a(e,t,n){return(t=function(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.r(t),n.d(t,{manifest:function(){return f}});var c={SET_ERROR_MESSAGE:function(e,t){return i(i({},e),{},{errorMessage:t})}},l=n(738),u={PERMISSION_DENIED:"Location permission denied. Please enable it in your browser settings.",POSITION_UNAVAILABLE:"Location information is unavailable.",TIMEOUT:"The location request timed out. Please try again.",FALLBACK:"Unable to get your location."},s=n(287),p={slot:"right-top",showLabel:!1},f={InitComponent:function(e){e.appConfig;var t=e.appState,n=e.pluginState,o=e.mapState,r=e.mapProvider,i=e.buttonConfig.useLocation;return(0,l.useEffect)(function(){if(o.isMapReady)return function(e){var t=e.appState,n=e.pluginState,o=e.mapProvider,r=e.useLocationButton,i=t.dispatch,a=t.buttonRefs,c=n.dispatch;r.onClick=function(){navigator.geolocation.getCurrentPosition(function(e){var t=e.coords,n=t.latitude,r=t.longitude;try{o.setView({center:[r,n],zoom:12})}catch(e){console.log("Map provider failed to pan:",e)}},function(e){var t=function(e){return e&&"number"==typeof e.code&&u[e.code]||u.FALLBACK}(e),n=a.current[r.id];c({type:"SET_ERROR_MESSAGE",payload:t}),i({type:"OPEN_PANEL",payload:{panelId:"useLocation",props:{triggeringElement:n}}})},{enableHighAccuracy:!0,maximumAge:0,timeout:1e4})}}({appState:t,pluginState:n,mapProvider:r,useLocationButton:i}),function(){i.onClick=null}},[o.isMapReady]),null},reducer:{initialState:{errorMessage:null},actions:c},buttons:[{id:"useLocation",group:{label:"Location",slotOrder:0},label:"Use your location",iconId:"locateFixed",keepFocus:!0,hiddenWhen:function(){return!navigator.geolocation},mobile:p,tablet:p,desktop:p}],panels:[{id:"useLocation",label:"Problem getting your location",mobile:{slot:"banner",open:!1,dismissible:!0,modal:!0},tablet:{slot:"banner",open:!1,dismissible:!0,modal:!0},desktop:{slot:"banner",open:!1,dismissible:!0,modal:!0},render:function(e){var t=e.pluginState.errorMessage;return(0,s.jsx)("div",{className:"im-c-use-location",children:(0,s.jsx)("p",{children:t})})}}],icons:[{id:"locateFixed",svgContent:'<line x1="2" x2="5" y1="12" y2="12"/><line x1="19" x2="22" y1="12" y2="12"/><line x1="12" x2="12" y1="2" y2="5"/><line x1="12" x2="12" y1="19" y2="22"/><circle cx="12" cy="12" r="7"/><circle cx="12" cy="12" r="3"/>'}]}}}]);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("defra",[],e):"object"==typeof exports?exports.defra=e():(t.defra=t.defra||{},t.defra.useLocationPlugin=e())}(Object("undefined"!=typeof self?self:this),function(){return function(){"use strict";var t,e,r={738:function(t){t.exports=preactCompat},287:function(t){t.exports=preactJsxRuntime}},n={};function o(t){var e=n[t];if(void 0!==e)return e.exports;var i=n[t]={exports:{}};return r[t](i,i.exports,o),i.exports}o.m=r,o.d=function(t,e){for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o.f={},o.e=function(t){return Promise.all(Object.keys(o.f).reduce(function(e,r){return o.f[r](t,e),e},[]))},o.u=function(t){return"im-use-location-plugin.js"},o.miniCssF=function(t){},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},t={},e="defra.useLocationPlugin:",o.l=function(r,n,i,u){if(t[r])t[r].push(n);else{var a,c;if(void 0!==i)for(var f=document.getElementsByTagName("script"),p=0;p<f.length;p++){var s=f[p];if(s.getAttribute("src")==r||s.getAttribute("data-webpack")==e+i){a=s;break}}a||(c=!0,(a=document.createElement("script")).charset="utf-8",o.nc&&a.setAttribute("nonce",o.nc),a.setAttribute("data-webpack",e+i),a.src=r),t[r]=[n];var l=function(e,n){a.onerror=a.onload=null,clearTimeout(d);var o=t[r];if(delete t[r],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach(function(t){return t(n)}),e)return e(n)},d=setTimeout(l.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=l.bind(null,a.onerror),a.onload=l.bind(null,a.onload),c&&document.head.appendChild(a)}},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},function(){var t;o.g.importScripts&&(t=o.g.location+"");var e=o.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!t||!/^http(s?):/.test(t));)t=r[n--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=t}(),function(){var t={57:0};o.f.j=function(e,r){var n=o.o(t,e)?t[e]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise(function(r,o){n=t[e]=[r,o]});r.push(n[2]=i);var u=o.p+o.u(e),a=new Error;o.l(u,function(r){if(o.o(t,e)&&(0!==(n=t[e])&&(t[e]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;a.message="Loading chunk "+e+" failed.\n("+i+": "+u+")",a.name="ChunkLoadError",a.type=i,a.request=u,n[1](a)}},"chunk-"+e,e)}};var e=function(e,r){var n,i,u=r[0],a=r[1],c=r[2],f=0;if(u.some(function(e){return 0!==t[e]})){for(n in a)o.o(a,n)&&(o.m[n]=a[n]);c&&c(o)}for(e&&e(r);f<u.length;f++)i=u[f],o.o(t,i)&&t[i]&&t[i][0](),t[i]=0},r=Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap=Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))}();var i={};function u(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof f?n:f,p=Object.create(u.prototype);return a(p,"_invoke",function(r,n,o){var i,u,a,f=0,p=o||[],s=!1,l={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return i=e,u=0,a=t,l.n=r,c}};function d(r,n){for(u=r,a=n,e=0;!s&&f&&!o&&e<p.length;e++){var o,i=p[e],d=l.p,b=i[2];r>3?(o=b===n)&&(a=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=r<2&&d<i[1])?(u=0,l.v=n,l.n=i[1]):d<b&&(o=r<3||i[0]>n||n>b)&&(i[4]=r,i[5]=n,l.n=b,u=0))}if(o||r>1)return c;throw s=!0,n}return function(o,p,b){if(f>1)throw TypeError("Generator is already running");for(s&&1===p&&d(p,b),u=p,a=b;(e=u<2?t:a)||!s;){i||(u?u<3?(u>1&&(l.n=-1),d(u,a)):l.n=a:l.v=a);try{if(f=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,a)))throw TypeError("iterator result is not an object");if(!e.done)return e;a=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(s=l.n<0)?a:r.call(n,l))!==c)break}catch(e){i=t,u=1,a=e}finally{f=1}}return{value:e,done:s}}}(r,o,i),!0),p}var c={};function f(){}function p(){}function s(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(a(e={},n,function(){return this}),e),d=s.prototype=f.prototype=Object.create(l);function b(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,a(t,o,"GeneratorFunction")),t.prototype=Object.create(d),t}return p.prototype=s,a(d,"constructor",s),a(s,"constructor",p),p.displayName="GeneratorFunction",a(s,o,"GeneratorFunction"),a(d),a(d,o,"Generator"),a(d,n,function(){return this}),a(d,"toString",function(){return"[object Generator]"}),(u=function(){return{w:i,m:b}})()}function a(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}a=function(t,e,r,n){function i(e,r){a(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},a(t,e,r,n)}function c(t,e,r,n,o,i,u){try{var a=t[i](u),c=a.value}catch(t){return void r(t)}a.done?e(c):Promise.resolve(c).then(n,o)}function f(){return{id:"useLocation",load:(t=u().m(function t(){var e;return u().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,o.e(419).then(o.bind(o,157));case 1:return e=t.v.manifest,t.a(2,e)}},t)}),e=function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function u(t){c(i,n,o,u,a,"next",t)}function a(t){c(i,n,o,u,a,"throw",t)}u(void 0)})},function(){return e.apply(this,arguments)})};var t,e}return o.d(i,{default:function(){return f}}),i.default}()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"@arcgis/core/config.js";import t from"@arcgis/core/layers/support/TileInfo.js";import n from"@arcgis/core/Map.js";import i from"@arcgis/core/views/MapView.js";import o from"@arcgis/core/layers/VectorTileLayer.js";import a from"@arcgis/core/geometry/Point.js";import{when as s,once as r,watch as m}from"@arcgis/core/core/reactiveUtils.js";import l from"@arcgis/core/geometry/Extent.js";class c{_notImplemented(e){throw new Error(`${this.name} must implement ${e}()`)}isBaseMapReady(){this._notImplemented("isBaseMapReady")}addSymbolsToMap(){this._notImplemented("addSymbolsToMap")}addPatternsToMap(){this._notImplemented("addPatternsToMap")}getActiveSymbolImageId(){this._notImplemented("getActiveSymbolImageId")}getSelectedSymbolImageId(){this._notImplemented("getSelectedSymbolImageId")}}const p={animationDuration:200},u=["showKeyboardHelp","selectControl","moveLarge","nudgeMap","zoomLarge","nudgeZoom"];const h=(e,t)=>{let n=null;const i=(...i)=>{clearTimeout(n),n=setTimeout(()=>{e(...i)},t)};return i.cancel=()=>{n&&(clearTimeout(n),n=null)},i};function d({mapProvider:e,view:t,baseTileLayer:n,events:i,eventBus:o,getZoom:a,getCenter:l,getBounds:c,getResolution:p}){let u=!1;const d=[],y=[],v=e=>{const n=(()=>{if(u||!t||t.destroyed||!t.extent)return null;const{maxZoom:e,minZoom:n}=t.constraints;return{center:l(),bounds:c(),resolution:p(),zoom:a(),isAtMaxZoom:t.zoom+.01>=e,isAtMinZoom:t.zoom-.01<=n}})();n&&o.emit(e,n)};s(()=>n.loaded&&t.resolution>0,()=>v(i.MAP_LOADED)),r(()=>t.ready).then(()=>{u||(e.setBaseMapReady(!0),o.emit(i.MAP_READY,{map:e.map,view:e.view,mapStyleId:e.mapStyleId,mapSize:e.mapSize,crs:e.crs}))}),r(()=>t.stationary).then(()=>v(i.MAP_FIRST_IDLE));const g=h(()=>v(i.MAP_MOVE_END),500);y.push(g),d.push(m(()=>[t.interacting,t.animation],([e,t])=>{(e||t)&&o.emit(i.MAP_MOVE_START),e||t||g()}));const x=((e,t)=>{let n=0;return(...i)=>{const o=Date.now();o-n>=t&&(n=o,e(...i))}})(()=>v(i.MAP_MOVE),10);y.push(x),d.push(m(()=>t.zoom,x)),d.push(m(()=>t.extent,()=>o.emit(i.MAP_RENDER),{initial:!1}));const f=h(()=>v(i.MAP_DATA_CHANGE),500);y.push(f),d.push(m(()=>t.updating,e=>!e&&f()));let w=null,M=null;return d.push(t.on("pointer-down",e=>{w=e.x,M=e.y})),d.push(t.on("pointer-up",n=>{if(0!==n.button)return;if(Math.hypot(n.x-w,n.y-M)>6)return;if("active"===e.sketchViewModel?.state)return;const a={x:n.x,y:n.y},s=t.toMap(a);s&&o.emit(i.MAP_CLICK,{point:a,coords:[s.x,s.y]})})),{remove(){u=!0,y.forEach(e=>e.cancel()),d.forEach(e=>e.remove())}}}const y=e=>e?new l({xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3],spatialReference:{wkid:27700}}):void 0,v=e=>e?new a({x:e[0],y:e[1],spatialReference:{wkid:27700}}):void 0,g=(e,t)=>{if(e)if("FeatureCollection"===e.type)e.features.forEach(e=>g(e,t));else if("Feature"===e.type)g(e.geometry,t);else if("GeometryCollection"===e.type)e.geometries.forEach(e=>g(e,t));else{const n=e=>{Array.isArray(e)&&("number"==typeof e[0]?t.push(e):e.forEach(n))};n(e.coordinates)}},x=e=>{const t=[];g(e,t);const n=t.map(e=>e[0]),i=t.map(e=>e[1]);return y([Math.min(...n),Math.min(...i),Math.max(...n),Math.max(...i)])},f=e=>{const t=1609.344,n=e/t;if(n<.5/t){const t=Math.round(e);return`${t} ${1===t?"metre":"metres"}`}if(n<10){const e=Number.parseFloat(n.toFixed(1));return`${e} ${1===e?"mile":"miles"}`}const i=Math.round(n);return`${i} ${1===i?"mile":"miles"}`};const w={top:0,right:0,bottom:0,left:0};class M extends c{constructor({mapProviderConfig:e={},events:t,eventBus:n}){super(),this.events=t,this.eventBus=n,this.capabilities={supportedShortcuts:u,supportsMapSizes:!1},Object.assign(this,e),this.mapEventHandles=[],this.appEventHandles=[]}get name(){return"EsriProvider"}async initMap(a){const{container:s,padding:r,mapStyle:m,mapSize:l,maxExtent:c}=a;this.mapStyleId=m?.id,this.mapSize=l;const{events:p,eventBus:u}=this;this.setupConfig&&await this.setupConfig(e);const h=new o({id:"baselayer",url:m.url,visible:!0}),g=new n({layers:[h]}),x=c?y(c):null,f=new i({spatialReference:27700,container:s,map:g,zoom:a.zoom,center:v(a.center),maxExtent:c,constraints:{lods:t.create({spatialReference:{wkid:27700}}).lods,snapToZoom:!1,minZoom:a.minZoom,maxZoom:a.maxZoom,maxScale:0,geometry:x,rotationEnabled:!1},ui:{components:[]},popupEnabled:!1});(e=>{if(!e)return;const t=e.querySelector(".esri-view-surface");t.removeAttribute("role"),t.tabIndex=-1,t.style["outline-color"]="transparent",t.style.touchAction="none"})(f.container),f.padding=r,a.bounds&&f.when(()=>f.goTo(y(a.bounds),{duration:0})),this.mapEventHandles=d({mapProvider:this,view:f,baseTileLayer:h,events:p,eventBus:u,getZoom:this.getZoom.bind(this),getCenter:this.getCenter.bind(this),getBounds:this.getBounds.bind(this),getResolution:this.getResolution.bind(this)}),this.appEventHandles=function({baseTileLayer:e,events:t,eventBus:n}){const i=i=>{e.loadStyle(i.url).then(()=>{n.emit(t.MAP_STYLE_CHANGE,{mapStyleId:i.id})})};return n.on(t.MAP_SET_STYLE,i),{remove(){n.off(t.MAP_SET_STYLE,i)}}}({baseTileLayer:h,events:p,eventBus:u})||[],this.map=g,this.view=f,this.baseTileLayer=h}_isBaseMapReady=!1;setBaseMapReady(e){this._isBaseMapReady=e}isBaseMapReady(){return this._isBaseMapReady}destroyMap(){this.mapEvents?.remove(),this.appEvents?.remove(),this.mapEvents=null,this.appEvents=null,this.view&&(this.view.container=null,this.view.destroy(),this.view=null),this.map&&(this.map.removeAll(),this.map=null)}setView({center:e,zoom:t}){this.view.animation?.destroy();const n={center:e?new a({x:e[0],y:e[1],spatialReference:{wkid:27700}}):this.view.center,zoom:t??this.view.zoom};this.view.goTo({...n,duration:p.animationDuration})}zoomIn(e){this.view.animation?.destroy(),this.view.goTo({zoom:this.view.zoom+e,duration:p.animationDuration})}zoomOut(e){this.view.animation?.destroy(),this.view.goTo({zoom:this.view.zoom-e,duration:p.animationDuration})}panBy(e){const{x:t,y:n}=this.view.toScreen(this.view.center),i={x:t+e[0],y:n+e[1]},o=this.view.toMap(i);this.view.goTo({center:o,duration:p.animationDuration})}fitToBounds(e){const t=Array.isArray(e)?y(e):x(e);this.view.goTo(t,{duration:p.DELAY})}setPadding(e){this.view.padding=e}getCenter(){const e=this.view.center;return[e.x,e.y].map(e=>Math.round(100*e)/100)}getZoom(){return this.view.zoom}getBounds(){const{xmin:e,ymin:t,xmax:n,ymax:i}=this.view.extent;return[e,t,n,i].map(e=>Math.round(100*e)/100)}getFeaturesAtPoint(e,t){return async function(e,t){if(!e||!t)return[];const n=e.map.layers.filter(e=>e instanceof o);return n.length?(await e.hitTest(t,{include:n.toArray()})).results.map(e=>({layerId:e.layer.id,layerTitle:e.layer.title||e.layer.id,type:e.layer.type,geometry:e.graphic.geometry,symbol:e.graphic.symbol})):[]}(this.view,e)}getVisibleFeatures(e){return[]}getAreaDimensions(){return(e=>{if(!(e&&e instanceof l))return"";const t=e.xmin,n=e.ymin,i=e.xmax,o=e.ymax-n,a=f(i-t);return`${f(o)} by ${a}`})(((e,t=w)=>{if(!e.container)return null;const{width:n,height:i}=e.container.getBoundingClientRect(),o={x:t.left,y:i-t.bottom},a={x:n-t.right,y:t.top},s=e.toMap(o),r=e.toMap(a);return new l({xmin:s.x,ymin:s.y,xmax:r.x,ymax:r.y,spatialReference:s.spatialReference})})(this.view))}getCardinalMove(e,t){return function(e,t){const[n,i]=e,[o,a]=t,s=o-n,r=a-i,m=[];return Math.abs(r)>.1&&m.push(`${r>0?"north":"south"} ${f(Math.abs(r))}`),Math.abs(s)>.1&&m.push(`${s>0?"east":"west"} ${f(Math.abs(s))}`),m.join(", ")}(e,t)}getResolution(){return this.view.resolution}mapToScreen(e){const t=v(e),n=this.view.toScreen(t);return{x:n.x,y:n.y}}screenToMap(e){const t=this.view.toMap(e);return[t.x,t.y]}isGeometryObscured(e,t){return((e,t,n)=>{if(!n?.container)return!1;const i=n.container.getBoundingClientRect(),o=x(e),s=[n.toScreen(new a({x:o.xmin,y:o.ymin,spatialReference:o.spatialReference})),n.toScreen(new a({x:o.xmin,y:o.ymax,spatialReference:o.spatialReference})),n.toScreen(new a({x:o.xmax,y:o.ymin,spatialReference:o.spatialReference})),n.toScreen(new a({x:o.xmax,y:o.ymax,spatialReference:o.spatialReference}))],r=Math.min(...s.map(e=>e.x)),m=Math.max(...s.map(e=>e.x)),l=Math.min(...s.map(e=>e.y)),c=Math.max(...s.map(e=>e.y)),p=t.left-i.left,u=t.top-i.top,h=t.right-i.left,d=t.bottom-i.top;return r<h&&m>p&&l<d&&c>u})(e,t,this.view)}}export{M as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"@babel/runtime/helpers/regenerator";import r from"@babel/runtime/helpers/objectSpread2";import t from"@babel/runtime/helpers/asyncToGenerator";import o from"@babel/runtime/helpers/createForOfIteratorHelper";var n=document.documentMode,a="Internet Explorer is not supported",i={isSupported:!!Array.prototype.findLast},p=function(e){if(!window.WebGLRenderingContext)return{isEnabled:!1,error:"WebGL is not supported"};var r,t=document.createElement("canvas"),n=!1,a=o(e);try{for(a.s();!(r=a.n()).done;){var i=r.value;try{if((n=t.getContext(i))&&"function"==typeof n.getParameter)return{isEnabled:!0}}catch(e){}}}catch(e){a.e(e)}finally{a.f()}return{isEnabled:!1,error:"WebGL is supported, but disabled"}}(["webgl2","webgl1"]);function u(){var o,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{checkDeviceCapabilities:function(){return{isSupported:i.isSupported&&p.isEnabled&&!n,error:a}},load:(o=t(e().m(function t(){var o,n,a;return e().w(function(e){for(;;)switch(e.p=e.n){case 0:return o=r(r({},u),{},{crs:"EPSG:27700"}),e.p=1,e.n=2,import(/* webpackChunkName: "im-esri-provider" */ "./im-esri-provider.js");case 2:return n=e.v.default,e.a(2,{MapProvider:n,mapProviderConfig:o});case 3:throw e.p=3,a=e.v,console.error("Failed to load map provider",a),a;case 4:return e.a(2)}},t,null,[[1,3]])})),function(){return o.apply(this,arguments)})}}export{u as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/plugins/mapStyles/EsriProvider.jsx
|
|
2
|
-
import { MapProvider } from '
|
|
2
|
+
import { MapProvider } from '../../mapProvider.js'
|
|
3
3
|
import './esriProvider.scss'
|
|
4
4
|
import esriConfig from '@arcgis/core/config.js'
|
|
5
5
|
import TileInfo from '@arcgis/core/layers/support/TileInfo.js'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { watch, when, once } from '@arcgis/core/core/reactiveUtils.js'
|
|
2
|
-
import { debounce } from '
|
|
3
|
-
import { throttle } from '
|
|
2
|
+
import { debounce } from '../../../src/utils/debounce.js'
|
|
3
|
+
import { throttle } from '../../../src/utils/throttle.js'
|
|
4
4
|
|
|
5
5
|
const DEBOUNCE_IDLE_TIME = 500
|
|
6
6
|
const MOVE_THROTTLE_TIME = 10
|