@defra/interactive-map 0.0.30-alpha → 0.0.31-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/index.css +1 -1
- package/dist/esm/im-core.js +1 -1
- package/dist/esm/im-shell.js +1 -1
- package/dist/umd/im-core.js +1 -1
- package/dist/umd/index.js +1 -1
- package/docs/api/context.md +4 -4
- package/docs/api.md +111 -37
- package/docs/assets/css/docusaurus.scss +20 -4
- package/docs/assets/images/basic-map.jpg +0 -0
- package/docs/assets/images/button-first.jpg +0 -0
- package/docs/assets/images/deuteranopia-ozs-map-thumb.jpg +0 -0
- package/docs/assets/images/draw.jpg +0 -0
- package/docs/assets/images/marker-panel.jpg +0 -0
- package/docs/assets/images/night-ozs-map-thumb.jpg +0 -0
- package/docs/assets/images/outdoor-ozs-map-thumb.jpg +0 -0
- package/docs/assets/images/search.jpg +0 -0
- package/docs/assets/images/select-feature.jpg +0 -0
- package/docs/assets/images/style-switcher.jpg +0 -0
- package/docs/assets/images/toggle-marker-label.jpg +0 -0
- package/docs/assets/images/tritanopia-ozs-map-thumb.jpg +0 -0
- package/docs/examples/add-marker-with-panel.mdx +2 -2
- package/docs/examples/basic-map.mdx +2 -2
- package/docs/examples/draw.mdx +271 -0
- package/docs/examples/index.mdx +58 -10
- package/docs/examples/search-control.mdx +71 -0
- package/docs/examples/select-feature.mdx +146 -0
- package/docs/examples/style-switcher.mdx +135 -0
- package/docs/examples/toggle-marker-label.mdx +3 -3
- package/docs/plugins/datasets.md +15 -28
- package/docusaurus.config.cjs +5 -1
- package/package.json +1 -1
- package/plugins/beta/datasets/dist/css/index.css +4 -0
- package/plugins/beta/datasets/dist/esm/im-datasets-ml-adapter.js +1 -0
- package/plugins/beta/datasets/dist/esm/im-datasets-plugin.js +1 -1
- package/plugins/beta/datasets/dist/esm/index.js +1 -1
- package/plugins/beta/datasets/dist/umd/im-datasets-ml-adapter.js +2 -0
- package/plugins/beta/datasets/dist/umd/im-datasets-plugin.js +2 -0
- package/plugins/beta/datasets/dist/umd/index.js +2 -0
- package/plugins/beta/datasets/src/adapters/loadLayerAdapter.js +33 -0
- package/plugins/beta/datasets/src/adapters/maplibre/layerBuilders.js +44 -120
- package/plugins/beta/datasets/src/adapters/maplibre/maplibreLayerAdapter.js +145 -245
- package/plugins/beta/datasets/src/adapters/maplibre/maplibreLayerAdapter.test.js +516 -0
- package/plugins/beta/datasets/src/adapters/maplibre/registry/mapLibreDataset.js +191 -0
- package/plugins/beta/datasets/src/adapters/maplibre/registry/mapLibreDataset.test.js +441 -0
- package/plugins/beta/datasets/src/api/addDataset.js +2 -5
- package/plugins/beta/datasets/src/api/addDataset.test.js +16 -0
- package/plugins/beta/datasets/src/api/getOpacity.js +14 -14
- package/plugins/beta/datasets/src/api/getOpacity.test.js +72 -0
- package/plugins/beta/datasets/src/api/getStyle.js +8 -9
- package/plugins/beta/datasets/src/api/getStyle.test.js +42 -0
- package/plugins/beta/datasets/src/api/removeDataset.js +7 -7
- package/plugins/beta/datasets/src/api/removeDataset.test.js +45 -0
- package/plugins/beta/datasets/src/api/setData.js +9 -3
- package/plugins/beta/datasets/src/api/setData.test.js +62 -0
- package/plugins/beta/datasets/src/api/setDatasetVisibility.js +5 -30
- package/plugins/beta/datasets/src/api/setDatasetVisibility.test.js +31 -0
- package/plugins/beta/datasets/src/api/setFeatureVisibility.js +3 -21
- package/plugins/beta/datasets/src/api/setFeatureVisibility.test.js +32 -0
- package/plugins/beta/datasets/src/api/setGlobals.js +20 -0
- package/plugins/beta/datasets/src/api/setGlobals.test.js +63 -0
- package/plugins/beta/datasets/src/api/setOpacity.js +8 -27
- package/plugins/beta/datasets/src/api/setOpacity.test.js +31 -0
- package/plugins/beta/datasets/src/api/setStyle.js +5 -21
- package/plugins/beta/datasets/src/api/setStyle.test.js +53 -0
- package/plugins/beta/datasets/src/components/Key/Key.jsx +51 -0
- package/plugins/beta/datasets/src/components/Key/KeyGroupItem.jsx +18 -0
- package/plugins/beta/datasets/src/components/Key/KeyItem.jsx +20 -0
- package/plugins/beta/datasets/src/components/Key/KeySvg.jsx +22 -0
- package/plugins/beta/datasets/src/components/Key/KeySvg.test.jsx +87 -0
- package/plugins/beta/datasets/src/components/Key/KeySvgLine.jsx +19 -0
- package/plugins/beta/datasets/src/components/Key/KeySvgLine.test.jsx +71 -0
- package/plugins/beta/datasets/src/components/{KeySvgPattern.jsx → Key/KeySvgPattern.jsx} +3 -4
- package/plugins/beta/datasets/src/components/Key/KeySvgPattern.test.jsx +55 -0
- package/plugins/beta/datasets/src/components/Key/KeySvgRect.jsx +22 -0
- package/plugins/beta/datasets/src/components/Key/KeySvgRect.test.jsx +85 -0
- package/plugins/beta/datasets/src/components/{KeySvgSymbol.jsx → Key/KeySvgSymbol.jsx} +5 -5
- package/plugins/beta/datasets/src/components/Key/KeySvgSymbol.test.jsx +80 -0
- package/plugins/beta/datasets/src/components/Key/svgProperties.test.js +61 -0
- package/plugins/beta/datasets/src/{panels → components/LayersMenu}/Layers.module.scss +4 -0
- package/plugins/beta/datasets/src/components/LayersMenu/LayersMenu.jsx +33 -0
- package/plugins/beta/datasets/src/components/LayersMenu/LayersMenuCheckbox.jsx +31 -0
- package/plugins/beta/datasets/src/components/LayersMenu/LayersMenuGroupWrapper.jsx +19 -0
- package/plugins/beta/datasets/src/datasets.scss +2 -2
- package/plugins/beta/datasets/src/fetch/createDynamicSource.js +8 -8
- package/plugins/beta/datasets/src/{DatasetsInit.jsx → initialise/DatasetsInit.jsx} +19 -21
- package/plugins/beta/datasets/src/{defaults.js → initialise/defaults.js} +17 -2
- package/plugins/beta/datasets/src/initialise/defaults.test.js +127 -0
- package/plugins/beta/datasets/src/{datasets.js → initialise/initialiseDatasets.js} +30 -26
- package/plugins/beta/datasets/src/initialise/initialiseDatasets.test.js +273 -0
- package/plugins/beta/datasets/src/manifest.js +8 -6
- package/plugins/beta/datasets/src/reducers/__data__/demoDatasets.js +253 -0
- package/plugins/beta/datasets/src/reducers/datasetsToMenu.js +78 -0
- package/plugins/beta/datasets/src/reducers/datasetsToMenu.test.js +35 -0
- package/plugins/beta/datasets/src/reducers/mappedDatasetsReducer.js +34 -0
- package/plugins/beta/datasets/src/reducers/mappedDatasetsReducer.test.js +117 -0
- package/plugins/beta/datasets/src/reducers/pluginState.js +206 -0
- package/plugins/beta/datasets/src/reducers/pluginState.test.js +386 -0
- package/plugins/beta/datasets/src/registry/__mocks__/datasetRegistry.js +29 -0
- package/plugins/beta/datasets/src/registry/createDataset.js +5 -0
- package/plugins/beta/datasets/src/registry/dataset.js +172 -0
- package/plugins/beta/datasets/src/registry/dataset.test.js +483 -0
- package/plugins/beta/datasets/src/registry/datasetDefinitionCache.js +35 -0
- package/plugins/beta/datasets/src/registry/datasetRegistry.js +116 -0
- package/plugins/beta/datasets/src/registry/datasetRegistry.test.js +335 -0
- package/plugins/beta/datasets/src/registry/dynamicGeoJson.js +17 -0
- package/plugins/beta/datasets/src/registry/globalDataset.js +36 -0
- package/plugins/beta/draw-ml/dist/esm/im-draw-ml-plugin.js +1 -1
- package/plugins/beta/draw-ml/dist/umd/im-draw-ml-plugin.js +1 -1
- package/plugins/beta/draw-ml/src/events.js +13 -1
- package/plugins/beta/draw-ml/src/index.js +1 -1
- package/plugins/beta/draw-ml/src/manifest.js +3 -0
- package/plugins/interact/dist/esm/im-interact-plugin.js +1 -1
- package/plugins/interact/dist/umd/im-interact-plugin.js +1 -1
- package/plugins/interact/src/InteractInit.jsx +2 -2
- package/plugins/interact/src/InteractInit.test.js +1 -1
- package/plugins/interact/src/events.js +2 -29
- package/plugins/interact/src/events.test.js +4 -102
- package/plugins/interact/src/hooks/useAttachEvents.js +3 -4
- package/plugins/interact/src/hooks/useAttachEvents.test.js +1 -3
- package/plugins/interact/src/hooks/useInteractionHandlers.js +10 -1
- package/plugins/interact/src/hooks/useInteractionHandlers.test.js +23 -4
- package/plugins/interact/src/manifest.js +0 -35
- package/plugins/interact/src/manifest.test.js +3 -43
- package/providers/beta/esri/dist/esm/im-esri-provider.js +1 -1
- package/providers/beta/esri/src/esriProvider.js +4 -0
- package/providers/beta/openlayers/dist/esm/im-openlayers-provider.js +1 -1
- package/providers/beta/openlayers/dist/umd/im-openlayers-provider.js +1 -1
- package/providers/beta/openlayers/src/openlayersProvider.js +4 -0
- package/providers/beta/openlayers/src/openlayersProvider.test.js +5 -0
- package/providers/maplibre/dist/esm/im-maplibre-provider.js +1 -1
- package/providers/maplibre/dist/umd/im-maplibre-provider.js +1 -1
- package/providers/maplibre/src/maplibreProvider.js +6 -4
- package/providers/maplibre/src/maplibreProvider.test.js +5 -0
- package/providers/maplibre/src/utils/highlightFeatures.js +74 -25
- package/providers/maplibre/src/utils/highlightFeatures.test.js +132 -0
- package/providers/maplibre/src/utils/patternImages.js +2 -4
- package/providers/maplibre/src/utils/symbolImages.js +1 -4
- package/rollup.esm.mjs +2 -8
- package/src/App/components/MapButton/MapButton.jsx +16 -1
- package/src/App/components/MapButton/MapButton.module.scss +12 -1
- package/src/App/components/MapButton/MapButton.test.jsx +40 -1
- package/src/App/hooks/useContinueEnabledEvaluator.js +31 -0
- package/src/App/hooks/useContinueEnabledEvaluator.test.js +118 -0
- package/src/App/hooks/useEvaluateProp.js +15 -15
- package/src/App/hooks/useEvaluateProp.test.js +80 -76
- package/src/App/hooks/useLayoutMeasurements.js +1 -3
- package/src/App/hooks/useResizeObserver.js +12 -1
- package/src/App/hooks/useResizeObserver.test.js +1 -0
- package/src/App/renderer/PluginInits.jsx +2 -0
- package/src/App/renderer/mapButtons.js +21 -1
- package/src/App/renderer/mapButtons.test.js +46 -1
- package/src/App/store/appReducer.js +1 -1
- package/src/App/store/appReducer.test.js +37 -0
- package/src/InteractiveMap/InteractiveMap.js +10 -0
- package/src/InteractiveMap/InteractiveMap.test.js +8 -0
- package/src/config/appConfig.js +25 -0
- package/src/config/appConfig.test.js +50 -0
- package/src/config/defaults.js +1 -0
- package/src/scss/settings/_dimensions.scss +1 -0
- package/src/services/patternRegistry.js +8 -4
- package/src/types.js +7 -0
- package/src/utils/patternUtils.js +1 -2
- package/src/utils/patternUtils.test.js +9 -0
- package/webpack.dev.mjs +10 -0
- package/webpack.umd.mjs +1 -1
- package/plugins/beta/datasets/dist/adapters/maplibre/esm/im-datasets-ml-adapter.js +0 -1
- package/plugins/beta/datasets/dist/adapters/maplibre/esm/index.js +0 -1
- package/plugins/beta/datasets/dist/umd/maplibre/im-datasets-maplibre-adapter.js +0 -2
- package/plugins/beta/datasets/dist/umd/maplibre/im-datasets-plugin.js +0 -2
- package/plugins/beta/datasets/dist/umd/maplibre/index.js +0 -2
- package/plugins/beta/datasets/src/adapters/maplibre/index.js +0 -18
- package/plugins/beta/datasets/src/adapters/maplibre/layerIds.js +0 -75
- package/plugins/beta/datasets/src/adapters/maplibre/patternImages.js +0 -27
- package/plugins/beta/datasets/src/adapters/maplibre/symbolImages.js +0 -31
- package/plugins/beta/datasets/src/components/KeySvg.jsx +0 -24
- package/plugins/beta/datasets/src/components/KeySvgLine.jsx +0 -19
- package/plugins/beta/datasets/src/components/KeySvgRect.jsx +0 -22
- package/plugins/beta/datasets/src/index.maplibre.umd.js +0 -23
- package/plugins/beta/datasets/src/panels/Key.jsx +0 -62
- package/plugins/beta/datasets/src/panels/Layers.jsx +0 -141
- package/plugins/beta/datasets/src/reducer.js +0 -219
- package/plugins/beta/datasets/src/reducers/keyReducer.js +0 -34
- package/plugins/beta/datasets/src/utils/filters.js +0 -34
- package/plugins/beta/datasets/src/utils/mergeSublayer.js +0 -86
- package/plugins/beta/draw-ml/dist/css/index.css +0 -21
- /package/plugins/beta/datasets/dist/umd/{maplibre/im-datasets-maplibre-adapter.js.LICENSE.txt → im-datasets-ml-adapter.js.LICENSE.txt} +0 -0
- /package/plugins/beta/datasets/dist/umd/{maplibre/im-datasets-plugin.js.LICENSE.txt → im-datasets-plugin.js.LICENSE.txt} +0 -0
- /package/plugins/beta/datasets/dist/umd/{maplibre/index.js.LICENSE.txt → index.js.LICENSE.txt} +0 -0
- /package/plugins/beta/datasets/src/components/{EmptyKey.jsx → Key/EmptyKey.jsx} +0 -0
- /package/plugins/beta/datasets/src/components/{EmptyKey.test.jsx → Key/EmptyKey.test.jsx} +0 -0
- /package/plugins/beta/datasets/src/{panels → components/Key}/Key.module.scss +0 -0
- /package/plugins/beta/datasets/src/components/{svgProperties.js → Key/svgProperties.js} +0 -0
package/dist/umd/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
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.InteractiveMap=t())}(this,()=>(()=>{"use strict";var e,t,n,r,o={698(e,t){var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function o(e,t,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==t.key&&(o=""+t.key),"key"in t)for(var i in r={},t)"key"!==i&&(r[i]=t[i]);else r=t;return t=r.ref,{$$typeof:n,type:e,key:o,ref:void 0!==t?t:null,props:r}}t.Fragment=r,t.jsx=o,t.jsxs=o},869(e,t){var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),h=Symbol.iterator,v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,m={};function b(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||v}function g(){}function _(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||v}b.prototype.isReactComponent={},b.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},b.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},g.prototype=b.prototype;var w=_.prototype=new g;w.constructor=_,y(w,b.prototype),w.isPureReactComponent=!0;var P=Array.isArray;function E(){}var O={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function S(e,t,r){var o=r.ref;return{$$typeof:n,type:e,key:t,ref:void 0!==o?o:null,props:r}}function k(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var j=/\/+/g;function T(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(n=""+e.key,r={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var n,r}function x(e,t,o,i,a){var u=typeof e;"undefined"!==u&&"boolean"!==u||(e=null);var c,s,l=!1;if(null===e)l=!0;else switch(u){case"bigint":case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case n:case r:l=!0;break;case p:return x((l=e._init)(e._payload),t,o,i,a)}}if(l)return a=a(e),l=""===i?"."+T(e,0):i,P(a)?(o="",null!=l&&(o=l.replace(j,"$&/")+"/"),x(a,t,o,"",function(e){return e})):null!=a&&(k(a)&&(c=a,s=o+(null==a.key||e&&e.key===a.key?"":(""+a.key).replace(j,"$&/")+"/")+l,a=S(c.type,s,c.props)),t.push(a)),1;l=0;var f,d=""===i?".":i+":";if(P(e))for(var v=0;v<e.length;v++)l+=x(i=e[v],t,o,u=d+T(i,v),a);else if("function"==typeof(v=null===(f=e)||"object"!=typeof f?null:"function"==typeof(f=h&&f[h]||f["@@iterator"])?f:null))for(e=v.call(e),v=0;!(i=e.next()).done;)l+=x(i=i.value,t,o,u=d+T(i,v++),a);else if("object"===u){if("function"==typeof e.then)return x(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(E,E):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(e),t,o,i,a);throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return l}function C(e,t,n){if(null==e)return e;var r=[],o=0;return x(e,r,"","",function(e){return t.call(n,e,o++)}),r}function M(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var D="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},R={map:C,forEach:function(e,t,n){C(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return C(e,function(){t++}),t},toArray:function(e){return C(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};t.Activity=d,t.Children=R,t.Component=b,t.Fragment=o,t.Profiler=a,t.PureComponent=_,t.StrictMode=i,t.Suspense=l,t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,t.__COMPILER_RUNTIME={__proto__:null,c:function(e){return O.H.useMemoCache(e)}},t.cache=function(e){return function(){return e.apply(null,arguments)}},t.cacheSignal=function(){return null},t.cloneElement=function(e,t,n){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var r=y({},e.props),o=e.key;if(null!=t)for(i in void 0!==t.key&&(o=""+t.key),t)!A.call(t,i)||"key"===i||"__self"===i||"__source"===i||"ref"===i&&void 0===t.ref||(r[i]=t[i]);var i=arguments.length-2;if(1===i)r.children=n;else if(1<i){for(var a=Array(i),u=0;u<i;u++)a[u]=arguments[u+2];r.children=a}return S(e.type,o,r)},t.createContext=function(e){return(e={$$typeof:c,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:u,_context:e},e},t.createElement=function(e,t,n){var r,o={},i=null;if(null!=t)for(r in void 0!==t.key&&(i=""+t.key),t)A.call(t,r)&&"key"!==r&&"__self"!==r&&"__source"!==r&&(o[r]=t[r]);var a=arguments.length-2;if(1===a)o.children=n;else if(1<a){for(var u=Array(a),c=0;c<a;c++)u[c]=arguments[c+2];o.children=u}if(e&&e.defaultProps)for(r in a=e.defaultProps)void 0===o[r]&&(o[r]=a[r]);return S(e,i,o)},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:s,render:e}},t.isValidElement=k,t.lazy=function(e){return{$$typeof:p,_payload:{_status:-1,_result:e},_init:M}},t.memo=function(e,t){return{$$typeof:f,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=O.T,n={};O.T=n;try{var r=e(),o=O.S;null!==o&&o(n,r),"object"==typeof r&&null!==r&&"function"==typeof r.then&&r.then(E,D)}catch(e){D(e)}finally{null!==t&&null!==n.types&&(t.types=n.types),O.T=t}},t.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},t.use=function(e){return O.H.use(e)},t.useActionState=function(e,t,n){return O.H.useActionState(e,t,n)},t.useCallback=function(e,t){return O.H.useCallback(e,t)},t.useContext=function(e){return O.H.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e,t){return O.H.useDeferredValue(e,t)},t.useEffect=function(e,t){return O.H.useEffect(e,t)},t.useEffectEvent=function(e){return O.H.useEffectEvent(e)},t.useId=function(){return O.H.useId()},t.useImperativeHandle=function(e,t,n){return O.H.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return O.H.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return O.H.useLayoutEffect(e,t)},t.useMemo=function(e,t){return O.H.useMemo(e,t)},t.useOptimistic=function(e,t){return O.H.useOptimistic(e,t)},t.useReducer=function(e,t,n){return O.H.useReducer(e,t,n)},t.useRef=function(e){return O.H.useRef(e)},t.useState=function(e){return O.H.useState(e)},t.useSyncExternalStore=function(e,t,n){return O.H.useSyncExternalStore(e,t,n)},t.useTransition=function(){return O.H.useTransition()},t.version="19.2.4"},540(e,t,n){e.exports=n(869)},848(e,t,n){e.exports=n(698)},205(e,t,n){n.d(t,{N:()=>a,i:()=>u});var r=n(637),o=n(901),i=n(201);function a(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).isFullscreen,n=e.config,a=e.rootEl,u=n.pageTitle,c=n.behaviour,s=n.containerHeight,l=null!=t?t:function(e){var t=e.id,n=e.behaviour,o=e.manageHistoryState;return"mapOnly"===n||("buttonFirst"===n?!1===o||(0,r.q)(e.mapViewQueryParam)===t:(0,i.w)(e)&&(0,r.q)(e.mapViewQueryParam)===t)}(n);["mapOnly","buttonFirst","hybrid"].includes(c)&&((0,o.U)({containerEl:a,isFullscreen:l}),document.documentElement.classList.toggle("im-is-fullscreen",l),a.classList.toggle("im-is-fullscreen",l)),["buttonFirst","hybrid"].includes(c)&&function(e){var t=e.pageTitle,n=e.isFullscreen,r=document.title.split(": "),o=r[r.length-1];document.title=n?"".concat(t,": ").concat(o):o}({pageTitle:u,isFullscreen:l});var f=l||"buttonFirst"!==c&&!(0,i.w)(n)?s:"auto";a.style.height=l?"100%":f}function u(){document.body.classList.remove("im-is-loading")}},12(e,t,n){n.d(t,{q:()=>r});var r={APP_ADD_MARKER:"app:addmarker",APP_UPDATE_MARKER:"app:updatemarker",APP_REMOVE_MARKER:"app:removemarker",APP_SET_MODE:"app:setmode",APP_REVERT_MODE:"app:revertmode",APP_ADD_BUTTON:"app:addbutton",APP_TOGGLE_BUTTON_STATE:"app:togglebuttonstate",APP_ADD_PANEL:"app:addpanel",APP_REMOVE_PANEL:"app:removepanel",APP_SHOW_PANEL:"app:showpanel",APP_HIDE_PANEL:"app:hidepanel",APP_ADD_CONTROL:"app:addcontrol",APP_READY:"app:ready",APP_OPENED:"app:opened",APP_CLOSED:"app:closed",APP_PANEL_OPENED:"app:panelopened",APP_PANEL_CLOSED:"app:panelclosed",MAP_SET_STYLE:"map:setstyle",MAP_SET_SIZE:"map:setsize",MAP_SET_FEATURES:"map:setfeatures",MAP_SET_ACTIVE_FEATURE:"map:setactivefeature",MAP_SELECT_FEATURE:"map:selectfeature",MAP_SET_PIXEL_RATIO:"map:setpixelratio",MAP_FIT_TO_BOUNDS:"map:fittobounds",MAP_SET_VIEW:"map:setview",MAP_INIT_MAP_STYLES:"map:initmapstyles",MAP_STYLE_CHANGE:"map:stylechange",MAP_LOADED:"map:loaded",MAP_READY:"map:ready",MAP_SIZE_CHANGE:"map:sizechange",MAP_FIRST_IDLE:"map:firstidle",MAP_MOVE_START:"map:movestart",MAP_MOVE:"map:move",MAP_MOVE_END:"map:moveend",MAP_STATE_UPDATED:"map:stateupdated",MAP_DATA_CHANGE:"map:datachange",MAP_RENDER:"map:render",MAP_CLICK:"map:click",MAP_DESTROY:"map:destroy"}},0(e,t,n){n.d(t,{v:()=>o});var r="[interactive-map]",o={warn:function(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(e=console).warn.apply(e,[r].concat(n))},error:function(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(e=console).error.apply(e,[r].concat(n))}}},233(e,t,n){function r(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function u(n,r,i,a){var u=r&&r.prototype instanceof s?r:s,l=Object.create(u.prototype);return o(l,"_invoke",function(n,r,o){var i,a,u,s=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return i=t,a=0,u=e,p.n=n,c}};function d(n,r){for(a=n,u=r,t=0;!f&&s&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];n>3?(o=h===r)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=n<2&&d<i[1])?(a=0,p.v=r,p.n=i[1]):d<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,a=0))}if(o||n>1)return c;throw f=!0,r}return function(o,l,h){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),a=l,u=h;(t=a<2?e:u)||!f;){i||(a?a<3?(a>1&&(p.n=-1),d(a,u)):p.n=u:p.v=u);try{if(s=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=p.n<0)?u:n.call(r,p))!==c)break}catch(t){i=e,a=1,u=t}finally{s=1}}return{value:t,done:f}}}(n,i,a),!0),l}var c={};function s(){}function l(){}function f(){}t=Object.getPrototypeOf;var p=[][i]?t(t([][i]())):(o(t={},i,function(){return this}),t),d=f.prototype=s.prototype=Object.create(p);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,o(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=f,o(d,"constructor",f),o(f,"constructor",l),l.displayName="GeneratorFunction",o(f,a,"GeneratorFunction"),o(d),o(d,a,"Generator"),o(d,i,function(){return this}),o(d,"toString",function(){return"[object Generator]"}),(r=function(){return{w:u,m:h}})()}function o(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}o=function(e,t,n,r){function a(t,n){o(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},o(e,t,n,r)}function i(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)}n.d(t,{H_:()=>u,Rt:()=>s,xK:()=>c});var a=null;function u(e,t){var n=e.url,o=e.transformRequest,u=e.load;a=function(){var e,a=(e=r().m(function e(i,a){var c;return r().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,u();case 1:return c=e.v,e.a(2,c(n,o,t,i,a))}},e)}),function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function u(e){i(a,r,o,u,c,"next",e)}function c(e){i(a,r,o,u,c,"throw",e)}u(void 0)})});return function(e,t){return a.apply(this,arguments)}}()}function c(){return null!==a}function s(e,t){if(!a)throw new Error("ReverseGeocode not initialised");return a(e,t)}},902(e,t,n){n.d(t,{C1:()=>u,Ey:()=>s,ip:()=>c});var r=window.matchMedia("(pointer: coarse)").matches?"touch":"unknown",o=new Set,i=new Set;function a(e){r!==e&&(r=e,i.forEach(function(t){return t(e)}),o.forEach(function(t){return t(e)}))}function u(){var e=window.matchMedia("(pointer: coarse)"),t=function(e){a(e.matches?"touch":"mouse")};e.addEventListener("change",t);var n=function(e){var t,n="pen"===(t=e.pointerType)||"touch"===t?"touch":"mouse"===t?"mouse":"unknown";n!==r&&(r=n,i.forEach(function(e){return e(n)}),setTimeout(function(){o.forEach(function(e){return e(n)})},150))},u=function(e){"Tab"===e.key&&a("keyboard")};return window.addEventListener("pointerdown",n,{passive:!0}),window.addEventListener("keydown",u,{passive:!0}),function(){e.removeEventListener("change",t),window.removeEventListener("pointerdown",n),window.removeEventListener("keydown",u)}}function c(){return"unknown"===r?(r="mouse","mouse"):r}function s(e){return o.add(e),function(){o.delete(e)}}},201(e,t,n){n.d(t,{g:()=>o,w:()=>r});var r=function(e){var t=e.behaviour,n=e.hybridWidth,r=e.maxMobileWidth;if("hybrid"!==t)return!1;var o=null!=n?n:r;return window.matchMedia("(max-width: ".concat(o,"px)")).matches},o=function(e){var t=e.behaviour;return["mapOnly","buttonFirst"].includes(t)||r(e)}},637(e,t,n){n.d(t,{q:()=>r});var r=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null===(t=window.location)||void 0===t?void 0:t.search;return new URLSearchParams(n).get(e)}},901(e,t,n){function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return o(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 a,u=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return u=e.done,e},e:function(e){c=!0,a=e},f:function(){try{u||null==n.return||n.return()}finally{if(c)throw a}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,{U:()=>a});var i=function(e,t,n,r){return e!==t&&!(null!=n&&n.contains(e))&&e.matches(":not([aria-hidden]):not([data-fm-inert])")&&r.contains(e)};function a(e){var t,n=e.containerEl,o=e.isFullscreen,a=e.boundaryEl,u=void 0===a?document.body:a,c=Array.from(u.querySelectorAll("[data-fm-inert]"));if(n&&(c=c.filter(function(e){return!n.contains(e)})),c.forEach(function(e){e.removeAttribute("aria-hidden"),delete e.dataset.fmInert}),o){null===(t=document.activeElement)||void 0===t||t.blur();for(var s=n;null!==(l=s)&&void 0!==l&&l.parentNode&&s!==u&&s!==document.body;){var l,f,p=s.parentNode,d=r(p.children);try{for(d.s();!(f=d.n()).done;){var h=f.value;i(h,s,n,u)&&(h.setAttribute("aria-hidden","true"),h.dataset.fmInert="")}}catch(e){d.e(e)}finally{d.f()}s=p}}}}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={exports:{}};return o[e](n,n.exports,a),n.exports}a.m=o,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var o=Object.create(null);a.r(o);var i={};e=e||[null,t({}),t([]),t(t)];for(var u=2&r&&n;("object"==typeof u||"function"==typeof u)&&!~e.indexOf(u);u=t(u))Object.getOwnPropertyNames(u).forEach(e=>i[e]=()=>n[e]);return i.default=()=>n,a.d(o,i),o},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce((t,n)=>(a.f[n](e,t),t),[])),a.u=e=>"im-core.js",a.miniCssF=e=>{},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},r="defra.InteractiveMap:",a.l=(e,t,o,i)=>{if(n[e])n[e].push(t);else{var u,c;if(void 0!==o)for(var s=document.getElementsByTagName("script"),l=0;l<s.length;l++){var f=s[l];if(f.getAttribute("src")==e||f.getAttribute("data-webpack")==r+o){u=f;break}}u||(c=!0,(u=document.createElement("script")).charset="utf-8",a.nc&&u.setAttribute("nonce",a.nc),u.setAttribute("data-webpack",r+o),u.src=e),n[e]=[t];var p=(t,r)=>{u.onerror=u.onload=null,clearTimeout(d);var o=n[e];if(delete n[e],u.parentNode&&u.parentNode.removeChild(u),o&&o.forEach(e=>e(r)),t)return t(r)},d=setTimeout(p.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=p.bind(null,u.onerror),u.onload=p.bind(null,u.onload),c&&document.head.appendChild(u)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={57:0};a.f.j=(t,n)=>{var r=a.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise((n,o)=>r=e[t]=[n,o]);n.push(r[2]=o);var i=a.p+a.u(t),u=new Error;a.l(i,n=>{if(a.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;u.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",u.name="ChunkLoadError",u.type=o,u.request=i,r[1](u)}},"chunk-"+t,t)}};var t=(t,n)=>{var r,o,[i,u,c]=n,s=0;if(i.some(t=>0!==e[t])){for(r in u)a.o(u,r)&&(a.m[r]=u[r]);c&&c(a)}for(t&&t(n);s<i.length;s++)o=i[s],a.o(e,o)&&e[o]&&e[o][0](),e[o]=0},n=this.webpackChunkdefra_DefraMap=this.webpackChunkdefra_DefraMap||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var u={};a.d(u,{default:()=>ie});var c=a(540),s=a(848),l=a.t(s,2),f=a(637),p=a(201);function d(){h.forEach(function(e){!function(e,t){var n;if(!1!==e.config.manageHistoryState){e._isClosingViaBack=!1;var r=e.id===t,o="hybrid"===e.config.behaviour&&!(0,p.w)(e.config),i=null===(n=e.rootEl)||void 0===n?void 0:n.children.length;!r||i&&!e._isHidden?r||!i||o||function(e){var t,n;e.config.preserveStateOnClose?null===(t=e.hideApp)||void 0===t||t.call(e):null===(n=e.removeApp)||void 0===n||n.call(e)}(e):function(e){var t,n;e._isHidden?null===(t=e.showApp)||void 0===t||t.call(e):null===(n=e.loadApp)||void 0===n||n.call(e)}(e)}}(e,(0,f.q)(e.config.mapViewQueryParam))})}var h=new Map,v=!1;const y=function(e){v||(globalThis.addEventListener("popstate",d),v=!0),h.set(e.id,e)},m=function(e){h.delete(e.id),0===h.size&&(globalThis.removeEventListener("popstate",d),v=!1)};function b(e){return b="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},b(e)}function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _(e,t,n){return(t=function(e){var t=function(e){if("object"!=b(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=b(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==b(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w(e){try{return JSON.parse(e)}catch(e){return console.log(e),null}}function P(e,t){e.innerHTML='<div class="im-c-error">'.concat(t,"</div>")}var E=a(205),O=a(0);function A(e){var t=e.id,n=e.behaviour,r=(0,f.q)(e.mapViewQueryParam)===t;return["mapOnly","inline"].includes(n)||"hybrid"===n&&!(0,p.w)(e)||r}const S={appColorScheme:"light",autoColorScheme:!1,backgroundColor:"var(--background-color)",behaviour:"buttonFirst",buttonClass:"im-c-open-map-button",buttonText:"Map view",containerHeight:"600px",deviceNotSupportedText:"Your device is not supported. A map is available with a more up-to-date browser or device.",enableFullscreen:!1,enableZoomControls:!0,genericErrorText:"There was a problem loading the map. Please try again later.",hasExitButton:!1,hybridWidth:null,keyboardHintText:'<span class="im-u-visually-hidden">Press </span><kbd>Shift</kbd> + <kbd>?</kbd> <span class="im-u-visually-hidden">to view </span>keyboard shortcuts',mapLabel:"Interactive map application",mapProvider:null,mapSize:"small",manageHistoryState:!0,mapViewQueryParam:"mv",urlPosition:"sync",maxMobileWidth:640,minDesktopWidth:835,nudgePanDelta:5,nudgeZoomDelta:.1,panDelta:100,pageTitle:"Map view",preserveStateOnClose:!1,readMapText:!1,reverseGeocodeProvider:null,zoomDelta:1};function k(e){return k="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},k(e)}var j=["mapViewParamKey"];function T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?T(Object(n),!0).forEach(function(t){C(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function C(e,t,n){return(t=function(e){var t=function(e){if("object"!=k(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=k(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==k(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var M=a(902),D=a(233),R=a(12);function B(e){return B="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},B(e)}function L(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function N(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,H(r.key),r)}}function H(e){var t=function(e){if("object"!=B(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=B(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==B(t)?t:t+""}var I=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.events={},this._queued={}},t=[{key:"on",value:function(e,t){if(this.events[e]||(this.events[e]=[]),this.events[e].push(t),void 0!==this._queued[e]){try{t.apply(void 0,function(e){return function(e){if(Array.isArray(e))return L(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return L(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?L(e,t):void 0}}(e)||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.")}()}(this._queued[e]))}catch(t){console.error("Error in event handler for '".concat(e,"':"),t)}delete this._queued[e]}return this}},{key:"once",value:function(e,t){var n=this,r=function(){n.off(e,r),t.apply(void 0,arguments)};return this.on(e,r)}},{key:"off",value:function(e,t){return this.events[e]?(this.events[e]=t?this.events[e].filter(function(e){return e!==t}):[],this):this}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return this.events[e]?(this.events[e].forEach(function(t){try{t.apply(void 0,n)}catch(t){console.error("Error in event handler for '".concat(e,"':"),t)}}),this):this}},{key:"emitWhenReady",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return this.events[e]&&0!==this.events[e].length?this.emit.apply(this,[e].concat(n)):(this._queued[e]=n,this)}},{key:"destroy",value:function(){this.events={},this._queued={}}}],t&&N(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();new I;var U=a(901);if("undefined"!=typeof crypto&&!crypto.randomUUID){var F=0;crypto.randomUUID=function(){return F=Math.max(Date.now(),F+1),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e,t){var n=t<12?Number.parseInt(F.toString(16).padStart(12,"0")[t],16):16*Math.random()|0;return("x"===e?n:3&n|8).toString(16)})}}var q=!Object.hasOwn;q&&(Object.hasOwn=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)});var V="undefined"!=typeof AbortController&&!Object.getPrototypeOf((new AbortController).signal).throwIfAborted;if(V&&(Object.getPrototypeOf((new AbortController).signal).throwIfAborted=function(){if(this.aborted){var e=new Error("The operation was aborted.");throw e.name="AbortError",e}}),(V||q)&&"undefined"!=typeof URL&&URL.createObjectURL){var $="text/javascript",W=["if(!Object.hasOwn){Object.hasOwn=function(o,k){return Object.prototype.hasOwnProperty.call(o,k)}}\n",V?'if(typeof AbortController!=="undefined"){var _p=Object.getPrototypeOf(new AbortController().signal);if(!_p.throwIfAborted){_p.throwIfAborted=function(){if(this.aborted){var e=new Error("The operation was aborted.");e.name="AbortError";throw e}}}}\n':""].join(""),G=URL.createObjectURL.bind(URL);if(URL.createObjectURL=function(e){return e instanceof Blob&&e.type===$&&(e=new Blob([W,e],{type:$})),G(e)},"undefined"!=typeof Worker){var z=Worker;Worker=function(e,t){if("string"==typeof e&&!e.startsWith("blob:")){var n=new Blob(["".concat(W,"importScripts(").concat(JSON.stringify(e),")")],{type:$});e=G(n)}return new z(e,t)},Worker.prototype=z.prototype}}function K(e){return K="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},K(e)}function Q(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var c=r&&r.prototype instanceof u?r:u,s=Object.create(c.prototype);return Y(s,"_invoke",function(n,r,o){var i,u,c,s=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return i=t,u=0,c=e,p.n=n,a}};function d(n,r){for(u=n,c=r,t=0;!f&&s&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];n>3?(o=h===r)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=n<2&&d<i[1])?(u=0,p.v=r,p.n=i[1]):d<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,u=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,h){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),u=l,c=h;(t=u<2?e:c)||!f;){i||(u?u<3?(u>1&&(p.n=-1),d(u,c)):p.n=c:p.v=c);try{if(s=2,i){if(u||(o="next"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,u<2&&(u=0)}else 1===u&&(t=i.return)&&t.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((t=(f=p.n<0)?c:n.call(r,p))!==a)break}catch(t){i=e,u=1,c=t}finally{s=1}}return{value:t,done:f}}}(n,o,i),!0),s}var a={};function u(){}function c(){}function s(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(Y(t={},r,function(){return this}),t),f=s.prototype=u.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,Y(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return c.prototype=s,Y(f,"constructor",s),Y(s,"constructor",c),c.displayName="GeneratorFunction",Y(s,o,"GeneratorFunction"),Y(f),Y(f,o,"Generator"),Y(f,r,function(){return this}),Y(f,"toString",function(){return"[object Generator]"}),(Q=function(){return{w:i,m:p}})()}function Y(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Y=function(e,t,n,r){function i(t,n){Y(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},Y(e,t,n,r)}function Z(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)}function J(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function X(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?J(Object(n),!0).forEach(function(t){te(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ee(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ne(r.key),r)}}function te(e,t,n){return(t=ne(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ne(e){var t=function(e){if("object"!=K(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=K(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==K(t)?t:t+""}var re=function(){return e=function e(t){var n,r,o,i,a,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),te(this,"_openButton",null),te(this,"_root",null),te(this,"_breakpointDetector",null),te(this,"_interfaceDetectorCleanup",null),te(this,"_hybridBehaviourCleanup",null),te(this,"_isHidden",!1),te(this,"_isClosingViaBack",!1),te(this,"_isLoading",!1),this.id=t,this.rootEl=document.getElementById(t),!this.rootEl)throw new Error('Element with id "'.concat(t,'" not found'));this.eventBus=new I,this.config=this._buildConfig(u),n=this.rootEl,o=(r=this.config).mapProvider,i=r.deviceNotSupportedText,a=null==o?void 0:o.checkDeviceCapabilities(),(o?null!=a&&a.isSupported||(P(n,i),(0,E.i)(),O.v.warn(null==a?void 0:a.error),0):(O.v.warn("No map provider"),0))&&(["buttonFirst","hybrid"].includes(this.config.behaviour)&&y(this),this._breakpointDetector=function(e){var t,n=e.maxMobileWidth,r=e.minDesktopWidth,o=e.containerEl,i="unknown",a=new Set,u=function(e){e!==i&&(i=e,requestAnimationFrame(function(){i===e&&a.forEach(function(t){return t(e)})}))};if(o){var c=function(e,t,n){e.style.containerType="inline-size";var r=e.getBoundingClientRect().width,o=t(r);e.dataset.breakpoint=o;var i=new window.ResizeObserver(function(r){var o,i,a=(null===(o=r[0])||void 0===o||null===(o=o.borderBoxSize)||void 0===o||null===(o=o[0])||void 0===o?void 0:o.inlineSize)||(null===(i=r[0])||void 0===i?void 0:i.contentRect.width),u=t(a);e.dataset.breakpoint=u,n(u)});return i.observe(e),{initialType:o,cleanup:function(){i.disconnect(),e.style.containerType="",delete e.dataset.breakpoint}}}(o,function(e){return function(e,t,n){return e<=t?"mobile":e>=n?"desktop":"tablet"}(e,n,r)},u);i=c.initialType,u(c.initialType),t=c.cleanup}else{var s=function(e,t,n){var r={mobile:window.matchMedia("(max-width: ".concat(e,"px)")),desktop:window.matchMedia("(min-width: ".concat(t,"px)"))},o=function(){var e="tablet";r.mobile.matches?e="mobile":r.desktop.matches&&(e="desktop"),n(e)};return r.mobile.addEventListener("change",o),r.desktop.addEventListener("change",o),o(),{cleanup:function(){r.mobile.removeEventListener("change",o),r.desktop.removeEventListener("change",o)}}}(n,r,u);t=s.cleanup}return{subscribe:function(e){return a.add(e),function(){return a.delete(e)}},getBreakpoint:function(){return i},destroy:function(){var e;null===(e=t)||void 0===e||e(),a.clear()}}}({maxMobileWidth:this.config.maxMobileWidth,minDesktopWidth:this.config.minDesktopWidth,containerEl:this.rootEl}),this._interfaceDetectorCleanup=(0,M.C1)(),this._initialize())},t=[{key:"_buildConfig",value:function(e){var t=function(e){for(var t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach(function(t){_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},null==e?void 0:e.dataset),n={},r=0,o=Object.keys(t);r<o.length;r++){var i=o[r];n[i]=w(t[i])}return n}(this.rootEl);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mapViewParamKey,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,j),r=x(x({},S),n);return void 0!==t&&(console.warn("[InteractiveMap] mapViewParamKey is deprecated — use mapViewQueryParam instead."),r.mapViewQueryParam=t),r}(X(X({id:this.id,title:document.title},t),e))}},{key:"_initialize",value:function(){var e=this;["buttonFirst","hybrid"].includes(this.config.behaviour)&&(this._openButton=function(t,n){var r=t.id,o=t.buttonText,i=t.buttonClass,a='\n <a class="'.concat(i,"\" role=\"button\">\n <svg focusable='false' aria-hidden='true' width='16' height='20' viewBox='0 0 16 20' fillRule='evenodd'>\n <path d='M15 7.5c.009 3.778-4.229 9.665-7.5 12.5C4.229 17.165-.009 11.278 0 7.5a7.5 7.5 0 1 1 15 0z'/>\n <path d='M7.5 12.961a5.46 5.46 0 1 0 0-10.922 5.46 5.46 0 1 0 0 10.922z' fill='#fff'/>\n </svg>\n <span>").concat(o,"</span>\n <span class='im-u-visually-hidden'> (Visual only)</span>\n </a>\n ");n.insertAdjacentHTML("beforebegin",a);var u=n.previousElementSibling,c=new URL(window.location.href);return c.searchParams.set(t.mapViewQueryParam,r),u.setAttribute("href",c.toString()),u.addEventListener("click",function(t){t.preventDefault(),function(t){e._handleButtonClick(t)}(t)}),u}(this.config,this.rootEl)),this._hybridBehaviourCleanup=function(e){var t=e.config,n=t.behaviour,r=t.hybridWidth,o=t.maxMobileWidth;if("buttonFirst"===n&&e._breakpointDetector.subscribe(function(){A(e.config)?e.loadApp():e.removeApp()}),"hybrid"===n){var i=null!=r?r:o,a=window.matchMedia("(max-width: ".concat(i,"px)")),u=function(){A(e.config)?e._isHidden?e.showApp():null==e._root?e.loadApp():(0,E.N)(e):e._root&&e.hideApp()};return a.addEventListener("change",u),function(){return a.removeEventListener("change",u)}}return null}(this),A(this.config)?this.loadApp():(0,E.i)()}},{key:"_handleButtonClick",value:function(e){this._isHidden?(this.config.manageHistoryState&&history.pushState({isBack:!0},"",e.currentTarget.getAttribute("href")),this.showApp()):this._root||(this.config.manageHistoryState&&history.pushState({isBack:!0},"",e.currentTarget.getAttribute("href")),this.loadApp())}},{key:"_removeMapParamFromUrl",value:function(e,t){var n=new RegExp("[?&]".concat(t,"=[^&]*(&|$)"));return n.test(e)?e.replace(n,function(e,t){return"&"===t?"?":""}).replace(/\?$/,""):e}},{key:"_handleExitClick",value:function(){var e,t=this;if(this.config.manageHistoryState)if(null!==(e=history.state)&&void 0!==e&&e.isBack){if(this._isClosingViaBack)return;this._isClosingViaBack=!0,history.back(),setTimeout(function(){t._isClosingViaBack=!1},1e3)}else{this.config.preserveStateOnClose?this.hideApp():this.removeApp();var n=this.config.mapViewQueryParam,r=this._removeMapParamFromUrl(location.href,n);history.replaceState(history.state,"",r)}else this.config.preserveStateOnClose?this.hideApp():this.removeApp()}},{key:"loadApp",value:(n=Q().m(function e(){var t,n,r,o,i,u,c,s,l,f,p=this;return Q().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!this._root&&!this._isLoading){e.n=1;break}return e.a(2);case 1:return this._isLoading=!0,this._openButton&&(this._openButton.style.display="none"),e.p=2,e.n=3,a.e(935).then(a.bind(a,455));case 3:return t=e.v,n=t.initialiseApp,e.n=4,this.config.mapProvider.load();case 4:return r=e.v,o=r.MapProvider,i=r.mapFramework,u=r.mapProviderConfig,this.config.reverseGeocodeProvider&&(0,D.H_)(this.config.reverseGeocodeProvider,u.crs),e.n=5,n(this.rootEl,X(X({id:this.id,initialBreakpoint:this._breakpointDetector.getBreakpoint(),initialInterfaceType:(0,M.ip)()},this.config),{},{MapProvider:o,mapProviderConfig:u,mapFramework:i,eventBus:this.eventBus,breakpointDetector:this._breakpointDetector,handleExitClick:this._handleExitClick.bind(this)}));case 5:c=e.v,this._root=c._root,delete c._root,s=new Set(["on","off","emit"]),Object.keys(c).forEach(function(e){s.has(e)||(p[e]=c[e])}),(0,E.N)(this),this.eventBus.emit(R.q.APP_OPENED,{statePreserved:!1}),e.n=7;break;case 6:throw e.p=6,f=e.v,null===(l=this._openButton)||void 0===l||l.removeAttribute("style"),P(this.rootEl,this.config.genericErrorText),console.error(f),f;case 7:return e.p=7,this._isLoading=!1,e.f(7);case 8:return e.a(2)}},e,this,[[2,6,7,8]])}),r=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){Z(i,r,o,a,u,"next",e)}function u(e){Z(i,r,o,a,u,"throw",e)}a(void 0)})},function(){return r.apply(this,arguments)})},{key:"removeApp",value:function(){this._root&&"function"==typeof this.unmount&&(this.unmount(),this._root=null),this._openButton&&(this._openButton.removeAttribute("style"),this._openButton.focus()),(0,E.N)(this,{isFullscreen:!1}),this.eventBus.emit(R.q.APP_CLOSED,{statePreserved:!1}),this.eventBus.emit(R.q.MAP_DESTROY,{mapId:this.id})}},{key:"hideApp",value:function(){this._isHidden=!0,this.rootEl.style.display="none",(0,U.U)({containerEl:this.rootEl,isFullscreen:!1}),this._openButton&&(this._openButton.removeAttribute("style"),this._openButton.focus()),document.documentElement.classList.remove("im-is-fullscreen"),this.rootEl.classList.remove("im-is-fullscreen");var e=document.title.split(": ");e.length>1&&(document.title=e.at(-1)),this.eventBus.emit(R.q.APP_CLOSED,{statePreserved:!0})}},{key:"showApp",value:function(){this._isHidden=!1,this.rootEl.style.display="",this._openButton&&(this._openButton.style.display="none"),(0,E.N)(this),this.eventBus.emit(R.q.APP_OPENED,{statePreserved:!0})}},{key:"destroy",value:function(){var e,t,n;this.removeApp(),null===(e=this._breakpointDetector)||void 0===e||e.destroy(),null===(t=this._interfaceDetectorCleanup)||void 0===t||t.call(this),null===(n=this._hybridBehaviourCleanup)||void 0===n||n.call(this),m(this),this.eventBus.destroy()}},{key:"on",value:function(){var e;(e=this.eventBus).on.apply(e,arguments)}},{key:"off",value:function(){var e;(e=this.eventBus).off.apply(e,arguments)}},{key:"emit",value:function(){var e;(e=this.eventBus).emit.apply(e,arguments)}},{key:"addMarker",value:function(e,t,n){this.eventBus.emit(R.q.APP_ADD_MARKER,{id:e,coords:t,options:n})}},{key:"updateMarker",value:function(e,t){this.eventBus.emit(R.q.APP_UPDATE_MARKER,{id:e,options:t})}},{key:"removeMarker",value:function(e){this.eventBus.emit(R.q.APP_REMOVE_MARKER,e)}},{key:"setMode",value:function(e){this.eventBus.emit(R.q.APP_SET_MODE,e)}},{key:"addButton",value:function(e,t){this.eventBus.emit(R.q.APP_ADD_BUTTON,{id:e,config:t})}},{key:"toggleButtonState",value:function(e,t,n){this.eventBus.emit(R.q.APP_TOGGLE_BUTTON_STATE,{id:e,prop:t,value:n})}},{key:"addPanel",value:function(e,t){this.eventBus.emit(R.q.APP_ADD_PANEL,{id:e,config:t})}},{key:"removePanel",value:function(e){this.eventBus.emit(R.q.APP_REMOVE_PANEL,e)}},{key:"showPanel",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).focus,n=void 0===t||t;this.eventBus.emit(R.q.APP_SHOW_PANEL,{id:e,focus:n})}},{key:"hidePanel",value:function(e){this.eventBus.emit(R.q.APP_HIDE_PANEL,e)}},{key:"addControl",value:function(e,t){this.eventBus.emit(R.q.APP_ADD_CONTROL,{id:e,config:t})}},{key:"fitToBounds",value:function(e){this.eventBus.emitWhenReady(R.q.MAP_FIT_TO_BOUNDS,e)}},{key:"setView",value:function(e){this.eventBus.emitWhenReady(R.q.MAP_SET_VIEW,e)}},{key:"open",value:function(){this._isHidden?this.showApp():this._root||this.loadApp()}},{key:"close",value:function(){this._handleExitClick()}}],t&&ee(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,r}(),oe="undefined"==typeof window?globalThis:window;oe.defra=oe.defra||{},oe.preactCompat=c,oe.preactJsxRuntime=l,oe.preactHooks={useState:c.useState},oe.defra.InteractiveMap=re,oe.preactCompat.default||(oe.preactCompat.default=oe.preactCompat),oe.preactCompat.createRoot||(oe.preactCompat.createRoot=function(e){return{render:function(t){oe.preactCompat.render(t,e)},unmount:function(){oe.preactCompat.render(null,e)}}});const ie=re;return u.default})());
|
|
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.InteractiveMap=t())}(this,()=>(()=>{"use strict";var e,t,n,r,o={698(e,t){var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function o(e,t,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==t.key&&(o=""+t.key),"key"in t)for(var i in r={},t)"key"!==i&&(r[i]=t[i]);else r=t;return t=r.ref,{$$typeof:n,type:e,key:o,ref:void 0!==t?t:null,props:r}}t.Fragment=r,t.jsx=o,t.jsxs=o},869(e,t){var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),h=Symbol.iterator,v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,m={};function b(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||v}function g(){}function _(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||v}b.prototype.isReactComponent={},b.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},b.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},g.prototype=b.prototype;var w=_.prototype=new g;w.constructor=_,y(w,b.prototype),w.isPureReactComponent=!0;var E=Array.isArray;function P(){}var A={H:null,A:null,T:null,S:null},O=Object.prototype.hasOwnProperty;function S(e,t,r){var o=r.ref;return{$$typeof:n,type:e,key:t,ref:void 0!==o?o:null,props:r}}function k(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var j=/\/+/g;function T(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(n=""+e.key,r={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var n,r}function x(e,t,o,i,a){var u=typeof e;"undefined"!==u&&"boolean"!==u||(e=null);var c,s,l=!1;if(null===e)l=!0;else switch(u){case"bigint":case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case n:case r:l=!0;break;case p:return x((l=e._init)(e._payload),t,o,i,a)}}if(l)return a=a(e),l=""===i?"."+T(e,0):i,E(a)?(o="",null!=l&&(o=l.replace(j,"$&/")+"/"),x(a,t,o,"",function(e){return e})):null!=a&&(k(a)&&(c=a,s=o+(null==a.key||e&&e.key===a.key?"":(""+a.key).replace(j,"$&/")+"/")+l,a=S(c.type,s,c.props)),t.push(a)),1;l=0;var f,d=""===i?".":i+":";if(E(e))for(var v=0;v<e.length;v++)l+=x(i=e[v],t,o,u=d+T(i,v),a);else if("function"==typeof(v=null===(f=e)||"object"!=typeof f?null:"function"==typeof(f=h&&f[h]||f["@@iterator"])?f:null))for(e=v.call(e),v=0;!(i=e.next()).done;)l+=x(i=i.value,t,o,u=d+T(i,v++),a);else if("object"===u){if("function"==typeof e.then)return x(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(P,P):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(e),t,o,i,a);throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return l}function C(e,t,n){if(null==e)return e;var r=[],o=0;return x(e,r,"","",function(e){return t.call(n,e,o++)}),r}function M(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var D="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},R={map:C,forEach:function(e,t,n){C(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return C(e,function(){t++}),t},toArray:function(e){return C(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};t.Activity=d,t.Children=R,t.Component=b,t.Fragment=o,t.Profiler=a,t.PureComponent=_,t.StrictMode=i,t.Suspense=l,t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,t.__COMPILER_RUNTIME={__proto__:null,c:function(e){return A.H.useMemoCache(e)}},t.cache=function(e){return function(){return e.apply(null,arguments)}},t.cacheSignal=function(){return null},t.cloneElement=function(e,t,n){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var r=y({},e.props),o=e.key;if(null!=t)for(i in void 0!==t.key&&(o=""+t.key),t)!O.call(t,i)||"key"===i||"__self"===i||"__source"===i||"ref"===i&&void 0===t.ref||(r[i]=t[i]);var i=arguments.length-2;if(1===i)r.children=n;else if(1<i){for(var a=Array(i),u=0;u<i;u++)a[u]=arguments[u+2];r.children=a}return S(e.type,o,r)},t.createContext=function(e){return(e={$$typeof:c,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:u,_context:e},e},t.createElement=function(e,t,n){var r,o={},i=null;if(null!=t)for(r in void 0!==t.key&&(i=""+t.key),t)O.call(t,r)&&"key"!==r&&"__self"!==r&&"__source"!==r&&(o[r]=t[r]);var a=arguments.length-2;if(1===a)o.children=n;else if(1<a){for(var u=Array(a),c=0;c<a;c++)u[c]=arguments[c+2];o.children=u}if(e&&e.defaultProps)for(r in a=e.defaultProps)void 0===o[r]&&(o[r]=a[r]);return S(e,i,o)},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:s,render:e}},t.isValidElement=k,t.lazy=function(e){return{$$typeof:p,_payload:{_status:-1,_result:e},_init:M}},t.memo=function(e,t){return{$$typeof:f,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=A.T,n={};A.T=n;try{var r=e(),o=A.S;null!==o&&o(n,r),"object"==typeof r&&null!==r&&"function"==typeof r.then&&r.then(P,D)}catch(e){D(e)}finally{null!==t&&null!==n.types&&(t.types=n.types),A.T=t}},t.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},t.use=function(e){return A.H.use(e)},t.useActionState=function(e,t,n){return A.H.useActionState(e,t,n)},t.useCallback=function(e,t){return A.H.useCallback(e,t)},t.useContext=function(e){return A.H.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e,t){return A.H.useDeferredValue(e,t)},t.useEffect=function(e,t){return A.H.useEffect(e,t)},t.useEffectEvent=function(e){return A.H.useEffectEvent(e)},t.useId=function(){return A.H.useId()},t.useImperativeHandle=function(e,t,n){return A.H.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return A.H.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return A.H.useLayoutEffect(e,t)},t.useMemo=function(e,t){return A.H.useMemo(e,t)},t.useOptimistic=function(e,t){return A.H.useOptimistic(e,t)},t.useReducer=function(e,t,n){return A.H.useReducer(e,t,n)},t.useRef=function(e){return A.H.useRef(e)},t.useState=function(e){return A.H.useState(e)},t.useSyncExternalStore=function(e,t,n){return A.H.useSyncExternalStore(e,t,n)},t.useTransition=function(){return A.H.useTransition()},t.version="19.2.4"},540(e,t,n){e.exports=n(869)},848(e,t,n){e.exports=n(698)},205(e,t,n){n.d(t,{N:()=>a,i:()=>u});var r=n(637),o=n(901),i=n(201);function a(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).isFullscreen,n=e.config,a=e.rootEl,u=n.pageTitle,c=n.behaviour,s=n.containerHeight,l=null!=t?t:function(e){var t=e.id,n=e.behaviour,o=e.manageHistoryState;return"mapOnly"===n||("buttonFirst"===n?!1===o||(0,r.q)(e.mapViewQueryParam)===t:(0,i.w)(e)&&(0,r.q)(e.mapViewQueryParam)===t)}(n);["mapOnly","buttonFirst","hybrid"].includes(c)&&((0,o.U)({containerEl:a,isFullscreen:l}),document.documentElement.classList.toggle("im-is-fullscreen",l),a.classList.toggle("im-is-fullscreen",l)),["buttonFirst","hybrid"].includes(c)&&function(e){var t=e.pageTitle,n=e.isFullscreen,r=document.title.split(": "),o=r[r.length-1];document.title=n?"".concat(t,": ").concat(o):o}({pageTitle:u,isFullscreen:l});var f=l||"buttonFirst"!==c&&!(0,i.w)(n)?s:"auto";a.style.height=l?"100%":f}function u(){document.body.classList.remove("im-is-loading")}},12(e,t,n){n.d(t,{q:()=>r});var r={APP_ADD_MARKER:"app:addmarker",APP_UPDATE_MARKER:"app:updatemarker",APP_REMOVE_MARKER:"app:removemarker",APP_SET_MODE:"app:setmode",APP_REVERT_MODE:"app:revertmode",APP_ADD_BUTTON:"app:addbutton",APP_TOGGLE_BUTTON_STATE:"app:togglebuttonstate",APP_ADD_PANEL:"app:addpanel",APP_REMOVE_PANEL:"app:removepanel",APP_SHOW_PANEL:"app:showpanel",APP_HIDE_PANEL:"app:hidepanel",APP_ADD_CONTROL:"app:addcontrol",APP_READY:"app:ready",APP_OPENED:"app:opened",APP_CLOSED:"app:closed",APP_PANEL_OPENED:"app:panelopened",APP_PANEL_CLOSED:"app:panelclosed",MAP_SET_STYLE:"map:setstyle",MAP_SET_SIZE:"map:setsize",MAP_SET_FEATURES:"map:setfeatures",MAP_SET_ACTIVE_FEATURE:"map:setactivefeature",MAP_SELECT_FEATURE:"map:selectfeature",MAP_SET_PIXEL_RATIO:"map:setpixelratio",MAP_FIT_TO_BOUNDS:"map:fittobounds",MAP_SET_VIEW:"map:setview",MAP_INIT_MAP_STYLES:"map:initmapstyles",MAP_STYLE_CHANGE:"map:stylechange",MAP_LOADED:"map:loaded",MAP_READY:"map:ready",MAP_SIZE_CHANGE:"map:sizechange",MAP_FIRST_IDLE:"map:firstidle",MAP_MOVE_START:"map:movestart",MAP_MOVE:"map:move",MAP_MOVE_END:"map:moveend",MAP_STATE_UPDATED:"map:stateupdated",MAP_DATA_CHANGE:"map:datachange",MAP_RENDER:"map:render",MAP_CLICK:"map:click",MAP_DESTROY:"map:destroy"}},0(e,t,n){n.d(t,{v:()=>o});var r="[interactive-map]",o={warn:function(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(e=console).warn.apply(e,[r].concat(n))},error:function(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(e=console).error.apply(e,[r].concat(n))}}},233(e,t,n){function r(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function u(n,r,i,a){var u=r&&r.prototype instanceof s?r:s,l=Object.create(u.prototype);return o(l,"_invoke",function(n,r,o){var i,a,u,s=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return i=t,a=0,u=e,p.n=n,c}};function d(n,r){for(a=n,u=r,t=0;!f&&s&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];n>3?(o=h===r)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=n<2&&d<i[1])?(a=0,p.v=r,p.n=i[1]):d<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,a=0))}if(o||n>1)return c;throw f=!0,r}return function(o,l,h){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),a=l,u=h;(t=a<2?e:u)||!f;){i||(a?a<3?(a>1&&(p.n=-1),d(a,u)):p.n=u:p.v=u);try{if(s=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=p.n<0)?u:n.call(r,p))!==c)break}catch(t){i=e,a=1,u=t}finally{s=1}}return{value:t,done:f}}}(n,i,a),!0),l}var c={};function s(){}function l(){}function f(){}t=Object.getPrototypeOf;var p=[][i]?t(t([][i]())):(o(t={},i,function(){return this}),t),d=f.prototype=s.prototype=Object.create(p);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,o(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=f,o(d,"constructor",f),o(f,"constructor",l),l.displayName="GeneratorFunction",o(f,a,"GeneratorFunction"),o(d),o(d,a,"Generator"),o(d,i,function(){return this}),o(d,"toString",function(){return"[object Generator]"}),(r=function(){return{w:u,m:h}})()}function o(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}o=function(e,t,n,r){function a(t,n){o(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},o(e,t,n,r)}function i(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)}n.d(t,{H_:()=>u,Rt:()=>s,xK:()=>c});var a=null;function u(e,t){var n=e.url,o=e.transformRequest,u=e.load;a=function(){var e,a=(e=r().m(function e(i,a){var c;return r().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,u();case 1:return c=e.v,e.a(2,c(n,o,t,i,a))}},e)}),function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function u(e){i(a,r,o,u,c,"next",e)}function c(e){i(a,r,o,u,c,"throw",e)}u(void 0)})});return function(e,t){return a.apply(this,arguments)}}()}function c(){return null!==a}function s(e,t){if(!a)throw new Error("ReverseGeocode not initialised");return a(e,t)}},902(e,t,n){n.d(t,{C1:()=>u,Ey:()=>s,ip:()=>c});var r=window.matchMedia("(pointer: coarse)").matches?"touch":"unknown",o=new Set,i=new Set;function a(e){r!==e&&(r=e,i.forEach(function(t){return t(e)}),o.forEach(function(t){return t(e)}))}function u(){var e=window.matchMedia("(pointer: coarse)"),t=function(e){a(e.matches?"touch":"mouse")};e.addEventListener("change",t);var n=function(e){var t,n="pen"===(t=e.pointerType)||"touch"===t?"touch":"mouse"===t?"mouse":"unknown";n!==r&&(r=n,i.forEach(function(e){return e(n)}),setTimeout(function(){o.forEach(function(e){return e(n)})},150))},u=function(e){"Tab"===e.key&&a("keyboard")};return window.addEventListener("pointerdown",n,{passive:!0}),window.addEventListener("keydown",u,{passive:!0}),function(){e.removeEventListener("change",t),window.removeEventListener("pointerdown",n),window.removeEventListener("keydown",u)}}function c(){return"unknown"===r?(r="mouse","mouse"):r}function s(e){return o.add(e),function(){o.delete(e)}}},201(e,t,n){n.d(t,{g:()=>o,w:()=>r});var r=function(e){var t=e.behaviour,n=e.hybridWidth,r=e.maxMobileWidth;if("hybrid"!==t)return!1;var o=null!=n?n:r;return window.matchMedia("(max-width: ".concat(o,"px)")).matches},o=function(e){var t=e.behaviour;return["mapOnly","buttonFirst"].includes(t)||r(e)}},637(e,t,n){n.d(t,{q:()=>r});var r=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null===(t=window.location)||void 0===t?void 0:t.search;return new URLSearchParams(n).get(e)}},901(e,t,n){function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return o(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 a,u=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return u=e.done,e},e:function(e){c=!0,a=e},f:function(){try{u||null==n.return||n.return()}finally{if(c)throw a}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,{U:()=>a});var i=function(e,t,n,r){return e!==t&&!(null!=n&&n.contains(e))&&e.matches(":not([aria-hidden]):not([data-fm-inert])")&&r.contains(e)};function a(e){var t,n=e.containerEl,o=e.isFullscreen,a=e.boundaryEl,u=void 0===a?document.body:a,c=Array.from(u.querySelectorAll("[data-fm-inert]"));if(n&&(c=c.filter(function(e){return!n.contains(e)})),c.forEach(function(e){e.removeAttribute("aria-hidden"),delete e.dataset.fmInert}),o){null===(t=document.activeElement)||void 0===t||t.blur();for(var s=n;null!==(l=s)&&void 0!==l&&l.parentNode&&s!==u&&s!==document.body;){var l,f,p=s.parentNode,d=r(p.children);try{for(d.s();!(f=d.n()).done;){var h=f.value;i(h,s,n,u)&&(h.setAttribute("aria-hidden","true"),h.dataset.fmInert="")}}catch(e){d.e(e)}finally{d.f()}s=p}}}}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={exports:{}};return o[e](n,n.exports,a),n.exports}a.m=o,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var o=Object.create(null);a.r(o);var i={};e=e||[null,t({}),t([]),t(t)];for(var u=2&r&&n;("object"==typeof u||"function"==typeof u)&&!~e.indexOf(u);u=t(u))Object.getOwnPropertyNames(u).forEach(e=>i[e]=()=>n[e]);return i.default=()=>n,a.d(o,i),o},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce((t,n)=>(a.f[n](e,t),t),[])),a.u=e=>"im-core.js",a.miniCssF=e=>{},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},r="defra.InteractiveMap:",a.l=(e,t,o,i)=>{if(n[e])n[e].push(t);else{var u,c;if(void 0!==o)for(var s=document.getElementsByTagName("script"),l=0;l<s.length;l++){var f=s[l];if(f.getAttribute("src")==e||f.getAttribute("data-webpack")==r+o){u=f;break}}u||(c=!0,(u=document.createElement("script")).charset="utf-8",a.nc&&u.setAttribute("nonce",a.nc),u.setAttribute("data-webpack",r+o),u.src=e),n[e]=[t];var p=(t,r)=>{u.onerror=u.onload=null,clearTimeout(d);var o=n[e];if(delete n[e],u.parentNode&&u.parentNode.removeChild(u),o&&o.forEach(e=>e(r)),t)return t(r)},d=setTimeout(p.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=p.bind(null,u.onerror),u.onload=p.bind(null,u.onload),c&&document.head.appendChild(u)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={57:0};a.f.j=(t,n)=>{var r=a.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise((n,o)=>r=e[t]=[n,o]);n.push(r[2]=o);var i=a.p+a.u(t),u=new Error;a.l(i,n=>{if(a.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;u.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",u.name="ChunkLoadError",u.type=o,u.request=i,r[1](u)}},"chunk-"+t,t)}};var t=(t,n)=>{var r,o,[i,u,c]=n,s=0;if(i.some(t=>0!==e[t])){for(r in u)a.o(u,r)&&(a.m[r]=u[r]);c&&c(a)}for(t&&t(n);s<i.length;s++)o=i[s],a.o(e,o)&&e[o]&&e[o][0](),e[o]=0},n=this.webpackChunkdefra_DefraMap=this.webpackChunkdefra_DefraMap||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var u={};a.d(u,{default:()=>ie});var c=a(540),s=a(848),l=a.t(s,2),f=a(637),p=a(201);function d(){h.forEach(function(e){!function(e,t){var n;if(!1!==e.config.manageHistoryState){e._isClosingViaBack=!1;var r=e.id===t,o="hybrid"===e.config.behaviour&&!(0,p.w)(e.config),i=null===(n=e.rootEl)||void 0===n?void 0:n.children.length;!r||i&&!e._isHidden?r||!i||o||function(e){var t,n;e.config.preserveStateOnClose?null===(t=e.hideApp)||void 0===t||t.call(e):null===(n=e.removeApp)||void 0===n||n.call(e)}(e):function(e){var t,n;e._isHidden?null===(t=e.showApp)||void 0===t||t.call(e):null===(n=e.loadApp)||void 0===n||n.call(e)}(e)}}(e,(0,f.q)(e.config.mapViewQueryParam))})}var h=new Map,v=!1;const y=function(e){v||(globalThis.addEventListener("popstate",d),v=!0),h.set(e.id,e)},m=function(e){h.delete(e.id),0===h.size&&(globalThis.removeEventListener("popstate",d),v=!1)};function b(e){return b="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},b(e)}function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _(e,t,n){return(t=function(e){var t=function(e){if("object"!=b(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=b(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==b(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w(e){try{return JSON.parse(e)}catch(e){return console.log(e),null}}function E(e,t){e.innerHTML='<div class="im-c-error">'.concat(t,"</div>")}var P=a(205),A=a(0);function O(e){var t=e.id,n=e.behaviour,r=(0,f.q)(e.mapViewQueryParam)===t;return["mapOnly","inline"].includes(n)||"hybrid"===n&&!(0,p.w)(e)||r}const S={appColorScheme:"light",autoColorScheme:!1,backgroundColor:"var(--background-color)",behaviour:"buttonFirst",buttonClass:"im-c-open-map-button",buttonText:"Map view",containerHeight:"600px",deviceNotSupportedText:"Your device is not supported. A map is available with a more up-to-date browser or device.",enableFullscreen:!1,enableZoomControls:!0,genericErrorText:"There was a problem loading the map. Please try again later.",hasExitButton:!1,backAndContinue:null,hybridWidth:null,keyboardHintText:'<span class="im-u-visually-hidden">Press </span><kbd>Shift</kbd> + <kbd>?</kbd> <span class="im-u-visually-hidden">to view </span>keyboard shortcuts',mapLabel:"Interactive map application",mapProvider:null,mapSize:"small",manageHistoryState:!0,mapViewQueryParam:"mv",urlPosition:"sync",maxMobileWidth:640,minDesktopWidth:835,nudgePanDelta:5,nudgeZoomDelta:.1,panDelta:100,pageTitle:"Map view",preserveStateOnClose:!1,readMapText:!1,reverseGeocodeProvider:null,zoomDelta:1};function k(e){return k="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},k(e)}var j=["mapViewParamKey"];function T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?T(Object(n),!0).forEach(function(t){C(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function C(e,t,n){return(t=function(e){var t=function(e){if("object"!=k(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=k(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==k(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var M=a(902),D=a(233),R=a(12);function B(e){return B="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},B(e)}function L(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function N(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,H(r.key),r)}}function H(e){var t=function(e){if("object"!=B(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=B(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==B(t)?t:t+""}var I=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.events={},this._queued={}},t=[{key:"on",value:function(e,t){if(this.events[e]||(this.events[e]=[]),this.events[e].push(t),void 0!==this._queued[e]){try{t.apply(void 0,function(e){return function(e){if(Array.isArray(e))return L(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return L(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?L(e,t):void 0}}(e)||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.")}()}(this._queued[e]))}catch(t){console.error("Error in event handler for '".concat(e,"':"),t)}delete this._queued[e]}return this}},{key:"once",value:function(e,t){var n=this,r=function(){n.off(e,r),t.apply(void 0,arguments)};return this.on(e,r)}},{key:"off",value:function(e,t){return this.events[e]?(this.events[e]=t?this.events[e].filter(function(e){return e!==t}):[],this):this}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return this.events[e]?(this.events[e].forEach(function(t){try{t.apply(void 0,n)}catch(t){console.error("Error in event handler for '".concat(e,"':"),t)}}),this):this}},{key:"emitWhenReady",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return this.events[e]&&0!==this.events[e].length?this.emit.apply(this,[e].concat(n)):(this._queued[e]=n,this)}},{key:"destroy",value:function(){this.events={},this._queued={}}}],t&&N(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();new I;var U=a(901);if("undefined"!=typeof crypto&&!crypto.randomUUID){var F=0;crypto.randomUUID=function(){return F=Math.max(Date.now(),F+1),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e,t){var n=t<12?Number.parseInt(F.toString(16).padStart(12,"0")[t],16):16*Math.random()|0;return("x"===e?n:3&n|8).toString(16)})}}var q=!Object.hasOwn;q&&(Object.hasOwn=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)});var V="undefined"!=typeof AbortController&&!Object.getPrototypeOf((new AbortController).signal).throwIfAborted;if(V&&(Object.getPrototypeOf((new AbortController).signal).throwIfAborted=function(){if(this.aborted){var e=new Error("The operation was aborted.");throw e.name="AbortError",e}}),(V||q)&&"undefined"!=typeof URL&&URL.createObjectURL){var $="text/javascript",W=["if(!Object.hasOwn){Object.hasOwn=function(o,k){return Object.prototype.hasOwnProperty.call(o,k)}}\n",V?'if(typeof AbortController!=="undefined"){var _p=Object.getPrototypeOf(new AbortController().signal);if(!_p.throwIfAborted){_p.throwIfAborted=function(){if(this.aborted){var e=new Error("The operation was aborted.");e.name="AbortError";throw e}}}}\n':""].join(""),G=URL.createObjectURL.bind(URL);if(URL.createObjectURL=function(e){return e instanceof Blob&&e.type===$&&(e=new Blob([W,e],{type:$})),G(e)},"undefined"!=typeof Worker){var z=Worker;Worker=function(e,t){if("string"==typeof e&&!e.startsWith("blob:")){var n=new Blob(["".concat(W,"importScripts(").concat(JSON.stringify(e),")")],{type:$});e=G(n)}return new z(e,t)},Worker.prototype=z.prototype}}function K(e){return K="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},K(e)}function Q(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var c=r&&r.prototype instanceof u?r:u,s=Object.create(c.prototype);return Y(s,"_invoke",function(n,r,o){var i,u,c,s=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return i=t,u=0,c=e,p.n=n,a}};function d(n,r){for(u=n,c=r,t=0;!f&&s&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];n>3?(o=h===r)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=n<2&&d<i[1])?(u=0,p.v=r,p.n=i[1]):d<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,u=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,h){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),u=l,c=h;(t=u<2?e:c)||!f;){i||(u?u<3?(u>1&&(p.n=-1),d(u,c)):p.n=c:p.v=c);try{if(s=2,i){if(u||(o="next"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,u<2&&(u=0)}else 1===u&&(t=i.return)&&t.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((t=(f=p.n<0)?c:n.call(r,p))!==a)break}catch(t){i=e,u=1,c=t}finally{s=1}}return{value:t,done:f}}}(n,o,i),!0),s}var a={};function u(){}function c(){}function s(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(Y(t={},r,function(){return this}),t),f=s.prototype=u.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,Y(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return c.prototype=s,Y(f,"constructor",s),Y(s,"constructor",c),c.displayName="GeneratorFunction",Y(s,o,"GeneratorFunction"),Y(f),Y(f,o,"Generator"),Y(f,r,function(){return this}),Y(f,"toString",function(){return"[object Generator]"}),(Q=function(){return{w:i,m:p}})()}function Y(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Y=function(e,t,n,r){function i(t,n){Y(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},Y(e,t,n,r)}function Z(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)}function J(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function X(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?J(Object(n),!0).forEach(function(t){te(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ee(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ne(r.key),r)}}function te(e,t,n){return(t=ne(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ne(e){var t=function(e){if("object"!=K(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=K(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==K(t)?t:t+""}var re=function(){return e=function e(t){var n,r,o,i,a,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),te(this,"_openButton",null),te(this,"_root",null),te(this,"_breakpointDetector",null),te(this,"_interfaceDetectorCleanup",null),te(this,"_hybridBehaviourCleanup",null),te(this,"_isHidden",!1),te(this,"_isClosingViaBack",!1),te(this,"_isLoading",!1),this.id=t,this.rootEl=document.getElementById(t),!this.rootEl)throw new Error('Element with id "'.concat(t,'" not found'));this.eventBus=new I,this.config=this._buildConfig(u),n=this.rootEl,o=(r=this.config).mapProvider,i=r.deviceNotSupportedText,a=null==o?void 0:o.checkDeviceCapabilities(),(o?null!=a&&a.isSupported||(E(n,i),(0,P.i)(),A.v.warn(null==a?void 0:a.error),0):(A.v.warn("No map provider"),0))&&(["buttonFirst","hybrid"].includes(this.config.behaviour)&&y(this),this._breakpointDetector=function(e){var t,n=e.maxMobileWidth,r=e.minDesktopWidth,o=e.containerEl,i="unknown",a=new Set,u=function(e){e!==i&&(i=e,requestAnimationFrame(function(){i===e&&a.forEach(function(t){return t(e)})}))};if(o){var c=function(e,t,n){e.style.containerType="inline-size";var r=e.getBoundingClientRect().width,o=t(r);e.dataset.breakpoint=o;var i=new window.ResizeObserver(function(r){var o,i,a=(null===(o=r[0])||void 0===o||null===(o=o.borderBoxSize)||void 0===o||null===(o=o[0])||void 0===o?void 0:o.inlineSize)||(null===(i=r[0])||void 0===i?void 0:i.contentRect.width),u=t(a);e.dataset.breakpoint=u,n(u)});return i.observe(e),{initialType:o,cleanup:function(){i.disconnect(),e.style.containerType="",delete e.dataset.breakpoint}}}(o,function(e){return function(e,t,n){return e<=t?"mobile":e>=n?"desktop":"tablet"}(e,n,r)},u);i=c.initialType,u(c.initialType),t=c.cleanup}else{var s=function(e,t,n){var r={mobile:window.matchMedia("(max-width: ".concat(e,"px)")),desktop:window.matchMedia("(min-width: ".concat(t,"px)"))},o=function(){var e="tablet";r.mobile.matches?e="mobile":r.desktop.matches&&(e="desktop"),n(e)};return r.mobile.addEventListener("change",o),r.desktop.addEventListener("change",o),o(),{cleanup:function(){r.mobile.removeEventListener("change",o),r.desktop.removeEventListener("change",o)}}}(n,r,u);t=s.cleanup}return{subscribe:function(e){return a.add(e),function(){return a.delete(e)}},getBreakpoint:function(){return i},destroy:function(){var e;null===(e=t)||void 0===e||e(),a.clear()}}}({maxMobileWidth:this.config.maxMobileWidth,minDesktopWidth:this.config.minDesktopWidth,containerEl:this.rootEl}),this._interfaceDetectorCleanup=(0,M.C1)(),this._initialize())},t=[{key:"_buildConfig",value:function(e){var t=function(e){for(var t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach(function(t){_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},null==e?void 0:e.dataset),n={},r=0,o=Object.keys(t);r<o.length;r++){var i=o[r];n[i]=w(t[i])}return n}(this.rootEl);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mapViewParamKey,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,j),r=x(x({},S),n);return void 0!==t&&(console.warn("[InteractiveMap] mapViewParamKey is deprecated — use mapViewQueryParam instead."),r.mapViewQueryParam=t),r}(X(X({id:this.id,title:document.title},t),e))}},{key:"_initialize",value:function(){var e=this;["buttonFirst","hybrid"].includes(this.config.behaviour)&&(this._openButton=function(t,n){var r=t.id,o=t.buttonText,i=t.buttonClass,a='\n <a class="'.concat(i,"\" role=\"button\">\n <svg focusable='false' aria-hidden='true' width='16' height='20' viewBox='0 0 16 20' fillRule='evenodd'>\n <path d='M15 7.5c.009 3.778-4.229 9.665-7.5 12.5C4.229 17.165-.009 11.278 0 7.5a7.5 7.5 0 1 1 15 0z'/>\n <path d='M7.5 12.961a5.46 5.46 0 1 0 0-10.922 5.46 5.46 0 1 0 0 10.922z' fill='#fff'/>\n </svg>\n <span>").concat(o,"</span>\n <span class='im-u-visually-hidden'> (Visual only)</span>\n </a>\n ");n.insertAdjacentHTML("beforebegin",a);var u=n.previousElementSibling,c=new URL(window.location.href);return c.searchParams.set(t.mapViewQueryParam,r),u.setAttribute("href",c.toString()),u.addEventListener("click",function(t){t.preventDefault(),function(t){e._handleButtonClick(t)}(t)}),u}(this.config,this.rootEl)),this._hybridBehaviourCleanup=function(e){var t=e.config,n=t.behaviour,r=t.hybridWidth,o=t.maxMobileWidth;if("buttonFirst"===n&&e._breakpointDetector.subscribe(function(){O(e.config)?e.loadApp():e.removeApp()}),"hybrid"===n){var i=null!=r?r:o,a=window.matchMedia("(max-width: ".concat(i,"px)")),u=function(){O(e.config)?e._isHidden?e.showApp():null==e._root?e.loadApp():(0,P.N)(e):e._root&&e.hideApp()};return a.addEventListener("change",u),function(){return a.removeEventListener("change",u)}}return null}(this),O(this.config)?this.loadApp():(0,P.i)()}},{key:"_handleButtonClick",value:function(e){this._isHidden?(this.config.manageHistoryState&&history.pushState({isBack:!0},"",e.currentTarget.getAttribute("href")),this.showApp()):this._root||(this.config.manageHistoryState&&history.pushState({isBack:!0},"",e.currentTarget.getAttribute("href")),this.loadApp())}},{key:"_removeMapParamFromUrl",value:function(e,t){var n=new RegExp("[?&]".concat(t,"=[^&]*(&|$)"));return n.test(e)?e.replace(n,function(e,t){return"&"===t?"?":""}).replace(/\?$/,""):e}},{key:"_handleExitClick",value:function(){var e,t=this;if(this.config.manageHistoryState)if(null!==(e=history.state)&&void 0!==e&&e.isBack){if(this._isClosingViaBack)return;this._isClosingViaBack=!0,history.back(),setTimeout(function(){t._isClosingViaBack=!1},1e3)}else{this.config.preserveStateOnClose?this.hideApp():this.removeApp();var n=this.config.mapViewQueryParam,r=this._removeMapParamFromUrl(location.href,n);history.replaceState(history.state,"",r)}else this.config.preserveStateOnClose?this.hideApp():this.removeApp()}},{key:"loadApp",value:(n=Q().m(function e(){var t,n,r,o,i,u,c,s,l,f,p=this;return Q().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!this._root&&!this._isLoading){e.n=1;break}return e.a(2);case 1:return this._isLoading=!0,this._openButton&&(this._openButton.style.display="none"),e.p=2,e.n=3,a.e(935).then(a.bind(a,29));case 3:return t=e.v,n=t.initialiseApp,e.n=4,this.config.mapProvider.load();case 4:return r=e.v,o=r.MapProvider,i=r.mapFramework,u=r.mapProviderConfig,this.config.reverseGeocodeProvider&&(0,D.H_)(this.config.reverseGeocodeProvider,u.crs),e.n=5,n(this.rootEl,X(X({id:this.id,initialBreakpoint:this._breakpointDetector.getBreakpoint(),initialInterfaceType:(0,M.ip)()},this.config),{},{MapProvider:o,mapProviderConfig:u,mapFramework:i,eventBus:this.eventBus,breakpointDetector:this._breakpointDetector,handleExitClick:this._handleExitClick.bind(this)}));case 5:c=e.v,this._root=c._root,delete c._root,s=new Set(["on","off","emit"]),Object.keys(c).forEach(function(e){s.has(e)||(p[e]=c[e])}),(0,P.N)(this),this.eventBus.emit(R.q.APP_OPENED,{statePreserved:!1}),e.n=7;break;case 6:throw e.p=6,f=e.v,null===(l=this._openButton)||void 0===l||l.removeAttribute("style"),E(this.rootEl,this.config.genericErrorText),console.error(f),f;case 7:return e.p=7,this._isLoading=!1,e.f(7);case 8:return e.a(2)}},e,this,[[2,6,7,8]])}),r=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){Z(i,r,o,a,u,"next",e)}function u(e){Z(i,r,o,a,u,"throw",e)}a(void 0)})},function(){return r.apply(this,arguments)})},{key:"removeApp",value:function(){this._root&&"function"==typeof this.unmount&&(this.unmount(),this._root=null),this._openButton&&(this._openButton.removeAttribute("style"),this._openButton.focus()),(0,P.N)(this,{isFullscreen:!1}),this.eventBus.emit(R.q.APP_CLOSED,{statePreserved:!1}),this.eventBus.emit(R.q.MAP_DESTROY,{mapId:this.id})}},{key:"hideApp",value:function(){this._isHidden=!0,this.rootEl.style.display="none",(0,U.U)({containerEl:this.rootEl,isFullscreen:!1}),this._openButton&&(this._openButton.removeAttribute("style"),this._openButton.focus()),document.documentElement.classList.remove("im-is-fullscreen"),this.rootEl.classList.remove("im-is-fullscreen");var e=document.title.split(": ");e.length>1&&(document.title=e.at(-1)),this.eventBus.emit(R.q.APP_CLOSED,{statePreserved:!0})}},{key:"showApp",value:function(){this._isHidden=!1,this.rootEl.style.display="",this._openButton&&(this._openButton.style.display="none"),(0,P.N)(this),this.eventBus.emit(R.q.APP_OPENED,{statePreserved:!0})}},{key:"destroy",value:function(){var e,t,n;this.removeApp(),null===(e=this._breakpointDetector)||void 0===e||e.destroy(),null===(t=this._interfaceDetectorCleanup)||void 0===t||t.call(this),null===(n=this._hybridBehaviourCleanup)||void 0===n||n.call(this),m(this),this.eventBus.destroy()}},{key:"on",value:function(){var e;(e=this.eventBus).on.apply(e,arguments)}},{key:"off",value:function(){var e;(e=this.eventBus).off.apply(e,arguments)}},{key:"emit",value:function(){var e;(e=this.eventBus).emit.apply(e,arguments)}},{key:"addMarker",value:function(e,t,n){this.eventBus.emit(R.q.APP_ADD_MARKER,{id:e,coords:t,options:n})}},{key:"updateMarker",value:function(e,t){this.eventBus.emit(R.q.APP_UPDATE_MARKER,{id:e,options:t})}},{key:"removeMarker",value:function(e){this.eventBus.emit(R.q.APP_REMOVE_MARKER,e)}},{key:"setMode",value:function(e){this.eventBus.emit(R.q.APP_SET_MODE,e)}},{key:"addButton",value:function(e,t){this.eventBus.emit(R.q.APP_ADD_BUTTON,{id:e,config:t})}},{key:"toggleButtonState",value:function(e,t,n){this.eventBus.emit(R.q.APP_TOGGLE_BUTTON_STATE,{id:e,prop:t,value:n})}},{key:"setContinueEnabled",value:function(e){this.toggleButtonState("journeyContinue","disabled",!e)}},{key:"addPanel",value:function(e,t){this.eventBus.emit(R.q.APP_ADD_PANEL,{id:e,config:t})}},{key:"removePanel",value:function(e){this.eventBus.emit(R.q.APP_REMOVE_PANEL,e)}},{key:"showPanel",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).focus,n=void 0===t||t;this.eventBus.emit(R.q.APP_SHOW_PANEL,{id:e,focus:n})}},{key:"hidePanel",value:function(e){this.eventBus.emit(R.q.APP_HIDE_PANEL,e)}},{key:"addControl",value:function(e,t){this.eventBus.emit(R.q.APP_ADD_CONTROL,{id:e,config:t})}},{key:"fitToBounds",value:function(e){this.eventBus.emitWhenReady(R.q.MAP_FIT_TO_BOUNDS,e)}},{key:"setView",value:function(e){this.eventBus.emitWhenReady(R.q.MAP_SET_VIEW,e)}},{key:"open",value:function(){this._isHidden?this.showApp():this._root||this.loadApp()}},{key:"close",value:function(){this._handleExitClick()}}],t&&ee(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,r}(),oe="undefined"==typeof window?globalThis:window;oe.defra=oe.defra||{},oe.preactCompat=c,oe.preactJsxRuntime=l,oe.preactHooks={useState:c.useState},oe.defra.InteractiveMap=re,oe.preactCompat.default||(oe.preactCompat.default=oe.preactCompat),oe.preactCompat.createRoot||(oe.preactCompat.createRoot=function(e){return{render:function(t){oe.preactCompat.render(t,e)},unmount:function(){oe.preactCompat.render(null,e)}}});const ie=re;return u.default})());
|
package/docs/api/context.md
CHANGED
|
@@ -50,13 +50,13 @@ context.mapProvider.setView({ zoom: 10 })
|
|
|
50
50
|
|
|
51
51
|
Rasterises and registers pattern fill images with the map engine. Plugin layer adapters call this instead of importing provider internals directly, keeping cross-package boundaries clean.
|
|
52
52
|
|
|
53
|
-
- `patternConfigs` — flat array of
|
|
53
|
+
- `patternConfigs` — flat array of style configs that have a `fillPattern` or `fillPatternSvgContent` property
|
|
54
54
|
- `mapStyleId` — current map style ID
|
|
55
55
|
- `patternRegistry` — the core pattern registry instance
|
|
56
56
|
|
|
57
57
|
```js
|
|
58
58
|
// In a plugin's MapLibre layer adapter
|
|
59
|
-
await mapProvider.addPatternsToMap(
|
|
59
|
+
await mapProvider.addPatternsToMap(patternConfigs, mapStyleId, patternRegistry)
|
|
60
60
|
```
|
|
61
61
|
|
|
62
62
|
---
|
|
@@ -65,13 +65,13 @@ await mapProvider.addPatternsToMap(getPatternConfigs(datasets, patternRegistry),
|
|
|
65
65
|
|
|
66
66
|
Rasterises and registers symbol images with the map engine. Plugin layer adapters call this instead of importing provider internals directly, keeping cross-package boundaries clean.
|
|
67
67
|
|
|
68
|
-
- `symbolConfigs` — flat array of
|
|
68
|
+
- `symbolConfigs` — flat array of style configs that have a `symbol` property
|
|
69
69
|
- `mapStyleId` — current map style ID, used to resolve style-variant token values
|
|
70
70
|
- `symbolRegistry` — the core symbol registry instance
|
|
71
71
|
|
|
72
72
|
```js
|
|
73
73
|
// In a plugin's MapLibre layer adapter
|
|
74
|
-
await mapProvider.addSymbolsToMap(
|
|
74
|
+
await mapProvider.addSymbolsToMap(symbolConfigs, mapStyleId, symbolRegistry)
|
|
75
75
|
```
|
|
76
76
|
|
|
77
77
|
---
|
package/docs/api.md
CHANGED
|
@@ -66,6 +66,34 @@ Whether to automatically determine the colour scheme based on the user's system
|
|
|
66
66
|
|
|
67
67
|
---
|
|
68
68
|
|
|
69
|
+
### `backAndContinue`
|
|
70
|
+
**Type:** `BackAndContinueConfig | null`
|
|
71
|
+
**Default:** `null`
|
|
72
|
+
|
|
73
|
+
Shows Back and/or Continue navigation buttons in the actions bar when the map is fullscreen. Intended for multi-step journey flows where the map is one step a user must complete before proceeding.
|
|
74
|
+
|
|
75
|
+
Provide `backLabel` to render a Back button; provide `continueLabel` to render a Continue button. Both are optional — include either or both.
|
|
76
|
+
|
|
77
|
+
The Continue button always starts **disabled**. Enable it either declaratively via the `continueEnabledWhen` function or imperatively via [`setContinueEnabled()`](#setcontinueenabledenabled).
|
|
78
|
+
|
|
79
|
+
```js
|
|
80
|
+
new InteractiveMap('map', {
|
|
81
|
+
behaviour: 'mapOnly',
|
|
82
|
+
backAndContinue: {
|
|
83
|
+
backLabel: 'Back',
|
|
84
|
+
continueLabel: 'Continue',
|
|
85
|
+
// Enable Continue once the user has selected at least one feature
|
|
86
|
+
continueEnabledWhen: ({ pluginStates }) =>
|
|
87
|
+
pluginStates.interact?.selectedFeatures.length > 0
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
> [!NOTE]
|
|
93
|
+
> In `mapOnly` behaviour the Back button is hidden when there is no browser history to go back to (direct link / bookmark). In `buttonFirst` or `hybrid` behaviour the Back button navigates back in browser history if the map was opened via the button, or collapses the map if arrived via a direct link or bookmark.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
69
97
|
### `backgroundColor`
|
|
70
98
|
**Type:** `string | Object<string, string>`
|
|
71
99
|
**Default:** `var(--background-color)`
|
|
@@ -311,19 +339,6 @@ URL query parameter used to control fullscreen/hybrid/buttonFirst state. Overrid
|
|
|
311
339
|
|
|
312
340
|
---
|
|
313
341
|
|
|
314
|
-
### `urlPosition`
|
|
315
|
-
**Type:** `'sync' | 'readOnly' | 'none'`
|
|
316
|
-
**Default:** `'sync'`
|
|
317
|
-
|
|
318
|
-
Controls how map center and zoom interact with the page URL.
|
|
319
|
-
|
|
320
|
-
| Value | Behaviour |
|
|
321
|
-
|---|---|
|
|
322
|
-
| `'sync'` | Reads center/zoom from the URL on load and writes back on pan/zoom — enables bookmarking and sharing the current map view |
|
|
323
|
-
| `'readOnly'` | Seeds the initial view from the URL but never writes back |
|
|
324
|
-
| `'none'` | Ignores the URL entirely — use when you don't want the user's pan/zoom to be persisted or shared |
|
|
325
|
-
---
|
|
326
|
-
|
|
327
342
|
### `markers`
|
|
328
343
|
**Type:** `MarkerConfig[]`
|
|
329
344
|
|
|
@@ -333,30 +348,6 @@ See [MarkerConfig](./api/marker-config.md) for full details.
|
|
|
333
348
|
|
|
334
349
|
---
|
|
335
350
|
|
|
336
|
-
### `symbolDefaults`
|
|
337
|
-
**Type:** `Partial<SymbolDefaults>`
|
|
338
|
-
|
|
339
|
-
App-wide defaults for symbol and marker appearance.
|
|
340
|
-
|
|
341
|
-
| Property | Default |
|
|
342
|
-
|---|---|
|
|
343
|
-
| `symbol` | `'pin'` |
|
|
344
|
-
| `backgroundColor` | `'#ca3535'` |
|
|
345
|
-
| `foregroundColor` | `'#ffffff'` |
|
|
346
|
-
|
|
347
|
-
```js
|
|
348
|
-
new InteractiveMap('map', {
|
|
349
|
-
symbolDefaults: {
|
|
350
|
-
symbol: 'circle',
|
|
351
|
-
backgroundColor: { outdoor: '#1d70b8', dark: '#4c9ed9' }
|
|
352
|
-
}
|
|
353
|
-
})
|
|
354
|
-
```
|
|
355
|
-
|
|
356
|
-
See [Symbol Config](./api/symbol-config.md) for the full property list.
|
|
357
|
-
|
|
358
|
-
---
|
|
359
|
-
|
|
360
351
|
### `maxExtent`
|
|
361
352
|
**Type:** `[number, number, number, number]`
|
|
362
353
|
|
|
@@ -481,6 +472,30 @@ new InteractiveMap('map', {
|
|
|
481
472
|
|
|
482
473
|
---
|
|
483
474
|
|
|
475
|
+
### `symbolDefaults`
|
|
476
|
+
**Type:** `Partial<SymbolDefaults>`
|
|
477
|
+
|
|
478
|
+
App-wide defaults for symbol and marker appearance.
|
|
479
|
+
|
|
480
|
+
| Property | Default |
|
|
481
|
+
|---|---|
|
|
482
|
+
| `symbol` | `'pin'` |
|
|
483
|
+
| `backgroundColor` | `'#ca3535'` |
|
|
484
|
+
| `foregroundColor` | `'#ffffff'` |
|
|
485
|
+
|
|
486
|
+
```js
|
|
487
|
+
new InteractiveMap('map', {
|
|
488
|
+
symbolDefaults: {
|
|
489
|
+
symbol: 'circle',
|
|
490
|
+
backgroundColor: { outdoor: '#1d70b8', dark: '#4c9ed9' }
|
|
491
|
+
}
|
|
492
|
+
})
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
See [Symbol Config](./api/symbol-config.md) for the full property list.
|
|
496
|
+
|
|
497
|
+
---
|
|
498
|
+
|
|
484
499
|
### `transformRequest`
|
|
485
500
|
**Type:** `function`
|
|
486
501
|
|
|
@@ -497,6 +512,20 @@ See the [MapLibre documentation](https://maplibre.org/maplibre-gl-js/docs/API/ty
|
|
|
497
512
|
|
|
498
513
|
---
|
|
499
514
|
|
|
515
|
+
### `urlPosition`
|
|
516
|
+
**Type:** `'sync' | 'readOnly' | 'none'`
|
|
517
|
+
**Default:** `'sync'`
|
|
518
|
+
|
|
519
|
+
Controls how map center and zoom interact with the page URL.
|
|
520
|
+
|
|
521
|
+
| Value | Behaviour |
|
|
522
|
+
|---|---|
|
|
523
|
+
| `'sync'` | Reads center/zoom from the URL on load and writes back on pan/zoom — enables bookmarking and sharing the current map view |
|
|
524
|
+
| `'readOnly'` | Seeds the initial view from the URL but never writes back |
|
|
525
|
+
| `'none'` | Ignores the URL entirely — use when you don't want the user's pan/zoom to be persisted or shared |
|
|
526
|
+
|
|
527
|
+
---
|
|
528
|
+
|
|
500
529
|
### `zoom`
|
|
501
530
|
**Type:** `number`
|
|
502
531
|
|
|
@@ -720,6 +749,31 @@ See [ControlDefinition](./api/control-definition.md) for configuration options.
|
|
|
720
749
|
|
|
721
750
|
---
|
|
722
751
|
|
|
752
|
+
### `setContinueEnabled(enabled)`
|
|
753
|
+
|
|
754
|
+
Enable or disable the Continue button added by [`backAndContinue`](#backandcontinue). Use this for imperative control — for example, enabling Continue after an async operation or in response to an external event. For reactive state-derived conditions, prefer the `continueEnabledWhen` function in `backAndContinue` instead.
|
|
755
|
+
|
|
756
|
+
> [!NOTE]
|
|
757
|
+
> If `continueEnabledWhen` is configured alongside `setContinueEnabled`, the function will override the imperative call on the next state change.
|
|
758
|
+
|
|
759
|
+
| Parameter | Type | Description |
|
|
760
|
+
|-----------|------|-------------|
|
|
761
|
+
| `enabled` | `boolean` | `true` to enable the Continue button, `false` to disable it |
|
|
762
|
+
|
|
763
|
+
```js
|
|
764
|
+
// Enable Continue after a draw operation completes
|
|
765
|
+
interactiveMap.on('draw:merged', () => {
|
|
766
|
+
interactiveMap.setContinueEnabled(true)
|
|
767
|
+
})
|
|
768
|
+
|
|
769
|
+
// Disable it again if the merge is undone
|
|
770
|
+
interactiveMap.on('draw:unmerged', () => {
|
|
771
|
+
interactiveMap.setContinueEnabled(false)
|
|
772
|
+
})
|
|
773
|
+
```
|
|
774
|
+
|
|
775
|
+
---
|
|
776
|
+
|
|
723
777
|
### `setMode(mode)`
|
|
724
778
|
|
|
725
779
|
Programmatically set the application mode. See the [`mode`](#mode) option for more detail.
|
|
@@ -860,6 +914,26 @@ interactiveMap.on('app:ready', () => {
|
|
|
860
914
|
|
|
861
915
|
---
|
|
862
916
|
|
|
917
|
+
### `app:continue`
|
|
918
|
+
|
|
919
|
+
Emitted when the user clicks the Continue button added by [`backAndContinue`](#backandcontinue). Includes a snapshot of all plugin states and the current map state at the moment Continue was clicked.
|
|
920
|
+
|
|
921
|
+
**Payload:**
|
|
922
|
+
|
|
923
|
+
| Property | Type | Description |
|
|
924
|
+
|---|---|---|
|
|
925
|
+
| `pluginStates` | `object` | All plugin states keyed by plugin ID (e.g. `pluginStates.interact.selectedFeatures`) |
|
|
926
|
+
| `mapState` | `object` | Current map state including `zoom`, `center`, `bounds` and other map properties |
|
|
927
|
+
|
|
928
|
+
```js
|
|
929
|
+
interactiveMap.on('app:continue', ({ pluginStates, mapState }) => {
|
|
930
|
+
const selectedFeatures = pluginStates.interact?.selectedFeatures ?? []
|
|
931
|
+
console.log('User continued with', selectedFeatures.length, 'features at zoom', mapState.zoom)
|
|
932
|
+
})
|
|
933
|
+
```
|
|
934
|
+
|
|
935
|
+
---
|
|
936
|
+
|
|
863
937
|
### `map:ready`
|
|
864
938
|
|
|
865
939
|
Emitted when the underlying map is ready and initial app state (style and size) has settled.
|
|
@@ -94,32 +94,42 @@
|
|
|
94
94
|
.app-example-card {
|
|
95
95
|
position: relative;
|
|
96
96
|
margin-bottom: 30px;
|
|
97
|
-
border: 1px solid #b1b4b6;
|
|
98
97
|
}
|
|
99
98
|
|
|
100
99
|
.app-example-card > img {
|
|
101
100
|
display: block;
|
|
102
101
|
width: 100%;
|
|
102
|
+
border: 1px solid #b1b4b6;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
.app-example-card__body {
|
|
106
|
-
padding:
|
|
106
|
+
padding: 10px 0;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
.app-prose-scope *:not(.app-no-prose *) .app-example-card__body h2:last-child {
|
|
110
110
|
margin-bottom: 0;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
.app-example-card__body .govuk-heading-
|
|
113
|
+
.app-example-card__body .govuk-heading-s {
|
|
114
114
|
margin-bottom: 0;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
.app-example-card .govuk-heading-
|
|
117
|
+
.app-example-card .govuk-heading-s a::after {
|
|
118
118
|
content: '';
|
|
119
119
|
position: absolute;
|
|
120
120
|
inset: 0;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
+
/* Two columns at tablet */
|
|
124
|
+
@media (min-width: 641px) and (max-width: 1019px) {
|
|
125
|
+
.app-example-cards .govuk-grid-column-one-third {
|
|
126
|
+
width: 50%;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.app-example-cards .govuk-grid-column-one-third:nth-child(odd) {
|
|
130
|
+
clear: left;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
123
133
|
|
|
124
134
|
/* GOV.UK tabs — enhanced styles for all devices; React manages active state.
|
|
125
135
|
Extra specificity via .app-prose-scope required to override the theme. */
|
|
@@ -210,6 +220,12 @@
|
|
|
210
220
|
margin-bottom: 20px;
|
|
211
221
|
}
|
|
212
222
|
|
|
223
|
+
.app-prose-scope *:not(.app-no-prose *) .govuk-heading-s {
|
|
224
|
+
font-size: 1.1875rem;
|
|
225
|
+
line-height: 1.3157894737;
|
|
226
|
+
margin-bottom: 15px;
|
|
227
|
+
}
|
|
228
|
+
|
|
213
229
|
.govuk-\!-margin-bottom-0 {
|
|
214
230
|
margin-bottom: 0 !important;
|
|
215
231
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -29,7 +29,7 @@ Add markers to the map and allow users to select them. Selecting a marker fires
|
|
|
29
29
|
},
|
|
30
30
|
center: [-2.96, 54.43],
|
|
31
31
|
zoom: 15,
|
|
32
|
-
containerHeight: '
|
|
32
|
+
containerHeight: '516px',
|
|
33
33
|
plugins: [interactPlugin]
|
|
34
34
|
})
|
|
35
35
|
|
|
@@ -85,7 +85,7 @@ Add markers to the map and allow users to select them. Selecting a marker fires
|
|
|
85
85
|
},
|
|
86
86
|
center: [-2.96, 54.43],
|
|
87
87
|
zoom: 15,
|
|
88
|
-
containerHeight: '
|
|
88
|
+
containerHeight: '516px',
|
|
89
89
|
plugins: [interactPlugin]
|
|
90
90
|
})
|
|
91
91
|
|
|
@@ -24,7 +24,7 @@ Embed an interactive map directly on the page, allowing users to explore and int
|
|
|
24
24
|
},
|
|
25
25
|
center: [-1.6, 53.1],
|
|
26
26
|
zoom: 6,
|
|
27
|
-
containerHeight: '
|
|
27
|
+
containerHeight: '516px'
|
|
28
28
|
})
|
|
29
29
|
`
|
|
30
30
|
},
|
|
@@ -45,7 +45,7 @@ Embed an interactive map directly on the page, allowing users to explore and int
|
|
|
45
45
|
},
|
|
46
46
|
center: [-1.6, 53.1],
|
|
47
47
|
zoom: 6,
|
|
48
|
-
containerHeight: '
|
|
48
|
+
containerHeight: '516px'
|
|
49
49
|
})
|
|
50
50
|
</script>
|
|
51
51
|
`
|