@defra/forms-engine-plugin 5.0.0-alpha.11 → 5.0.0-alpha.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/.public/javascripts/shared.min.js +1 -1
  2. package/.public/javascripts/shared.min.js.map +1 -1
  3. package/.server/client/javascripts/geospatial-map.d.ts +153 -5
  4. package/.server/client/javascripts/geospatial-map.js +147 -46
  5. package/.server/client/javascripts/geospatial-map.js.map +1 -1
  6. package/.server/client/javascripts/location-map.d.ts +38 -0
  7. package/.server/client/javascripts/location-map.js +42 -2
  8. package/.server/client/javascripts/location-map.js.map +1 -1
  9. package/.server/client/javascripts/map-constants.d.ts +3 -0
  10. package/.server/client/javascripts/map-constants.js +4 -0
  11. package/.server/client/javascripts/map-constants.js.map +1 -0
  12. package/.server/client/javascripts/map.d.ts +4 -0
  13. package/.server/client/javascripts/map.js +5 -0
  14. package/.server/client/javascripts/map.js.map +1 -1
  15. package/.server/server/plugins/engine/__stubs__/definitions.d.ts +29 -0
  16. package/.server/server/plugins/engine/__stubs__/definitions.js +125 -0
  17. package/.server/server/plugins/engine/__stubs__/definitions.js.map +1 -0
  18. package/.server/server/plugins/engine/components/CheckboxesField.d.ts +20 -2
  19. package/.server/server/plugins/engine/components/CheckboxesField.js +24 -12
  20. package/.server/server/plugins/engine/components/CheckboxesField.js.map +1 -1
  21. package/.server/server/plugins/engine/components/EastingNorthingField.d.ts +4 -0
  22. package/.server/server/plugins/engine/components/EastingNorthingField.js +1 -1
  23. package/.server/server/plugins/engine/components/EastingNorthingField.js.map +1 -1
  24. package/.server/server/plugins/engine/components/FileUploadField.d.ts +10 -1
  25. package/.server/server/plugins/engine/components/FileUploadField.js +18 -6
  26. package/.server/server/plugins/engine/components/FileUploadField.js.map +1 -1
  27. package/.server/server/plugins/engine/components/GeospatialField.d.ts +22 -0
  28. package/.server/server/plugins/engine/components/GeospatialField.js +33 -9
  29. package/.server/server/plugins/engine/components/GeospatialField.js.map +1 -1
  30. package/.server/server/plugins/engine/components/LatLongField.d.ts +4 -0
  31. package/.server/server/plugins/engine/components/LocationFieldBase.js +7 -1
  32. package/.server/server/plugins/engine/components/LocationFieldBase.js.map +1 -1
  33. package/.server/server/plugins/engine/components/LocationFieldHelpers.d.ts +4 -0
  34. package/.server/server/plugins/engine/components/LocationFieldHelpers.js +9 -2
  35. package/.server/server/plugins/engine/components/LocationFieldHelpers.js.map +1 -1
  36. package/.server/server/plugins/engine/components/helpers/components.js +2 -1
  37. package/.server/server/plugins/engine/components/helpers/components.js.map +1 -1
  38. package/.server/server/plugins/engine/components/helpers/geospatial.d.ts +5 -0
  39. package/.server/server/plugins/engine/components/helpers/geospatial.js +25 -16
  40. package/.server/server/plugins/engine/components/helpers/geospatial.js.map +1 -1
  41. package/.server/server/plugins/engine/errors.d.ts +49 -0
  42. package/.server/server/plugins/engine/errors.js +75 -0
  43. package/.server/server/plugins/engine/errors.js.map +1 -0
  44. package/.server/server/plugins/engine/form-availability.d.ts +3 -2
  45. package/.server/server/plugins/engine/form-availability.js +3 -2
  46. package/.server/server/plugins/engine/form-availability.js.map +1 -1
  47. package/.server/server/plugins/engine/form-context.js +2 -2
  48. package/.server/server/plugins/engine/form-context.js.map +1 -1
  49. package/.server/server/plugins/engine/i18n/buildValidationMessages.d.ts +1 -1
  50. package/.server/server/plugins/engine/i18n/buildValidationMessages.js +30 -9
  51. package/.server/server/plugins/engine/i18n/buildValidationMessages.js.map +1 -1
  52. package/.server/server/plugins/engine/i18n/translations/cy.json +117 -11
  53. package/.server/server/plugins/engine/i18n/translations/en-GB.json +80 -11
  54. package/.server/server/plugins/engine/i18n/types.d.ts +1 -0
  55. package/.server/server/plugins/engine/i18n/types.js.map +1 -1
  56. package/.server/server/plugins/engine/models/FormModel.js +10 -2
  57. package/.server/server/plugins/engine/models/FormModel.js.map +1 -1
  58. package/.server/server/plugins/engine/models/unavailable-view-model.d.ts +11 -2
  59. package/.server/server/plugins/engine/models/unavailable-view-model.js +23 -4
  60. package/.server/server/plugins/engine/models/unavailable-view-model.js.map +1 -1
  61. package/.server/server/plugins/engine/pageControllers/helpers/pages.js +2 -1
  62. package/.server/server/plugins/engine/pageControllers/helpers/pages.js.map +1 -1
  63. package/.server/server/plugins/engine/pageControllers/validationOptions.d.ts +1 -1
  64. package/.server/server/plugins/engine/pageControllers/validationOptions.js +1 -1
  65. package/.server/server/plugins/engine/pageControllers/validationOptions.js.map +1 -1
  66. package/.server/server/plugins/engine/unavailable-response.js +5 -2
  67. package/.server/server/plugins/engine/unavailable-response.js.map +1 -1
  68. package/.server/server/plugins/engine/views/components/_location-field-base.html +2 -1
  69. package/.server/server/plugins/engine/views/components/geospatialfield.html +1 -0
  70. package/.server/server/plugins/engine/views/components/osgridreffield.html +3 -1
  71. package/.server/server/plugins/engine/views/unavailable.html +14 -11
  72. package/package.json +1 -1
  73. package/src/client/javascripts/geospatial-map.js +169 -47
  74. package/src/client/javascripts/location-map.js +50 -2
  75. package/src/client/javascripts/map-constants.js +3 -0
  76. package/src/client/javascripts/map.js +5 -0
  77. package/src/server/plugins/engine/__stubs__/definitions.ts +155 -0
  78. package/src/server/plugins/engine/components/CheckboxesField.ts +34 -13
  79. package/src/server/plugins/engine/components/EastingNorthingField.ts +1 -1
  80. package/src/server/plugins/engine/components/FileUploadField.ts +26 -6
  81. package/src/server/plugins/engine/components/GeospatialField.ts +44 -11
  82. package/src/server/plugins/engine/components/LocationFieldBase.ts +7 -1
  83. package/src/server/plugins/engine/components/LocationFieldHelpers.ts +9 -2
  84. package/src/server/plugins/engine/components/helpers/components.ts +2 -1
  85. package/src/server/plugins/engine/components/helpers/geospatial.ts +32 -22
  86. package/src/server/plugins/engine/errors.ts +78 -0
  87. package/src/server/plugins/engine/form-availability.ts +8 -2
  88. package/src/server/plugins/engine/form-context.ts +4 -2
  89. package/src/server/plugins/engine/i18n/buildValidationMessages.ts +15 -10
  90. package/src/server/plugins/engine/i18n/translations/cy.json +117 -11
  91. package/src/server/plugins/engine/i18n/translations/en-GB.json +80 -11
  92. package/src/server/plugins/engine/i18n/types.ts +1 -0
  93. package/src/server/plugins/engine/models/FormModel.ts +12 -2
  94. package/src/server/plugins/engine/models/unavailable-view-model.ts +26 -5
  95. package/src/server/plugins/engine/pageControllers/helpers/pages.ts +2 -1
  96. package/src/server/plugins/engine/pageControllers/validationOptions.ts +2 -2
  97. package/src/server/plugins/engine/unavailable-response.ts +6 -2
  98. package/src/server/plugins/engine/views/components/_location-field-base.html +2 -1
  99. package/src/server/plugins/engine/views/components/geospatialfield.html +1 -0
  100. package/src/server/plugins/engine/views/components/osgridreffield.html +3 -1
  101. package/src/server/plugins/engine/views/unavailable.html +14 -11
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see shared.min.js.LICENSE.txt */
2
- var e,t,n,r={452:(e,t,n)=>{n.d(t,{Ob:()=>Ae,q6:()=>s.q6,d5:()=>ae,Ay:()=>xe,Rf:()=>q,Qv:()=>fe,XX:()=>pe,xJ:()=>Pe,hb:()=>O,NT:()=>A,vJ:()=>b,Nf:()=>w,Kr:()=>k,WO:()=>y,li:()=>E,J0:()=>v});var r,o,i,a,s=n(126),l=0,u=[],c=s.fF,d=c.__b,h=c.__r,p=c.diffed,f=c.__c,m=c.unmount,g=c.__;function _(e,t){c.__h&&c.__h(o,e,l||t),l=0;var n=o.__H||(o.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function v(e){return l=1,y(D,e)}function y(e,t,n){var i=_(r++,2);if(i.t=e,!i.__c&&(i.__=[n?n(t):D(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=o,!o.__f)){var a=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter(function(e){return e.__c});if(r.every(function(e){return!e.__N}))return!s||s.call(this,e,t,n);var o=i.__c.props!==e;return r.some(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),s&&s.call(this,e,t,n)||o};o.__f=!0;var s=o.shouldComponentUpdate,l=o.componentWillUpdate;o.componentWillUpdate=function(e,t,n){if(this.__e){var r=s;s=void 0,a(e,t,n),s=r}l&&l.call(this,e,t,n)},o.shouldComponentUpdate=a}return i.__N||i.__}function b(e,t){var n=_(r++,3);!c.__s&&$(n.__H,t)&&(n.__=e,n.u=t,o.__H.__h.push(n))}function w(e,t){var n=_(r++,4);!c.__s&&$(n.__H,t)&&(n.__=e,n.u=t,o.__h.push(n))}function E(e){return l=5,k(function(){return{current:e}},[])}function S(e,t,n){l=6,w(function(){if("function"==typeof e){var n=e(t());return function(){e(null),n&&"function"==typeof n&&n()}}if(e)return e.current=t(),function(){return e.current=null}},null==n?n:n.concat(e))}function k(e,t){var n=_(r++,7);return $(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function O(e,t){return l=8,k(function(){return e},t)}function A(e){var t=o.context[e.__c],n=_(r++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(o)),t.props.value):e.__}function P(e,t){c.useDebugValue&&c.useDebugValue(t?t(e):e)}function N(){var e=_(r++,11);if(!e.__){for(var t=o.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function T(){for(var e;e=u.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(C),t.__h.some(L),t.__h=[]}catch(o){t.__h=[],c.__e(o,e.__v)}}}c.__b=function(e){o=null,d&&d(e)},c.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),g&&g(e,t)},c.__r=function(e){h&&h(e),r=0;var t=(o=e.__c).__H;t&&(i===o?(t.__h=[],o.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(C),t.__h.some(L),t.__h=[],r=0)),i=o},c.diffed=function(e){p&&p(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==u.push(t)&&a===c.requestAnimationFrame||((a=c.requestAnimationFrame)||M)(T)),t.__H.__.some(function(e){e.u&&(e.__H=e.u),e.u=void 0})),i=o=null},c.__c=function(e,t){t.some(function(e){try{e.__h.some(C),e.__h=e.__h.filter(function(e){return!e.__||L(e)})}catch(o){t.some(function(e){e.__h&&(e.__h=[])}),t=[],c.__e(o,e.__v)}}),f&&f(e,t)},c.unmount=function(e){m&&m(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{C(e)}catch(e){t=e}}),n.__H=void 0,t&&c.__e(t,n.__v))};var x="function"==typeof requestAnimationFrame;function M(e){var t,n=function(){clearTimeout(r),x&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);x&&(t=requestAnimationFrame(n))}function C(e){var t=o,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),o=t}function L(e){var t=o;e.__c=e.__(),o=t}function $(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function D(e,t){return"function"==typeof t?t(e):t}function j(e,t){for(var n in t)e[n]=t[n];return e}function R(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function F(e,t){var n=t(),r=v({t:{__:n,u:t}}),o=r[0].t,i=r[1];return w(function(){o.__=n,o.u=t,I(o)&&i({t:o})},[e,n,t]),b(function(){return I(o)&&i({t:o}),e(function(){I(o)&&i({t:o})})},[e]),n}function I(e){try{return!((t=e.__)===(n=e.u())&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}var t,n}function B(e){e()}function G(e){return e}function W(){return[!1,B]}var U=w;function H(e,t){this.props=e,this.context=t}(H.prototype=new s.uA).isPureReactComponent=!0,H.prototype.shouldComponentUpdate=function(e,t){return R(this.props,e)||R(this.state,t)};var z=s.fF.__b;s.fF.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),z&&z(e)};var V="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function q(e){function t(t){var n=j({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=V,t.render=e,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Y=function(e,t){return null==e?null:(0,s.v2)((0,s.v2)(e).map(t))},K={map:Y,forEach:Y,count:function(e){return e?(0,s.v2)(e).length:0},only:function(e){var t=(0,s.v2)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:s.v2},Z=s.fF.__e;s.fF.__e=function(e,t,n,r){if(e.then)for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t);Z(e,t,n,r)};var X=s.fF.unmount;function J(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),e.__c.__H=null),null!=(e=j({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return J(e,t,n)})),e}function Q(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return Q(e,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function ee(){this.__u=0,this.o=null,this.__b=null}function te(e){if(!e.__)return null;var t=e.__.__c;return t&&t.__a&&t.__a(e)}function ne(){this.i=null,this.l=null}s.fF.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),X&&X(e)},(ee.prototype=new s.uA).__c=function(e,t){var n=t.__c,r=this;null==r.o&&(r.o=[]),r.o.push(n);var o=te(r.__v),i=!1,a=function(){i||r.__z||(i=!0,n.__R=null,o?o(l):l())};n.__R=a;var s=n.__P;n.__P=null;var l=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=Q(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.__P=s,t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},ee.prototype.componentWillUnmount=function(){this.o=[]},ee.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=J(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&(0,s.n)(s.FK,null,e.fallback);return o&&(o.__u&=-33),[(0,s.n)(s.FK,null,t.__a?null:e.children),o]};var re=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function oe(e){return this.getChildContext=function(){return e.context},e.children}function ie(e){var t=this,n=e.h;if(t.componentWillUnmount=function(){(0,s.XX)(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),!t.v){for(var r=t.__v;null!==r&&!r.__m&&null!==r.__;)r=r.__;t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:r.__m},contains:function(){return!0},namespaceURI:n.namespaceURI,insertBefore:function(e,n){this.childNodes.push(e),t.h.insertBefore(e,n)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}}(0,s.XX)((0,s.n)(oe,{context:t.context},e.__v),t.v)}function ae(e,t){var n=(0,s.n)(ie,{__v:e,h:t});return n.containerInfo=t,n}(ne.prototype=new s.uA).__a=function(e){var t=this,n=te(t.__v),r=t.l.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),re(t,e,r)):o()};n?n(i):i()}},ne.prototype.render=function(e){this.i=null,this.l=new Map;var t=(0,s.v2)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},ne.prototype.componentDidUpdate=ne.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){re(e,n,t)})};var se="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,le=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,ue=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,ce=/[A-Z0-9]/g,de="undefined"!=typeof document,he=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function pe(e,t,n){return null==t.__k&&(t.textContent=""),(0,s.XX)(e,t),"function"==typeof n&&n(),e?e.__c:null}function fe(e,t,n){return(0,s.Qv)(e,t),"function"==typeof n&&n(),e?e.__c:null}s.uA.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(s.uA.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var me=s.fF.event;function ge(){}function _e(){return this.cancelBubble}function ve(){return this.defaultPrevented}s.fF.event=function(e){return me&&(e=me(e)),e.persist=ge,e.isPropagationStopped=_e,e.isDefaultPrevented=ve,e.nativeEvent=e};var ye,be={enumerable:!1,configurable:!0,get:function(){return this.class}},we=s.fF.vnode;s.fF.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,r={},o=-1===n.indexOf("-");for(var i in t){var a=t[i];if(!("value"===i&&"defaultValue"in t&&null==a||de&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var l=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===a?a="":"translate"===l&&"no"===a?a=!1:"o"===l[0]&&"n"===l[1]?"ondoubleclick"===l?i="ondblclick":"onchange"!==l||"input"!==n&&"textarea"!==n||he(t.type)?"onfocus"===l?i="onfocusin":"onblur"===l?i="onfocusout":ue.test(i)&&(i=l):l=i="oninput":o&&le.test(i)?i=i.replace(ce,"-$&").toLowerCase():null===a&&(a=void 0),"oninput"===l&&r[i=l]&&(i="oninputCapture"),r[i]=a}}"select"==n&&r.multiple&&Array.isArray(r.value)&&(r.value=(0,s.v2)(t.children).forEach(function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)})),"select"==n&&null!=r.defaultValue&&(r.value=(0,s.v2)(t.children).forEach(function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value})),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",be)):t.className&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=se,we&&we(e)};var Ee=s.fF.__r;s.fF.__r=function(e){Ee&&Ee(e),ye=e.__c};var Se=s.fF.diffed;s.fF.diffed=function(e){Se&&Se(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),ye=null};var ke={ReactCurrentDispatcher:{current:{readContext:function(e){return ye.__n[e.__c].props.value},useCallback:O,useContext:A,useDebugValue:P,useDeferredValue:G,useEffect:b,useId:N,useImperativeHandle:S,useInsertionEffect:U,useLayoutEffect:w,useMemo:k,useReducer:y,useRef:E,useState:v,useSyncExternalStore:F,useTransition:W}}};function Oe(e){return!!e&&e.$$typeof===se}function Ae(e){return Oe(e)?s.Ob.apply(null,arguments):e}function Pe(e){return!!e.__k&&((0,s.XX)(null,e),!0)}var Ne=s.FK,Te=Oe,xe={useState:v,useId:N,useReducer:y,useEffect:b,useLayoutEffect:w,useInsertionEffect:U,useTransition:W,useDeferredValue:G,useSyncExternalStore:F,startTransition:B,useRef:E,useImperativeHandle:S,useMemo:k,useCallback:O,useContext:A,useDebugValue:P,version:"18.3.1",Children:K,render:pe,hydrate:fe,unmountComponentAtNode:Pe,createPortal:ae,createElement:s.n,createContext:s.q6,createFactory:function(e){return s.n.bind(null,e)},cloneElement:Ae,createRef:s._3,Fragment:s.FK,isValidElement:Oe,isElement:Te,isFragment:function(e){return Oe(e)&&e.type===s.FK},isMemo:function(e){return!!e&&"string"==typeof e.displayName&&e.displayName.startsWith("Memo(")},findDOMNode:function(e){return e&&(e.base||1===e.nodeType&&e)||null},Component:s.uA,PureComponent:H,memo:function(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:R(this.props,e)}function r(t){return this.shouldComponentUpdate=n,(0,s.n)(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r.type=e,r},forwardRef:q,flushSync:function(e,t){return e(t)},unstable_batchedUpdates:function(e,t){return e(t)},StrictMode:Ne,Suspense:ee,SuspenseList:ne,lazy:function(e){var t,n,r,o=null;function i(i){if(t||(t=e()).then(function(e){e&&(o=e.default||e),r=!0},function(e){n=e,r=!0}),n)throw n;if(!r)throw t;return o?(0,s.n)(o,i):null}return i.displayName="Lazy",i.__f=!0,i},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ke}},126:(e,t,n)=>{n.d(t,{FK:()=>k,Ob:()=>K,Qv:()=>Y,XX:()=>q,_3:()=>S,fF:()=>o,n:()=>w,q6:()=>Z,uA:()=>O,v2:()=>$});var r,o,i,a,s,l,u,c,d,h,p,f,m={},g=[],_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,v=Array.isArray;function y(e,t){for(var n in t)e[n]=t[n];return e}function b(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function w(e,t,n){var o,i,a,s={};for(a in t)"key"==a?o=t[a]:"ref"==a?i=t[a]:s[a]=t[a];if(arguments.length>2&&(s.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return E(e,s,o,i,null)}function E(e,t,n,r,a){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==a?++i:a,__i:-1,__u:0};return null==a&&null!=o.vnode&&o.vnode(s),s}function S(){return{current:null}}function k(e){return e.children}function O(e,t){this.props=e,this.context=t}function A(e,t){if(null==t)return e.__?A(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?A(e):null}function P(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],i=[],a=y({},t);a.__v=t.__v+1,o.vnode&&o.vnode(a),I(e.__P,a,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,null==n?A(t):n,!!(32&t.__u),i),a.__v=t.__v,a.__.__k[a.__i]=a,G(r,a,i),t.__e=t.__=null,a.__e!=n&&N(a)}}function N(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some(function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e}),N(e)}function T(e){(!e.__d&&(e.__d=!0)&&a.push(e)&&!x.__r++||s!=o.debounceRendering)&&((s=o.debounceRendering)||l)(x)}function x(){for(var e,t=1;a.length;)a.length>t&&a.sort(u),e=a.shift(),t=a.length,P(e);x.__r=0}function M(e,t,n,r,o,i,a,s,l,u,c){var d,h,p,f,_,v,y,b=r&&r.__k||g,w=t.length;for(l=C(n,t,b,l,w),d=0;d<w;d++)null!=(p=n.__k[d])&&(h=-1!=p.__i&&b[p.__i]||m,p.__i=d,v=I(e,p,h,o,i,a,s,l,u,c),f=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&H(h.ref,null,p),c.push(p.ref,p.__c||f,p)),null==_&&null!=f&&(_=f),(y=!!(4&p.__u))||h.__k===p.__k?l=L(p,l,e,y):"function"==typeof p.type&&void 0!==v?l=v:f&&(l=f.nextSibling),p.__u&=-7);return n.__e=_,l}function C(e,t,n,r,o){var i,a,s,l,u,c=n.length,d=c,h=0;for(e.__k=new Array(o),i=0;i<o;i++)null!=(a=t[i])&&"boolean"!=typeof a&&"function"!=typeof a?("string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?a=e.__k[i]=E(null,a,null,null,null):v(a)?a=e.__k[i]=E(k,{children:a},null,null,null):void 0===a.constructor&&a.__b>0?a=e.__k[i]=E(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[i]=a,l=i+h,a.__=e,a.__b=e.__b+1,s=null,-1!=(u=a.__i=D(a,n,l,d))&&(d--,(s=n[u])&&(s.__u|=2)),null==s||null==s.__v?(-1==u&&(o>c?h--:o<c&&h++),"function"!=typeof a.type&&(a.__u|=4)):u!=l&&(u==l-1?h--:u==l+1?h++:(u>l?h--:h++,a.__u|=4))):e.__k[i]=null;if(d)for(i=0;i<c;i++)null!=(s=n[i])&&!(2&s.__u)&&(s.__e==r&&(r=A(s)),z(s,s));return r}function L(e,t,n,r){var o,i;if("function"==typeof e.type){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,t=L(o[i],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=A(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function $(e,t){return t=t||[],null==e||"boolean"==typeof e||(v(e)?e.some(function(e){$(e,t)}):t.push(e)),t}function D(e,t,n,r){var o,i,a,s=e.key,l=e.type,u=t[n],c=null!=u&&!(2&u.__u);if(null===u&&null==s||c&&s==u.key&&l==u.type)return n;if(r>(c?1:0))for(o=n-1,i=n+1;o>=0||i<t.length;)if(null!=(u=t[a=o>=0?o--:i++])&&!(2&u.__u)&&s==u.key&&l==u.type)return a;return-1}function j(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||_.test(t)?n:n+"px"}function R(e,t,n,r,o){var i,a;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||j(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||j(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])i=t!=(t=t.replace(c,"$1")),a=t.toLowerCase(),t=a in e||"onFocusOut"==t||"onFocusIn"==t?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=d,e.addEventListener(t,i?p:h,i)):e.removeEventListener(t,i?p:h,i);else{if("http://www.w3.org/2000/svg"==o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function F(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=d++;else if(t.t<n.u)return;return n(o.event?o.event(t):t)}}}function I(e,t,n,r,i,a,s,l,u,c){var d,h,p,f,m,_,w,E,S,A,P,N,T,x,C,L=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(u=!!(32&n.__u),a=[l=t.__e=n.__e]),(d=o.__b)&&d(t);e:if("function"==typeof L)try{if(E=t.props,S="prototype"in L&&L.prototype.render,A=(d=L.contextType)&&r[d.__c],P=d?A?A.props.value:d.__:r,n.__c?w=(h=t.__c=n.__c).__=h.__E:(S?t.__c=h=new L(E,P):(t.__c=h=new O(E,P),h.constructor=L,h.render=V),A&&A.sub(h),h.state||(h.state={}),h.__n=r,p=h.__d=!0,h.__h=[],h._sb=[]),S&&null==h.__s&&(h.__s=h.state),S&&null!=L.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=y({},h.__s)),y(h.__s,L.getDerivedStateFromProps(E,h.__s))),f=h.props,m=h.state,h.__v=t,p)S&&null==L.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),S&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(S&&null==L.getDerivedStateFromProps&&E!==f&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(E,P),t.__v==n.__v||!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(E,h.__s,P)){t.__v!=n.__v&&(h.props=E,h.state=h.__s,h.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),g.push.apply(h.__h,h._sb),h._sb=[],h.__h.length&&s.push(h);break e}null!=h.componentWillUpdate&&h.componentWillUpdate(E,h.__s,P),S&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(f,m,_)})}if(h.context=P,h.props=E,h.__P=e,h.__e=!1,N=o.__r,T=0,S)h.state=h.__s,h.__d=!1,N&&N(t),d=h.render(h.props,h.state,h.context),g.push.apply(h.__h,h._sb),h._sb=[];else do{h.__d=!1,N&&N(t),d=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++T<25);h.state=h.__s,null!=h.getChildContext&&(r=y(y({},r),h.getChildContext())),S&&!p&&null!=h.getSnapshotBeforeUpdate&&(_=h.getSnapshotBeforeUpdate(f,m)),x=null!=d&&d.type===k&&null==d.key?W(d.props.children):d,l=M(e,v(x)?x:[x],t,n,r,i,a,s,l,u,c),h.base=t.__e,t.__u&=-161,h.__h.length&&s.push(h),w&&(h.__E=h.__=null)}catch(e){if(t.__v=null,u||null!=a)if(e.then){for(t.__u|=u?160:128;l&&8==l.nodeType&&l.nextSibling;)l=l.nextSibling;a[a.indexOf(l)]=null,t.__e=l}else{for(C=a.length;C--;)b(a[C]);B(t)}else t.__e=n.__e,t.__k=n.__k,e.then||B(t);o.__e(e,t,n)}else null==a&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):l=t.__e=U(n.__e,t,n,r,i,a,s,u,c);return(d=o.diffed)&&d(t),128&t.__u?void 0:l}function B(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(B))}function G(e,t,n){for(var r=0;r<n.length;r++)H(n[r],n[++r],n[++r]);o.__c&&o.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){o.__e(e,t.__v)}})}function W(e){return"object"!=typeof e||null==e||e.__b>0?e:v(e)?e.map(W):y({},e)}function U(e,t,n,i,a,s,l,u,c){var d,h,p,f,g,_,y,w=n.props||m,E=t.props,S=t.type;if("svg"==S?a="http://www.w3.org/2000/svg":"math"==S?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),null!=s)for(d=0;d<s.length;d++)if((g=s[d])&&"setAttribute"in g==!!S&&(S?g.localName==S:3==g.nodeType)){e=g,s[d]=null;break}if(null==e){if(null==S)return document.createTextNode(E);e=document.createElementNS(a,S,E.is&&E),u&&(o.__m&&o.__m(t,s),u=!1),s=null}if(null==S)w===E||u&&e.data==E||(e.data=E);else{if(s=s&&r.call(e.childNodes),!u&&null!=s)for(w={},d=0;d<e.attributes.length;d++)w[(g=e.attributes[d]).name]=g.value;for(d in w)g=w[d],"dangerouslySetInnerHTML"==d?p=g:"children"==d||d in E||"value"==d&&"defaultValue"in E||"checked"==d&&"defaultChecked"in E||R(e,d,null,g,a);for(d in E)g=E[d],"children"==d?f=g:"dangerouslySetInnerHTML"==d?h=g:"value"==d?_=g:"checked"==d?y=g:u&&"function"!=typeof g||w[d]===g||R(e,d,g,w[d],a);if(h)u||p&&(h.__html==p.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(p&&(e.innerHTML=""),M("template"==t.type?e.content:e,v(f)?f:[f],t,n,i,"foreignObject"==S?"http://www.w3.org/1999/xhtml":a,s,l,s?s[0]:n.__k&&A(n,0),u,c),null!=s)for(d=s.length;d--;)b(s[d]);u||(d="value","progress"==S&&null==_?e.removeAttribute("value"):null!=_&&(_!==e[d]||"progress"==S&&!_||"option"==S&&_!=w[d])&&R(e,d,_,w[d],a),d="checked",null!=y&&y!=e[d]&&R(e,d,y,w[d],a))}return e}function H(e,t,n){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){o.__e(e,n)}}function z(e,t,n){var r,i;if(o.unmount&&o.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||H(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){o.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&z(r[i],t,n||"function"!=typeof e.type);n||b(e.__e),e.__c=e.__=e.__e=void 0}function V(e,t,n){return this.constructor(e,n)}function q(e,t,n){var i,a,s,l;t==document&&(t=document.documentElement),o.__&&o.__(e,t),a=(i="function"==typeof n)?null:n&&n.__k||t.__k,s=[],l=[],I(t,e=(!i&&n||t).__k=w(k,null,[e]),a||m,m,t.namespaceURI,!i&&n?[n]:a?null:t.firstChild?r.call(t.childNodes):null,s,!i&&n?n:a?a.__e:t.firstChild,i,l),G(s,e,l)}function Y(e,t){q(e,t,Y)}function K(e,t,n){var o,i,a,s,l=y({},e.props);for(a in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==a?o=t[a]:"ref"==a?i=t[a]:l[a]=void 0===t[a]&&null!=s?s[a]:t[a];return arguments.length>2&&(l.children=arguments.length>3?r.call(arguments,2):n),E(e.type,l,o||e.key,i||e.ref,null)}function Z(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,T(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+f++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}r=g.slice,o={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(t){e=t}throw e}},i=0,O.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=y({},this.state),"function"==typeof e&&(e=e(y({},n),this.props)),e&&y(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),T(this))},O.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),T(this))},O.prototype.render=k,a=[],l="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,u=function(e,t){return e.__v.__b-t.__v.__b},x.__r=0,c=/(PointerCapture)$|Capture$/i,d=0,h=F(!1),p=F(!0),f=0},247:(e,t,n)=>{n.d(t,{FD:()=>i,FK:()=>r.FK,Y:()=>i});var r=n(126),o=0;function i(e,t,n,i,a,s){t||(t={});var l,u,c=t;if("ref"in c)for(u in c={},t)"ref"==u?l=t[u]:c[u]=t[u];var d={type:e,props:c,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--o,__i:-1,__u:0,__source:a,__self:s};if("function"==typeof e&&(l=e.defaultProps))for(u in l)void 0===c[u]&&(c[u]=l[u]);return r.fF.vnode&&r.fF.vnode(d),d}Array.isArray},409:(e,t,n)=>{n.d(t,{g5:()=>o,Yv:()=>Re,g$:()=>i,Tj:()=>a,zp:()=>r});var r={};n.r(r),n.d(r,{default:()=>Z,sssiEnglandRequestTransformer:()=>q,sssiScotlandRequestTransformer:()=>K,sssiWalesRequestTransformer:()=>Y});var o={};n.r(o),n.d(o,{addFeatureToMap:()=>ue,createFeatureHTML:()=>he,createFeaturesHTML:()=>ce,focusFeature:()=>de,getBoundingBox:()=>se,getGeoJSON:()=>ae,getHelpPanelHtml:()=>Q,getUIManager:()=>me,processGeospatial:()=>le});var i={};n.r(i),n.d(i,{processLocation:()=>ke});var a={};n.r(a),n.d(a,{EVENTS:()=>De,centerMap:()=>Be,createMap:()=>Ie,defaultConfig:()=>$e,eastingNorthingToLatLong:()=>Te,formSubmitFactory:()=>je,getCentroidGridRef:()=>Le,getCoordinateGridRef:()=>Ce,getMapCountryLayers:()=>We,getMapLayers:()=>Ge,initMaps:()=>Re,latLongToEastingNorthing:()=>Ne,latLongToOsGridRef:()=>xe,makeTileRequestTransformer:()=>Fe,osGridRefToLatLong:()=>Me});var s=n(196),l=n(321),u=n(585);function c(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 d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach(function(t){(0,u.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h(){var e,{manifest:t,mapStyles:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{id:"mapStyles",manifest:t,mapStyles:r,load:(e=(0,l.A)(function*(){return(yield n.e(402).then(n.bind(n,171))).manifest}),function(){return e.apply(this,arguments)}),handlesMapStyle:!0,api:{}}}function p(){var e,{manifest:t,units:r="metric"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{id:"scaleBar",manifest:t,units:r,load:(e=(0,l.A)(function*(){return(yield n.e(402).then(n.bind(n,415))).manifest}),function(){return e.apply(this,arguments)})}}var f=n(463);function m(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 g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach(function(t){(0,u.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return g(g(g(g({},f.D),t),t.expanded&&{manifest:{controls:[{id:"search",mobile:{slot:"banner"}}]}}),{},{id:"search",load:(e=(0,l.A)(function*(){return(yield Promise.resolve().then(n.bind(n,463)).then(function(e){return e.m})).manifest}),function(){return e.apply(this,arguments)})})}function v(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 y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach(function(t){(0,u.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function b(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{checkDeviceCapabilities:()=>{var e=(()=>{if(!window.WebGLRenderingContext)return{isEnabled:!1,error:"WebGL is not supported"};var t=document.createElement("canvas"),n=!1;for(var r of["webgl2","webgl1"])try{if((n=t.getContext(r))&&"function"==typeof n.getParameter)return{isEnabled:!0}}catch(e){}return{isEnabled:!1,error:"WebGL is supported, but disabled"}})(),t=document.documentMode;return{isSupported:e.isEnabled&&"function"==typeof"".replaceAll,error:t?"Internet Explorer is not supported":e.error}},load:(e=(0,l.A)(function*(){var e=yield n.e(264).then(n.t.bind(n,825,19));return t.workerUrl&&e.setWorkerUrl(t.workerUrl),{MapProvider:(yield n.e(402).then(n.bind(n,814))).default,mapProviderConfig:y(y({},t),{},{crs:"EPSG:4326"}),mapFramework:e}}),function(){return e.apply(this,arguments)})}}n(452),n(247);function w(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}function E(e,t,n){if(null!==e)for(var r,o,i,a,s,l,u,c,d=0,h=0,p=e.type,f="FeatureCollection"===p,m="Feature"===p,g=f?e.features.length:1,_=0;_<g;_++){s=(c=!!(u=f?e.features[_].geometry:m?e.geometry:e)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var v=0;v<s;v++){var y=0,b=0;if(null!==(a=c?u.geometries[v]:u)){l=a.coordinates;var w=a.type;switch(d=!n||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===t(l,h,_,y,b))return!1;h++,y++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(!1===t(l[r],h,_,y,b))return!1;h++,"MultiPoint"===w&&y++}"LineString"===w&&y++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(o=0;o<l[r].length-d;o++){if(!1===t(l[r][o],h,_,y,b))return!1;h++}"MultiLineString"===w&&y++,"Polygon"===w&&b++}"Polygon"===w&&y++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(b=0,o=0;o<l[r].length;o++){for(i=0;i<l[r][o].length-d;i++){if(!1===t(l[r][o][i],h,_,y,b))return!1;h++}b++}y++}break;case"GeometryCollection":for(r=0;r<a.geometries.length;r++)if(!1===E(a.geometries[r],t,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function S(e,t={}){let n=0,r=0,o=0;return E(e,function(e){n+=e[0],r+=e[1],o++},!0),function(e,t,n={}){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!w(e[0])||!w(e[1]))throw new Error("coordinates must contain numbers");return function(e,t,n={}){const r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}({type:"Point",coordinates:e},t,n)}([n/o,r/o],t.properties)}Math.PI;let k=" ";class O{static get separator(){return k}static set separator(e){k=e}static parse(e){if(!isNaN(parseFloat(e))&&isFinite(e))return Number(e);const t=String(e).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==t[t.length-1]&&t.splice(t.length-1),""==t)return NaN;let n=null;switch(t.length){case 3:n=t[0]/1+t[1]/60+t[2]/3600;break;case 2:n=t[0]/1+t[1]/60;break;case 1:n=t[0];break;default:return NaN}return/^-|[WS]$/i.test(e.trim())&&(n=-n),Number(n)}static toDms(e,t="d",n=void 0){if(isNaN(e))return null;if("string"==typeof e&&""==e.trim())return null;if("boolean"==typeof e)return null;if(e==1/0)return null;if(null==e)return null;if(void 0===n)switch(t){case"d":case"deg":n=4;break;case"dm":case"deg+min":n=2;break;case"dms":case"deg+min+sec":n=0;break;default:t="d",n=4}e=Math.abs(e);let r=null,o=null,i=null,a=null;switch(t){default:case"d":case"deg":o=e.toFixed(n),o<100&&(o="0"+o),o<10&&(o="0"+o),r=o+"°";break;case"dm":case"deg+min":o=Math.floor(e),i=(60*e%60).toFixed(n),60==i&&(i=(0).toFixed(n),o++),o=("000"+o).slice(-3),i<10&&(i="0"+i),r=o+"°"+O.separator+i+"′";break;case"dms":case"deg+min+sec":o=Math.floor(e),i=Math.floor(3600*e/60)%60,a=(3600*e%60).toFixed(n),60==a&&(a=(0).toFixed(n),i++),60==i&&(i=0,o++),o=("000"+o).slice(-3),i=("00"+i).slice(-2),a<10&&(a="0"+a),r=o+"°"+O.separator+i+"′"+O.separator+a+"″"}return r}static toLat(e,t,n){const r=O.toDms(O.wrap90(e),t,n);return null===r?"–":r.slice(1)+O.separator+(e<0?"S":"N")}static toLon(e,t,n){const r=O.toDms(O.wrap180(e),t,n);return null===r?"–":r+O.separator+(e<0?"W":"E")}static toBrng(e,t,n){const r=O.toDms(O.wrap360(e),t,n);return null===r?"–":r.replace("360","0")}static fromLocale(e){const t=123456.789.toLocaleString(),n={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(n.thousands,"⁜").replace(n.decimal,".").replace("⁜",",")}static toLocale(e){const t=123456.789.toLocaleString(),n={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(/,([0-9])/,"⁜$1").replace(".",n.decimal).replace("⁜",n.thousands)}static compassPoint(e,t=3){if(![1,2,3].includes(Number(t)))throw new RangeError(`invalid precision ‘${t}’`);e=O.wrap360(e);const n=4*2**(t-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(e*n/360)%n*16/n]}static wrap90(e){if(-90<=e&&e<=90)return e;const t=e;return 1*Math.abs(((t-90)%360+360)%360-180)-90}static wrap180(e){if(-180<=e&&e<=180)return e;const t=360;return((360*e/t-180)%t+t)%t-180}static wrap360(e){if(0<=e&&e<360)return e;const t=360;return(360*e/t%t+t)%t}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const A=O;class P{constructor(e,t,n){if(isNaN(e)||isNaN(t)||isNaN(n))throw new TypeError(`invalid vector [${e},${t},${n}]`);this.x=Number(e),this.y=Number(t),this.z=Number(n)}get length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}plus(e){if(!(e instanceof P))throw new TypeError("v is not Vector3d object");return new P(this.x+e.x,this.y+e.y,this.z+e.z)}minus(e){if(!(e instanceof P))throw new TypeError("v is not Vector3d object");return new P(this.x-e.x,this.y-e.y,this.z-e.z)}times(e){if(isNaN(e))throw new TypeError(`invalid scalar value ‘${e}’`);return new P(this.x*e,this.y*e,this.z*e)}dividedBy(e){if(isNaN(e))throw new TypeError(`invalid scalar value ‘${e}’`);return new P(this.x/e,this.y/e,this.z/e)}dot(e){if(!(e instanceof P))throw new TypeError("v is not Vector3d object");return this.x*e.x+this.y*e.y+this.z*e.z}cross(e){if(!(e instanceof P))throw new TypeError("v is not Vector3d object");const t=this.y*e.z-this.z*e.y,n=this.z*e.x-this.x*e.z,r=this.x*e.y-this.y*e.x;return new P(t,n,r)}negate(){return new P(-this.x,-this.y,-this.z)}unit(){const e=this.length;if(1==e)return this;if(0==e)return this;const t=this.x/e,n=this.y/e,r=this.z/e;return new P(t,n,r)}angleTo(e,t=void 0){if(!(e instanceof P))throw new TypeError("v is not Vector3d object");if(!(t instanceof P||null==t))throw new TypeError("n is not Vector3d object");const n=null==t||this.cross(e).dot(t)>=0?1:-1,r=this.cross(e).length*n,o=this.dot(e);return Math.atan2(r,o)}rotateAround(e,t){if(!(e instanceof P))throw new TypeError("axis is not Vector3d object");const n=t.toRadians(),r=this.unit(),o=e.unit(),i=Math.sin(n),a=Math.cos(n),s=1-a,l=o.x,u=o.y,c=o.z,d=[[s*l*l+a,s*l*u-i*c,s*l*c+i*u],[s*l*u+i*c,s*u*u+a,s*u*c-i*l],[s*l*c-i*u,s*u*c+i*l,s*c*c+a]],h=[d[0][0]*r.x+d[0][1]*r.y+d[0][2]*r.z,d[1][0]*r.x+d[1][1]*r.y+d[1][2]*r.z,d[2][0]*r.x+d[2][1]*r.y+d[2][2]*r.z];return new P(h[0],h[1],h[2])}toString(e=3){return`[${this.x.toFixed(e)},${this.y.toFixed(e)},${this.z.toFixed(e)}]`}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const N=P,T={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563}},x={WGS84:{ellipsoid:T.WGS84}};Object.freeze(T.WGS84),Object.freeze(x.WGS84);class M{constructor(e,t,n=0){if(isNaN(e)||null==e)throw new TypeError(`invalid lat ‘${e}’`);if(isNaN(t)||null==t)throw new TypeError(`invalid lon ‘${t}’`);if(isNaN(n)||null==n)throw new TypeError(`invalid height ‘${n}’`);this._lat=A.wrap90(Number(e)),this._lon=A.wrap180(Number(t)),this._height=Number(n)}get lat(){return this._lat}get latitude(){return this._lat}set lat(e){if(this._lat=isNaN(e)?A.wrap90(A.parse(e)):A.wrap90(Number(e)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${e}’`)}set latitude(e){if(this._lat=isNaN(e)?A.wrap90(A.parse(e)):A.wrap90(Number(e)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${e}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(e){if(this._lon=isNaN(e)?A.wrap180(A.parse(e)):A.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${e}’`)}set lng(e){if(this._lon=isNaN(e)?A.wrap180(A.parse(e)):A.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${e}’`)}set longitude(e){if(this._lon=isNaN(e)?A.wrap180(A.parse(e)):A.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${e}’`)}get height(){return this._height}set height(e){if(this._height=Number(e),isNaN(this._height))throw new TypeError(`invalid height ‘${e}’`)}get datum(){return this._datum}set datum(e){this._datum=e}static get ellipsoids(){return T}static get datums(){return x}static parse(...e){if(0==e.length)throw new TypeError("invalid (empty) point");let t,n,r;if("object"==typeof e[0]&&(1==e.length||!isNaN(parseFloat(e[1])))){const o=e[0];if("Point"==o.type&&Array.isArray(o.coordinates)?([n,t,r]=o.coordinates,r=r||0):(null!=o.latitude&&(t=o.latitude),null!=o.lat&&(t=o.lat),null!=o.longitude&&(n=o.longitude),null!=o.lng&&(n=o.lng),null!=o.lon&&(n=o.lon),null!=o.height&&(r=o.height),t=A.wrap90(A.parse(t)),n=A.wrap180(A.parse(n))),null!=e[1]&&(r=e[1]),isNaN(t)||isNaN(n))throw new TypeError(`invalid point ‘${JSON.stringify(e[0])}’`)}if("string"==typeof e[0]&&2==e[0].split(",").length&&([t,n]=e[0].split(","),t=A.wrap90(A.parse(t)),n=A.wrap180(A.parse(n)),r=e[1]||0,isNaN(t)||isNaN(n)))throw new TypeError(`invalid point ‘${e[0]}’`);if(null==t&&null==n&&([t,n]=e,t=A.wrap90(A.parse(t)),n=A.wrap180(A.parse(n)),r=e[2]||0,isNaN(t)||isNaN(n)))throw new TypeError(`invalid point ‘${e.toString()}’`);return new this(t,n,r)}toCartesian(){const e=this.datum?this.datum.ellipsoid:this.referenceFrame?this.referenceFrame.ellipsoid:T.WGS84,t=this.lat.toRadians(),n=this.lon.toRadians(),r=this.height,{a:o,f:i}=e,a=Math.sin(t),s=Math.cos(t),l=Math.sin(n),u=Math.cos(n),c=2*i-i*i,d=o/Math.sqrt(1-c*a*a);return new C((d+r)*s*u,(d+r)*s*l,(d*(1-c)+r)*a)}equals(e){if(!(e instanceof M))throw new TypeError(`invalid point ‘${e}’`);return!(Math.abs(this.lat-e.lat)>Number.EPSILON||Math.abs(this.lon-e.lon)>Number.EPSILON||Math.abs(this.height-e.height)>Number.EPSILON||this.datum!=e.datum||this.referenceFrame!=e.referenceFrame||this.epoch!=e.epoch)}toString(e="d",t=void 0,n=null){if(!["d","dm","dms","n"].includes(e))throw new RangeError(`invalid format ‘${e}’`);const r=(this.height>=0?" +":" ")+this.height.toFixed(n)+"m";return"n"==e?(null==t&&(t=4),`${this.lat.toFixed(t)}, ${this.lon.toFixed(t)}${null==n?"":r}`):`${A.toLat(this.lat,e,t)}, ${A.toLon(this.lon,e,t)}${null==n?"":r}`}}class C extends N{constructor(e,t,n){super(e,t,n)}toLatLon(e=T.WGS84){if(!e||!e.a)throw new TypeError(`invalid ellipsoid ‘${e}’`);const{x:t,y:n,z:r}=this,{a:o,b:i,f:a}=e,s=2*a-a*a,l=s/(1-s),u=Math.sqrt(t*t+n*n),c=i*r/(o*u)*(1+l*i/Math.sqrt(u*u+r*r)),d=c/Math.sqrt(1+c*c),h=d/c,p=isNaN(h)?0:Math.atan2(r+l*i*d*d*d,u-s*o*h*h*h),f=Math.atan2(n,t),m=Math.sin(p),g=u*Math.cos(p)+r*m-o*o/(o/Math.sqrt(1-s*m*m));return new M(p.toDegrees(),f.toDegrees(),g)}toString(e=0){return`[${this.x.toFixed(e)},${this.y.toFixed(e)},${this.z.toFixed(e)}]`}}const L={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563},Airy1830:{a:6377563.396,b:6356256.909,f:1/299.3249646},AiryModified:{a:6377340.189,b:6356034.448,f:1/299.3249646},Bessel1841:{a:6377397.155,b:6356078.962818,f:1/299.1528128},Clarke1866:{a:6378206.4,b:6356583.8,f:1/294.978698214},Clarke1880IGN:{a:6378249.2,b:6356515,f:1/293.466021294},GRS80:{a:6378137,b:6356752.31414,f:1/298.257222101},Intl1924:{a:6378388,b:6356911.946,f:1/297},WGS72:{a:6378135,b:6356750.5,f:1/298.26}},$={ED50:{ellipsoid:L.Intl1924,transform:[89.5,93.8,123.1,-1.2,0,0,.156]},ETRS89:{ellipsoid:L.GRS80,transform:[0,0,0,0,0,0,0]},Irl1975:{ellipsoid:L.AiryModified,transform:[-482.53,130.596,-564.557,-8.15,1.042,.214,.631]},NAD27:{ellipsoid:L.Clarke1866,transform:[8,-160,-176,0,0,0,0]},NAD83:{ellipsoid:L.GRS80,transform:[.9956,-1.9103,-.5215,-62e-5,.025915,.009426,.011599]},NTF:{ellipsoid:L.Clarke1880IGN,transform:[168,60,-320,0,0,0,0]},OSGB36:{ellipsoid:L.Airy1830,transform:[-446.448,125.157,-542.06,20.4894,-.1502,-.247,-.8421]},Potsdam:{ellipsoid:L.Bessel1841,transform:[-582,-105,-414,-8.3,1.04,.35,-3.08]},TokyoJapan:{ellipsoid:L.Bessel1841,transform:[148,-507,-685,0,0,0,0]},WGS72:{ellipsoid:L.WGS72,transform:[0,0,-4.5,-.22,0,0,.554]},WGS84:{ellipsoid:L.WGS84,transform:[0,0,0,0,0,0,0]}};Object.keys(L).forEach(e=>Object.freeze(L[e])),Object.keys($).forEach(e=>{Object.freeze($[e]),Object.freeze($[e].transform)});class D extends M{constructor(e,t,n=0,r=$.WGS84){if(!r||null==r.ellipsoid)throw new TypeError(`unrecognised datum ‘${r}’`);super(e,t,n),this._datum=r}get datum(){return this._datum}static get ellipsoids(){return L}static get datums(){return $}static parse(...e){let t=$.WGS84;if((4==e.length||3==e.length&&"object"==typeof e[2])&&(t=e.pop()),!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);const n=super.parse(...e);return n._datum=t,n}convertDatum(e){if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);return this.toCartesian().convertDatum(e).toLatLon()}toCartesian(){const e=super.toCartesian();return new j(e.x,e.y,e.z,this.datum)}}class j extends C{constructor(e,t,n,r=void 0){if(r&&null==r.ellipsoid)throw new TypeError(`unrecognised datum ‘${r}’`);super(e,t,n),r&&(this._datum=r)}get datum(){return this._datum}set datum(e){if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);this._datum=e}toLatLon(e=void 0){e&&(console.info("datum parameter to Cartesian_Datum.toLatLon is deprecated: set datum before calling toLatLon()"),this.datum=e);const t=this.datum||$.WGS84;if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);const n=super.toLatLon(t.ellipsoid);return new D(n.lat,n.lon,n.height,this.datum)}convertDatum(e){if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);if(!this.datum)throw new TypeError("cartesian coordinate has no datum");let t=null,n=null;null!=this.datum&&this.datum!=$.WGS84||(t=this,n=e.transform),e==$.WGS84&&(t=this,n=this.datum.transform.map(e=>-e)),null==n&&(t=this.convertDatum($.WGS84),n=e.transform);const r=t.applyTransform(n);return r.datum=e,r}applyTransform(e){const{x:t,y:n,z:r}=this,o=e[0],i=e[1],a=e[2],s=e[3]/1e6+1,l=(e[4]/3600).toRadians(),u=(e[5]/3600).toRadians(),c=(e[6]/3600).toRadians();return new j(o+t*s-n*c+r*u,i+t*c+n*s-r*l,a-t*u+n*l+r*s)}}const R={trueOrigin:{lat:49,lon:-2},falseOrigin:{easting:-4e5,northing:1e5},scaleFactor:.9996012717,ellipsoid:D.ellipsoids.Airy1830};class F{constructor(e,t){if(this.easting=Number(e),this.northing=Number(t),isNaN(e)||this.easting<0||this.easting>7e5)throw new RangeError(`invalid easting ‘${e}’`);if(isNaN(t)||this.northing<0||this.northing>13e5)throw new RangeError(`invalid northing ‘${t}’`)}toLatLon(e=D.datums.WGS84){const{easting:t,northing:n}=this,{a:r,b:o}=R.ellipsoid,i=R.trueOrigin.lat.toRadians(),a=R.trueOrigin.lon.toRadians(),s=-R.falseOrigin.easting,l=-R.falseOrigin.northing,u=R.scaleFactor,c=1-o*o/(r*r),d=(r-o)/(r+o),h=d*d,p=d*d*d;let f=i,m=0;do{f=(n-l-m)/(r*u)+f,m=o*u*((1+d+5/4*h+5/4*p)*(f-i)-(3*d+3*d*d+21/8*p)*Math.sin(f-i)*Math.cos(f+i)+(15/8*h+15/8*p)*Math.sin(2*(f-i))*Math.cos(2*(f+i))-35/24*p*Math.sin(3*(f-i))*Math.cos(3*(f+i)))}while(Math.abs(n-l-m)>=1e-5);const g=Math.cos(f),_=Math.sin(f),v=r*u/Math.sqrt(1-c*_*_),y=r*u*(1-c)/Math.pow(1-c*_*_,1.5),b=v/y-1,w=Math.tan(f),E=w*w,S=E*E,k=1/g,O=v*v*v,A=O*v*v,P=t-s,N=P*P,T=N*P,x=N*N,M=T*N;f=f-w/(2*y*v)*N+w/(24*y*O)*(5+3*E+b-9*E*b)*x-w/(720*y*A)*(61+90*E+45*S)*(x*N);const C=a+k/v*P-k/(6*O)*(v/y+2*E)*T+k/(120*A)*(5+28*E+24*S)*M-k/(A*v*v*5040)*(61+662*E+1320*S+S*E*720)*(M*N);let L=new I(f.toDegrees(),C.toDegrees(),0,D.datums.OSGB36);return e!=D.datums.OSGB36&&(L=L.convertDatum(e),L=new I(L.lat,L.lon,L.height,L.datum)),L}static parse(e){let t=(e=String(e).trim()).match(/^(\d+),\s*(\d+)$/);if(t)return new F(t[1],t[2]);if(t=e.match(/^[HNST][ABCDEFGHJKLMNOPQRSTUVWXYZ]\s*[0-9]+\s*[0-9]+$/i),!t)throw new Error(`invalid grid reference ‘${e}’`);let n=e.toUpperCase().charCodeAt(0)-"A".charCodeAt(0),r=e.toUpperCase().charCodeAt(1)-"A".charCodeAt(0);n>7&&n--,r>7&&r--;const o=(n-2)%5*5+r%5,i=19-5*Math.floor(n/5)-Math.floor(r/5);let a=e.slice(2).trim().split(/\s+/);if(1==a.length&&(a=[a[0].slice(0,a[0].length/2),a[0].slice(a[0].length/2)]),a[0].length!=a[1].length)throw new Error(`invalid grid reference ‘${e}’`);a[0]=a[0].padEnd(5,"0"),a[1]=a[1].padEnd(5,"0");const s=o+a[0],l=i+a[1];return new F(s,l)}toString(e=10){if(![0,2,4,6,8,10,12,14,16].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);let{easting:t,northing:n}=this;if(0==e){const e={useGrouping:!1,minimumIntegerDigits:6,maximumFractionDigits:3};return`${t.toLocaleString("en",e)},${n.toLocaleString("en",e)}`}const r=Math.floor(t/1e5),o=Math.floor(n/1e5);let i=19-o-(19-o)%5+Math.floor((r+10)/5),a=5*(19-o)%25+r%5;i>7&&i++,a>7&&a++;const s=String.fromCharCode(i+"A".charCodeAt(0),a+"A".charCodeAt(0));return t=Math.floor(t%1e5/Math.pow(10,5-e/2)),n=Math.floor(n%1e5/Math.pow(10,5-e/2)),t=t.toString().padStart(e/2,"0"),n=n.toString().padStart(e/2,"0"),`${s} ${t} ${n}`}}class I extends D{toOsGrid(){const e=this.datum==D.datums.OSGB36?this:this.convertDatum(D.datums.OSGB36),t=e.lat.toRadians(),n=e.lon.toRadians(),{a:r,b:o}=R.ellipsoid,i=R.trueOrigin.lat.toRadians(),a=R.trueOrigin.lon.toRadians(),s=-R.falseOrigin.easting,l=-R.falseOrigin.northing,u=R.scaleFactor,c=1-o*o/(r*r),d=(r-o)/(r+o),h=d*d,f=d*d*d,m=Math.cos(t),g=Math.sin(t),_=r*u/Math.sqrt(1-c*g*g),v=r*u*(1-c)/Math.pow(1-c*g*g,1.5),y=_/v-1,b=o*u*((1+d+5/4*h+5/4*f)*(t-i)-(3*d+3*d*d+21/8*f)*Math.sin(t-i)*Math.cos(t+i)+(15/8*h+15/8*f)*Math.sin(2*(t-i))*Math.cos(2*(t+i))-35/24*f*Math.sin(3*(t-i))*Math.cos(3*(t+i))),w=m*m*m,E=w*m*m,S=Math.tan(t)*Math.tan(t),k=S*S,O=n-a,A=O*O,P=A*O,N=P*O,T=N*O;let x=b+l+_/2*g*m*A+_/24*g*w*(5-S+9*y)*N+_/720*g*E*(61-58*S+k)*(T*O),M=s+_*m*O+_/6*w*(_/v-S)*P+_/120*E*(5-18*S+k+14*y-58*S*y)*T;x=Number(x.toFixed(3)),M=Number(M.toFixed(3));try{return new F(M,x)}catch(p){throw new Error(`${p.message} from (${e.lat.toFixed(6)},${e.lon.toFixed(6)}).toOsGrid()`)}}convertDatum(e){const t=super.convertDatum(e);return new I(t.lat,t.lon,t.height,t.datum)}}function B(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 G(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?B(Object(n),!0).forEach(function(t){(0,u.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function W(){var e,t=G(G({noKeyItemText:"No features displayed"},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{id:"datasets",load:(e=(0,l.A)(function*(){return(yield n.e(402).then(n.bind(n,407)).then(function(e){return e.m})).manifest}),function(){return e.apply(this,arguments)})});return t}function U(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 H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?U(Object(n),!0).forEach(function(t){(0,u.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function z(e,t={}){if(null!=e.bbox&&!0!==t.recompute)return e.bbox;const n=[1/0,1/0,-1/0,-1/0];return E(e,e=>{n[0]>e[0]&&(n[0]=e[0]),n[1]>e[1]&&(n[1]=e[1]),n[2]<e[0]&&(n[2]=e[0]),n[3]<e[1]&&(n[3]=e[1])}),n}const V={stroke:"#00897B",fillPattern:"diagonal-cross-hatch",fillPatternForegroundColor:"#00897B",fillPatternBackgroundColor:"transparent"};function q(e,{bbox:t}){const n=new URL(e);return n.searchParams.set("bbox",t.join(",")),{url:n.toString()}}function Y(e,{bbox:t}){const n=new URL(e);return n.searchParams.set("bbox",`${t.join(",")},EPSG:4326`),{url:n.toString()}}function K(e,{bbox:t}){const n=new URL(e);return n.searchParams.set("geometry",t.join(",")),{url:n.toString()}}const Z=[{id:"sssi-england",label:"Sites of Special Scientific Interest",dynamicGeoJSON:{url:"https://environment.data.gov.uk/geoservices/datasets/ba8dc201-66ef-4983-9d46-7378af21027e/ogc/features/v1/collections/Sites_of_Special_Scientific_Interest_England/items?f=json",idProperty:"ref_code",transformRequest:q},minZoom:12,style:V,showInKey:!0,showInMenu:!1},{id:"sssi-wales",label:"SSSI Wales",dynamicGeoJSON:{url:"https://datamap.gov.wales/geoserver/wfs?service=WFS&version=2.0.0&request=GetFeature&typeNames=inspire-nrw:NRW_SSSI&outputFormat=application/json&srsName=EPSG:4326",idProperty:"id",transformRequest:Y},minZoom:12,style:V,showInKey:!1,showInMenu:!1},{id:"sssi-scotland",label:"SSSI Scotland",dynamicGeoJSON:{url:"https://services1.arcgis.com/LM9GyVFsughzHdbO/ArcGIS/rest/services/Sites_of_Special_Scientific_Interest/FeatureServer/0/query?f=geojson&where=1%3D1&geometryType=esriGeometryEnvelope&inSR=4326&spatialRel=esriSpatialRelIntersects&returnGeometry=true&outFields=*",idProperty:"OBJECTID",transformRequest:K},minZoom:12,style:V,showInKey:!1,showInMenu:!1}];function X(){return X=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},X.apply(null,arguments)}const J={focus:!1,showLabel:!0,label:"How to use this map",mobile:{slot:"drawer",open:!0,dismissible:!0,modal:!1},tablet:{slot:"drawer",open:!0,dismissible:!0,modal:!1},desktop:{slot:"drawer",open:!0,dismissible:!0,modal:!1}};function Q(e,t,n){const r=function(e,t){return e&&t?"a line or shape":e?"a line":t?"a shape":""}(t,n),o=r?`<li>Double‑click, or select 'Done', when you have finished drawing ${r}</li>`:"",i=function(e,t,n){const r=[];return e&&r.push("points"),t&&r.push("lines"),n&&r.push("shapes"),function(e){if(0===e.length)return"";if(1===e.length)return e[0];if(2===e.length)return`${e[0]} or ${e[1]}`;const t=e.pop();return`${e.join(", ")} or ${t}`}(r)}(e,t,n);return`<p class="govuk-body-s govuk-!-margin-bottom-2">You can add ${i} to the map.</p><ul class="govuk-list govuk-list--number govuk-body-s"><li>Search for a county, place or postcode</li><li>Use the + and - icons to zoom in and out</li>${o}<li>Give the location a name</li></ul>`}const ee={stroke:"rgba(0, 11, 112, 1)",fill:"rgba(0, 11, 112, 0.2)",strokeWidth:2},te={stroke:"rgb(0, 0, 0)",fill:"rgba(255, 221, 0, 0.2)",strokeWidth:2},ne={Point:"Point",LineString:"Line",Polygon:"Shape"},re='<path d="M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0" /><circle cx="12" cy="10" r="3" />',oe='<path d="M19.5 7v10M4.5 7v10M7 19.5h10M7 4.5h10"/><path d="M22 18v3a1 1 0 0 1-1 1h-3a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1zm0-15v3a1 1 0 0 1-1 1h-3a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1zM7 18v3a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1zM7 3v3a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1z"/>',ie='<path d="M5.706 16.294L16.294 5.706"/><path d="M21 2v3c0 .549-.451 1-1 1h-3c-.549 0-1-.451-1-1V2c0-.549.451-1 1-1h3c.549 0 1 .451 1 1zM6 17v3c0 .549-.451 1-1 1H2c-.549 0-1-.451-1-1v-3c0-.549.451-1 1-1h3c.549 0 1 .451 1 1z"/>';function ae(e){const t=e.value.trim();return{type:"FeatureCollection",features:t?JSON.parse(t):[]}}function se(e){return z(e)}function le(e,t,r){if(!(t instanceof HTMLDivElement))return;const o=t.querySelector(".govuk-textarea");if(!(o instanceof HTMLTextAreaElement))return;const{listEl:i,mapId:a}=function(e,t){const n=document.createElement("div"),r=`geospatialmap_${t}`;n.setAttribute("id",r),n.setAttribute("class","map-container");const o=document.createElement("div"),i=`${r}_list`;return o.setAttribute("id",i),e.after(n),n.after(o),e.classList.add("js-hidden"),{mapEl:n,listEl:o,mapId:r}}(o,r),s=ae(o),u=s.features.length?se(s):void 0,c=function(){var e;return H(H({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{id:"draw",load:(e=(0,l.A)(function*(){return(yield n.e(402).then(n.bind(n,327))).manifest}),function(){return e.apply(this,arguments)})})}(),d=[c],h=t.dataset.country,p=Ge(t.dataset.maplayers),f=We(e.apiPath,h);p.includes("sssi")&&f.push(...Z),f.length&&d.push(W({datasets:f}));const m=X({},$e,{bounds:u,plugins:d}),{map:g,interactPlugin:_}=Ie(a,m,e),v=function(e){function t(t){return e.features.find(e=>e.id===t)}return{getFeatures:function(){return e.features},getFeature:t,addFeature:function(t){t.properties.coordinateGridReference=Ce(t),t.properties.centroidGridReference=Le(t),fe(t),e.features.push(t)},updateFeature:function(e,n){const r=t(e);return r&&(r.properties.coordinateGridReference=Ce(r),r.properties.centroidGridReference=Le(r),r.geometry=n,fe(r)),r},removeFeature:function(t){const n=e.features.findIndex(e=>e.id===t);return n>-1?e.features.splice(n,1):void 0}}}(s);!function(e){const{map:t}=e;t.on(De.mapReady,function(e){const{map:t,activeFeatureManager:n,uiManager:r,interactPlugin:o,drawPlugin:i}=e,{toggleActionButtons:a,renderList:s,getAllowableGeometryTypes:l}=r,{resetActiveFeature:u}=n;return function(n){const c=l(),d=c.includes("point"),h=c.includes("line"),p=c.includes("shape");t.addPanel("info",X({},J,{html:Q(d,h,p)})),d&&t.addButton("btnAddPoint",{variant:"tertiary",label:"Add point",iconSvgContent:re,onClick:()=>{u(),a(!0),s(!0),o.enable()},mobile:{slot:"actions"},tablet:{slot:"actions"},desktop:{slot:"actions"}}),p&&t.addButton("btnAddPolygon",{variant:"tertiary",label:"Add shape",iconSvgContent:oe,onClick:()=>{u(),a(!0),s(!0),i.newPolygon(pe(),te)},mobile:{slot:"actions"},tablet:{slot:"actions"},desktop:{slot:"actions"}}),h&&t.addButton("btnAddLine",{variant:"tertiary",label:"Add line",iconSvgContent:ie,onClick:()=>{u(),a(!0),s(!0),i.newLine(pe(),ee)},mobile:{slot:"actions"},tablet:{slot:"actions"},desktop:{slot:"actions"}}),e.mapProvider=n.map,t.on(De.drawReady,function(e){const{featuresManager:t,uiManager:n,drawPlugin:r,map:o}=e,{renderList:i}=n,{getFeatures:a}=t;return function(){a().forEach(e=>ue(e,r,o)),i()}}(e)),t.on(De.drawCreated,function(e){const{featuresManager:t,uiManager:n}=e,{addFeature:r}=t,{renderList:o,toggleActionButtons:i,focusDescriptionInput:a}=n;return function(e){r(X({},e,{properties:{description:""}})),o(),i(!1),a()}}(e)),t.on(De.drawEdited,function(e){const{featuresManager:t,activeFeatureManager:n,uiManager:r}=e,{updateFeature:o}=t,{getActiveFeature:i,resetActiveFeature:a}=n,{renderList:s,toggleActionButtons:l}=r;return function(e){const t=e,n=t.id;i()===n&&(o(n,t.geometry),s()),a(),l(!1)}}(e)),t.on(De.drawCancelled,function(e){const{uiManager:t,activeFeatureManager:n}=e,{toggleActionButtons:r,renderList:o}=t,{resetActiveFeature:i}=n;return function(){r(!1),i(),o()}}(e)),t.on(De.interactMarkerChange,function(e){const{featuresManager:t,activeFeatureManager:n,map:r,interactPlugin:o,uiManager:i}=e,{addFeature:a,updateFeature:s}=t,{getActiveFeature:l,resetActiveFeature:u}=n,{renderList:c,focusDescriptionInput:d,toggleActionButtons:h}=i;return function(e){const t=l();if(t){const n=s(t,{type:"Point",coordinates:e.coords});r.addMarker(t,e.coords),n&&c(),u()}else{const t=pe();a({type:"Feature",properties:{description:""},geometry:{type:"Point",coordinates:e.coords},id:t}),r.addMarker(t,e.coords),c(),d()}r.removeMarker("location"),o.disable(),h(!1)}}(e));const{listEl:f}=r;f.addEventListener("click",function(e){const{map:t,mapProvider:n,featuresManager:r,activeFeatureManager:o,interactPlugin:i,uiManager:a,drawPlugin:s}=e,{getFeature:l,removeFeature:u}=r,{getActiveFeature:c,setActiveFeature:d}=o,{renderList:h,toggleActionButtons:p}=a;return function(e){const r=e.target;if(r instanceof HTMLElement){if(c())return e.preventDefault(),void e.stopPropagation();if("A"===r.tagName&&r.dataset.action&&r.dataset.id&&r.dataset.type){const{action:o,id:a,type:c}=r.dataset;"edit"===o?function(e,t){d(e),"Point"===t?(i.selectFeature({featureId:e}),i.enable()):s.editFeature(e);const r=l(e);r&&n&&de(r,n),p(!0),h(!0)}(a,c):(e.preventDefault(),e.stopPropagation(),"delete"===o&&function(e,n){"Point"===n?(t.removeMarker(e),u(e)):(s.deleteFeature(e),u(e)),h()}(a,c))}}}}(e),!1),f.addEventListener("change",function(e){const{featuresManager:t,uiManager:n}=e,{getFeature:r}=t,{renderValue:o}=n;return function(e){e.preventDefault(),e.stopPropagation();const t=e.target;if(!(t instanceof HTMLInputElement&&t.dataset.id))return;const{id:n}=t.dataset,i=r(n);i&&(i.properties.description=t.value.trim(),o())}}(e),!1),f.addEventListener("keydown",function(e){e.target instanceof HTMLInputElement&&("Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),e.stopPropagation()))},!1)}}(e))}({map:g,featuresManager:v,activeFeatureManager:function(){let e;return{getActiveFeature:function(){return e},setActiveFeature:function(t){e=t},resetActiveFeature:function(){e=void 0}}}(),uiManager:me(s,g,a,i,o,{geometryTypes:t.dataset.geometrytypes}),interactPlugin:_,drawPlugin:c})}function ue(e,t,n){switch(e.geometry.type){case"Polygon":t.addFeature(X({},e,te));break;case"LineString":t.addFeature(X({},e,ee));break;case"Point":n.addMarker(e.id,e.geometry.coordinates)}}function ce(e,t,n=!1,r=!1){return`<dl class="govuk-summary-list">\n ${e.map((e,o)=>he(e,o,t,n,r)).join("\n")}\n </dl>`}function de(e,t){t.fitBounds(z(e))}function he(e,t,n,r=!1,o=!1){const i=e.geometry.coordinates.flat(2),a=[];for(let l=0;l<i.length;l+=2)a.push(i.slice(l,l+2).join(", "));const s=a.map(e=>`<li>${e}</li>`).join("");return`<div class="govuk-summary-list__row govuk-summary-list__row--no-border">\n <dt class="govuk-summary-list__key">\n <div class="govuk-form-group">\n <label class="govuk-label govuk-label--s" ${o?"":`for="description_${t}"`}>Location ${t+1} description</label>\n ${o?`<p class="govuk-body govuk-!-margin-bottom-0">${e.properties.description}</p>`:`<input class="govuk-input govuk-!-width-two-thirds" type="text" id="description_${t}" value="${e.properties.description}" data-id="${e.id}">`}\n </div>\n </dt>\n <dd class="govuk-summary-list__actions">\n <ul class="govuk-summary-list__actions-list">${o?`<li class="govuk-summary-list__actions-list-item">\n <a class="govuk-link govuk-link--no-visited-state" href="#${n}" data-action="focus" data-id="${e.id}">Show<span class="govuk-visually-hidden"> location</span></a>\n</li>`:`<li class="govuk-summary-list__actions-list-item">\n <a class="govuk-link govuk-link--no-visited-state ${r?"govuk-link--disabled":""}" href="#${n}" data-action="edit" data-id="${e.id}"\n data-type="${e.geometry.type}">Update<span class="govuk-visually-hidden"> location</span></a>\n</li><li class="govuk-summary-list__actions-list-item">\n <a class="govuk-link govuk-link--no-visited-state ${r?"govuk-link--disabled":""}" href="#" data-action="delete" data-id="${e.id}"\n data-type="${e.geometry.type}">Delete<span class="govuk-visually-hidden"> location</span></a>\n</li>`}</ul>\n </dd>\n</div>\n<div class="govuk-summary-list__row">\n <details class="govuk-details govuk-!-margin-bottom-2">\n <summary class="govuk-details__summary">\n <span class="govuk-details__summary-text">Coordinates</span>\n </summary>\n <div class="govuk-details__text">\n <dl class="govuk-summary-list">\n <div class="govuk-summary-list__row">\n <dt class="govuk-summary-list__key">Type</dt>\n <dd class="govuk-summary-list__value">${ne[e.geometry.type]}</dd>\n </div>\n <div class="govuk-summary-list__row">\n <dt class="govuk-summary-list__key">Centre grid reference</dt>\n <dd class="govuk-summary-list__value">${e.properties.centroidGridReference}</dd>\n </div>\n <div class="govuk-summary-list__row">\n <dt class="govuk-summary-list__key">First point grid reference</dt>\n <dd class="govuk-summary-list__value">${e.properties.coordinateGridReference}</dd>\n </div>\n <div class="govuk-summary-list__row">\n <dt class="govuk-summary-list__key">Detailed coordinates</dt>\n <dd class="govuk-summary-list__value">\n <ol class="govuk-list govuk-list--number">${s}</ol>\n </dd>\n </div>\n </dl>\n </div>\n </details>\n</div>`}function pe(){return window.crypto.randomUUID()}function fe(e){const{geometry:t}=e;function n(e){e[0]=+e[0].toFixed(7),e[1]=+e[1].toFixed(7)}"Point"===t.type?n(t.coordinates):"LineString"===t.type?t.coordinates.forEach(n):t.coordinates.flat().forEach(n)}function me(e,t,n,r,o,i){function a(){return null!=i&&i.geometryTypes?i.geometryTypes.split(","):["point","line","shape"]}const s=function(e,t){return function(){t.value=JSON.stringify(e.features,null,2)}}(e,o),l=function(e,t,n,r){return function(o=!1){const i=ce(e.features,t,o);n.innerHTML=i,r()}}(e,n,r,s);return{renderList:l,renderValue:s,listEl:r,toggleActionButtons:function(e){const n=a();n.includes("point")&&t.toggleButtonState("btnAddPoint","hidden",e),n.includes("shape")&&t.toggleButtonState("btnAddPolygon","hidden",e),n.includes("line")&&t.toggleButtonState("btnAddLine","hidden",e)},focusDescriptionInput:function(){const e=r.querySelectorAll("input");if(e.length){const t=e.item(e.length-1);t.focus(),t.select()}},getAllowableGeometryTypes:a}}const ge="input.govuk-input";function _e(e,t){const n=e.trim()&&Number(e.trim()),r=t.trim()&&Number(t.trim());return n&&r&&n>=49.85&&n<=60.859&&r>=-13.687&&r<=1.767?{valid:!0,value:{lat:n,long:r}}:{valid:!1}}function ve(e,t){const n=e.trim()&&Number(e.trim()),r=t.trim()&&Number(t.trim());return n&&r&&n>=0&&n<=7e5&&r>=0&&r<=13e5?{valid:!0,value:{easting:n,northing:r}}:{valid:!1}}function ye(e){if(!e)return{valid:!1};const t=/^((([sS]|[nN])[a-hA-Hj-zJ-Z])|(([tT]|[oO])[abfglmqrvwABFGLMQRVW])|([hH][l-zL-Z])|([jJ][lmqrvwLMQRVW]))\s?(([0-9]{3})\s?([0-9]{3})|([0-9]{4})\s?([0-9]{4})|([0-9]{5})\s?([0-9]{5}))$/.exec(e);return null===t?{valid:!1}:{valid:!0,value:t[0]}}function be(e){const t=e.querySelectorAll(ge);if(2!==t.length)throw new Error("Expected 2 inputs for lat and long");return{latInput:t[0],longInput:t[1]}}function we(e){const t=e.querySelectorAll(ge);if(2!==t.length)throw new Error("Expected 2 inputs for easting and northing");return{eastingInput:t[0],northingInput:t[1]}}function Ee(e){const t=e.querySelector(ge);if(null===t)throw new Error("Expected 1 input for osgridref");return t}function Se(e){return{zoom:"16",center:e,markers:[{id:"location",coords:e}]}}function ke(e,t,n){var r;if(!(t instanceof HTMLDivElement))return;const o=t.querySelector(".app-location-field-inputs");if(!(o instanceof HTMLDivElement))return;const i=t.dataset.locationtype;if(!i||!["latlongfield","eastingnorthingfield","osgridreffield"].includes(i))return;const a=document.createElement("div"),s=`map_${n}`;a.setAttribute("id",s),a.setAttribute("class","map-container");const l=null!=(r=function(e){switch(e.dataset.locationtype){case"latlongfield":return function(e){const{latInput:t,longInput:n}=be(e),r=_e(t.value,n.value);if(r.valid)return Se([r.value.long,r.value.lat])}(e);case"eastingnorthingfield":return function(e){const{eastingInput:t,northingInput:n}=we(e),r=ve(t.value,n.value);if(!r.valid)return;const o=Te(r.value);return Se([o.long,o.lat])}(e);case"osgridreffield":return function(e){const t=ye(Ee(e).value);if(!t.valid)return;const n=Me(t.value);return Se([n.long,n.lat])}(e);default:throw new Error("Not implemented")}}(t))?r:$e;o.after(a);const u=t.dataset.country,c=Ge(t.dataset.maplayers),d=We(e.apiPath,u);c.includes("sssi")&&d.push(...Z),d.length&&(l.plugins=[W({datasets:d})]);const{map:h,interactPlugin:p}=Ie(s,l,e);h.on(De.mapReady,function(e){switch(i){case"latlongfield":!function(e,t,n){const{latInput:r,longInput:o}=be(e);function i(){const e=_e(r.value,o.value);if(e.valid){const r=[e.value.long,e.value.lat];Be(t,n,r)}}t.on(De.interactMarkerChange,function(e){r.value=e.coords[1].toFixed(7),o.value=e.coords[0].toFixed(7)}),r.addEventListener("change",i,!1),o.addEventListener("change",i,!1)}(t,h,e.map);break;case"eastingnorthingfield":!function(e,t,n){const{eastingInput:r,northingInput:o}=we(e);function i(){const e=ve(r.value,o.value);if(e.valid){const r=Te(e.value),o=[r.long,r.lat];Be(t,n,o)}}t.on(De.interactMarkerChange,function(e){const t=Ne({lat:e.coords[1],long:e.coords[0]});r.value=t.easting.toFixed(0),o.value=t.northing.toFixed(0)}),r.addEventListener("change",i,!1),o.addEventListener("change",i,!1)}(t,h,e.map);break;case"osgridreffield":!function(e,t,n){const r=Ee(e);t.on(De.interactMarkerChange,function(e){const t=xe({lat:e.coords[1],long:e.coords[0]});r.value=t}),r.addEventListener("change",function(){const e=ye(r.value);if(e.valid){const r=Me(e.value),o=[r.long,r.lat];Be(t,n,o)}},!1)}(t,h,e.map);break;default:throw new Error("Not implemented")}h.addPanel("info",{focus:!1,showLabel:!0,label:"How to use the map",mobile:{slot:"drawer",open:!0,dismissible:!0,modal:!1},tablet:{slot:"drawer",open:!0,dismissible:!0,modal:!1},desktop:{slot:"drawer",open:!0,dismissible:!0,modal:!1},html:"<ul><li>Search for a place or postcode</li><li>Use the + and - icons to zoom in and out</li><li>Use a mouse or keyboard to centre the point at the location</li><li>Click to add the location to the map</li></ul>"}),p.enable()})}function Oe(){return Oe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Oe.apply(null,arguments)}const Ae=169,Pe={VTS_OUTDOOR_URL:"/api/maps/vts/OS_VTS_3857_Outdoor.json",VTS_DARK_URL:"/api/maps/vts/OS_VTS_3857_Dark.json",VTS_BLACK_AND_WHITE_URL:"/api/maps/vts/OS_VTS_3857_Black_and_White.json",VTS_AERIAL_URL:"/api/maps/vts/esri-aerial.json"};function Ne({lat:e,long:t}){return new I(e,t).toOsGrid()}function Te({easting:e,northing:t}){const n=new F(e,t).toLatLon();return{lat:n.latitude,long:n.longitude}}function xe({lat:e,long:t}){return new I(e,t).toOsGrid().toString()}function Me(e){const t=F.parse(e).toLatLon();return{lat:t.latitude,long:t.longitude}}function Ce(e){if("Point"===e.geometry.type){const[t,n]=e.geometry.coordinates;return new I(n,t).toOsGrid().toString()}if("LineString"===e.geometry.type){const[t,n]=e.geometry.coordinates[0];return new I(n,t).toOsGrid().toString()}{const[t,n]=e.geometry.coordinates[0][0];return new I(n,t).toOsGrid().toString()}}function Le(e){if("Point"===e.geometry.type){const[t,n]=e.geometry.coordinates;return new I(n,t).toOsGrid().toString()}{const t=S(e),[n,r]=t.geometry.coordinates;return new I(r,n).toOsGrid().toString()}}const $e={zoom:"6",center:[-2.421975,53.825564]},De={mapReady:"map:ready",interactMarkerChange:"interact:markerchange",drawReady:"draw:ready",drawCreated:"draw:created",drawEdited:"draw:edited",drawCancelled:"draw:cancelled"};function je(e){return function(t){t.submitter instanceof HTMLButtonElement&&e.includes(t.submitter)||t.preventDefault()}}function Re(e={}){const{assetPath:t="/assets",apiPath:n="/form/api",data:r=Pe}=e,o=document.querySelectorAll(".app-location-field"),i=document.querySelectorAll(".app-geospatial-field");if(o.length){const e=o[0].closest("form");if(null===e)return;const t=Array.from(e.querySelectorAll("button"));e.addEventListener("submit",je(t),!1)}if(i.length){const e=i[0].closest("form");if(null===e)return;const t=Array.from(e.querySelectorAll("button"));e.addEventListener("submit",je(t),!1)}o.forEach((e,o)=>{ke({assetPath:t,apiPath:n,data:r},e,o)}),i.forEach((e,o)=>{le({assetPath:t,apiPath:n,data:r},e,o)})}function Fe(e){return function(t,n){if(t.startsWith("https://api.os.uk")){if("Tile"===n)return{url:t.replace("https://api.os.uk/maps/vector/v1/vts",`${window.location.origin}${e}`),headers:{}};if("Style"!==n)return{url:`${e}/map-proxy?url=${encodeURIComponent(t)}`,headers:{}}}if(t.startsWith("https://raw.githubusercontent.com/OrdnanceSurvey/OS-Vector-Tile-API-Stylesheets/main")){const n=t.substring(84);return{url:`${e}/maps/vts${n}`,headers:{}}}return{url:t,headers:{}}}}function Ie(e,t,r){var o;const{assetPath:i,apiPath:a,data:u=Pe}=r,c="Ordnance survey logo",f=function(){var e;return d(d({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{id:"interact",load:(e=(0,l.A)(function*(){return(yield n.e(402).then(n.bind(n,706))).manifest}),function(){return e.apply(this,arguments)})})}({markerColor:{outdoor:"#ff0000",dark:"#00ff00"},interactionModes:["placeMarker"],multiSelect:!1});return{map:new s.I(e,Oe({enableFullscreen:!0,autoColorScheme:!1,mapProvider:b(),behaviour:"inline",minZoom:6,maxZoom:18,containerHeight:"400px",enableZoomControls:!0,transformRequest:Fe(a)},t,{plugins:[h({mapStyles:[{id:"outdoor",label:"Outdoor",url:u.VTS_OUTDOOR_URL,thumbnail:`${i}/interactive-map/assets/images/outdoor-map-thumb.jpg`,logo:`${i}/interactive-map/assets/images/os-logo.svg`,logoAltText:c,attribution:`Contains OS data ${String.fromCodePoint(Ae)} Crown copyright and database rights ${(new Date).getFullYear()}`,backgroundColor:"#f5f5f0"},{id:"dark",label:"Dark",url:u.VTS_DARK_URL,mapColorScheme:"dark",appColorScheme:"dark",thumbnail:`${i}/interactive-map/assets/images/dark-map-thumb.jpg`,logo:`${i}/interactive-map/assets/images/os-logo-white.svg`,logoAltText:c,attribution:`Contains OS data ${String.fromCodePoint(Ae)} Crown copyright and database rights ${(new Date).getFullYear()}`},{id:"black-and-white",label:"Black/White",url:u.VTS_BLACK_AND_WHITE_URL,thumbnail:`${i}/interactive-map/assets/images/black-and-white-map-thumb.jpg`,logo:`${i}/interactive-map/assets/images/os-logo-black.svg`,logoAltText:c,attribution:`Contains OS data ${String.fromCodePoint(Ae)} Crown copyright and database rights ${(new Date).getFullYear()}`},{id:"aerial",label:"Aerial",url:u.VTS_AERIAL_URL,thumbnail:`${i}/interactive-map/assets/images/aerial-map-thumb.jpg`,logo:`${i}/interactive-map/assets/images/esri-logo.png`,logoAltText:"Powered by Esri",attribution:`Tiles ${String.fromCodePoint(Ae)} Esri — Source: Esri, Maxar, Earthstar Geographics, and the GIS User Community ${(new Date).getFullYear()}`}]}),f,_({osNamesURL:`${a}/geocode-proxy?query={query}`,width:"300px",showMarker:!1}),p({units:"metric"}),...null!=(o=t.plugins)?o:[]]})),interactPlugin:f}}function Be(e,t,n){e.addMarker("location",n),t.flyTo({center:n,zoom:14,essential:!0})}function Ge(e){const t=null==e?void 0:e.trim();return t?t.split(","):[]}function We(e,t){const n=[];return t&&n.push({id:"invalid-area",label:"Invalid areas",geojson:`${e}/maps/countries.geojson?omit=${t}`,showInKey:!1,showInMenu:!1,style:{stroke:"gray",strokeWidth:1,fill:"rgba(211,211,211,0.8)"}},{id:"valid-area",label:"Valid areas",geojson:`${e}/maps/countries.geojson?only=${t}`,showInKey:!1,showInMenu:!1,style:{stroke:"rgba(0,112,60,1)",strokeWidth:1}}),n}},321:(e,t,n)=>{function r(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function o(e){return function(){var t=this,n=arguments;return new Promise(function(o,i){var a=e.apply(t,n);function s(e){r(a,o,i,s,l,"next",e)}function l(e){r(a,o,i,s,l,"throw",e)}s(void 0)})}}n.d(t,{A:()=>o})},585:(e,t,n)=>{function r(e){return r="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},r(e)}function o(e,t,n){return(t=function(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,{A:()=>o})},505:(e,t,n)=>{function r(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}n.d(t,{A:()=>r})},196:(e,t,n)=>{n.d(t,{E:()=>w,I:()=>V,a:()=>M,b:()=>v,g:()=>l,h:()=>$,l:()=>b,r:()=>D,s:()=>C,t:()=>g});var r=n(321),o=n(585),i=n(505),a=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)},s=e=>{var{behaviour:t,hybridWidth:n,maxMobileWidth:r}=e;if("hybrid"!==t)return!1;var o=null!=n?n:r;return window.matchMedia("(max-width: ".concat(o,"px)")).matches},l=e=>{var{behaviour:t}=e;return["mapOnly","buttonFirst"].includes(t)||s(e)};function u(){c.forEach(e=>{!function(e,t){var n;if(!1!==e.config.manageHistoryState){e._isClosingViaBack=!1;var r=e.id===t,o="hybrid"===e.config.behaviour&&!s(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,a(e.config.mapViewQueryParam))})}var c=new Map,d=!1;function h(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 p(e){try{return JSON.parse(e)}catch(e){return console.log(e),null}}function f(e,t){e.innerHTML='<div class="im-c-error">'.concat(t,"</div>")}var m=(e,t,n,r)=>e!==t&&!(null!=n&&n.contains(e))&&e.matches(":not([aria-hidden]):not([data-fm-inert])")&&r.contains(e);function g(e){var t,{containerEl:n,isFullscreen:r,boundaryEl:o=document.body}=e,i=Array.from(o.querySelectorAll("[data-fm-inert]"));if(n&&(i=i.filter(e=>!n.contains(e))),i.forEach(e=>{e.removeAttribute("aria-hidden"),delete e.dataset.fmInert}),r){null===(t=document.activeElement)||void 0===t||t.blur();for(var a=n;null!==(s=a)&&void 0!==s&&s.parentNode&&a!==o&&a!==document.body;){var s,l=a.parentNode;for(var u of l.children)m(u,a,n,o)&&(u.setAttribute("aria-hidden","true"),u.dataset.fmInert="");a=l}}}function _(e){var{isFullscreen:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{config:n,rootEl:r}=e,{pageTitle:o,behaviour:i,containerHeight:l}=n,u=null!=t?t:function(e){var{id:t,behaviour:n,manageHistoryState:r}=e;return"mapOnly"===n||("buttonFirst"===n?!1===r||a(e.mapViewQueryParam)===t:s(e)&&a(e.mapViewQueryParam)===t)}(n);["mapOnly","buttonFirst","hybrid"].includes(i)&&(g({containerEl:r,isFullscreen:u}),document.documentElement.classList.toggle("im-is-fullscreen",u),r.classList.toggle("im-is-fullscreen",u)),["buttonFirst","hybrid"].includes(i)&&function(e){var{pageTitle:t,isFullscreen:n}=e,r=document.title.split(": "),o=r[r.length-1];document.title=n?"".concat(t,": ").concat(o):o}({pageTitle:o,isFullscreen:u});var c=u||"buttonFirst"!==i&&!s(n)?l:"auto";return r.style.height=u?"100%":c,{isFullscreen:u}}function v(){document.body.classList.remove("im-is-loading")}var y="[interactive-map]",b={warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return console.warn(y,...t)},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return console.error(y,...t)}},w={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_FULLSCREEN_CHANGE:"app:fullscreenchange",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"};function E(e){var{id:t,behaviour:n}=e,r=a(e.mapViewQueryParam)===t;return["mapOnly","inline"].includes(n)||"hybrid"===n&&!s(e)||r}var 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},k=["mapViewParamKey"];function O(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 A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach(function(t){(0,o.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var P=window.matchMedia("(pointer: coarse)").matches?"touch":"unknown",N=new Set,T=new Set;function x(e){P!==e&&(P=e,T.forEach(t=>t(e)),N.forEach(t=>t(e)))}function M(){return"unknown"===P?(P="mouse","mouse"):P}function C(e){return N.add(e),()=>{N.delete(e)}}var L=null;function $(){return null!==L}function D(e,t){if(!L)throw new Error("ReverseGeocode not initialised");return L(e,t)}class j{constructor(){this.events={},this._queued={}}on(e,t){if(this.events[e]||(this.events[e]=[]),this.events[e].push(t),void 0!==this._queued[e]){try{t(...this._queued[e])}catch(t){console.error("Error in event handler for '".concat(e,"':"),t)}delete this._queued[e]}return this}once(e,t){var n=this,r=function(){n.off(e,r),t(...arguments)};return this.on(e,r)}off(e,t){return this.events[e]?(this.events[e]=t?this.events[e].filter(e=>e!==t):[],this):this}emit(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(t=>{try{t(...n)}catch(t){console.error("Error in event handler for '".concat(e,"':"),t)}}),this):this}emitWhenReady(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(e,...n):(this._queued[e]=n,this)}destroy(){this.events={},this._queued={}}}if("undefined"!=typeof crypto&&!crypto.randomUUID){var R=0;crypto.randomUUID=()=>(R=Math.max(Date.now(),R+1),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e,t)=>{var n=t<12?Number.parseInt(R.toString(16).padStart(12,"0")[t],16):16*Math.random()|0;return("x"===e?n:3&n|8).toString(16)}))}var F=!Object.hasOwn;F&&(Object.hasOwn=(e,t)=>Object.prototype.hasOwnProperty.call(e,t));var I="undefined"!=typeof AbortController&&!Object.getPrototypeOf((new AbortController).signal).throwIfAborted;if(I&&(Object.getPrototypeOf((new AbortController).signal).throwIfAborted=function(){if(this.aborted){var e=new Error("The operation was aborted.");throw e.name="AbortError",e}}),(I||F)&&"undefined"!=typeof URL&&URL.createObjectURL){var B="text/javascript",G=["if(!Object.hasOwn){Object.hasOwn=function(o,k){return Object.prototype.hasOwnProperty.call(o,k)}}\n",I?'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(""),W=URL.createObjectURL.bind(URL);if(URL.createObjectURL=e=>(e instanceof Blob&&e.type===B&&(e=new Blob([G,e],{type:B})),W(e)),"undefined"!=typeof Worker){var U=Worker;Worker=function(e,t){if("string"==typeof e&&!e.startsWith("blob:")){var n=new Blob(["".concat(G,"importScripts(").concat(JSON.stringify(e),")")],{type:B});e=W(n)}return new U(e,t)},Worker.prototype=U.prototype}}function H(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 z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?H(Object(n),!0).forEach(function(t){(0,o.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}class V{constructor(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((0,o.A)(this,"_openButton",null),(0,o.A)(this,"_root",null),(0,o.A)(this,"_breakpointDetector",null),(0,o.A)(this,"_interfaceDetectorCleanup",null),(0,o.A)(this,"_hybridBehaviourCleanup",null),(0,o.A)(this,"_isHidden",!1),(0,o.A)(this,"_isClosingViaBack",!1),(0,o.A)(this,"_isLoading",!1),this.id=e,this.rootEl=document.getElementById(e),!this.rootEl)throw new Error('Element with id "'.concat(e,'" not found'));this.eventBus=new j,this.config=this._buildConfig(t),function(e,t){var{mapProvider:n,deviceNotSupportedText:r}=t,o=null==n?void 0:n.checkDeviceCapabilities();return n?!(null==o||!o.isSupported)||(f(e,r),v(),b.warn(null==o?void 0:o.error),!1):(b.warn("No map provider"),!1)}(this.rootEl,this.config)&&(["buttonFirst","hybrid"].includes(this.config.behaviour)&&function(e){d||(globalThis.addEventListener("popstate",u),d=!0),c.set(e.id,e)}(this),this._breakpointDetector=function(e){var t,{maxMobileWidth:n,minDesktopWidth:r,containerEl:o}=e,i="unknown",a=new Set,s=e=>{e!==i&&(i=e,requestAnimationFrame(()=>{i===e&&a.forEach(t=>t(e))}))};if(o){var l=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(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),s=t(a);e.dataset.breakpoint=s,n(s)});return i.observe(e),{initialType:o,cleanup:()=>{i.disconnect(),e.style.containerType="",delete e.dataset.breakpoint}}}(o,e=>function(e,t,n){return e<=t?"mobile":e>=n?"desktop":"tablet"}(e,n,r),s);i=l.initialType,s(l.initialType),t=l.cleanup}else{var u=function(e,t,n){var r={mobile:window.matchMedia("(max-width: ".concat(e,"px)")),desktop:window.matchMedia("(min-width: ".concat(t,"px)"))},o=()=>{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:()=>{r.mobile.removeEventListener("change",o),r.desktop.removeEventListener("change",o)}}}(n,r,s);t=u.cleanup}return{subscribe:e=>(a.add(e),()=>a.delete(e)),getBreakpoint:()=>i,destroy:()=>{var e;null===(e=t)||void 0===e||e(),a.clear()}}}({maxMobileWidth:this.config.maxMobileWidth,minDesktopWidth:this.config.minDesktopWidth,containerEl:this.rootEl}),this._interfaceDetectorCleanup=function(){var e=window.matchMedia("(pointer: coarse)"),t=e=>{x(e.matches?"touch":"mouse")};e.addEventListener("change",t);var n=e=>{var t,n="pen"===(t=e.pointerType)||"touch"===t?"touch":"mouse"===t?"mouse":"unknown";n!==P&&(P=n,T.forEach(e=>e(n)),setTimeout(()=>{N.forEach(e=>e(n))},150))},r=e=>{"Tab"===e.key&&x("keyboard")};return window.addEventListener("pointerdown",n,{passive:!0}),window.addEventListener("keydown",r,{passive:!0}),()=>{e.removeEventListener("change",t),window.removeEventListener("pointerdown",n),window.removeEventListener("keydown",r)}}(),this._initialize())}_buildConfig(e){var t=function(e){var t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach(function(t){(0,o.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},null==e?void 0:e.dataset),n={};for(var r of Object.keys(t))n[r]=p(t[r]);return n}(this.rootEl);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{mapViewParamKey:t}=e,n=(0,i.A)(e,k),r=A(A({},S),n);return void 0!==t&&(console.warn("[InteractiveMap] mapViewParamKey is deprecated — use mapViewQueryParam instead."),r.mapViewQueryParam=t),r}(z(z({id:this.id,title:document.title},t),e))}_initialize(){["buttonFirst","hybrid"].includes(this.config.behaviour)&&(this._openButton=function(e,t,n){var{id:r,buttonText:o,buttonClass:i}=e,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 ");t.insertAdjacentHTML("beforebegin",a);var s=t.previousElementSibling,l=new URL(window.location.href);return l.searchParams.set(e.mapViewQueryParam,r),s.setAttribute("href",l.toString()),s.addEventListener("click",e=>{e.preventDefault(),n(e)}),s}(this.config,this.rootEl,e=>{this._handleButtonClick(e)})),this._hybridBehaviourCleanup=function(e){var{behaviour:t,hybridWidth:n,maxMobileWidth:r}=e.config;if("buttonFirst"===t&&e._breakpointDetector.subscribe(()=>{E(e.config)?e.loadApp():e.removeApp()}),"hybrid"===t){var o=null!=n?n:r,i=window.matchMedia("(max-width: ".concat(o,"px)")),a=()=>{if(E(e.config))if(e._isHidden)e.showApp();else if(null==e._root)e.loadApp();else{var{isFullscreen:t}=_(e);e.eventBus.emit(w.APP_FULLSCREEN_CHANGE,{isFullscreen:t})}else e._root&&e.hideApp()};return i.addEventListener("change",a),()=>i.removeEventListener("change",a)}return null}(this),E(this.config)?this.loadApp():v()}_handleButtonClick(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())}_removeMapParamFromUrl(e,t){var n=new RegExp("[?&]".concat(t,"=[^&]*(&|$)"));return n.test(e)?e.replace(n,(e,t)=>"&"===t?"?":"").replace(/\?$/,""):e}_handleExitClick(){var e;if(this.config.manageHistoryState)if(null!==(e=history.state)&&void 0!==e&&e.isBack){if(this._isClosingViaBack)return;this._isClosingViaBack=!0,history.back(),setTimeout(()=>{this._isClosingViaBack=!1},1e3)}else{this.config.preserveStateOnClose?this.hideApp():this.removeApp();var t=this.config.mapViewQueryParam,n=this._removeMapParamFromUrl(location.href,t);history.replaceState(history.state,"",n)}else this.config.preserveStateOnClose?this.hideApp():this.removeApp()}loadApp(){var e=this;return(0,r.A)(function*(){if(!e._root&&!e._isLoading){e._isLoading=!0,e._openButton&&(e._openButton.style.display="none");try{var{initialiseApp:t}=yield Promise.all([n.e(402),n.e(935)]).then(n.bind(n,967)),{MapProvider:o,mapFramework:i,mapProviderConfig:a}=yield e.config.mapProvider.load();e.config.reverseGeocodeProvider&&function(e,t){var{url:n,transformRequest:o,load:i}=e;L=function(){var e=(0,r.A)(function*(e,r){return(yield i())(n,o,t,e,r)});return function(t,n){return e.apply(this,arguments)}}()}(e.config.reverseGeocodeProvider,a.crs);var s=yield t(e.rootEl,z(z({id:e.id,initialBreakpoint:e._breakpointDetector.getBreakpoint(),initialInterfaceType:M()},e.config),{},{MapProvider:o,mapProviderConfig:a,mapFramework:i,eventBus:e.eventBus,breakpointDetector:e._breakpointDetector,handleExitClick:e._handleExitClick.bind(e)}));e._root=s._root,delete s._root;var l=new Set(["on","off","emit"]);Object.keys(s).forEach(t=>{l.has(t)||(e[t]=s[t])});var{isFullscreen:u}=_(e);e.eventBus.emit(w.APP_OPENED,{statePreserved:!1,isFullscreen:u})}catch(d){var c;throw null===(c=e._openButton)||void 0===c||c.removeAttribute("style"),f(e.rootEl,e.config.genericErrorText),console.error(d),d}finally{e._isLoading=!1}}})()}removeApp(){this._root&&"function"==typeof this.unmount&&(this.unmount(),this._root=null),this._openButton&&(this._openButton.removeAttribute("style"),this._openButton.focus()),_(this,{isFullscreen:!1}),this.eventBus.emit(w.APP_CLOSED,{statePreserved:!1}),this.eventBus.emit(w.MAP_DESTROY,{mapId:this.id})}hideApp(){this._isHidden=!0,this.rootEl.style.display="none",g({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(w.APP_CLOSED,{statePreserved:!0})}showApp(){this._isHidden=!1,this.rootEl.style.display="",this._openButton&&(this._openButton.style.display="none");var{isFullscreen:e}=_(this);this.eventBus.emit(w.APP_OPENED,{statePreserved:!0,isFullscreen:e})}destroy(){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),function(e){c.delete(e.id),0===c.size&&(globalThis.removeEventListener("popstate",u),d=!1)}(this),this.eventBus.destroy()}on(){this.eventBus.on(...arguments)}off(){this.eventBus.off(...arguments)}emit(){this.eventBus.emit(...arguments)}addMarker(e,t,n){this.eventBus.emit(w.APP_ADD_MARKER,{id:e,coords:t,options:n})}updateMarker(e,t){this.eventBus.emit(w.APP_UPDATE_MARKER,{id:e,options:t})}removeMarker(e){this.eventBus.emit(w.APP_REMOVE_MARKER,e)}setMode(e){this.eventBus.emit(w.APP_SET_MODE,e)}addButton(e,t){this.eventBus.emit(w.APP_ADD_BUTTON,{id:e,config:t})}toggleButtonState(e,t,n){this.eventBus.emit(w.APP_TOGGLE_BUTTON_STATE,{id:e,prop:t,value:n})}setContinueEnabled(e){this.toggleButtonState("journeyContinue","disabled",!e)}addPanel(e,t){this.eventBus.emit(w.APP_ADD_PANEL,{id:e,config:t})}removePanel(e){this.eventBus.emit(w.APP_REMOVE_PANEL,e)}showPanel(e){var{focus:t=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.eventBus.emit(w.APP_SHOW_PANEL,{id:e,focus:t})}hidePanel(e){this.eventBus.emit(w.APP_HIDE_PANEL,e)}addControl(e,t){this.eventBus.emit(w.APP_ADD_CONTROL,{id:e,config:t})}fitToBounds(e){this.eventBus.emitWhenReady(w.MAP_FIT_TO_BOUNDS,e)}setView(e){this.eventBus.emitWhenReady(w.MAP_SET_VIEW,e)}open(){this._isHidden?this.showApp():this._root||this.loadApp()}close(){this._handleExitClick()}}},463:(e,t,n)=>{n.d(t,{D:()=>u,m:()=>re});var r=n(452),o=n(247),i=n(585),a=n(505);function s(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var l=n(321),u={expanded:!1,showMarker:!0,placeholder:"Search",minSearchLength:3,maxSuggestions:8,noResultsMessage:"No results available",searchErrorMessage:"Sorry, there was a problem with search"};function c(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 d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach(function(t){(0,i.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var h={TOGGLE_EXPANDED:(e,t)=>d(d({},e),{},{isExpanded:t,areSuggestionsVisible:t,hasFetchedSuggestions:!1,hasSearchError:!1}),SET_KEYBOARD_FOCUS_WITHIN:(e,t)=>d(d({},e),{},{hasKeyboardFocusWithin:t,areSuggestionsVisible:!0}),INPUT_BLUR:(e,t)=>d(d({},e),{},{hasKeyboardFocusWithin:!1,areSuggestionsVisible:e.areSuggestionsVisible&&"keyboard"!==t,selectedIndex:-1}),SET_VALUE:(e,t)=>d(d({},e),{},{value:t}),UPDATE_SUGGESTIONS:(e,t)=>d(d({},e),{},{suggestions:t.results,hasFetchedSuggestions:!0,hasSearchError:t.hasError}),SHOW_SUGGESTIONS:e=>d(d({},e),{},{areSuggestionsVisible:!0,hasFetchedSuggestions:!1,hasSearchError:!1}),HIDE_SUGGESTIONS:e=>d(d({},e),{},{areSuggestionsVisible:!1,hasFetchedSuggestions:!1,hasSearchError:!1}),SET_SELECTED:(e,t)=>d(d({},e),{},{selectedIndex:t,areSuggestionsVisible:t>=0})},p=e=>{var{id:t,isExpanded:n,onClick:r,buttonRef:i,searchIcon:a,showLabel:s}=e;return(0,o.FD)("button",{"aria-label":"Open search",className:"im-c-map-button im-c-search-open-button",onClick:r,"aria-controls":"".concat(t,"-search-form"),ref:i,style:n?{display:"none"}:void 0,children:[a&&(0,o.Y)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:a}}),s&&(0,o.Y)("span",{children:"Search"})]})},f=e=>{var{id:t,pluginState:n,handleSuggestionClick:r}=e;return(0,o.Y)("ul",{id:"".concat(t,"-search-suggestions"),role:"listbox","aria-labelledby":"".concat(t,"-search"),className:"im-c-search-suggestions",style:n.areSuggestionsVisible&&n.suggestions.length?void 0:{display:"none"},children:n.suggestions.map((e,i)=>(0,o.Y)("li",{id:"".concat(t,"-search-suggestion-").concat(i),className:"im-c-search-suggestions__item",role:"option","aria-selected":n.selectedIndex===i,"aria-setsize":n.suggestions.length,"aria-posinset":i+1,onClick:()=>r(e),children:(0,o.Y)("span",{className:"im-c-search-suggestions__label",dangerouslySetInnerHTML:{__html:e.marked}})},e.id))})};function m(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}var g=(e,t,n)=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach(function(t){(0,i.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({display:e.expanded||t.isExpanded?"flex":void 0},"mobile"!==n.breakpoint&&(null==e?void 0:e.width)&&{width:e.width}),_=e=>{var{id:t,pluginState:n,pluginConfig:i,appState:a,inputRef:s,events:l,services:u,children:c}=e,{areSuggestionsVisible:d,hasFetchedSuggestions:h,hasSearchError:p,suggestions:m=[]}=n,{noResultsMessage:_,searchErrorMessage:v}=i;(0,r.vJ)(()=>{d&&h&&u.announce(((e,t,n,r)=>{if(t)return n;if(0===e)return r;var o=1===e?"result":"results";return"".concat(e," ").concat(o," available")})(m.length,p,v,_))},[m,h]);var y=["im-c-search-form",i.expanded&&"im-c-search-form--default-expanded","im-c-panel"].filter(Boolean).join(" "),b=d&&h&&(p||!m.length);return(0,o.FD)("form",{id:"".concat(t,"-search-form"),role:"search",className:y,style:g(i,n,a),"aria-controls":"".concat(t,"-viewport"),onSubmit:e=>l.handleSubmit(e,a,n),children:[(0,o.Y)("button",{type:"submit",style:{display:"none"},"aria-hidden":"true",tabIndex:-1,children:"Submit"}),(0,o.FD)("div",{className:"im-c-search__input-container".concat(n.hasKeyboardFocusWithin?" im-c-search__input-container--keyboard-focus-within":""),children:[(0,o.Y)("label",{htmlFor:"".concat(t,"-search"),className:"im-u-visually-hidden",children:i.placeholder}),(0,o.Y)("input",{id:"".concat(t,"-search"),className:"im-c-search__input",type:"search",role:"combobox","aria-expanded":n.suggestionsVisible,"aria-controls":"".concat(t,"-search-suggestions"),"aria-activedescendant":n.selectedIndex>=0?"".concat(t,"-search-suggestion-").concat(n.selectedIndex):void 0,"aria-describedby":n.value?void 0:"".concat(t,"-search-hint"),"aria-autocomplete":"list",autoComplete:"off",placeholder:i.placeholder,name:"".concat(t,"-search"),spellCheck:!1,enterKeyHint:"search",value:n.value,onClick:l.handleInputClick,onChange:l.handleInputChange,onFocus:()=>l.handleInputFocus(a.interfaceType),onBlur:()=>l.handleInputBlur(a.interfaceType),onKeyDown:e=>l.handleInputKeyDown(e,n),ref:s}),(0,o.Y)("span",{id:"".concat(t,"-search-hint"),className:"im-c-search__hint",children:"When search results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures."}),c]}),b&&(0,o.Y)("div",{className:"im-c-search__status","aria-hidden":"true",children:p?v:_}),(0,o.Y)(f,{id:t,appState:a,pluginState:n,handleSuggestionClick:e=>l.handleSuggestionClick(e,a)})]})},v=e=>{var{defaultExpanded:t,onClick:n,closeIcon:r}=e;return(0,o.Y)("button",{"aria-label":"Close search",className:"im-c-map-button im-c-search-close-button",type:"button",onClick:n,style:t?{display:"none"}:void 0,children:r&&(0,o.Y)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:r}})})},y=e=>{var{defaultExpanded:t,submitIcon:n}=e;return(0,o.Y)("button",{"aria-label":"Search",className:"im-c-map-button im-c-search-submit-button",type:"submit",style:t?void 0:{display:"none"},children:n&&(0,o.Y)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:n}})})};let b=" ";class w{static get separator(){return b}static set separator(e){b=e}static parse(e){if(!isNaN(parseFloat(e))&&isFinite(e))return Number(e);const t=String(e).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==t[t.length-1]&&t.splice(t.length-1),""==t)return NaN;let n=null;switch(t.length){case 3:n=t[0]/1+t[1]/60+t[2]/3600;break;case 2:n=t[0]/1+t[1]/60;break;case 1:n=t[0];break;default:return NaN}return/^-|[WS]$/i.test(e.trim())&&(n=-n),Number(n)}static toDms(e,t="d",n=void 0){if(isNaN(e))return null;if("string"==typeof e&&""==e.trim())return null;if("boolean"==typeof e)return null;if(e==1/0)return null;if(null==e)return null;if(void 0===n)switch(t){case"d":case"deg":n=4;break;case"dm":case"deg+min":n=2;break;case"dms":case"deg+min+sec":n=0;break;default:t="d",n=4}e=Math.abs(e);let r=null,o=null,i=null,a=null;switch(t){default:case"d":case"deg":o=e.toFixed(n),o<100&&(o="0"+o),o<10&&(o="0"+o),r=o+"°";break;case"dm":case"deg+min":o=Math.floor(e),i=(60*e%60).toFixed(n),60==i&&(i=(0).toFixed(n),o++),o=("000"+o).slice(-3),i<10&&(i="0"+i),r=o+"°"+w.separator+i+"′";break;case"dms":case"deg+min+sec":o=Math.floor(e),i=Math.floor(3600*e/60)%60,a=(3600*e%60).toFixed(n),60==a&&(a=(0).toFixed(n),i++),60==i&&(i=0,o++),o=("000"+o).slice(-3),i=("00"+i).slice(-2),a<10&&(a="0"+a),r=o+"°"+w.separator+i+"′"+w.separator+a+"″"}return r}static toLat(e,t,n){const r=w.toDms(w.wrap90(e),t,n);return null===r?"–":r.slice(1)+w.separator+(e<0?"S":"N")}static toLon(e,t,n){const r=w.toDms(w.wrap180(e),t,n);return null===r?"–":r+w.separator+(e<0?"W":"E")}static toBrng(e,t,n){const r=w.toDms(w.wrap360(e),t,n);return null===r?"–":r.replace("360","0")}static fromLocale(e){const t=123456.789.toLocaleString(),n={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(n.thousands,"⁜").replace(n.decimal,".").replace("⁜",",")}static toLocale(e){const t=123456.789.toLocaleString(),n={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(/,([0-9])/,"⁜$1").replace(".",n.decimal).replace("⁜",n.thousands)}static compassPoint(e,t=3){if(![1,2,3].includes(Number(t)))throw new RangeError(`invalid precision ‘${t}’`);e=w.wrap360(e);const n=4*2**(t-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(e*n/360)%n*16/n]}static wrap90(e){if(-90<=e&&e<=90)return e;const t=e;return 1*Math.abs(((t-90)%360+360)%360-180)-90}static wrap180(e){if(-180<=e&&e<=180)return e;const t=360;return((360*e/t-180)%t+t)%t-180}static wrap360(e){if(0<=e&&e<360)return e;const t=360;return(360*e/t%t+t)%t}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};class E{constructor(e,t,n){if(isNaN(e)||isNaN(t)||isNaN(n))throw new TypeError(`invalid vector [${e},${t},${n}]`);this.x=Number(e),this.y=Number(t),this.z=Number(n)}get length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}plus(e){if(!(e instanceof E))throw new TypeError("v is not Vector3d object");return new E(this.x+e.x,this.y+e.y,this.z+e.z)}minus(e){if(!(e instanceof E))throw new TypeError("v is not Vector3d object");return new E(this.x-e.x,this.y-e.y,this.z-e.z)}times(e){if(isNaN(e))throw new TypeError(`invalid scalar value ‘${e}’`);return new E(this.x*e,this.y*e,this.z*e)}dividedBy(e){if(isNaN(e))throw new TypeError(`invalid scalar value ‘${e}’`);return new E(this.x/e,this.y/e,this.z/e)}dot(e){if(!(e instanceof E))throw new TypeError("v is not Vector3d object");return this.x*e.x+this.y*e.y+this.z*e.z}cross(e){if(!(e instanceof E))throw new TypeError("v is not Vector3d object");const t=this.y*e.z-this.z*e.y,n=this.z*e.x-this.x*e.z,r=this.x*e.y-this.y*e.x;return new E(t,n,r)}negate(){return new E(-this.x,-this.y,-this.z)}unit(){const e=this.length;if(1==e)return this;if(0==e)return this;const t=this.x/e,n=this.y/e,r=this.z/e;return new E(t,n,r)}angleTo(e,t=void 0){if(!(e instanceof E))throw new TypeError("v is not Vector3d object");if(!(t instanceof E||null==t))throw new TypeError("n is not Vector3d object");const n=null==t||this.cross(e).dot(t)>=0?1:-1,r=this.cross(e).length*n,o=this.dot(e);return Math.atan2(r,o)}rotateAround(e,t){if(!(e instanceof E))throw new TypeError("axis is not Vector3d object");const n=t.toRadians(),r=this.unit(),o=e.unit(),i=Math.sin(n),a=Math.cos(n),s=1-a,l=o.x,u=o.y,c=o.z,d=[[s*l*l+a,s*l*u-i*c,s*l*c+i*u],[s*l*u+i*c,s*u*u+a,s*u*c-i*l],[s*l*c-i*u,s*u*c+i*l,s*c*c+a]],h=[d[0][0]*r.x+d[0][1]*r.y+d[0][2]*r.z,d[1][0]*r.x+d[1][1]*r.y+d[1][2]*r.z,d[2][0]*r.x+d[2][1]*r.y+d[2][2]*r.z];return new E(h[0],h[1],h[2])}toString(e=3){return`[${this.x.toFixed(e)},${this.y.toFixed(e)},${this.z.toFixed(e)}]`}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const S={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563}},k={WGS84:{ellipsoid:S.WGS84}};Object.freeze(S.WGS84),Object.freeze(k.WGS84);class O{constructor(e,t,n=0){if(isNaN(e)||null==e)throw new TypeError(`invalid lat ‘${e}’`);if(isNaN(t)||null==t)throw new TypeError(`invalid lon ‘${t}’`);if(isNaN(n)||null==n)throw new TypeError(`invalid height ‘${n}’`);this._lat=w.wrap90(Number(e)),this._lon=w.wrap180(Number(t)),this._height=Number(n)}get lat(){return this._lat}get latitude(){return this._lat}set lat(e){if(this._lat=isNaN(e)?w.wrap90(w.parse(e)):w.wrap90(Number(e)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${e}’`)}set latitude(e){if(this._lat=isNaN(e)?w.wrap90(w.parse(e)):w.wrap90(Number(e)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${e}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(e){if(this._lon=isNaN(e)?w.wrap180(w.parse(e)):w.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${e}’`)}set lng(e){if(this._lon=isNaN(e)?w.wrap180(w.parse(e)):w.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${e}’`)}set longitude(e){if(this._lon=isNaN(e)?w.wrap180(w.parse(e)):w.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${e}’`)}get height(){return this._height}set height(e){if(this._height=Number(e),isNaN(this._height))throw new TypeError(`invalid height ‘${e}’`)}get datum(){return this._datum}set datum(e){this._datum=e}static get ellipsoids(){return S}static get datums(){return k}static parse(...e){if(0==e.length)throw new TypeError("invalid (empty) point");let t,n,r;if("object"==typeof e[0]&&(1==e.length||!isNaN(parseFloat(e[1])))){const o=e[0];if("Point"==o.type&&Array.isArray(o.coordinates)?([n,t,r]=o.coordinates,r=r||0):(null!=o.latitude&&(t=o.latitude),null!=o.lat&&(t=o.lat),null!=o.longitude&&(n=o.longitude),null!=o.lng&&(n=o.lng),null!=o.lon&&(n=o.lon),null!=o.height&&(r=o.height),t=w.wrap90(w.parse(t)),n=w.wrap180(w.parse(n))),null!=e[1]&&(r=e[1]),isNaN(t)||isNaN(n))throw new TypeError(`invalid point ‘${JSON.stringify(e[0])}’`)}if("string"==typeof e[0]&&2==e[0].split(",").length&&([t,n]=e[0].split(","),t=w.wrap90(w.parse(t)),n=w.wrap180(w.parse(n)),r=e[1]||0,isNaN(t)||isNaN(n)))throw new TypeError(`invalid point ‘${e[0]}’`);if(null==t&&null==n&&([t,n]=e,t=w.wrap90(w.parse(t)),n=w.wrap180(w.parse(n)),r=e[2]||0,isNaN(t)||isNaN(n)))throw new TypeError(`invalid point ‘${e.toString()}’`);return new this(t,n,r)}toCartesian(){const e=this.datum?this.datum.ellipsoid:this.referenceFrame?this.referenceFrame.ellipsoid:S.WGS84,t=this.lat.toRadians(),n=this.lon.toRadians(),r=this.height,{a:o,f:i}=e,a=Math.sin(t),s=Math.cos(t),l=Math.sin(n),u=Math.cos(n),c=2*i-i*i,d=o/Math.sqrt(1-c*a*a);return new A((d+r)*s*u,(d+r)*s*l,(d*(1-c)+r)*a)}equals(e){if(!(e instanceof O))throw new TypeError(`invalid point ‘${e}’`);return!(Math.abs(this.lat-e.lat)>Number.EPSILON||Math.abs(this.lon-e.lon)>Number.EPSILON||Math.abs(this.height-e.height)>Number.EPSILON||this.datum!=e.datum||this.referenceFrame!=e.referenceFrame||this.epoch!=e.epoch)}toString(e="d",t=void 0,n=null){if(!["d","dm","dms","n"].includes(e))throw new RangeError(`invalid format ‘${e}’`);const r=(this.height>=0?" +":" ")+this.height.toFixed(n)+"m";return"n"==e?(null==t&&(t=4),`${this.lat.toFixed(t)}, ${this.lon.toFixed(t)}${null==n?"":r}`):`${w.toLat(this.lat,e,t)}, ${w.toLon(this.lon,e,t)}${null==n?"":r}`}}class A extends E{constructor(e,t,n){super(e,t,n)}toLatLon(e=S.WGS84){if(!e||!e.a)throw new TypeError(`invalid ellipsoid ‘${e}’`);const{x:t,y:n,z:r}=this,{a:o,b:i,f:a}=e,s=2*a-a*a,l=s/(1-s),u=Math.sqrt(t*t+n*n),c=i*r/(o*u)*(1+l*i/Math.sqrt(u*u+r*r)),d=c/Math.sqrt(1+c*c),h=d/c,p=isNaN(h)?0:Math.atan2(r+l*i*d*d*d,u-s*o*h*h*h),f=Math.atan2(n,t),m=Math.sin(p),g=u*Math.cos(p)+r*m-o*o/(o/Math.sqrt(1-s*m*m));return new O(p.toDegrees(),f.toDegrees(),g)}toString(e=0){return`[${this.x.toFixed(e)},${this.y.toFixed(e)},${this.z.toFixed(e)}]`}}const P={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563},Airy1830:{a:6377563.396,b:6356256.909,f:1/299.3249646},AiryModified:{a:6377340.189,b:6356034.448,f:1/299.3249646},Bessel1841:{a:6377397.155,b:6356078.962818,f:1/299.1528128},Clarke1866:{a:6378206.4,b:6356583.8,f:1/294.978698214},Clarke1880IGN:{a:6378249.2,b:6356515,f:1/293.466021294},GRS80:{a:6378137,b:6356752.31414,f:1/298.257222101},Intl1924:{a:6378388,b:6356911.946,f:1/297},WGS72:{a:6378135,b:6356750.5,f:1/298.26}},N={ED50:{ellipsoid:P.Intl1924,transform:[89.5,93.8,123.1,-1.2,0,0,.156]},ETRS89:{ellipsoid:P.GRS80,transform:[0,0,0,0,0,0,0]},Irl1975:{ellipsoid:P.AiryModified,transform:[-482.53,130.596,-564.557,-8.15,1.042,.214,.631]},NAD27:{ellipsoid:P.Clarke1866,transform:[8,-160,-176,0,0,0,0]},NAD83:{ellipsoid:P.GRS80,transform:[.9956,-1.9103,-.5215,-62e-5,.025915,.009426,.011599]},NTF:{ellipsoid:P.Clarke1880IGN,transform:[168,60,-320,0,0,0,0]},OSGB36:{ellipsoid:P.Airy1830,transform:[-446.448,125.157,-542.06,20.4894,-.1502,-.247,-.8421]},Potsdam:{ellipsoid:P.Bessel1841,transform:[-582,-105,-414,-8.3,1.04,.35,-3.08]},TokyoJapan:{ellipsoid:P.Bessel1841,transform:[148,-507,-685,0,0,0,0]},WGS72:{ellipsoid:P.WGS72,transform:[0,0,-4.5,-.22,0,0,.554]},WGS84:{ellipsoid:P.WGS84,transform:[0,0,0,0,0,0,0]}};Object.keys(P).forEach(e=>Object.freeze(P[e])),Object.keys(N).forEach(e=>{Object.freeze(N[e]),Object.freeze(N[e].transform)});class T extends O{constructor(e,t,n=0,r=N.WGS84){if(!r||null==r.ellipsoid)throw new TypeError(`unrecognised datum ‘${r}’`);super(e,t,n),this._datum=r}get datum(){return this._datum}static get ellipsoids(){return P}static get datums(){return N}static parse(...e){let t=N.WGS84;if((4==e.length||3==e.length&&"object"==typeof e[2])&&(t=e.pop()),!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);const n=super.parse(...e);return n._datum=t,n}convertDatum(e){if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);return this.toCartesian().convertDatum(e).toLatLon()}toCartesian(){const e=super.toCartesian();return new x(e.x,e.y,e.z,this.datum)}}class x extends A{constructor(e,t,n,r=void 0){if(r&&null==r.ellipsoid)throw new TypeError(`unrecognised datum ‘${r}’`);super(e,t,n),r&&(this._datum=r)}get datum(){return this._datum}set datum(e){if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);this._datum=e}toLatLon(e=void 0){e&&(console.info("datum parameter to Cartesian_Datum.toLatLon is deprecated: set datum before calling toLatLon()"),this.datum=e);const t=this.datum||N.WGS84;if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);const n=super.toLatLon(t.ellipsoid);return new T(n.lat,n.lon,n.height,this.datum)}convertDatum(e){if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);if(!this.datum)throw new TypeError("cartesian coordinate has no datum");let t=null,n=null;null!=this.datum&&this.datum!=N.WGS84||(t=this,n=e.transform),e==N.WGS84&&(t=this,n=this.datum.transform.map(e=>-e)),null==n&&(t=this.convertDatum(N.WGS84),n=e.transform);const r=t.applyTransform(n);return r.datum=e,r}applyTransform(e){const{x:t,y:n,z:r}=this,o=e[0],i=e[1],a=e[2],s=e[3]/1e6+1,l=(e[4]/3600).toRadians(),u=(e[5]/3600).toRadians(),c=(e[6]/3600).toRadians();return new x(o+t*s-n*c+r*u,i+t*c+n*s-r*l,a-t*u+n*l+r*s)}}const M={trueOrigin:{lat:49,lon:-2},scaleFactor:.9996012717,ellipsoid:T.ellipsoids.Airy1830};class C{constructor(e,t){if(this.easting=Number(e),this.northing=Number(t),isNaN(e)||this.easting<0||this.easting>7e5)throw new RangeError(`invalid easting ‘${e}’`);if(isNaN(t)||this.northing<0||this.northing>13e5)throw new RangeError(`invalid northing ‘${t}’`)}toLatLon(e=T.datums.WGS84){const{easting:t,northing:n}=this,{a:r,b:o}=M.ellipsoid,i=M.trueOrigin.lat.toRadians(),a=M.trueOrigin.lon.toRadians(),s=-1e5,l=M.scaleFactor,u=1-o*o/(r*r),c=(r-o)/(r+o),d=c*c,h=c*c*c;let p=i,f=0;do{p=(n-s-f)/(r*l)+p,f=o*l*((1+c+5/4*d+5/4*h)*(p-i)-(3*c+3*c*c+21/8*h)*Math.sin(p-i)*Math.cos(p+i)+(15/8*d+15/8*h)*Math.sin(2*(p-i))*Math.cos(2*(p+i))-35/24*h*Math.sin(3*(p-i))*Math.cos(3*(p+i)))}while(Math.abs(n-s-f)>=1e-5);const m=Math.cos(p),g=Math.sin(p),_=r*l/Math.sqrt(1-u*g*g),v=r*l*(1-u)/Math.pow(1-u*g*g,1.5),y=_/v-1,b=Math.tan(p),w=b*b,E=w*w,S=1/m,k=_*_*_,O=k*_*_,A=t-4e5,P=A*A,N=P*A,x=P*P,C=N*P;p=p-b/(2*v*_)*P+b/(24*v*k)*(5+3*w+y-9*w*y)*x-b/(720*v*O)*(61+90*w+45*E)*(x*P);const $=a+S/_*A-S/(6*k)*(_/v+2*w)*N+S/(120*O)*(5+28*w+24*E)*C-S/(O*_*_*5040)*(61+662*w+1320*E+E*w*720)*(C*P);let D=new L(p.toDegrees(),$.toDegrees(),0,T.datums.OSGB36);return e!=T.datums.OSGB36&&(D=D.convertDatum(e),D=new L(D.lat,D.lon,D.height,D.datum)),D}static parse(e){let t=(e=String(e).trim()).match(/^(\d+),\s*(\d+)$/);if(t)return new C(t[1],t[2]);if(t=e.match(/^[HNST][ABCDEFGHJKLMNOPQRSTUVWXYZ]\s*[0-9]+\s*[0-9]+$/i),!t)throw new Error(`invalid grid reference ‘${e}’`);let n=e.toUpperCase().charCodeAt(0)-"A".charCodeAt(0),r=e.toUpperCase().charCodeAt(1)-"A".charCodeAt(0);n>7&&n--,r>7&&r--;const o=(n-2)%5*5+r%5,i=19-5*Math.floor(n/5)-Math.floor(r/5);let a=e.slice(2).trim().split(/\s+/);if(1==a.length&&(a=[a[0].slice(0,a[0].length/2),a[0].slice(a[0].length/2)]),a[0].length!=a[1].length)throw new Error(`invalid grid reference ‘${e}’`);a[0]=a[0].padEnd(5,"0"),a[1]=a[1].padEnd(5,"0");const s=o+a[0],l=i+a[1];return new C(s,l)}toString(e=10){if(![0,2,4,6,8,10,12,14,16].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);let{easting:t,northing:n}=this;if(0==e){const e={useGrouping:!1,minimumIntegerDigits:6,maximumFractionDigits:3};return`${t.toLocaleString("en",e)},${n.toLocaleString("en",e)}`}const r=Math.floor(t/1e5),o=Math.floor(n/1e5);let i=19-o-(19-o)%5+Math.floor((r+10)/5),a=5*(19-o)%25+r%5;i>7&&i++,a>7&&a++;const s=String.fromCharCode(i+"A".charCodeAt(0),a+"A".charCodeAt(0));return t=Math.floor(t%1e5/Math.pow(10,5-e/2)),n=Math.floor(n%1e5/Math.pow(10,5-e/2)),t=t.toString().padStart(e/2,"0"),n=n.toString().padStart(e/2,"0"),`${s} ${t} ${n}`}}class L extends T{toOsGrid(){const e=this.datum==T.datums.OSGB36?this:this.convertDatum(T.datums.OSGB36),t=e.lat.toRadians(),n=e.lon.toRadians(),{a:r,b:o}=M.ellipsoid,i=M.trueOrigin.lat.toRadians(),a=M.trueOrigin.lon.toRadians(),s=M.scaleFactor,l=1-o*o/(r*r),u=(r-o)/(r+o),c=u*u,d=u*u*u,h=Math.cos(t),p=Math.sin(t),f=r*s/Math.sqrt(1-l*p*p),m=r*s*(1-l)/Math.pow(1-l*p*p,1.5),g=f/m-1,_=o*s*((1+u+5/4*c+5/4*d)*(t-i)-(3*u+3*u*u+21/8*d)*Math.sin(t-i)*Math.cos(t+i)+(15/8*c+15/8*d)*Math.sin(2*(t-i))*Math.cos(2*(t+i))-35/24*d*Math.sin(3*(t-i))*Math.cos(3*(t+i))),v=h*h*h,y=v*h*h,b=Math.tan(t)*Math.tan(t),w=b*b,E=n-a,S=E*E,k=S*E,O=k*E,A=O*E;let P=_+-1e5+f/2*p*h*S+f/24*p*v*(5-b+9*g)*O+f/720*p*y*(61-58*b+w)*(A*E),N=4e5+f*h*E+f/6*v*(f/m-b)*k+f/120*y*(5-18*b+w+14*g-58*b*g)*A;P=Number(P.toFixed(3)),N=Number(N.toFixed(3));try{return new C(N,P)}catch(t){throw new Error(`${t.message} from (${e.lat.toFixed(6)},${e.lon.toFixed(6)}).toOsGrid()`)}}convertDatum(e){const t=super.convertDatum(e);return new L(t.lat,t.lon,t.height,t.datum)}}var $;function D(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 j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D(Object(n),!0).forEach(function(t){(0,i.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var R,F=500,I=e=>{var t=e.GAZETTEER_ENTRY,n="eng"===t.NAME2_LANG?t.NAME2:t.NAME1;return e.GAZETTEER_ENTRY.NAME1=n,e.GAZETTEER_ENTRY.NAME1_LANG="eng",e},B=(e,t)=>{var n,r,o,i,{MBR_XMIN:a,MBR_YMIN:s,MBR_XMAX:l,MBR_YMAX:u,GEOMETRY_X:c,GEOMETRY_Y:d}=t;if(null==a?(n=c-F,r=d-F,o=c+F,i=d+F):(n=a,r=s,o=l,i=u),"EPSG:27700"===e)return[n,r,o,i];if("EPSG:4326"===e){var h=new C(n,r).toLatLon(),p=new C(o,i).toLatLon();return[h.lon,h.lat,p.lon,p.lat].map(e=>Math.round(1e6*e)/1e6)}throw new Error("Unsupported CRS: ".concat(e))},G=(e,t)=>{var{GEOMETRY_X:n,GEOMETRY_Y:r}=t;if("EPSG:27700"===e)return[n,r];if("EPSG:4326"===e){var o=new C(n,r).toLatLon();return[Math.round(1e6*o.lon)/1e6,Math.round(1e6*o.lat)/1e6]}throw new Error("Unsupported CRS: ".concat(e))},W=function(e,t,n,r){var o,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:8;if(!e||e.error||0===(null===(o=e.header)||void 0===o?void 0:o.totalresults))return[];var a=e.results;return a=((e,t)=>{var n=t.toLowerCase().replace(/,/g,"").split(" ");return e.map(I).filter(e=>n.some(n=>{return e.GAZETTEER_ENTRY.NAME1.toLowerCase().includes(n)||(r=(r=t).replace(/\s/g,""),/^(([A-Z]{1,2}\d[A-Z\d]?|ASCN|STHL|TDCU|BBND|[BFS]IQQ|PCRN|TKCA) ?\d[A-Z]{2}|BFPO ?\d{1,4}|(KY\d|MSR|VG|AI)[ -]?\d{4}|[A-Z]{2} ?\d{2}|GE ?CX|GIR ?0A{2}|SAN ?TA1)$/i.test(r));var r}))})(a,t),a=((e,t)=>e.filter(e=>{var n,r=null==e||null===(n=e.GAZETTEER_ENTRY)||void 0===n||null===(n=n.COUNTRY)||void 0===n?void 0:n.toLowerCase();return r&&t.includes(r)}))(a=(e=>Array.from(new Map(e.map(e=>[e.GAZETTEER_ENTRY.ID,e])).values()))(a),n),(a=a.slice(0,i)).map(e=>j(j({id:e.GAZETTEER_ENTRY.ID,bounds:B(r,e.GAZETTEER_ENTRY),point:G(r,e.GAZETTEER_ENTRY)},((e,t)=>{var n,r,o,i,{NAME1:a,COUNTY_UNITARY:l,DISTRICT_BOROUGH:u,POSTCODE_DISTRICT:c,LOCAL_TYPE:d}=t,h="".concat(["City","Postcode"].includes(d)?"":c+", ").concat("City"===d?"":l||u),p="".concat(a).concat(h?", "+h:"");return{text:p,marked:(n=p,r=e,o=r.replace(/\s+/g,"").split("").join(String.raw($||($=s(["s*"],["\\s*"])))),i=new RegExp("(".concat(o,")"),"i"),n.replace(i,"<mark>$1</mark>"))}})(t,e.GAZETTEER_ENTRY)),{},{type:"os-names"}))},U=e=>{var{url:t,options:n}=e;return new Request(t,n)},H=(R=(0,l.A)(function*(e,t,n){var r,o={url:null===(r=e.urlTemplate)||void 0===r?void 0:r.replace("{query}",encodeURIComponent(t)),options:{method:"GET"}};if(e.buildRequest){var i=e.buildRequest(t,()=>o);return i instanceof Request?i:U(i)}return U(n?yield n(o,t):o)}),function(e,t,n){return R.apply(this,arguments)}),z=function(){var e=(0,l.A)(function*(e,t,n){try{var r=yield fetch(t);if(!r.ok)return console.error("Fetch error for ".concat(e.label||"dataset",": ").concat(r.status)),{error:!0};var o=yield r.json();return e.parseResults(o,n)}catch(t){return console.error("Network error for ".concat(e.label||"dataset",":"),t),{error:!0}}});return function(t,n,r){return e.apply(this,arguments)}}(),V=function(){var e=(0,l.A)(function*(e,t,n,r){var o=(e=>e.replaceAll(/[^a-zA-Z0-9\s\-.,]/g,"").trim())(e),i=t.filter(t=>{var n=!t.includeRegex||t.includeRegex.test(e),r=!!t.excludeRegex&&t.excludeRegex.test(o);return n&&!r}),a=[],s=!1;for(var l of i){var u=yield H(l,o,r),c=yield z(l,u,o);if(null!=c&&c.error?s=!0:null!=c&&c.length&&(a=[...a,...c]),l.exclusive&&a.length)break}return n({type:"UPDATE_SUGGESTIONS",payload:{results:a,hasError:s}}),{results:a,sanitisedValue:o}});return function(t,n,r,o){return e.apply(this,arguments)}}();function q(e){var{mapProvider:t,bounds:n,point:r,markers:o,showMarker:i,markerOptions:a}=e;t.fitToBounds(n),i&&o.add("search",r,a)}function Y(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 K(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(n),!0).forEach(function(t){(0,i.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Z(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,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 J(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?X(Object(n),!0).forEach(function(t){(0,i.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Q(e){var t,n,r,{dispatch:o,searchContainerRef:a}=e,s=(t=t=>V(t,e.datasets,o,e.transformRequest),n=null,r=function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];clearTimeout(n),n=setTimeout(()=>{t(...r)},350)},r.cancel=()=>{n&&(clearTimeout(n),n=null)},r),c=(e=>{var{dispatch:t,services:n,viewportRef:r,mapProvider:o,markers:i,datasets:a,transformRequest:s,showMarker:c,markerOptions:d}=e,h="";return{handleOpenClick(){t({type:"TOGGLE_EXPANDED",payload:!0}),n.eventBus.emit("search:open")},handleCloseClick(e,r){t({type:"TOGGLE_EXPANDED",payload:!1}),t({type:"UPDATE_SUGGESTIONS",payload:{results:[],hasError:!1}}),t({type:"SET_VALUE",payload:""}),setTimeout(()=>r.current.focus(),0),i.remove("search"),n.eventBus.emit("search:clear"),n.eventBus.emit("search:close")},handleSubmit:(e,p,f)=>(0,l.A)(function*(){e.preventDefault();var{suggestions:l,selectedIndex:m,value:g}=f,_=null==g?void 0:g.trim();if(t({type:"SET_SELECTED",payload:-1}),t({type:"HIDE_SUGGESTIONS"}),m>=0){var v,y=l[m];return t({type:"SET_VALUE",payload:y.text}),null===(v=r.current)||void 0===v||v.focus(),q({mapProvider:o,bounds:y.bounds,point:y.point,markers:i,showMarker:c,markerOptions:d}),void n.eventBus.emit("search:match",K({query:y.text},y))}if(!((null==_?void 0:_.length)<u.minSearchLength)){var b=l;if(!l.length||_!==h){var{results:w,sanitisedValue:E}=yield V(_,a,t,s);b=w,h=E}if(b.length){var S;null===(S=r.current)||void 0===S||S.focus(),"mobile"===p.breakpoint&&(t({type:"TOGGLE_EXPANDED",payload:!1}),n.eventBus.emit("search:close"));var k=b[0];q({mapProvider:o,bounds:k.bounds,point:k.point,markers:i,showMarker:c,markerOptions:d}),n.eventBus.emit("search:match",K({query:g},k))}}})()}})(e),d=(e=>{var{dispatch:t,debouncedFetchSuggestions:n}=e;return{handleInputClick(){t({type:"SHOW_SUGGESTIONS"})},handleInputFocus(e){t({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:"keyboard"===e})},handleInputBlur(e){t({type:"INPUT_BLUR",payload:e})},handleInputChange(e){var r=e.target.value;if(t({type:"SET_VALUE",payload:r}),r.length<u.minSearchLength)return n.cancel(),t({type:"UPDATE_SUGGESTIONS",payload:{results:[],hasError:!1}}),void t({type:"HIDE_SUGGESTIONS"});t({type:"SHOW_SUGGESTIONS"}),n(r)}}})(J(J({},e),{},{debouncedFetchSuggestions:s})),h=(e=>{var{dispatch:t,services:n,mapProvider:r,markers:o,showMarker:a,markerOptions:s,viewportRef:l}=e,u=(e,t)=>{var n;return t>=0?"".concat(null===(n=e[t])||void 0===n?void 0:n.text,". ").concat(t+1," of ").concat(e.length," is highlighted"):"".concat(e.length," suggestions available")};return{handleSuggestionClick(e,u){var c;t({type:"SET_VALUE",payload:e.text}),t({type:"HIDE_SUGGESTIONS"}),t({type:"SET_SELECTED",payload:-1}),"mobile"===u.breakpoint&&(t({type:"TOGGLE_EXPANDED",payload:!1}),n.eventBus.emit("search:close")),null===(c=l.current)||void 0===c||c.focus(),q({mapProvider:r,bounds:e.bounds,point:e.point,markers:o,showMarker:a,markerOptions:s}),n.eventBus.emit("search:match",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(n),!0).forEach(function(t){(0,i.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Z(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({query:e.text},e))},handleInputKeyDown(e,r){var{suggestions:o,selectedIndex:i}=r;switch(e.key){case"ArrowDown":if(null==o||!o.length)return;if(e.preventDefault(),i<o.length-1){var a=i+1;n.announce(u(o,a)),t({type:"SET_SELECTED",payload:a}),t({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:!1})}break;case"ArrowUp":if(null==o||!o.length)return;e.preventDefault();var s=i>0?i-1:-1;n.announce(u(o,s)),t({type:"SET_SELECTED",payload:s}),t({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:s<0});break;case"Escape":e.preventDefault(),t({type:"HIDE_SUGGESTIONS"}),t({type:"SET_SELECTED",payload:-1})}}}})(e);return J(J(J(J({},c),d),h),{},{handleOutside(t){a.current.contains(t.target)||(o({type:"TOGGLE_EXPANDED",payload:!1}),e.services.eventBus.emit("search:close"))}})}var ee=["marker"];function te(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}var ne={reducer:{initialState:{isExpanded:!1,hasKeyboardFocusWithin:!1,value:"",suggestions:[],areSuggestionsVisible:!1,hasFetchedSuggestions:!1,hasSearchError:!1,selectedIndex:-1},actions:h},controls:[{id:"search",mobile:{slot:"top-right",showLabel:!1},tablet:{slot:"top-left",showLabel:!1},desktop:{slot:"top-left",showLabel:!1},render:function(e){var t,{appConfig:n,iconRegistry:s,pluginState:l,pluginConfig:u,appState:c,mapState:d,services:h,mapProvider:f}=e,{id:m}=n,{interfaceType:g}=c,{expanded:b,customDatasets:w,osNamesURL:E,regions:S,maxSuggestions:k}=u,{dispatch:O,isExpanded:A,areSuggestionsVisible:P,suggestions:N}=l,T=(null==c||null===(t=c.controlConfig)||void 0===t||null===(t=t.search)||void 0===t?void 0:t[null==c?void 0:c.breakpoint].showLabel)||!1,x=s.close,M=s.search,C=(0,r.li)(null),L=(0,r.li)(null),$=(0,r.li)(null),D=c.layoutRefs.viewportRef,j=function(e){var{customDatasets:t=[],osNamesURL:n,crs:r,regions:o=["england","scotland","wales"],maxSuggestions:i}=e;return n?[{name:"osNames",urlTemplate:n,parseResults:(e,t)=>W(e,t,o,r,i),includeRegex:/[a-zA-Z0-9]/,excludeRegex:/^(?:[a-z]{2}\s*(?:\d{3}\s*\d{3}|\d{4}\s*\d{4}|\d{5}\s*\d{5})|\d+\s*,?\s*\d+)$/i},...t]:t}({customDatasets:w,osNamesURL:E,regions:S,maxSuggestions:k,crs:f.crs}),R=(0,r.li)(null);if(!R.current){var{marker:F}=u,I=(0,a.A)(u,ee);R.current=Q(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?te(Object(n),!0).forEach(function(t){(0,i.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):te(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({dispatch:O,datasets:j,services:h,mapProvider:f,viewportRef:D,searchContainerRef:C,markers:d.markers,markerOptions:F},I))}var B=R.current,G=A||!!(b&&P&&N.length);return(0,r.vJ)(()=>{var e;A&&(null===(e=$.current)||void 0===e||e.focus())},[A]),(0,r.vJ)(()=>{if(c.dispatch({type:"TOGGLE_HAS_EXCLUSIVE_CONTROL",payload:A}),G)return D.current.style.pointerEvents="none",document.addEventListener("focusin",B.handleOutside),document.addEventListener("pointerdown",B.handleOutside),()=>{D.current.style.pointerEvents="auto",document.removeEventListener("focusin",B.handleOutside),document.removeEventListener("pointerdown",B.handleOutside)}},[A,g,P,N]),(0,o.FD)("div",{className:"im-c-search",ref:C,children:[!b&&(0,o.Y)(p,{id:m,isExpanded:A,onClick:()=>B.handleOpenClick(c),buttonRef:L,searchIcon:M,showLabel:T}),(0,o.FD)(_,{id:m,pluginState:l,pluginConfig:u,appState:c,inputRef:$,events:B,services:h,children:[(0,o.Y)(v,{defaultExpanded:b,onClick:e=>B.handleCloseClick(e,L,c),closeIcon:x}),(0,o.Y)(y,{defaultExpanded:b,onClick:e=>B.handleCloseClick(e,L,c),submitIcon:M})]})]})}}],icons:[{id:"search",svgContent:'<path d="m21 21-4.34-4.34"></path><circle cx="11" cy="11" r="8"></circle>'}]},re=Object.freeze({__proto__:null,manifest:ne})}},o={};function i(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return r[e].call(n.exports,n,n.exports,i),n.exports}function a(e){const t=e.currentTarget;if("true"===t.dataset.debouncing)return e.preventDefault(),void e.stopImmediatePropagation();t.dataset.debouncing="true",setTimeout(()=>{delete t.dataset.debouncing},1e4)}function s(e){a(e)}function l(e){"Enter"!==e.key&&" "!==e.key||a(e)}i.m=r,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.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);i.r(o);var a={};e=e||[null,t({}),t([]),t(t)];for(var s=2&r&&n;("object"==typeof s||"function"==typeof s)&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach(e=>a[e]=()=>n[e]);return a.default=()=>n,i.d(o,a),o},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce((t,n)=>(i.f[n](e,t),t),[])),i.u=e=>"javascripts/"+{7:"vendor/accessible-autocomplete",264:"vendor/maplibre-gl",402:"vendor/@defra",935:"im-core"}[e]+".min.js",i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},i.l=(e,t,r,o)=>{if(n[e])n[e].push(t);else{var a,s;if(void 0!==r)for(var l=document.getElementsByTagName("script"),u=0;u<l.length;u++){var c=l[u];if(c.getAttribute("src")==e){a=c;break}}a||(s=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",i.nc&&a.setAttribute("nonce",i.nc),a.src=e),n[e]=[t];var d=(t,r)=>{a.onerror=a.onload=null,clearTimeout(h);var o=n[e];if(delete n[e],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach(e=>e(r)),t)return t(r)},h=setTimeout(d.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=d.bind(null,a.onerror),a.onload=d.bind(null,a.onload),s&&document.head.appendChild(a)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;if("string"==typeof import.meta.url&&(e=import.meta.url),!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e+"../"})(),(()=>{var e={804:0};i.f.j=(t,n)=>{var r=i.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 a=i.p+i.u(t),s=new Error;i.l(a,n=>{if(i.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),a=n&&n.target&&n.target.src;s.message="Loading chunk "+t+" failed.\n("+o+": "+a+")",s.name="ChunkLoadError",s.type=o,s.request=a,r[1](s)}},"chunk-"+t,t)}};var t=(t,n)=>{var r,o,a=n[0],s=n[1],l=n[2],u=0;if(a.some(t=>0!==e[t])){for(r in s)i.o(s,r)&&(i.m[r]=s[r]);l&&l(i)}for(t&&t(n);u<a.length;u++)o=a[u],i.o(e,o)&&e[o]&&e[o][0](),e[o]=0},n=self.webpackChunk=self.webpackChunk||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();const u="aria-describedby",c="error-summary-title";function d(e,t,n){var r;const o=document.getElementById("uploadedFilesContainer"),i=o?o.closest("form"):null;if(!(i&&i instanceof HTMLFormElement))return;const a=i.querySelector("p.govuk-body");if(!a)return;const s=function(e,t){let n=null==e?void 0:e.querySelector("#statusInformation");if(!n){n=document.createElement("div"),n.id="statusInformation",n.className="govuk-visually-hidden",n.setAttribute("aria-live","polite");try{!function(e,t,n){var r;null!=t&&t.nextSibling&&t.parentNode===e?e.insertBefore(n,t.nextSibling):(null!=(r=null==t?void 0:t.parentNode)?r:e).appendChild(n)}(e,t,n)}catch(r){try{null==e||e.appendChild(n)}catch(o){document.body.appendChild(n)}}}return n}(i,a),l=n.querySelector('input[type="file"]');l&&l.setAttribute(u,"statusInformation");const c=function(e,t){let n=e.querySelector("dl.govuk-summary-list");if(!n){n=document.createElement("dl"),n.className="govuk-summary-list govuk-summary-list--long-key";const r=e.querySelector(".govuk-button-group");r?e.insertBefore(n,r):e.insertBefore(n,t.nextSibling)}return n}(i,a),d=document.querySelector(`[data-filename="${null==e?void 0:e.name}"]`);d&&d.remove();const h=function(e,t){var n,r;const o=document.createElement("div");return o.className="govuk-summary-list__row",o.setAttribute("data-filename",null!=(n=null==e?void 0:e.name)?n:""),o.innerHTML=`\n <dt class="govuk-summary-list__key">\n ${null!=(r=null==e?void 0:e.name)?r:""}\n </dt>\n <dd class="govuk-summary-list__value">\n <strong class="govuk-tag govuk-tag--yellow">${t}</strong>\n </dd>\n <dd class="govuk-summary-list__actions">\n </dd>\n `,o}(e,t);c.insertBefore(h,c.firstChild),s.textContent=`${null!=(r=null==e?void 0:e.name)?r:""} ${t}`}function h(e,t,n){if(document.querySelector(".govuk-error-summary"))return void(document.getElementById(c)?n.setAttribute(u,c):n.removeAttribute(u));t&&(t.innerHTML=`\n <div class="govuk-error-summary" data-module="govuk-error-summary">\n <div role="alert">\n <h2 class="govuk-error-summary__title" id="${c}">\n There is a problem\n </h2>\n <div class="govuk-error-summary__body">\n <ul class="govuk-list govuk-error-summary__list">\n <li>\n <a href="#file-upload">${e}</a>\n </li>\n </ul>\n </div>\n </div>\n </div>\n `,n.setAttribute(u,c));const r=n.closest(".govuk-form-group");if(r){r.classList.add("govuk-form-group--error"),n.classList.add("govuk-file-upload--error");const t=n.id;let o=document.getElementById(`${t}-error`);o||(o=document.createElement("p"),o.id=`${t}-error`,o.className="govuk-error-message",o.innerHTML=`<span class="govuk-visually-hidden">Error:</span> ${e}`,r.insertBefore(o,n)),n.setAttribute(u,`error-summary-title ${t}-error`)}}function p(){window.history.replaceState(null,"",window.location.href),window.location.href=window.location.pathname}function f(){var e,t,n;const r=document.querySelector('form:has(input[type="file"])'),o=r?r.querySelector('input[type="file"]'):null,i=r?r.querySelector(".upload-file-button"):null,a=null!=(e=Array.from(document.querySelectorAll("button.govuk-button")).find(e=>"Continue"===e.textContent.trim()))?e:null,s=document.querySelector(".govuk-error-summary-container");if(!r||!o||!i)return;const l=null!=(t=null==(n=document.getElementById("uploadedFilesContainer"))?void 0:n.dataset.uploadinglabel)?t:"Uploading…",u=r;let c=[],f=!1;const m=u.dataset.uploadId;o.addEventListener("change",()=>{s&&(s.innerHTML=""),o.files&&o.files.length>0&&(c=Array.from(o.files),i.click())}),i.addEventListener("click",e=>{if(0===c.length)return e.preventDefault(),void h("Select a file",s,o);f?e.preventDefault():(f=!0,function(e,t,n,r,o,i){for(let a=o.length-1;a>=0;a--)d(o[a],i,e);t.focus(),setTimeout(()=>{t.disabled=!0,n.disabled=!0,r.disabled=!0},100)}(u,o,i,a,c,l),function(e,t,n,r,o,i){var a;if(!t.action||!i)return!1;e.preventDefault();const s=new FormData(t),l=!!t.dataset.proxyUrl,u=null!=(a=t.dataset.proxyUrl)?a:t.action,c={method:"POST",body:s,redirect:l?"follow":"manual"};l&&(c.mode="no-cors"),fetch(u,c).then(()=>{!function(e){let t=0;const n=setInterval(()=>{if(t++,t>=300)return clearInterval(n),void p();const r=function(e,t){const n=e.replace(/\/preview\/(draft|live)/g,"").replace(/\/{2,}/g,"/").replace(/\/$/,"").split("/").filter(Boolean);return`${n.length>2?`/${n.slice(0,n.length-2).join("/")}`:""}/upload-status/${t}`}(window.location.pathname,e);fetch(r,{headers:{Accept:"application/json"}}).then(e=>{if(!e.ok)throw new Error("Network response was not ok");return e.json()}).then(e=>{"ready"===e.uploadStatus&&(clearInterval(n),p())}).catch(()=>{clearInterval(n),p()})},1e3)}(i)}).catch(()=>(n.disabled=!1,r.disabled=!1,h("There was a problem uploading the file",o,n),null))}(e,u,o,i,s,m))})}function m(e,t={}){var n;const r=e.getAttribute("tabindex");function o(){var n;null==(n=t.onBlur)||n.call(e),r||e.removeAttribute("tabindex")}r||e.setAttribute("tabindex","-1"),e.addEventListener("focus",function(){e.addEventListener("blur",o,{once:!0})},{once:!0}),null==(n=t.onBeforeFocus)||n.call(e),e.focus()}function g(e=document.body){return!!e&&e.classList.contains("govuk-frontend-supported")}function _(e){return!!e&&"object"==typeof e&&!function(e){return Array.isArray(e)}(e)}function v(e){return!!e&&(e instanceof Element||e instanceof Document)}function y(e,t){return`${e.moduleName}: ${t}`}class b extends Error{constructor(...e){super(...e),this.name="GOVUKFrontendError"}}class w extends b{constructor(e=document.body){const t="noModule"in HTMLScriptElement.prototype?'GOV.UK Frontend initialised without `<body class="govuk-frontend-supported">` from template `<script>` snippet':"GOV.UK Frontend is not supported in this browser";super(e?t:'GOV.UK Frontend initialised without `<script type="module">`'),this.name="SupportError"}}class E extends b{constructor(...e){super(...e),this.name="ConfigError"}}class S extends b{constructor(e){let t="string"==typeof e?e:"";if(_(e)){const{component:n,identifier:r,element:o,expectedType:i}=e;t=r,t+=o?` is not of type ${null!=i?i:"HTMLElement"}`:" not found",n&&(t=y(n,t))}super(t),this.name="ElementError"}}class k extends b{constructor(e){super("string"==typeof e?e:y(e,"Root element (`$root`) already initialised")),this.name="InitError"}}class O{get $root(){return this._$root}constructor(e){this._$root=void 0;const t=this.constructor;if("string"!=typeof t.moduleName)throw new k("`moduleName` not defined in component");if(!(e instanceof t.elementType))throw new S({element:e,component:t,identifier:"Root element (`$root`)",expectedType:t.elementType.name});this._$root=e,t.checkSupport(),this.checkInitialised();const n=t.moduleName;this.$root.setAttribute(`data-${n}-init`,"")}checkInitialised(){const e=this.constructor,t=e.moduleName;if(t&&function(e,t){return e instanceof HTMLElement&&e.hasAttribute(`data-${t}-init`)}(this.$root,t))throw new k(e)}static checkSupport(){if(!g())throw new w}}O.elementType=HTMLElement;const A=Symbol.for("configOverride");class P extends O{[A](e){return{}}get config(){return this._config}constructor(e,t){super(e),this._config=void 0;const n=this.constructor;if(!_(n.defaults))throw new E(y(n,"Config passed as parameter into constructor but no defaults defined"));const r=function(e,t){if(!_(e.schema))throw new E(y(e,"Config passed as parameter into constructor but no schema defined"));const n={},r=Object.entries(e.schema.properties);for(const o of r){const[r,i]=o,a=r.toString();a in t&&(n[a]=N(t[a],i)),"object"===(null==i?void 0:i.type)&&(n[a]=x(e.schema,t,r))}return n}(n,this._$root.dataset);this._config=T(n.defaults,null!=t?t:{},this[A](r),r)}}function N(e,t){const n=e?e.trim():"";let r,o=null==t?void 0:t.type;switch(o||(["true","false"].includes(n)&&(o="boolean"),n.length>0&&isFinite(Number(n))&&(o="number")),o){case"boolean":r="true"===n;break;case"number":r=Number(n);break;default:r=e}return r}function T(...e){const t={};for(const n of e)for(const e of Object.keys(n)){const r=t[e],o=n[e];_(r)&&_(o)?t[e]=T(r,o):t[e]=o}return t}function x(e,t,n){const r=e.properties[n];if("object"!==(null==r?void 0:r.type))return;const o={[n]:{}};for(const[i,a]of Object.entries(t)){let e=o;const t=i.split(".");for(const[r,o]of t.entries())_(e)&&(r<t.length-1?(_(e[o])||(e[o]={}),e=e[o]):i!==n&&(e[o]=N(a)))}return o[n]}function M(e,t,n){let r;const o=function(e){let t,n=document;if(_(e)){const r=e;(v(r.scope)||null===r.scope)&&(n=r.scope),"function"==typeof r.onError&&(t=r.onError)}return v(e)?n=e:null===e?n=null:"function"==typeof e&&(t=e),{scope:n,onError:t}}(n);try{var i;if(!g())throw new w;if(null===o.scope)throw new S({element:o.scope,component:e,identifier:"Scope element (`$scope`)"});r=null==(i=o.scope)?void 0:i.querySelectorAll(`[data-module="${e.moduleName}"]`)}catch(a){return o.onError?o.onError(a,{component:e,config:t}):console.log(a),[]}return Array.from(null!=r?r:[]).map(n=>{try{return void 0!==t?new e(n,t):new e(n)}catch(a){return o.onError?o.onError(a,{element:n,component:e,config:t}):console.log(a),null}}).filter(Boolean)}class C extends P{constructor(e,t={}){super(e,t),this.debounceFormSubmitTimer=null,this.$root.addEventListener("keydown",e=>this.handleKeyDown(e)),this.$root.addEventListener("click",e=>this.debounce(e))}handleKeyDown(e){const t=e.target;" "===e.key&&t instanceof HTMLElement&&"button"===t.getAttribute("role")&&(e.preventDefault(),t.click())}debounce(e){if(this.config.preventDoubleClick)return this.debounceFormSubmitTimer?(e.preventDefault(),!1):void(this.debounceFormSubmitTimer=window.setTimeout(()=>{this.debounceFormSubmitTimer=null},1e3))}}function L(e,t){const n=e.closest(`[${t}]`);return n?n.getAttribute(t):null}C.moduleName="govuk-button",C.defaults=Object.freeze({preventDoubleClick:!1}),C.schema=Object.freeze({properties:{preventDoubleClick:{type:"boolean"}}});class ${constructor(e={},t={}){var n;this.translations=void 0,this.locale=void 0,this.translations=e,this.locale=null!=(n=t.locale)?n:document.documentElement.lang||"en"}t(e,t){if(!e)throw new Error("i18n: lookup key missing");let n=this.translations[e];if("number"==typeof(null==t?void 0:t.count)&&_(n)){const r=n[this.getPluralSuffix(e,t.count)];r&&(n=r)}if("string"==typeof n){if(n.match(/%{(.\S+)}/)){if(!t)throw new Error("i18n: cannot replace placeholders in string if no option data provided");return this.replacePlaceholders(n,t)}return n}return e}replacePlaceholders(e,t){const n=Intl.NumberFormat.supportedLocalesOf(this.locale).length?new Intl.NumberFormat(this.locale):void 0;return e.replace(/%{(.\S+)}/g,function(e,r){if(Object.prototype.hasOwnProperty.call(t,r)){const e=t[r];return!1===e||"number"!=typeof e&&"string"!=typeof e?"":"number"==typeof e?n?n.format(e):`${e}`:e}throw new Error(`i18n: no data found to replace ${e} placeholder in string`)})}hasIntlPluralRulesSupport(){return Boolean("PluralRules"in window.Intl&&Intl.PluralRules.supportedLocalesOf(this.locale).length)}getPluralSuffix(e,t){if(t=Number(t),!isFinite(t))return"other";const n=this.translations[e],r=this.hasIntlPluralRulesSupport()?new Intl.PluralRules(this.locale).select(t):"other";if(_(n)){if(r in n)return r;if("other"in n)return console.warn(`i18n: Missing plural form ".${r}" for "${this.locale}" locale. Falling back to ".other".`),"other"}throw new Error(`i18n: Plural form ".other" is required for "${this.locale}" locale`)}}class D extends P{[A](e){let t={};return("maxwords"in e||"maxlength"in e)&&(t={maxlength:void 0,maxwords:void 0}),t}constructor(e,t={}){var n,r;super(e,t),this.$textarea=void 0,this.$visibleCountMessage=void 0,this.$screenReaderCountMessage=void 0,this.lastInputTimestamp=null,this.lastInputValue="",this.valueChecker=null,this.i18n=void 0,this.maxLength=void 0;const o=this.$root.querySelector(".govuk-js-character-count");if(!(o instanceof HTMLTextAreaElement||o instanceof HTMLInputElement))throw new S({component:D,element:o,expectedType:"HTMLTextareaElement or HTMLInputElement",identifier:"Form field (`.govuk-js-character-count`)"});const i=function(e,t){const n=[];for(const[r,o]of Object.entries(e)){const e=[];if(Array.isArray(o)){for(const{required:n,errorMessage:r}of o)n.every(e=>!!t[e])||e.push(r);"anyOf"!==r||o.length-e.length>=1||n.push(...e)}}return n}(D.schema,this.config);if(i[0])throw new E(y(D,i[0]));this.i18n=new $(this.config.i18n,{locale:L(this.$root,"lang")}),this.maxLength=null!=(n=null!=(r=this.config.maxwords)?r:this.config.maxlength)?n:1/0,this.$textarea=o;const a=`${this.$textarea.id}-info`,s=document.getElementById(a);if(!s)throw new S({component:D,element:s,identifier:`Count message (\`id="${a}"\`)`});this.$errorMessage=this.$root.querySelector(".govuk-error-message"),s.textContent.match(/^\s*$/)&&(s.textContent=this.i18n.t("textareaDescription",{count:this.maxLength})),this.$textarea.insertAdjacentElement("afterend",s);const l=document.createElement("div");l.className="govuk-character-count__sr-status govuk-visually-hidden",l.setAttribute("aria-live","polite"),this.$screenReaderCountMessage=l,s.insertAdjacentElement("afterend",l);const u=document.createElement("div");u.className=s.className,u.classList.add("govuk-character-count__status"),u.setAttribute("aria-hidden","true"),this.$visibleCountMessage=u,s.insertAdjacentElement("afterend",u),s.classList.add("govuk-visually-hidden"),this.$textarea.removeAttribute("maxlength"),this.bindChangeEvents(),window.addEventListener("pageshow",()=>this.updateCountMessage()),this.updateCountMessage()}bindChangeEvents(){this.$textarea.addEventListener("keyup",()=>this.handleKeyUp()),this.$textarea.addEventListener("focus",()=>this.handleFocus()),this.$textarea.addEventListener("blur",()=>this.handleBlur())}handleKeyUp(){this.updateVisibleCountMessage(),this.lastInputTimestamp=Date.now()}handleFocus(){this.valueChecker=window.setInterval(()=>{(!this.lastInputTimestamp||Date.now()-500>=this.lastInputTimestamp)&&this.updateIfValueChanged()},1e3)}handleBlur(){this.valueChecker&&window.clearInterval(this.valueChecker)}updateIfValueChanged(){this.$textarea.value!==this.lastInputValue&&(this.lastInputValue=this.$textarea.value,this.updateCountMessage())}updateCountMessage(){this.updateVisibleCountMessage(),this.updateScreenReaderCountMessage()}updateVisibleCountMessage(){const e=this.maxLength-this.count(this.$textarea.value)<0;this.$visibleCountMessage.classList.toggle("govuk-character-count__message--disabled",!this.isOverThreshold()),this.$errorMessage||this.$textarea.classList.toggle("govuk-textarea--error",e),this.$visibleCountMessage.classList.toggle("govuk-error-message",e),this.$visibleCountMessage.classList.toggle("govuk-hint",!e),this.$visibleCountMessage.textContent=this.getCountMessage()}updateScreenReaderCountMessage(){this.isOverThreshold()?this.$screenReaderCountMessage.removeAttribute("aria-hidden"):this.$screenReaderCountMessage.setAttribute("aria-hidden","true"),this.$screenReaderCountMessage.textContent=this.getCountMessage()}count(e){var t;return this.config.maxwords?(null!=(t=e.match(/\S+/g))?t:[]).length:e.length}getCountMessage(){const e=this.maxLength-this.count(this.$textarea.value),t=this.config.maxwords?"words":"characters";return this.formatCountMessage(e,t)}formatCountMessage(e,t){if(0===e)return this.i18n.t(`${t}AtLimit`);const n=e<0?"OverLimit":"UnderLimit";return this.i18n.t(`${t}${n}`,{count:Math.abs(e)})}isOverThreshold(){if(!this.config.threshold)return!0;const e=this.count(this.$textarea.value);return this.maxLength*this.config.threshold/100<=e}}D.moduleName="govuk-character-count",D.defaults=Object.freeze({threshold:0,i18n:{charactersUnderLimit:{one:"You have %{count} character remaining",other:"You have %{count} characters remaining"},charactersAtLimit:"You have 0 characters remaining",charactersOverLimit:{one:"You have %{count} character too many",other:"You have %{count} characters too many"},wordsUnderLimit:{one:"You have %{count} word remaining",other:"You have %{count} words remaining"},wordsAtLimit:"You have 0 words remaining",wordsOverLimit:{one:"You have %{count} word too many",other:"You have %{count} words too many"},textareaDescription:{other:""}}}),D.schema=Object.freeze({properties:{i18n:{type:"object"},maxwords:{type:"number"},maxlength:{type:"number"},threshold:{type:"number"}},anyOf:[{required:["maxwords"],errorMessage:'Either "maxlength" or "maxwords" must be provided'},{required:["maxlength"],errorMessage:'Either "maxlength" or "maxwords" must be provided'}]});class j extends O{constructor(e){super(e),this.$inputs=void 0;const t=this.$root.querySelectorAll('input[type="checkbox"]');if(!t.length)throw new S({component:j,identifier:'Form inputs (`<input type="checkbox">`)'});this.$inputs=t,this.$inputs.forEach(e=>{const t=e.getAttribute("data-aria-controls");if(t){if(!document.getElementById(t))throw new S({component:j,identifier:`Conditional reveal (\`id="${t}"\`)`});e.setAttribute("aria-controls",t),e.removeAttribute("data-aria-controls")}}),window.addEventListener("pageshow",()=>this.syncAllConditionalReveals()),this.syncAllConditionalReveals(),this.$root.addEventListener("click",e=>this.handleClick(e))}syncAllConditionalReveals(){this.$inputs.forEach(e=>this.syncConditionalRevealWithInputState(e))}syncConditionalRevealWithInputState(e){const t=e.getAttribute("aria-controls");if(!t)return;const n=document.getElementById(t);if(null!=n&&n.classList.contains("govuk-checkboxes__conditional")){const t=e.checked;e.setAttribute("aria-expanded",t.toString()),n.classList.toggle("govuk-checkboxes__conditional--hidden",!t)}}unCheckAllInputsExcept(e){document.querySelectorAll(`input[type="checkbox"][name="${e.name}"]`).forEach(t=>{e.form===t.form&&t!==e&&(t.checked=!1,this.syncConditionalRevealWithInputState(t))})}unCheckExclusiveInputs(e){document.querySelectorAll(`input[data-behaviour="exclusive"][type="checkbox"][name="${e.name}"]`).forEach(t=>{e.form===t.form&&(t.checked=!1,this.syncConditionalRevealWithInputState(t))})}handleClick(e){const t=e.target;t instanceof HTMLInputElement&&"checkbox"===t.type&&(t.getAttribute("aria-controls")&&this.syncConditionalRevealWithInputState(t),t.checked&&("exclusive"===t.getAttribute("data-behaviour")?this.unCheckAllInputsExcept(t):this.unCheckExclusiveInputs(t)))}}j.moduleName="govuk-checkboxes";class R extends P{constructor(e,t={}){super(e,t),this.config.disableAutoFocus||m(this.$root),this.$root.addEventListener("click",e=>this.handleClick(e))}handleClick(e){const t=e.target;t&&this.focusTarget(t)&&e.preventDefault()}focusTarget(e){if(!(e instanceof HTMLAnchorElement))return!1;const t=e.hash.replace("#","");if(!t)return!1;const n=document.getElementById(t);if(!n)return!1;const r=this.getAssociatedLegendOrLabel(n);return!!r&&(r.scrollIntoView(),n.focus({preventScroll:!0}),!0)}getAssociatedLegendOrLabel(e){var t;const n=e.closest("fieldset");if(n){const t=n.getElementsByTagName("legend");if(t.length){const n=t[0];if(e instanceof HTMLInputElement&&("checkbox"===e.type||"radio"===e.type))return n;const r=n.getBoundingClientRect().top,o=e.getBoundingClientRect();if(o.height&&window.innerHeight&&o.top+o.height-r<window.innerHeight/2)return n}}return null!=(t=document.querySelector(`label[for='${e.getAttribute("id")}']`))?t:e.closest("label")}}R.moduleName="govuk-error-summary",R.defaults=Object.freeze({disableAutoFocus:!1}),R.schema=Object.freeze({properties:{disableAutoFocus:{type:"boolean"}}});class F extends O{constructor(e){super(e),this.$menuButton=void 0,this.$menu=void 0,this.menuIsOpen=!1,this.mql=null;const t=this.$root.querySelector(".govuk-js-header-toggle");if(!t)return this;this.$root.classList.add("govuk-header--with-js-navigation");const n=t.getAttribute("aria-controls");if(!n)throw new S({component:F,identifier:'Navigation button (`<button class="govuk-js-header-toggle">`) attribute (`aria-controls`)'});const r=document.getElementById(n);if(!r)throw new S({component:F,element:r,identifier:`Navigation (\`<ul id="${n}">\`)`});this.$menu=r,this.$menuButton=t,this.setupResponsiveChecks(),this.$menuButton.addEventListener("click",()=>this.handleMenuButtonClick())}setupResponsiveChecks(){const e=function(){const e="--govuk-breakpoint-desktop";return{property:e,value:window.getComputedStyle(document.documentElement).getPropertyValue(e)||void 0}}();if(!e.value)throw new S({component:F,identifier:`CSS custom property (\`${e.property}\`) on pseudo-class \`:root\``});this.mql=window.matchMedia(`(min-width: ${e.value})`),"addEventListener"in this.mql?this.mql.addEventListener("change",()=>this.checkMode()):this.mql.addListener(()=>this.checkMode()),this.checkMode()}checkMode(){this.mql&&this.$menu&&this.$menuButton&&(this.mql.matches?(this.$menu.removeAttribute("hidden"),this.$menuButton.setAttribute("hidden","")):(this.$menuButton.removeAttribute("hidden"),this.$menuButton.setAttribute("aria-expanded",this.menuIsOpen.toString()),this.menuIsOpen?this.$menu.removeAttribute("hidden"):this.$menu.setAttribute("hidden","")))}handleMenuButtonClick(){this.menuIsOpen=!this.menuIsOpen,this.checkMode()}}F.moduleName="govuk-header";class I extends P{constructor(e,t={}){super(e,t),this.$input=void 0,this.$button=void 0,this.$status=void 0,this.i18n=void 0,this.id=void 0,this.$announcements=void 0,this.enteredAnotherElement=void 0;const n=this.$root.querySelector("input");if(null===n)throw new S({component:I,identifier:'File inputs (`<input type="file">`)'});if("file"!==n.type)throw new S(y(I,'File input (`<input type="file">`) attribute (`type`) is not `file`'));if(this.$input=n,!this.$input.id)throw new S({component:I,identifier:'File input (`<input type="file">`) attribute (`id`)'});this.id=this.$input.id,this.i18n=new $(this.config.i18n,{locale:L(this.$root,"lang")});const r=this.findLabel();r.id||(r.id=`${this.id}-label`),this.$input.id=`${this.id}-input`,this.$input.setAttribute("hidden","true");const o=document.createElement("button");o.classList.add("govuk-file-upload-button"),o.type="button",o.id=this.id,o.classList.add("govuk-file-upload-button--empty");const i=this.$input.getAttribute("aria-describedby");i&&o.setAttribute("aria-describedby",i);const a=document.createElement("span");a.className="govuk-body govuk-file-upload-button__status",a.setAttribute("aria-live","polite"),a.innerText=this.i18n.t("noFileChosen"),o.appendChild(a);const s=document.createElement("span");s.className="govuk-visually-hidden",s.innerText=", ",s.id=`${this.id}-comma`,o.appendChild(s);const l=document.createElement("span");l.className="govuk-file-upload-button__pseudo-button-container";const u=document.createElement("span");u.className="govuk-button govuk-button--secondary govuk-file-upload-button__pseudo-button",u.innerText=this.i18n.t("chooseFilesButton"),l.appendChild(u),l.insertAdjacentText("beforeend"," ");const c=document.createElement("span");c.className="govuk-body govuk-file-upload-button__instruction",c.innerText=this.i18n.t("dropInstruction"),l.appendChild(c),o.appendChild(l),o.setAttribute("aria-labelledby",`${r.id} ${s.id} ${o.id}`),o.addEventListener("click",this.onClick.bind(this)),o.addEventListener("dragover",e=>{e.preventDefault()}),this.$root.insertAdjacentElement("afterbegin",o),this.$input.setAttribute("tabindex","-1"),this.$input.setAttribute("aria-hidden","true"),this.$button=o,this.$status=a,this.$input.addEventListener("change",this.onChange.bind(this)),this.updateDisabledState(),this.observeDisabledState(),this.$announcements=document.createElement("span"),this.$announcements.classList.add("govuk-file-upload-announcements"),this.$announcements.classList.add("govuk-visually-hidden"),this.$announcements.setAttribute("aria-live","assertive"),this.$root.insertAdjacentElement("afterend",this.$announcements),this.$button.addEventListener("drop",this.onDrop.bind(this)),document.addEventListener("dragenter",this.updateDropzoneVisibility.bind(this)),document.addEventListener("dragenter",()=>{this.enteredAnotherElement=!0}),document.addEventListener("dragleave",()=>{this.enteredAnotherElement||this.$button.disabled||(this.hideDraggingState(),this.$announcements.innerText=this.i18n.t("leftDropZone")),this.enteredAnotherElement=!1})}updateDropzoneVisibility(e){this.$button.disabled||e.target instanceof Node&&(this.$root.contains(e.target)?e.dataTransfer&&this.canDrop(e.dataTransfer)&&(this.$button.classList.contains("govuk-file-upload-button--dragging")||(this.showDraggingState(),this.$announcements.innerText=this.i18n.t("enteredDropZone"))):this.$button.classList.contains("govuk-file-upload-button--dragging")&&(this.hideDraggingState(),this.$announcements.innerText=this.i18n.t("leftDropZone")))}showDraggingState(){this.$button.classList.add("govuk-file-upload-button--dragging")}hideDraggingState(){this.$button.classList.remove("govuk-file-upload-button--dragging")}onDrop(e){e.preventDefault(),e.dataTransfer&&this.canFillInput(e.dataTransfer)&&(this.$input.files=e.dataTransfer.files,this.$input.dispatchEvent(new CustomEvent("change")),this.hideDraggingState())}canFillInput(e){return this.matchesInputCapacity(e.files.length)}canDrop(e){return e.items.length?this.matchesInputCapacity(function(e){let t=0;for(let n=0;n<e.length;n++)"file"===e[n].kind&&t++;return t}(e.items)):!e.types.length||e.types.includes("Files")}matchesInputCapacity(e){return this.$input.multiple?e>0:1===e}onChange(){const e=this.$input.files.length;0===e?(this.$status.innerText=this.i18n.t("noFileChosen"),this.$button.classList.add("govuk-file-upload-button--empty")):(this.$status.innerText=1===e?this.$input.files[0].name:this.i18n.t("multipleFilesChosen",{count:e}),this.$button.classList.remove("govuk-file-upload-button--empty"))}findLabel(){const e=document.querySelector(`label[for="${this.$input.id}"]`);if(!e)throw new S({component:I,identifier:`Field label (\`<label for=${this.$input.id}>\`)`});return e}onClick(){this.$input.click()}observeDisabledState(){new MutationObserver(e=>{for(const t of e)"attributes"===t.type&&"disabled"===t.attributeName&&this.updateDisabledState()}).observe(this.$input,{attributes:!0})}updateDisabledState(){this.$button.disabled=this.$input.disabled,this.$root.classList.toggle("govuk-drop-zone--disabled",this.$button.disabled)}}I.moduleName="govuk-file-upload",I.defaults=Object.freeze({i18n:{chooseFilesButton:"Choose file",dropInstruction:"or drop file",noFileChosen:"No file chosen",multipleFilesChosen:{one:"%{count} file chosen",other:"%{count} files chosen"},enteredDropZone:"Entered drop zone",leftDropZone:"Left drop zone"}}),I.schema=Object.freeze({properties:{i18n:{type:"object"}}});class B extends P{constructor(e,t={}){super(e,t),"alert"!==this.$root.getAttribute("role")||this.config.disableAutoFocus||m(this.$root)}}B.moduleName="govuk-notification-banner",B.defaults=Object.freeze({disableAutoFocus:!1}),B.schema=Object.freeze({properties:{disableAutoFocus:{type:"boolean"}}});class G extends O{constructor(e){super(e),this.$inputs=void 0;const t=this.$root.querySelectorAll('input[type="radio"]');if(!t.length)throw new S({component:G,identifier:'Form inputs (`<input type="radio">`)'});this.$inputs=t,this.$inputs.forEach(e=>{const t=e.getAttribute("data-aria-controls");if(t){if(!document.getElementById(t))throw new S({component:G,identifier:`Conditional reveal (\`id="${t}"\`)`});e.setAttribute("aria-controls",t),e.removeAttribute("data-aria-controls")}}),window.addEventListener("pageshow",()=>this.syncAllConditionalReveals()),this.syncAllConditionalReveals(),this.$root.addEventListener("click",e=>this.handleClick(e))}syncAllConditionalReveals(){this.$inputs.forEach(e=>this.syncConditionalRevealWithInputState(e))}syncConditionalRevealWithInputState(e){const t=e.getAttribute("aria-controls");if(!t)return;const n=document.getElementById(t);if(null!=n&&n.classList.contains("govuk-radios__conditional")){const t=e.checked;e.setAttribute("aria-expanded",t.toString()),n.classList.toggle("govuk-radios__conditional--hidden",!t)}}handleClick(e){const t=e.target;if(!(t instanceof HTMLInputElement)||"radio"!==t.type)return;const n=document.querySelectorAll('input[type="radio"][aria-controls]'),r=t.form,o=t.name;n.forEach(e=>{const t=e.form===r;e.name===o&&t&&this.syncConditionalRevealWithInputState(e)})}}G.moduleName="govuk-radios";class W extends O{constructor(e){var t;super(e);const n=this.$root.hash,r=null!=(t=this.$root.getAttribute("href"))?t:"";if(this.$root.origin!==window.location.origin||this.$root.pathname!==window.location.pathname)return;const o=n.replace("#","");if(!o)throw new S(`Skip link: Target link (\`href="${r}"\`) has no hash fragment`);const i=document.getElementById(o);if(!i)throw new S({component:W,element:i,identifier:`Target content (\`id="${o}"\`)`});this.$root.addEventListener("click",()=>m(i,{onBeforeFocus(){i.classList.add("govuk-skip-link-focused-element")},onBlur(){i.classList.remove("govuk-skip-link-focused-element")}}))}}W.elementType=HTMLAnchorElement,W.moduleName="govuk-skip-link";var U=i(409);const H=function(){M(C),M(D),M(j),M(R),M(F),M(I),M(B),M(G),M(W)},z=function(){const e=document.querySelectorAll('[data-module="govuk-accessible-autocomplete"]');e.length&&i.e(7).then(i.t.bind(i,60,19)).then(t=>{const{default:n}=t;e.forEach(e=>function(e,t){if(!e)return;const n={id:e.id,selectElement:e};t(n);const r=document.querySelector(`#${n.id}`),o=[...e.options].map(e=>e.text);null==r||r.addEventListener("blur",()=>{r.value&&o.includes(r.value)||(e.value="")})}(e.querySelector("select"),n.enhanceSelectElement))}).catch(console.error)},V=function(){const e=document.querySelectorAll(".prevent-multiple-clicks");for(const t of e)t.addEventListener("click",s),t.addEventListener("keydown",l)},q=function(){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",f):f()},Y=function(){if(window.opener){const e=document.querySelector(".js-preview-banner-close");null==e||e.removeAttribute("hidden"),null==e||e.addEventListener("click",e=>{e.preventDefault(),window.close()})}};function K(){H(),z(),V(),q(),Y()}export{K as initAll,z as initAllAutocomplete,H as initAllGovuk,V as initDebounceClick,q as initFileUpload,Y as initPreviewCloseLink};export const geospatialMap=U.g5;export const initMaps=U.Yv;export const locationMap=U.g$;export const map=U.Tj;export const sssiDataset=U.zp;
2
+ var e,t,n,r={452:(e,t,n)=>{n.d(t,{Ob:()=>Pe,q6:()=>s.q6,d5:()=>ae,Ay:()=>xe,Rf:()=>q,Qv:()=>fe,XX:()=>he,xJ:()=>Ae,hb:()=>O,NT:()=>P,vJ:()=>b,Nf:()=>w,Kr:()=>k,WO:()=>y,li:()=>E,J0:()=>v});var r,o,i,a,s=n(126),l=0,u=[],c=s.fF,d=c.__b,p=c.__r,h=c.diffed,f=c.__c,m=c.unmount,g=c.__;function _(e,t){c.__h&&c.__h(o,e,l||t),l=0;var n=o.__H||(o.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function v(e){return l=1,y(D,e)}function y(e,t,n){var i=_(r++,2);if(i.t=e,!i.__c&&(i.__=[n?n(t):D(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=o,!o.__f)){var a=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter(function(e){return e.__c});if(r.every(function(e){return!e.__N}))return!s||s.call(this,e,t,n);var o=i.__c.props!==e;return r.some(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),s&&s.call(this,e,t,n)||o};o.__f=!0;var s=o.shouldComponentUpdate,l=o.componentWillUpdate;o.componentWillUpdate=function(e,t,n){if(this.__e){var r=s;s=void 0,a(e,t,n),s=r}l&&l.call(this,e,t,n)},o.shouldComponentUpdate=a}return i.__N||i.__}function b(e,t){var n=_(r++,3);!c.__s&&C(n.__H,t)&&(n.__=e,n.u=t,o.__H.__h.push(n))}function w(e,t){var n=_(r++,4);!c.__s&&C(n.__H,t)&&(n.__=e,n.u=t,o.__h.push(n))}function E(e){return l=5,k(function(){return{current:e}},[])}function S(e,t,n){l=6,w(function(){if("function"==typeof e){var n=e(t());return function(){e(null),n&&"function"==typeof n&&n()}}if(e)return e.current=t(),function(){return e.current=null}},null==n?n:n.concat(e))}function k(e,t){var n=_(r++,7);return C(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function O(e,t){return l=8,k(function(){return e},t)}function P(e){var t=o.context[e.__c],n=_(r++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(o)),t.props.value):e.__}function A(e,t){c.useDebugValue&&c.useDebugValue(t?t(e):e)}function N(){var e=_(r++,11);if(!e.__){for(var t=o.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function T(){for(var e;e=u.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(L),t.__h.some($),t.__h=[]}catch(o){t.__h=[],c.__e(o,e.__v)}}}c.__b=function(e){o=null,d&&d(e)},c.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),g&&g(e,t)},c.__r=function(e){p&&p(e),r=0;var t=(o=e.__c).__H;t&&(i===o?(t.__h=[],o.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(L),t.__h.some($),t.__h=[],r=0)),i=o},c.diffed=function(e){h&&h(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==u.push(t)&&a===c.requestAnimationFrame||((a=c.requestAnimationFrame)||M)(T)),t.__H.__.some(function(e){e.u&&(e.__H=e.u),e.u=void 0})),i=o=null},c.__c=function(e,t){t.some(function(e){try{e.__h.some(L),e.__h=e.__h.filter(function(e){return!e.__||$(e)})}catch(o){t.some(function(e){e.__h&&(e.__h=[])}),t=[],c.__e(o,e.__v)}}),f&&f(e,t)},c.unmount=function(e){m&&m(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{L(e)}catch(e){t=e}}),n.__H=void 0,t&&c.__e(t,n.__v))};var x="function"==typeof requestAnimationFrame;function M(e){var t,n=function(){clearTimeout(r),x&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);x&&(t=requestAnimationFrame(n))}function L(e){var t=o,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),o=t}function $(e){var t=o;e.__c=e.__(),o=t}function C(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function D(e,t){return"function"==typeof t?t(e):t}function j(e,t){for(var n in t)e[n]=t[n];return e}function R(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function F(e,t){var n=t(),r=v({t:{__:n,u:t}}),o=r[0].t,i=r[1];return w(function(){o.__=n,o.u=t,I(o)&&i({t:o})},[e,n,t]),b(function(){return I(o)&&i({t:o}),e(function(){I(o)&&i({t:o})})},[e]),n}function I(e){try{return!((t=e.__)===(n=e.u())&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}var t,n}function B(e){e()}function G(e){return e}function W(){return[!1,B]}var U=w;function H(e,t){this.props=e,this.context=t}(H.prototype=new s.uA).isPureReactComponent=!0,H.prototype.shouldComponentUpdate=function(e,t){return R(this.props,e)||R(this.state,t)};var V=s.fF.__b;s.fF.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),V&&V(e)};var z="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function q(e){function t(t){var n=j({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=z,t.render=e,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Y=function(e,t){return null==e?null:(0,s.v2)((0,s.v2)(e).map(t))},K={map:Y,forEach:Y,count:function(e){return e?(0,s.v2)(e).length:0},only:function(e){var t=(0,s.v2)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:s.v2},Z=s.fF.__e;s.fF.__e=function(e,t,n,r){if(e.then)for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t);Z(e,t,n,r)};var X=s.fF.unmount;function J(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),e.__c.__H=null),null!=(e=j({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return J(e,t,n)})),e}function Q(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return Q(e,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function ee(){this.__u=0,this.o=null,this.__b=null}function te(e){if(!e.__)return null;var t=e.__.__c;return t&&t.__a&&t.__a(e)}function ne(){this.i=null,this.l=null}s.fF.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),X&&X(e)},(ee.prototype=new s.uA).__c=function(e,t){var n=t.__c,r=this;null==r.o&&(r.o=[]),r.o.push(n);var o=te(r.__v),i=!1,a=function(){i||r.__z||(i=!0,n.__R=null,o?o(l):l())};n.__R=a;var s=n.__P;n.__P=null;var l=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=Q(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.__P=s,t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},ee.prototype.componentWillUnmount=function(){this.o=[]},ee.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=J(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&(0,s.n)(s.FK,null,e.fallback);return o&&(o.__u&=-33),[(0,s.n)(s.FK,null,t.__a?null:e.children),o]};var re=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function oe(e){return this.getChildContext=function(){return e.context},e.children}function ie(e){var t=this,n=e.h;if(t.componentWillUnmount=function(){(0,s.XX)(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),!t.v){for(var r=t.__v;null!==r&&!r.__m&&null!==r.__;)r=r.__;t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:r.__m},contains:function(){return!0},namespaceURI:n.namespaceURI,insertBefore:function(e,n){this.childNodes.push(e),t.h.insertBefore(e,n)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}}(0,s.XX)((0,s.n)(oe,{context:t.context},e.__v),t.v)}function ae(e,t){var n=(0,s.n)(ie,{__v:e,h:t});return n.containerInfo=t,n}(ne.prototype=new s.uA).__a=function(e){var t=this,n=te(t.__v),r=t.l.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),re(t,e,r)):o()};n?n(i):i()}},ne.prototype.render=function(e){this.i=null,this.l=new Map;var t=(0,s.v2)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},ne.prototype.componentDidUpdate=ne.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){re(e,n,t)})};var se="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,le=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,ue=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,ce=/[A-Z0-9]/g,de="undefined"!=typeof document,pe=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function he(e,t,n){return null==t.__k&&(t.textContent=""),(0,s.XX)(e,t),"function"==typeof n&&n(),e?e.__c:null}function fe(e,t,n){return(0,s.Qv)(e,t),"function"==typeof n&&n(),e?e.__c:null}s.uA.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(s.uA.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var me=s.fF.event;function ge(){}function _e(){return this.cancelBubble}function ve(){return this.defaultPrevented}s.fF.event=function(e){return me&&(e=me(e)),e.persist=ge,e.isPropagationStopped=_e,e.isDefaultPrevented=ve,e.nativeEvent=e};var ye,be={enumerable:!1,configurable:!0,get:function(){return this.class}},we=s.fF.vnode;s.fF.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,r={},o=-1===n.indexOf("-");for(var i in t){var a=t[i];if(!("value"===i&&"defaultValue"in t&&null==a||de&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var l=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===a?a="":"translate"===l&&"no"===a?a=!1:"o"===l[0]&&"n"===l[1]?"ondoubleclick"===l?i="ondblclick":"onchange"!==l||"input"!==n&&"textarea"!==n||pe(t.type)?"onfocus"===l?i="onfocusin":"onblur"===l?i="onfocusout":ue.test(i)&&(i=l):l=i="oninput":o&&le.test(i)?i=i.replace(ce,"-$&").toLowerCase():null===a&&(a=void 0),"oninput"===l&&r[i=l]&&(i="oninputCapture"),r[i]=a}}"select"==n&&r.multiple&&Array.isArray(r.value)&&(r.value=(0,s.v2)(t.children).forEach(function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)})),"select"==n&&null!=r.defaultValue&&(r.value=(0,s.v2)(t.children).forEach(function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value})),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",be)):t.className&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=se,we&&we(e)};var Ee=s.fF.__r;s.fF.__r=function(e){Ee&&Ee(e),ye=e.__c};var Se=s.fF.diffed;s.fF.diffed=function(e){Se&&Se(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),ye=null};var ke={ReactCurrentDispatcher:{current:{readContext:function(e){return ye.__n[e.__c].props.value},useCallback:O,useContext:P,useDebugValue:A,useDeferredValue:G,useEffect:b,useId:N,useImperativeHandle:S,useInsertionEffect:U,useLayoutEffect:w,useMemo:k,useReducer:y,useRef:E,useState:v,useSyncExternalStore:F,useTransition:W}}};function Oe(e){return!!e&&e.$$typeof===se}function Pe(e){return Oe(e)?s.Ob.apply(null,arguments):e}function Ae(e){return!!e.__k&&((0,s.XX)(null,e),!0)}var Ne=s.FK,Te=Oe,xe={useState:v,useId:N,useReducer:y,useEffect:b,useLayoutEffect:w,useInsertionEffect:U,useTransition:W,useDeferredValue:G,useSyncExternalStore:F,startTransition:B,useRef:E,useImperativeHandle:S,useMemo:k,useCallback:O,useContext:P,useDebugValue:A,version:"18.3.1",Children:K,render:he,hydrate:fe,unmountComponentAtNode:Ae,createPortal:ae,createElement:s.n,createContext:s.q6,createFactory:function(e){return s.n.bind(null,e)},cloneElement:Pe,createRef:s._3,Fragment:s.FK,isValidElement:Oe,isElement:Te,isFragment:function(e){return Oe(e)&&e.type===s.FK},isMemo:function(e){return!!e&&"string"==typeof e.displayName&&e.displayName.startsWith("Memo(")},findDOMNode:function(e){return e&&(e.base||1===e.nodeType&&e)||null},Component:s.uA,PureComponent:H,memo:function(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:R(this.props,e)}function r(t){return this.shouldComponentUpdate=n,(0,s.n)(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r.type=e,r},forwardRef:q,flushSync:function(e,t){return e(t)},unstable_batchedUpdates:function(e,t){return e(t)},StrictMode:Ne,Suspense:ee,SuspenseList:ne,lazy:function(e){var t,n,r,o=null;function i(i){if(t||(t=e()).then(function(e){e&&(o=e.default||e),r=!0},function(e){n=e,r=!0}),n)throw n;if(!r)throw t;return o?(0,s.n)(o,i):null}return i.displayName="Lazy",i.__f=!0,i},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ke}},126:(e,t,n)=>{n.d(t,{FK:()=>k,Ob:()=>K,Qv:()=>Y,XX:()=>q,_3:()=>S,fF:()=>o,n:()=>w,q6:()=>Z,uA:()=>O,v2:()=>C});var r,o,i,a,s,l,u,c,d,p,h,f,m={},g=[],_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,v=Array.isArray;function y(e,t){for(var n in t)e[n]=t[n];return e}function b(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function w(e,t,n){var o,i,a,s={};for(a in t)"key"==a?o=t[a]:"ref"==a?i=t[a]:s[a]=t[a];if(arguments.length>2&&(s.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return E(e,s,o,i,null)}function E(e,t,n,r,a){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==a?++i:a,__i:-1,__u:0};return null==a&&null!=o.vnode&&o.vnode(s),s}function S(){return{current:null}}function k(e){return e.children}function O(e,t){this.props=e,this.context=t}function P(e,t){if(null==t)return e.__?P(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?P(e):null}function A(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],i=[],a=y({},t);a.__v=t.__v+1,o.vnode&&o.vnode(a),I(e.__P,a,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,null==n?P(t):n,!!(32&t.__u),i),a.__v=t.__v,a.__.__k[a.__i]=a,G(r,a,i),t.__e=t.__=null,a.__e!=n&&N(a)}}function N(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some(function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e}),N(e)}function T(e){(!e.__d&&(e.__d=!0)&&a.push(e)&&!x.__r++||s!=o.debounceRendering)&&((s=o.debounceRendering)||l)(x)}function x(){for(var e,t=1;a.length;)a.length>t&&a.sort(u),e=a.shift(),t=a.length,A(e);x.__r=0}function M(e,t,n,r,o,i,a,s,l,u,c){var d,p,h,f,_,v,y,b=r&&r.__k||g,w=t.length;for(l=L(n,t,b,l,w),d=0;d<w;d++)null!=(h=n.__k[d])&&(p=-1!=h.__i&&b[h.__i]||m,h.__i=d,v=I(e,h,p,o,i,a,s,l,u,c),f=h.__e,h.ref&&p.ref!=h.ref&&(p.ref&&H(p.ref,null,h),c.push(h.ref,h.__c||f,h)),null==_&&null!=f&&(_=f),(y=!!(4&h.__u))||p.__k===h.__k?l=$(h,l,e,y):"function"==typeof h.type&&void 0!==v?l=v:f&&(l=f.nextSibling),h.__u&=-7);return n.__e=_,l}function L(e,t,n,r,o){var i,a,s,l,u,c=n.length,d=c,p=0;for(e.__k=new Array(o),i=0;i<o;i++)null!=(a=t[i])&&"boolean"!=typeof a&&"function"!=typeof a?("string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?a=e.__k[i]=E(null,a,null,null,null):v(a)?a=e.__k[i]=E(k,{children:a},null,null,null):void 0===a.constructor&&a.__b>0?a=e.__k[i]=E(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[i]=a,l=i+p,a.__=e,a.__b=e.__b+1,s=null,-1!=(u=a.__i=D(a,n,l,d))&&(d--,(s=n[u])&&(s.__u|=2)),null==s||null==s.__v?(-1==u&&(o>c?p--:o<c&&p++),"function"!=typeof a.type&&(a.__u|=4)):u!=l&&(u==l-1?p--:u==l+1?p++:(u>l?p--:p++,a.__u|=4))):e.__k[i]=null;if(d)for(i=0;i<c;i++)null!=(s=n[i])&&!(2&s.__u)&&(s.__e==r&&(r=P(s)),V(s,s));return r}function $(e,t,n,r){var o,i;if("function"==typeof e.type){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,t=$(o[i],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=P(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function C(e,t){return t=t||[],null==e||"boolean"==typeof e||(v(e)?e.some(function(e){C(e,t)}):t.push(e)),t}function D(e,t,n,r){var o,i,a,s=e.key,l=e.type,u=t[n],c=null!=u&&!(2&u.__u);if(null===u&&null==s||c&&s==u.key&&l==u.type)return n;if(r>(c?1:0))for(o=n-1,i=n+1;o>=0||i<t.length;)if(null!=(u=t[a=o>=0?o--:i++])&&!(2&u.__u)&&s==u.key&&l==u.type)return a;return-1}function j(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||_.test(t)?n:n+"px"}function R(e,t,n,r,o){var i,a;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||j(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||j(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])i=t!=(t=t.replace(c,"$1")),a=t.toLowerCase(),t=a in e||"onFocusOut"==t||"onFocusIn"==t?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=d,e.addEventListener(t,i?h:p,i)):e.removeEventListener(t,i?h:p,i);else{if("http://www.w3.org/2000/svg"==o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function F(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=d++;else if(t.t<n.u)return;return n(o.event?o.event(t):t)}}}function I(e,t,n,r,i,a,s,l,u,c){var d,p,h,f,m,_,w,E,S,P,A,N,T,x,L,$=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(u=!!(32&n.__u),a=[l=t.__e=n.__e]),(d=o.__b)&&d(t);e:if("function"==typeof $)try{if(E=t.props,S="prototype"in $&&$.prototype.render,P=(d=$.contextType)&&r[d.__c],A=d?P?P.props.value:d.__:r,n.__c?w=(p=t.__c=n.__c).__=p.__E:(S?t.__c=p=new $(E,A):(t.__c=p=new O(E,A),p.constructor=$,p.render=z),P&&P.sub(p),p.state||(p.state={}),p.__n=r,h=p.__d=!0,p.__h=[],p._sb=[]),S&&null==p.__s&&(p.__s=p.state),S&&null!=$.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=y({},p.__s)),y(p.__s,$.getDerivedStateFromProps(E,p.__s))),f=p.props,m=p.state,p.__v=t,h)S&&null==$.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),S&&null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(S&&null==$.getDerivedStateFromProps&&E!==f&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(E,A),t.__v==n.__v||!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(E,p.__s,A)){t.__v!=n.__v&&(p.props=E,p.state=p.__s,p.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),g.push.apply(p.__h,p._sb),p._sb=[],p.__h.length&&s.push(p);break e}null!=p.componentWillUpdate&&p.componentWillUpdate(E,p.__s,A),S&&null!=p.componentDidUpdate&&p.__h.push(function(){p.componentDidUpdate(f,m,_)})}if(p.context=A,p.props=E,p.__P=e,p.__e=!1,N=o.__r,T=0,S)p.state=p.__s,p.__d=!1,N&&N(t),d=p.render(p.props,p.state,p.context),g.push.apply(p.__h,p._sb),p._sb=[];else do{p.__d=!1,N&&N(t),d=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++T<25);p.state=p.__s,null!=p.getChildContext&&(r=y(y({},r),p.getChildContext())),S&&!h&&null!=p.getSnapshotBeforeUpdate&&(_=p.getSnapshotBeforeUpdate(f,m)),x=null!=d&&d.type===k&&null==d.key?W(d.props.children):d,l=M(e,v(x)?x:[x],t,n,r,i,a,s,l,u,c),p.base=t.__e,t.__u&=-161,p.__h.length&&s.push(p),w&&(p.__E=p.__=null)}catch(e){if(t.__v=null,u||null!=a)if(e.then){for(t.__u|=u?160:128;l&&8==l.nodeType&&l.nextSibling;)l=l.nextSibling;a[a.indexOf(l)]=null,t.__e=l}else{for(L=a.length;L--;)b(a[L]);B(t)}else t.__e=n.__e,t.__k=n.__k,e.then||B(t);o.__e(e,t,n)}else null==a&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):l=t.__e=U(n.__e,t,n,r,i,a,s,u,c);return(d=o.diffed)&&d(t),128&t.__u?void 0:l}function B(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(B))}function G(e,t,n){for(var r=0;r<n.length;r++)H(n[r],n[++r],n[++r]);o.__c&&o.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){o.__e(e,t.__v)}})}function W(e){return"object"!=typeof e||null==e||e.__b>0?e:v(e)?e.map(W):y({},e)}function U(e,t,n,i,a,s,l,u,c){var d,p,h,f,g,_,y,w=n.props||m,E=t.props,S=t.type;if("svg"==S?a="http://www.w3.org/2000/svg":"math"==S?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),null!=s)for(d=0;d<s.length;d++)if((g=s[d])&&"setAttribute"in g==!!S&&(S?g.localName==S:3==g.nodeType)){e=g,s[d]=null;break}if(null==e){if(null==S)return document.createTextNode(E);e=document.createElementNS(a,S,E.is&&E),u&&(o.__m&&o.__m(t,s),u=!1),s=null}if(null==S)w===E||u&&e.data==E||(e.data=E);else{if(s=s&&r.call(e.childNodes),!u&&null!=s)for(w={},d=0;d<e.attributes.length;d++)w[(g=e.attributes[d]).name]=g.value;for(d in w)g=w[d],"dangerouslySetInnerHTML"==d?h=g:"children"==d||d in E||"value"==d&&"defaultValue"in E||"checked"==d&&"defaultChecked"in E||R(e,d,null,g,a);for(d in E)g=E[d],"children"==d?f=g:"dangerouslySetInnerHTML"==d?p=g:"value"==d?_=g:"checked"==d?y=g:u&&"function"!=typeof g||w[d]===g||R(e,d,g,w[d],a);if(p)u||h&&(p.__html==h.__html||p.__html==e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(h&&(e.innerHTML=""),M("template"==t.type?e.content:e,v(f)?f:[f],t,n,i,"foreignObject"==S?"http://www.w3.org/1999/xhtml":a,s,l,s?s[0]:n.__k&&P(n,0),u,c),null!=s)for(d=s.length;d--;)b(s[d]);u||(d="value","progress"==S&&null==_?e.removeAttribute("value"):null!=_&&(_!==e[d]||"progress"==S&&!_||"option"==S&&_!=w[d])&&R(e,d,_,w[d],a),d="checked",null!=y&&y!=e[d]&&R(e,d,y,w[d],a))}return e}function H(e,t,n){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){o.__e(e,n)}}function V(e,t,n){var r,i;if(o.unmount&&o.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||H(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){o.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&V(r[i],t,n||"function"!=typeof e.type);n||b(e.__e),e.__c=e.__=e.__e=void 0}function z(e,t,n){return this.constructor(e,n)}function q(e,t,n){var i,a,s,l;t==document&&(t=document.documentElement),o.__&&o.__(e,t),a=(i="function"==typeof n)?null:n&&n.__k||t.__k,s=[],l=[],I(t,e=(!i&&n||t).__k=w(k,null,[e]),a||m,m,t.namespaceURI,!i&&n?[n]:a?null:t.firstChild?r.call(t.childNodes):null,s,!i&&n?n:a?a.__e:t.firstChild,i,l),G(s,e,l)}function Y(e,t){q(e,t,Y)}function K(e,t,n){var o,i,a,s,l=y({},e.props);for(a in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==a?o=t[a]:"ref"==a?i=t[a]:l[a]=void 0===t[a]&&null!=s?s[a]:t[a];return arguments.length>2&&(l.children=arguments.length>3?r.call(arguments,2):n),E(e.type,l,o||e.key,i||e.ref,null)}function Z(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,T(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+f++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}r=g.slice,o={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(t){e=t}throw e}},i=0,O.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=y({},this.state),"function"==typeof e&&(e=e(y({},n),this.props)),e&&y(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),T(this))},O.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),T(this))},O.prototype.render=k,a=[],l="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,u=function(e,t){return e.__v.__b-t.__v.__b},x.__r=0,c=/(PointerCapture)$|Capture$/i,d=0,p=F(!1),h=F(!0),f=0},247:(e,t,n)=>{n.d(t,{FD:()=>i,FK:()=>r.FK,Y:()=>i});var r=n(126),o=0;function i(e,t,n,i,a,s){t||(t={});var l,u,c=t;if("ref"in c)for(u in c={},t)"ref"==u?l=t[u]:c[u]=t[u];var d={type:e,props:c,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--o,__i:-1,__u:0,__source:a,__self:s};if("function"==typeof e&&(l=e.defaultProps))for(u in l)void 0===c[u]&&(c[u]=l[u]);return r.fF.vnode&&r.fF.vnode(d),d}Array.isArray},944:(e,t,n)=>{n.d(t,{g5:()=>o,Yv:()=>Ke,g$:()=>i,Tj:()=>a,zp:()=>r});var r={};n.r(r),n.d(r,{default:()=>Q,sssiEnglandRequestTransformer:()=>Z,sssiScotlandRequestTransformer:()=>J,sssiWalesRequestTransformer:()=>X});var o={};n.r(o),n.d(o,{addFeatureToMap:()=>_e,createFeatureHTML:()=>be,createFeaturesHTML:()=>ve,focusFeature:()=>ye,getBoundingBox:()=>me,getGeoJSON:()=>fe,getHelpPanelHtml:()=>le,getTexts:()=>ae,getUIManager:()=>Se,languageTexts:()=>ie,processGeospatial:()=>ge});var i={};n.r(i),n.d(i,{getTexts:()=>Ne,languageTexts:()=>Ae,processLocation:()=>je});var a={};n.r(a),n.d(a,{EVENTS:()=>qe,centerMap:()=>Je,createMap:()=>Xe,defaultConfig:()=>ze,eastingNorthingToLatLong:()=>Ge,formSubmitFactory:()=>Ye,getCentroidGridRef:()=>Ve,getCoordinateGridRef:()=>He,getMapCountryLayers:()=>et,getMapLayers:()=>Qe,initMaps:()=>Ke,latLongToEastingNorthing:()=>Be,latLongToOsGridRef:()=>We,makeTileRequestTransformer:()=>Ze,osGridRefToLatLong:()=>Ue});var s=n(196),l=n(321),u=n(585);function c(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 d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach(function(t){(0,u.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function p(){var e,{manifest:t,mapStyles:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{id:"mapStyles",manifest:t,mapStyles:r,load:(e=(0,l.A)(function*(){return(yield n.e(402).then(n.bind(n,171))).manifest}),function(){return e.apply(this,arguments)}),handlesMapStyle:!0,api:{}}}function h(){var e,{manifest:t,units:r="metric"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{id:"scaleBar",manifest:t,units:r,load:(e=(0,l.A)(function*(){return(yield n.e(402).then(n.bind(n,415))).manifest}),function(){return e.apply(this,arguments)})}}var f=n(463);function m(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 g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach(function(t){(0,u.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return g(g(g(g({},f.D),t),t.expanded&&{manifest:{controls:[{id:"search",mobile:{slot:"banner"}}]}}),{},{id:"search",load:(e=(0,l.A)(function*(){return(yield Promise.resolve().then(n.bind(n,463)).then(function(e){return e.m})).manifest}),function(){return e.apply(this,arguments)})})}function v(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 y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach(function(t){(0,u.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function b(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{checkDeviceCapabilities:()=>{var e=(()=>{if(!window.WebGLRenderingContext)return{isEnabled:!1,error:"WebGL is not supported"};var t=document.createElement("canvas"),n=!1;for(var r of["webgl2","webgl1"])try{if((n=t.getContext(r))&&"function"==typeof n.getParameter)return{isEnabled:!0}}catch(e){}return{isEnabled:!1,error:"WebGL is supported, but disabled"}})(),t=document.documentMode;return{isSupported:e.isEnabled&&"function"==typeof"".replaceAll,error:t?"Internet Explorer is not supported":e.error}},load:(e=(0,l.A)(function*(){var e=yield n.e(264).then(n.t.bind(n,825,19));return t.workerUrl&&e.setWorkerUrl(t.workerUrl),{MapProvider:(yield n.e(402).then(n.bind(n,814))).default,mapProviderConfig:y(y({},t),{},{crs:"EPSG:4326"}),mapFramework:e}}),function(){return e.apply(this,arguments)})}}n(452),n(247);function w(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}function E(e,t,n){if(null!==e)for(var r,o,i,a,s,l,u,c,d=0,p=0,h=e.type,f="FeatureCollection"===h,m="Feature"===h,g=f?e.features.length:1,_=0;_<g;_++){s=(c=!!(u=f?e.features[_].geometry:m?e.geometry:e)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var v=0;v<s;v++){var y=0,b=0;if(null!==(a=c?u.geometries[v]:u)){l=a.coordinates;var w=a.type;switch(d=!n||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===t(l,p,_,y,b))return!1;p++,y++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(!1===t(l[r],p,_,y,b))return!1;p++,"MultiPoint"===w&&y++}"LineString"===w&&y++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(o=0;o<l[r].length-d;o++){if(!1===t(l[r][o],p,_,y,b))return!1;p++}"MultiLineString"===w&&y++,"Polygon"===w&&b++}"Polygon"===w&&y++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(b=0,o=0;o<l[r].length;o++){for(i=0;i<l[r][o].length-d;i++){if(!1===t(l[r][o][i],p,_,y,b))return!1;p++}b++}y++}break;case"GeometryCollection":for(r=0;r<a.geometries.length;r++)if(!1===E(a.geometries[r],t,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function S(e,t={}){let n=0,r=0,o=0;return E(e,function(e){n+=e[0],r+=e[1],o++},!0),function(e,t,n={}){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!w(e[0])||!w(e[1]))throw new Error("coordinates must contain numbers");return function(e,t,n={}){const r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}({type:"Point",coordinates:e},t,n)}([n/o,r/o],t.properties)}Math.PI;let k=" ";class O{static get separator(){return k}static set separator(e){k=e}static parse(e){if(!isNaN(parseFloat(e))&&isFinite(e))return Number(e);const t=String(e).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==t[t.length-1]&&t.splice(t.length-1),""==t)return NaN;let n=null;switch(t.length){case 3:n=t[0]/1+t[1]/60+t[2]/3600;break;case 2:n=t[0]/1+t[1]/60;break;case 1:n=t[0];break;default:return NaN}return/^-|[WS]$/i.test(e.trim())&&(n=-n),Number(n)}static toDms(e,t="d",n=void 0){if(isNaN(e))return null;if("string"==typeof e&&""==e.trim())return null;if("boolean"==typeof e)return null;if(e==1/0)return null;if(null==e)return null;if(void 0===n)switch(t){case"d":case"deg":n=4;break;case"dm":case"deg+min":n=2;break;case"dms":case"deg+min+sec":n=0;break;default:t="d",n=4}e=Math.abs(e);let r=null,o=null,i=null,a=null;switch(t){default:case"d":case"deg":o=e.toFixed(n),o<100&&(o="0"+o),o<10&&(o="0"+o),r=o+"°";break;case"dm":case"deg+min":o=Math.floor(e),i=(60*e%60).toFixed(n),60==i&&(i=(0).toFixed(n),o++),o=("000"+o).slice(-3),i<10&&(i="0"+i),r=o+"°"+O.separator+i+"′";break;case"dms":case"deg+min+sec":o=Math.floor(e),i=Math.floor(3600*e/60)%60,a=(3600*e%60).toFixed(n),60==a&&(a=(0).toFixed(n),i++),60==i&&(i=0,o++),o=("000"+o).slice(-3),i=("00"+i).slice(-2),a<10&&(a="0"+a),r=o+"°"+O.separator+i+"′"+O.separator+a+"″"}return r}static toLat(e,t,n){const r=O.toDms(O.wrap90(e),t,n);return null===r?"–":r.slice(1)+O.separator+(e<0?"S":"N")}static toLon(e,t,n){const r=O.toDms(O.wrap180(e),t,n);return null===r?"–":r+O.separator+(e<0?"W":"E")}static toBrng(e,t,n){const r=O.toDms(O.wrap360(e),t,n);return null===r?"–":r.replace("360","0")}static fromLocale(e){const t=123456.789.toLocaleString(),n={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(n.thousands,"⁜").replace(n.decimal,".").replace("⁜",",")}static toLocale(e){const t=123456.789.toLocaleString(),n={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(/,([0-9])/,"⁜$1").replace(".",n.decimal).replace("⁜",n.thousands)}static compassPoint(e,t=3){if(![1,2,3].includes(Number(t)))throw new RangeError(`invalid precision ‘${t}’`);e=O.wrap360(e);const n=4*2**(t-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(e*n/360)%n*16/n]}static wrap90(e){if(-90<=e&&e<=90)return e;const t=e;return 1*Math.abs(((t-90)%360+360)%360-180)-90}static wrap180(e){if(-180<=e&&e<=180)return e;const t=360;return((360*e/t-180)%t+t)%t-180}static wrap360(e){if(0<=e&&e<360)return e;const t=360;return(360*e/t%t+t)%t}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const P=O;class A{constructor(e,t,n){if(isNaN(e)||isNaN(t)||isNaN(n))throw new TypeError(`invalid vector [${e},${t},${n}]`);this.x=Number(e),this.y=Number(t),this.z=Number(n)}get length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}plus(e){if(!(e instanceof A))throw new TypeError("v is not Vector3d object");return new A(this.x+e.x,this.y+e.y,this.z+e.z)}minus(e){if(!(e instanceof A))throw new TypeError("v is not Vector3d object");return new A(this.x-e.x,this.y-e.y,this.z-e.z)}times(e){if(isNaN(e))throw new TypeError(`invalid scalar value ‘${e}’`);return new A(this.x*e,this.y*e,this.z*e)}dividedBy(e){if(isNaN(e))throw new TypeError(`invalid scalar value ‘${e}’`);return new A(this.x/e,this.y/e,this.z/e)}dot(e){if(!(e instanceof A))throw new TypeError("v is not Vector3d object");return this.x*e.x+this.y*e.y+this.z*e.z}cross(e){if(!(e instanceof A))throw new TypeError("v is not Vector3d object");const t=this.y*e.z-this.z*e.y,n=this.z*e.x-this.x*e.z,r=this.x*e.y-this.y*e.x;return new A(t,n,r)}negate(){return new A(-this.x,-this.y,-this.z)}unit(){const e=this.length;if(1==e)return this;if(0==e)return this;const t=this.x/e,n=this.y/e,r=this.z/e;return new A(t,n,r)}angleTo(e,t=void 0){if(!(e instanceof A))throw new TypeError("v is not Vector3d object");if(!(t instanceof A||null==t))throw new TypeError("n is not Vector3d object");const n=null==t||this.cross(e).dot(t)>=0?1:-1,r=this.cross(e).length*n,o=this.dot(e);return Math.atan2(r,o)}rotateAround(e,t){if(!(e instanceof A))throw new TypeError("axis is not Vector3d object");const n=t.toRadians(),r=this.unit(),o=e.unit(),i=Math.sin(n),a=Math.cos(n),s=1-a,l=o.x,u=o.y,c=o.z,d=[[s*l*l+a,s*l*u-i*c,s*l*c+i*u],[s*l*u+i*c,s*u*u+a,s*u*c-i*l],[s*l*c-i*u,s*u*c+i*l,s*c*c+a]],p=[d[0][0]*r.x+d[0][1]*r.y+d[0][2]*r.z,d[1][0]*r.x+d[1][1]*r.y+d[1][2]*r.z,d[2][0]*r.x+d[2][1]*r.y+d[2][2]*r.z];return new A(p[0],p[1],p[2])}toString(e=3){return`[${this.x.toFixed(e)},${this.y.toFixed(e)},${this.z.toFixed(e)}]`}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const N=A,T={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563}},x={WGS84:{ellipsoid:T.WGS84}};Object.freeze(T.WGS84),Object.freeze(x.WGS84);class M{constructor(e,t,n=0){if(isNaN(e)||null==e)throw new TypeError(`invalid lat ‘${e}’`);if(isNaN(t)||null==t)throw new TypeError(`invalid lon ‘${t}’`);if(isNaN(n)||null==n)throw new TypeError(`invalid height ‘${n}’`);this._lat=P.wrap90(Number(e)),this._lon=P.wrap180(Number(t)),this._height=Number(n)}get lat(){return this._lat}get latitude(){return this._lat}set lat(e){if(this._lat=isNaN(e)?P.wrap90(P.parse(e)):P.wrap90(Number(e)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${e}’`)}set latitude(e){if(this._lat=isNaN(e)?P.wrap90(P.parse(e)):P.wrap90(Number(e)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${e}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(e){if(this._lon=isNaN(e)?P.wrap180(P.parse(e)):P.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${e}’`)}set lng(e){if(this._lon=isNaN(e)?P.wrap180(P.parse(e)):P.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${e}’`)}set longitude(e){if(this._lon=isNaN(e)?P.wrap180(P.parse(e)):P.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${e}’`)}get height(){return this._height}set height(e){if(this._height=Number(e),isNaN(this._height))throw new TypeError(`invalid height ‘${e}’`)}get datum(){return this._datum}set datum(e){this._datum=e}static get ellipsoids(){return T}static get datums(){return x}static parse(...e){if(0==e.length)throw new TypeError("invalid (empty) point");let t,n,r;if("object"==typeof e[0]&&(1==e.length||!isNaN(parseFloat(e[1])))){const o=e[0];if("Point"==o.type&&Array.isArray(o.coordinates)?([n,t,r]=o.coordinates,r=r||0):(null!=o.latitude&&(t=o.latitude),null!=o.lat&&(t=o.lat),null!=o.longitude&&(n=o.longitude),null!=o.lng&&(n=o.lng),null!=o.lon&&(n=o.lon),null!=o.height&&(r=o.height),t=P.wrap90(P.parse(t)),n=P.wrap180(P.parse(n))),null!=e[1]&&(r=e[1]),isNaN(t)||isNaN(n))throw new TypeError(`invalid point ‘${JSON.stringify(e[0])}’`)}if("string"==typeof e[0]&&2==e[0].split(",").length&&([t,n]=e[0].split(","),t=P.wrap90(P.parse(t)),n=P.wrap180(P.parse(n)),r=e[1]||0,isNaN(t)||isNaN(n)))throw new TypeError(`invalid point ‘${e[0]}’`);if(null==t&&null==n&&([t,n]=e,t=P.wrap90(P.parse(t)),n=P.wrap180(P.parse(n)),r=e[2]||0,isNaN(t)||isNaN(n)))throw new TypeError(`invalid point ‘${e.toString()}’`);return new this(t,n,r)}toCartesian(){const e=this.datum?this.datum.ellipsoid:this.referenceFrame?this.referenceFrame.ellipsoid:T.WGS84,t=this.lat.toRadians(),n=this.lon.toRadians(),r=this.height,{a:o,f:i}=e,a=Math.sin(t),s=Math.cos(t),l=Math.sin(n),u=Math.cos(n),c=2*i-i*i,d=o/Math.sqrt(1-c*a*a);return new L((d+r)*s*u,(d+r)*s*l,(d*(1-c)+r)*a)}equals(e){if(!(e instanceof M))throw new TypeError(`invalid point ‘${e}’`);return!(Math.abs(this.lat-e.lat)>Number.EPSILON||Math.abs(this.lon-e.lon)>Number.EPSILON||Math.abs(this.height-e.height)>Number.EPSILON||this.datum!=e.datum||this.referenceFrame!=e.referenceFrame||this.epoch!=e.epoch)}toString(e="d",t=void 0,n=null){if(!["d","dm","dms","n"].includes(e))throw new RangeError(`invalid format ‘${e}’`);const r=(this.height>=0?" +":" ")+this.height.toFixed(n)+"m";return"n"==e?(null==t&&(t=4),`${this.lat.toFixed(t)}, ${this.lon.toFixed(t)}${null==n?"":r}`):`${P.toLat(this.lat,e,t)}, ${P.toLon(this.lon,e,t)}${null==n?"":r}`}}class L extends N{constructor(e,t,n){super(e,t,n)}toLatLon(e=T.WGS84){if(!e||!e.a)throw new TypeError(`invalid ellipsoid ‘${e}’`);const{x:t,y:n,z:r}=this,{a:o,b:i,f:a}=e,s=2*a-a*a,l=s/(1-s),u=Math.sqrt(t*t+n*n),c=i*r/(o*u)*(1+l*i/Math.sqrt(u*u+r*r)),d=c/Math.sqrt(1+c*c),p=d/c,h=isNaN(p)?0:Math.atan2(r+l*i*d*d*d,u-s*o*p*p*p),f=Math.atan2(n,t),m=Math.sin(h),g=u*Math.cos(h)+r*m-o*o/(o/Math.sqrt(1-s*m*m));return new M(h.toDegrees(),f.toDegrees(),g)}toString(e=0){return`[${this.x.toFixed(e)},${this.y.toFixed(e)},${this.z.toFixed(e)}]`}}const $={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563},Airy1830:{a:6377563.396,b:6356256.909,f:1/299.3249646},AiryModified:{a:6377340.189,b:6356034.448,f:1/299.3249646},Bessel1841:{a:6377397.155,b:6356078.962818,f:1/299.1528128},Clarke1866:{a:6378206.4,b:6356583.8,f:1/294.978698214},Clarke1880IGN:{a:6378249.2,b:6356515,f:1/293.466021294},GRS80:{a:6378137,b:6356752.31414,f:1/298.257222101},Intl1924:{a:6378388,b:6356911.946,f:1/297},WGS72:{a:6378135,b:6356750.5,f:1/298.26}},C={ED50:{ellipsoid:$.Intl1924,transform:[89.5,93.8,123.1,-1.2,0,0,.156]},ETRS89:{ellipsoid:$.GRS80,transform:[0,0,0,0,0,0,0]},Irl1975:{ellipsoid:$.AiryModified,transform:[-482.53,130.596,-564.557,-8.15,1.042,.214,.631]},NAD27:{ellipsoid:$.Clarke1866,transform:[8,-160,-176,0,0,0,0]},NAD83:{ellipsoid:$.GRS80,transform:[.9956,-1.9103,-.5215,-62e-5,.025915,.009426,.011599]},NTF:{ellipsoid:$.Clarke1880IGN,transform:[168,60,-320,0,0,0,0]},OSGB36:{ellipsoid:$.Airy1830,transform:[-446.448,125.157,-542.06,20.4894,-.1502,-.247,-.8421]},Potsdam:{ellipsoid:$.Bessel1841,transform:[-582,-105,-414,-8.3,1.04,.35,-3.08]},TokyoJapan:{ellipsoid:$.Bessel1841,transform:[148,-507,-685,0,0,0,0]},WGS72:{ellipsoid:$.WGS72,transform:[0,0,-4.5,-.22,0,0,.554]},WGS84:{ellipsoid:$.WGS84,transform:[0,0,0,0,0,0,0]}};Object.keys($).forEach(e=>Object.freeze($[e])),Object.keys(C).forEach(e=>{Object.freeze(C[e]),Object.freeze(C[e].transform)});class D extends M{constructor(e,t,n=0,r=C.WGS84){if(!r||null==r.ellipsoid)throw new TypeError(`unrecognised datum ‘${r}’`);super(e,t,n),this._datum=r}get datum(){return this._datum}static get ellipsoids(){return $}static get datums(){return C}static parse(...e){let t=C.WGS84;if((4==e.length||3==e.length&&"object"==typeof e[2])&&(t=e.pop()),!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);const n=super.parse(...e);return n._datum=t,n}convertDatum(e){if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);return this.toCartesian().convertDatum(e).toLatLon()}toCartesian(){const e=super.toCartesian();return new j(e.x,e.y,e.z,this.datum)}}class j extends L{constructor(e,t,n,r=void 0){if(r&&null==r.ellipsoid)throw new TypeError(`unrecognised datum ‘${r}’`);super(e,t,n),r&&(this._datum=r)}get datum(){return this._datum}set datum(e){if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);this._datum=e}toLatLon(e=void 0){e&&(console.info("datum parameter to Cartesian_Datum.toLatLon is deprecated: set datum before calling toLatLon()"),this.datum=e);const t=this.datum||C.WGS84;if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);const n=super.toLatLon(t.ellipsoid);return new D(n.lat,n.lon,n.height,this.datum)}convertDatum(e){if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);if(!this.datum)throw new TypeError("cartesian coordinate has no datum");let t=null,n=null;null!=this.datum&&this.datum!=C.WGS84||(t=this,n=e.transform),e==C.WGS84&&(t=this,n=this.datum.transform.map(e=>-e)),null==n&&(t=this.convertDatum(C.WGS84),n=e.transform);const r=t.applyTransform(n);return r.datum=e,r}applyTransform(e){const{x:t,y:n,z:r}=this,o=e[0],i=e[1],a=e[2],s=e[3]/1e6+1,l=(e[4]/3600).toRadians(),u=(e[5]/3600).toRadians(),c=(e[6]/3600).toRadians();return new j(o+t*s-n*c+r*u,i+t*c+n*s-r*l,a-t*u+n*l+r*s)}}const R={trueOrigin:{lat:49,lon:-2},falseOrigin:{easting:-4e5,northing:1e5},scaleFactor:.9996012717,ellipsoid:D.ellipsoids.Airy1830};class F{constructor(e,t){if(this.easting=Number(e),this.northing=Number(t),isNaN(e)||this.easting<0||this.easting>7e5)throw new RangeError(`invalid easting ‘${e}’`);if(isNaN(t)||this.northing<0||this.northing>13e5)throw new RangeError(`invalid northing ‘${t}’`)}toLatLon(e=D.datums.WGS84){const{easting:t,northing:n}=this,{a:r,b:o}=R.ellipsoid,i=R.trueOrigin.lat.toRadians(),a=R.trueOrigin.lon.toRadians(),s=-R.falseOrigin.easting,l=-R.falseOrigin.northing,u=R.scaleFactor,c=1-o*o/(r*r),d=(r-o)/(r+o),p=d*d,h=d*d*d;let f=i,m=0;do{f=(n-l-m)/(r*u)+f,m=o*u*((1+d+5/4*p+5/4*h)*(f-i)-(3*d+3*d*d+21/8*h)*Math.sin(f-i)*Math.cos(f+i)+(15/8*p+15/8*h)*Math.sin(2*(f-i))*Math.cos(2*(f+i))-35/24*h*Math.sin(3*(f-i))*Math.cos(3*(f+i)))}while(Math.abs(n-l-m)>=1e-5);const g=Math.cos(f),_=Math.sin(f),v=r*u/Math.sqrt(1-c*_*_),y=r*u*(1-c)/Math.pow(1-c*_*_,1.5),b=v/y-1,w=Math.tan(f),E=w*w,S=E*E,k=1/g,O=v*v*v,P=O*v*v,A=t-s,N=A*A,T=N*A,x=N*N,M=T*N;f=f-w/(2*y*v)*N+w/(24*y*O)*(5+3*E+b-9*E*b)*x-w/(720*y*P)*(61+90*E+45*S)*(x*N);const L=a+k/v*A-k/(6*O)*(v/y+2*E)*T+k/(120*P)*(5+28*E+24*S)*M-k/(P*v*v*5040)*(61+662*E+1320*S+S*E*720)*(M*N);let $=new I(f.toDegrees(),L.toDegrees(),0,D.datums.OSGB36);return e!=D.datums.OSGB36&&($=$.convertDatum(e),$=new I($.lat,$.lon,$.height,$.datum)),$}static parse(e){let t=(e=String(e).trim()).match(/^(\d+),\s*(\d+)$/);if(t)return new F(t[1],t[2]);if(t=e.match(/^[HNST][ABCDEFGHJKLMNOPQRSTUVWXYZ]\s*[0-9]+\s*[0-9]+$/i),!t)throw new Error(`invalid grid reference ‘${e}’`);let n=e.toUpperCase().charCodeAt(0)-"A".charCodeAt(0),r=e.toUpperCase().charCodeAt(1)-"A".charCodeAt(0);n>7&&n--,r>7&&r--;const o=(n-2)%5*5+r%5,i=19-5*Math.floor(n/5)-Math.floor(r/5);let a=e.slice(2).trim().split(/\s+/);if(1==a.length&&(a=[a[0].slice(0,a[0].length/2),a[0].slice(a[0].length/2)]),a[0].length!=a[1].length)throw new Error(`invalid grid reference ‘${e}’`);a[0]=a[0].padEnd(5,"0"),a[1]=a[1].padEnd(5,"0");const s=o+a[0],l=i+a[1];return new F(s,l)}toString(e=10){if(![0,2,4,6,8,10,12,14,16].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);let{easting:t,northing:n}=this;if(0==e){const e={useGrouping:!1,minimumIntegerDigits:6,maximumFractionDigits:3};return`${t.toLocaleString("en",e)},${n.toLocaleString("en",e)}`}const r=Math.floor(t/1e5),o=Math.floor(n/1e5);let i=19-o-(19-o)%5+Math.floor((r+10)/5),a=5*(19-o)%25+r%5;i>7&&i++,a>7&&a++;const s=String.fromCharCode(i+"A".charCodeAt(0),a+"A".charCodeAt(0));return t=Math.floor(t%1e5/Math.pow(10,5-e/2)),n=Math.floor(n%1e5/Math.pow(10,5-e/2)),t=t.toString().padStart(e/2,"0"),n=n.toString().padStart(e/2,"0"),`${s} ${t} ${n}`}}class I extends D{toOsGrid(){const e=this.datum==D.datums.OSGB36?this:this.convertDatum(D.datums.OSGB36),t=e.lat.toRadians(),n=e.lon.toRadians(),{a:r,b:o}=R.ellipsoid,i=R.trueOrigin.lat.toRadians(),a=R.trueOrigin.lon.toRadians(),s=-R.falseOrigin.easting,l=-R.falseOrigin.northing,u=R.scaleFactor,c=1-o*o/(r*r),d=(r-o)/(r+o),p=d*d,f=d*d*d,m=Math.cos(t),g=Math.sin(t),_=r*u/Math.sqrt(1-c*g*g),v=r*u*(1-c)/Math.pow(1-c*g*g,1.5),y=_/v-1,b=o*u*((1+d+5/4*p+5/4*f)*(t-i)-(3*d+3*d*d+21/8*f)*Math.sin(t-i)*Math.cos(t+i)+(15/8*p+15/8*f)*Math.sin(2*(t-i))*Math.cos(2*(t+i))-35/24*f*Math.sin(3*(t-i))*Math.cos(3*(t+i))),w=m*m*m,E=w*m*m,S=Math.tan(t)*Math.tan(t),k=S*S,O=n-a,P=O*O,A=P*O,N=A*O,T=N*O;let x=b+l+_/2*g*m*P+_/24*g*w*(5-S+9*y)*N+_/720*g*E*(61-58*S+k)*(T*O),M=s+_*m*O+_/6*w*(_/v-S)*A+_/120*E*(5-18*S+k+14*y-58*S*y)*T;x=Number(x.toFixed(3)),M=Number(M.toFixed(3));try{return new F(M,x)}catch(h){throw new Error(`${h.message} from (${e.lat.toFixed(6)},${e.lon.toFixed(6)}).toOsGrid()`)}}convertDatum(e){const t=super.convertDatum(e);return new I(t.lat,t.lon,t.height,t.datum)}}function B(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 G(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?B(Object(n),!0).forEach(function(t){(0,u.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function W(){var e,t=G(G({noKeyItemText:"No features displayed"},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{id:"datasets",load:(e=(0,l.A)(function*(){return(yield n.e(402).then(n.bind(n,407)).then(function(e){return e.m})).manifest}),function(){return e.apply(this,arguments)})});return t}function U(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 H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?U(Object(n),!0).forEach(function(t){(0,u.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function V(e,t={}){if(null!=e.bbox&&!0!==t.recompute)return e.bbox;const n=[1/0,1/0,-1/0,-1/0];return E(e,e=>{n[0]>e[0]&&(n[0]=e[0]),n[1]>e[1]&&(n[1]=e[1]),n[2]<e[0]&&(n[2]=e[0]),n[3]<e[1]&&(n[3]=e[1])}),n}const z="en-GB",q="cy",Y=z,K={stroke:"#00897B",fillPattern:"diagonal-cross-hatch",fillPatternForegroundColor:"#00897B",fillPatternBackgroundColor:"transparent"};function Z(e,{bbox:t}){const n=new URL(e);return n.searchParams.set("bbox",t.join(",")),{url:n.toString()}}function X(e,{bbox:t}){const n=new URL(e);return n.searchParams.set("bbox",`${t.join(",")},EPSG:4326`),{url:n.toString()}}function J(e,{bbox:t}){const n=new URL(e);return n.searchParams.set("geometry",t.join(",")),{url:n.toString()}}const Q=[{id:"sssi-england",label:"Sites of Special Scientific Interest",dynamicGeoJSON:{url:"https://environment.data.gov.uk/geoservices/datasets/ba8dc201-66ef-4983-9d46-7378af21027e/ogc/features/v1/collections/Sites_of_Special_Scientific_Interest_England/items?f=json",idProperty:"ref_code",transformRequest:Z},minZoom:12,style:K,showInKey:!0,showInMenu:!1},{id:"sssi-wales",label:"SSSI Wales",dynamicGeoJSON:{url:"https://datamap.gov.wales/geoserver/wfs?service=WFS&version=2.0.0&request=GetFeature&typeNames=inspire-nrw:NRW_SSSI&outputFormat=application/json&srsName=EPSG:4326",idProperty:"id",transformRequest:X},minZoom:12,style:K,showInKey:!1,showInMenu:!1},{id:"sssi-scotland",label:"SSSI Scotland",dynamicGeoJSON:{url:"https://services1.arcgis.com/LM9GyVFsughzHdbO/ArcGIS/rest/services/Sites_of_Special_Scientific_Interest/FeatureServer/0/query?f=geojson&where=1%3D1&geometryType=esriGeometryEnvelope&inSR=4326&spatialRel=esriSpatialRelIntersects&returnGeometry=true&outFields=*",idProperty:"OBJECTID",transformRequest:J},minZoom:12,style:K,showInKey:!1,showInMenu:!1}],ee=JSON.parse('{"dK":{"Bt":{"T":{"helpPanel":{"label":"Sut i ddefnyddio\'r map hwn","point1":"Chwilio am sir, lle neu god post","point2":"Defnyddiwch yr eiconau + a - i chwyddo i mewn ac allan","point3":"Defnyddiwch lyfliwr neu allweddlon i ganolbwyntio\'r pwynt yn y lleoliad","point4":"Cliciwch i ychwanegu\'r lleoliad i\'r map"}}},"QW":{"Tj":{"helpPanel":{"label":"Sut i ddefnyddio\'r map hwn","ledeIntro":"Gallwch ychwanegu","ledeOutro":"i\'r map.","lineText":"llinell","shapeText":"siâp","lineOrShapeText":"llinell neu siâp","typesPhrasePoint":"pwyntiau","typesPhraseLine":"lliniau","typesPhraseShape":"siâpiau","typesPhraseOr":"neu","point1":"Chwilio am sir, lle neu god post","point2":"Defnyddiwch yr eiconau + a - i chwyddo i mewn ac allan","point3":"Cliciwch ddwywaith, neu dewiswch \'Wedi gorffen\', pan fyddwch wedi","point4":"Rhowch enw i\'r lleoliad"},"typeDescriptions":{"point":"Pwynt","line":"Llinell","polygon":"Siâp"},"buttons":{"point":"Ychwanegu pwynt","line":"Ychwanegu llinell","polygon":"Ychwanegu siâp"},"itemLabel1":"Lleoliad","itemLabel2":"disgrifiad","itemUpdateLink":"Diweddaru","itemDeleteLink":"Dileu","itemFocusLink":"Dangos","itemVisuallyHidden":"lleoliad","details":{"summary":"Cyfesurynnau","type":"Math","centroidGridReference":"Canol cyfeirnod grid","firstPointGridReference":"Cyfeirnod grid y pwynt cyntaf","detailedCoordinates":"Cyfesurynnau manwl"}}}}}'),te=JSON.parse('{"dK":{"Bt":{"T":{"helpPanel":{"label":"How to use this map","point1":"Search for a place or postcode","point2":"Use the + and - icons to zoom in and out","point3":"Use a mouse or keyboard to centre the point at the location","point4":"Click to add the location to the map"}}},"QW":{"Tj":{"helpPanel":{"label":"How to use this map","ledeIntro":"You can add","ledeOutro":"to the map.","lineText":"a line","shapeText":"a shape","lineOrShapeText":"a line or shape","typesPhrasePoint":"points","typesPhraseLine":"lines","typesPhraseShape":"shapes","typesPhraseOr":"or","point1":"Search for a county, place or postcode","point2":"Use the + and - icons to zoom in and out","point3":"Double‑click, or select \'Done\', when you have finished drawing","point4":"Give the location a name"},"typeDescriptions":{"point":"Point","line":"Line","polygon":"Shape"},"buttons":{"point":"Add point","line":"Add line","polygon":"Add shape"},"itemLabel1":"Location","itemLabel2":"description","itemUpdateLink":"Update","itemDeleteLink":"Delete","itemFocusLink":"Show","itemVisuallyHidden":"location","details":{"summary":"Coordinates","type":"Type","centroidGridReference":"Centre grid reference","firstPointGridReference":"First point grid reference","detailedCoordinates":"Detailed coordinates"}}}}}');function ne(){return ne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ne.apply(null,arguments)}const re=te.dK.QW.Tj,oe=ee.dK.QW.Tj,ie={[z]:re,[q]:oe};function ae(e=Y){return ie[e]}const se={focus:!1,showLabel:!0,mobile:{slot:"drawer",open:!0,dismissible:!0,modal:!1},tablet:{slot:"drawer",open:!0,dismissible:!0,modal:!1},desktop:{slot:"drawer",open:!0,dismissible:!0,modal:!1}};function le(e,t,n,r){const o=function(e,t,n){return t&&n?e.lineOrShapeText:t?e.lineText:n?e.shapeText:""}(e,n,r),i=o?`<li>${e.point3} ${o}</li>`:"",a=function(e,t,n,r){const o=[];return t&&o.push(e.typesPhrasePoint),n&&o.push(e.typesPhraseLine),r&&o.push(e.typesPhraseShape),function(e,t,n){if(0===e.length)return"";if(1===e.length)return e[0];if(2===e.length)return`${e[0]} ${n} ${e[1]}`;const r=e.pop();return`${e.join(", ")} ${n} ${r}`}(o,0,e.typesPhraseOr)}(e,t,n,r);return`<p class="govuk-body-s govuk-!-margin-bottom-2">${e.ledeIntro} ${a} ${e.ledeOutro}</p><ul class="govuk-list govuk-list--number govuk-body-s"><li>${e.point1}</li><li>${e.point2}</li>${i}<li>${e.point4}</li></ul>`}const ue={stroke:"rgba(0, 11, 112, 1)",fill:"rgba(0, 11, 112, 0.2)",strokeWidth:2},ce={stroke:"rgb(0, 0, 0)",fill:"rgba(255, 221, 0, 0.2)",strokeWidth:2},de='<path d="M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0" /><circle cx="12" cy="10" r="3" />',pe='<path d="M19.5 7v10M4.5 7v10M7 19.5h10M7 4.5h10"/><path d="M22 18v3a1 1 0 0 1-1 1h-3a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1zm0-15v3a1 1 0 0 1-1 1h-3a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1zM7 18v3a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1zM7 3v3a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1z"/>',he='<path d="M5.706 16.294L16.294 5.706"/><path d="M21 2v3c0 .549-.451 1-1 1h-3c-.549 0-1-.451-1-1V2c0-.549.451-1 1-1h3c.549 0 1 .451 1 1zM6 17v3c0 .549-.451 1-1 1H2c-.549 0-1-.451-1-1v-3c0-.549.451-1 1-1h3c.549 0 1 .451 1 1z"/>';function fe(e){const t=e.value.trim();return{type:"FeatureCollection",features:t?JSON.parse(t):[]}}function me(e){return V(e)}function ge(e,t,r){if(!(t instanceof HTMLDivElement))return;const o=t.querySelector(".govuk-textarea");if(!(o instanceof HTMLTextAreaElement))return;const{listEl:i,mapId:a}=function(e,t){const n=document.createElement("div"),r=`geospatialmap_${t}`;n.setAttribute("id",r),n.setAttribute("class","map-container");const o=document.createElement("div"),i=`${r}_list`;return o.setAttribute("id",i),e.after(n),n.after(o),e.classList.add("js-hidden"),{mapEl:n,listEl:o,mapId:r}}(o,r),s=fe(o),u=s.features.length?me(s):void 0,c=function(){var e;return H(H({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{id:"draw",load:(e=(0,l.A)(function*(){return(yield n.e(402).then(n.bind(n,327))).manifest}),function(){return e.apply(this,arguments)})})}(),d=[c],p=t.dataset.country,h=Qe(t.dataset.maplayers),f=et(e.apiPath,p);h.includes("sssi")&&f.push(...Q),f.length&&d.push(W({datasets:f}));const m=ne({},ze,{bounds:u,plugins:d}),{map:g,interactPlugin:_}=Xe(a,m,e),v=function(e){function t(t){return e.features.find(e=>e.id===t)}return{getFeatures:function(){return e.features},getFeature:t,addFeature:function(t){t.properties.coordinateGridReference=He(t),t.properties.centroidGridReference=Ve(t),Ee(t),e.features.push(t)},updateFeature:function(e,n){const r=t(e);return r&&(r.properties.coordinateGridReference=He(r),r.properties.centroidGridReference=Ve(r),r.geometry=n,Ee(r)),r},removeFeature:function(t){const n=e.features.findIndex(e=>e.id===t);return n>-1?e.features.splice(n,1):void 0}}}(s),y=function(){let e;return{getActiveFeature:function(){return e},setActiveFeature:function(t){e=t},resetActiveFeature:function(){e=void 0}}}(),b={geometryTypes:t.dataset.geometrytypes},w=t.dataset.lang||Y,E=Se(s,g,a,i,o,b,w);!function(e){const{map:t}=e;t.on(qe.mapReady,function(e){const{map:t,activeFeatureManager:n,uiManager:r,interactPlugin:o,drawPlugin:i}=e,{toggleActionButtons:a,renderList:s,getAllowableGeometryTypes:l}=r,{resetActiveFeature:u}=n;return function(n){const c=l(),d=c.includes("point"),p=c.includes("line"),h=c.includes("shape"),{texts:f}=e.languageManager;t.addPanel("info",ne({},se,{label:f.helpPanel.label,html:le(f.helpPanel,d,p,h)})),d&&t.addButton("btnAddPoint",{variant:"tertiary",label:f.buttons.point,iconSvgContent:de,onClick:()=>{u(),a(!0),s(!0),o.enable()},mobile:{slot:"actions"},tablet:{slot:"actions"},desktop:{slot:"actions"}}),h&&t.addButton("btnAddPolygon",{variant:"tertiary",label:f.buttons.polygon,iconSvgContent:pe,onClick:()=>{u(),a(!0),s(!0),i.newPolygon(we(),ce)},mobile:{slot:"actions"},tablet:{slot:"actions"},desktop:{slot:"actions"}}),p&&t.addButton("btnAddLine",{variant:"tertiary",label:f.buttons.line,iconSvgContent:he,onClick:()=>{u(),a(!0),s(!0),i.newLine(we(),ue)},mobile:{slot:"actions"},tablet:{slot:"actions"},desktop:{slot:"actions"}}),e.mapProvider=n.map,t.on(qe.drawReady,function(e){const{featuresManager:t,uiManager:n,drawPlugin:r,map:o}=e,{renderList:i}=n,{getFeatures:a}=t;return function(){a().forEach(e=>_e(e,r,o)),i()}}(e)),t.on(qe.drawCreated,function(e){const{featuresManager:t,uiManager:n}=e,{addFeature:r}=t,{renderList:o,toggleActionButtons:i,focusDescriptionInput:a}=n;return function(e){r(ne({},e,{properties:{description:""}})),o(),i(!1),a()}}(e)),t.on(qe.drawEdited,function(e){const{featuresManager:t,activeFeatureManager:n,uiManager:r}=e,{updateFeature:o}=t,{getActiveFeature:i,resetActiveFeature:a}=n,{renderList:s,toggleActionButtons:l}=r;return function(e){const t=e,n=t.id;i()===n&&(o(n,t.geometry),s()),a(),l(!1)}}(e)),t.on(qe.drawCancelled,function(e){const{uiManager:t,activeFeatureManager:n}=e,{toggleActionButtons:r,renderList:o}=t,{resetActiveFeature:i}=n;return function(){r(!1),i(),o()}}(e)),t.on(qe.interactMarkerChange,function(e){const{featuresManager:t,activeFeatureManager:n,map:r,interactPlugin:o,uiManager:i}=e,{addFeature:a,updateFeature:s}=t,{getActiveFeature:l,resetActiveFeature:u}=n,{renderList:c,focusDescriptionInput:d,toggleActionButtons:p}=i;return function(e){const t=l();if(t){const n=s(t,{type:"Point",coordinates:e.coords});r.addMarker(t,e.coords),n&&c(),u()}else{const t=we();a({type:"Feature",properties:{description:""},geometry:{type:"Point",coordinates:e.coords},id:t}),r.addMarker(t,e.coords),c(),d()}r.removeMarker("location"),o.disable(),p(!1)}}(e));const{listEl:m}=r;m.addEventListener("click",function(e){const{map:t,mapProvider:n,featuresManager:r,activeFeatureManager:o,interactPlugin:i,uiManager:a,drawPlugin:s}=e,{getFeature:l,removeFeature:u}=r,{getActiveFeature:c,setActiveFeature:d}=o,{renderList:p,toggleActionButtons:h}=a;return function(e){const r=e.target;if(r instanceof HTMLElement){if(c())return e.preventDefault(),void e.stopPropagation();if("A"===r.tagName&&r.dataset.action&&r.dataset.id&&r.dataset.type){const{action:o,id:a,type:c}=r.dataset;"edit"===o?function(e,t){d(e),"Point"===t?(i.selectFeature({featureId:e}),i.enable()):s.editFeature(e);const r=l(e);r&&n&&ye(r,n),h(!0),p(!0)}(a,c):(e.preventDefault(),e.stopPropagation(),"delete"===o&&function(e,n){"Point"===n?(t.removeMarker(e),u(e)):(s.deleteFeature(e),u(e)),p()}(a,c))}}}}(e),!1),m.addEventListener("change",function(e){const{featuresManager:t,uiManager:n}=e,{getFeature:r}=t,{renderValue:o}=n;return function(e){e.preventDefault(),e.stopPropagation();const t=e.target;if(!(t instanceof HTMLInputElement&&t.dataset.id))return;const{id:n}=t.dataset,i=r(n);i&&(i.properties.description=t.value.trim(),o())}}(e),!1),m.addEventListener("keydown",function(e){e.target instanceof HTMLInputElement&&("Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),e.stopPropagation()))},!1)}}(e))}({languageManager:{lang:w,texts:ae(w)},map:g,featuresManager:v,activeFeatureManager:y,uiManager:E,interactPlugin:_,drawPlugin:c})}function _e(e,t,n){switch(e.geometry.type){case"Polygon":t.addFeature(ne({},e,ce));break;case"LineString":t.addFeature(ne({},e,ue));break;case"Point":n.addMarker(e.id,e.geometry.coordinates)}}function ve(e,t,n=!1,r=!1,o=Y){return`<dl class="govuk-summary-list">\n ${e.map((e,i)=>be(e,i,t,n,r,o)).join("\n")}\n </dl>`}function ye(e,t){t.fitBounds(V(e))}function be(e,t,n,r=!1,o=!1,i=Y){const a=ae(i),s=e.geometry.coordinates.flat(2),l=[];for(let h=0;h<s.length;h+=2)l.push(s.slice(h,h+2).join(", "));const u=l.map(e=>`<li>${e}</li>`).join(""),c=o?`<p class="govuk-body govuk-!-margin-bottom-0">${e.properties.description}</p>`:`<input class="govuk-input govuk-!-width-two-thirds" type="text" id="description_${t}" value="${e.properties.description}" data-id="${e.id}">`,d=`<ul class="govuk-summary-list__actions-list">${o?`<li class="govuk-summary-list__actions-list-item">\n <a class="govuk-link govuk-link--no-visited-state" href="#${n}" data-action="focus" data-id="${e.id}">${a.itemFocusLink}<span class="govuk-visually-hidden"> ${a.itemVisuallyHidden}</span></a>\n</li>`:`<li class="govuk-summary-list__actions-list-item">\n <a class="govuk-link govuk-link--no-visited-state ${r?"govuk-link--disabled":""}" href="#${n}" data-action="edit" data-id="${e.id}"\n data-type="${e.geometry.type}">${a.itemUpdateLink}<span class="govuk-visually-hidden"> ${a.itemVisuallyHidden}</span></a>\n</li><li class="govuk-summary-list__actions-list-item">\n <a class="govuk-link govuk-link--no-visited-state ${r?"govuk-link--disabled":""}" href="#" data-action="delete" data-id="${e.id}"\n data-type="${e.geometry.type}">${a.itemDeleteLink}<span class="govuk-visually-hidden"> ${a.itemVisuallyHidden}</span></a>\n</li>`}</ul>`,p=function(e,t){switch(e.geometry.type){case"Point":return t.point;case"LineString":return t.line;case"Polygon":return t.polygon}}(e,a.typeDescriptions);return`<div class="govuk-summary-list__row govuk-summary-list__row--no-border">\n <dt class="govuk-summary-list__key">\n <div class="govuk-form-group">\n <label class="govuk-label govuk-label--s" ${o?"":`for="description_${t}"`}>${a.itemLabel1} ${t+1} ${a.itemLabel2}</label>\n ${c}\n </div>\n </dt>\n <dd class="govuk-summary-list__actions">\n ${d}\n </dd>\n</div>\n<div class="govuk-summary-list__row">\n <details class="govuk-details govuk-!-margin-bottom-2">\n <summary class="govuk-details__summary">\n <span class="govuk-details__summary-text">${a.details.summary}</span>\n </summary>\n <div class="govuk-details__text">\n <dl class="govuk-summary-list">\n <div class="govuk-summary-list__row">\n <dt class="govuk-summary-list__key">${a.details.type}</dt>\n <dd class="govuk-summary-list__value">${p}</dd>\n </div>\n <div class="govuk-summary-list__row">\n <dt class="govuk-summary-list__key">${a.details.centroidGridReference}</dt>\n <dd class="govuk-summary-list__value">${e.properties.centroidGridReference}</dd>\n </div>\n <div class="govuk-summary-list__row">\n <dt class="govuk-summary-list__key">${a.details.firstPointGridReference}</dt>\n <dd class="govuk-summary-list__value">${e.properties.coordinateGridReference}</dd>\n </div>\n <div class="govuk-summary-list__row">\n <dt class="govuk-summary-list__key">${a.details.detailedCoordinates}</dt>\n <dd class="govuk-summary-list__value">\n <ol class="govuk-list govuk-list--number">${u}</ol>\n </dd>\n </div>\n </dl>\n </div>\n </details>\n</div>`}function we(){return window.crypto.randomUUID()}function Ee(e){const{geometry:t}=e;function n(e){e[0]=+e[0].toFixed(7),e[1]=+e[1].toFixed(7)}"Point"===t.type?n(t.coordinates):"LineString"===t.type?t.coordinates.forEach(n):t.coordinates.flat().forEach(n)}function Se(e,t,n,r,o,i,a=Y){function s(){return null!=i&&i.geometryTypes?i.geometryTypes.split(","):["point","line","shape"]}const l=function(e,t){return function(){t.value=JSON.stringify(e.features,null,2)}}(e,o),u=function(e,t,n,r,o=Y){return function(i=!1){const a=ve(e.features,t,i,!1,o);n.innerHTML=a,r()}}(e,n,r,l,a);return{renderList:u,renderValue:l,listEl:r,toggleActionButtons:function(e){const n=s();n.includes("point")&&t.toggleButtonState("btnAddPoint","hidden",e),n.includes("shape")&&t.toggleButtonState("btnAddPolygon","hidden",e),n.includes("line")&&t.toggleButtonState("btnAddLine","hidden",e)},focusDescriptionInput:function(){const e=r.querySelectorAll("input");if(e.length){const t=e.item(e.length-1);t.focus(),t.select()}},getAllowableGeometryTypes:s}}const ke=te.dK.Bt.T,Oe=ee.dK.Bt.T,Pe="input.govuk-input",Ae={[z]:ke,[q]:Oe};function Ne(e=Y){return Ae[e]}function Te(e,t){const n=e.trim()&&Number(e.trim()),r=t.trim()&&Number(t.trim());return n&&r&&n>=49.85&&n<=60.859&&r>=-13.687&&r<=1.767?{valid:!0,value:{lat:n,long:r}}:{valid:!1}}function xe(e,t){const n=e.trim()&&Number(e.trim()),r=t.trim()&&Number(t.trim());return n&&r&&n>=0&&n<=7e5&&r>=0&&r<=13e5?{valid:!0,value:{easting:n,northing:r}}:{valid:!1}}function Me(e){if(!e)return{valid:!1};const t=/^((([sS]|[nN])[a-hA-Hj-zJ-Z])|(([tT]|[oO])[abfglmqrvwABFGLMQRVW])|([hH][l-zL-Z])|([jJ][lmqrvwLMQRVW]))\s?(([0-9]{3})\s?([0-9]{3})|([0-9]{4})\s?([0-9]{4})|([0-9]{5})\s?([0-9]{5}))$/.exec(e);return null===t?{valid:!1}:{valid:!0,value:t[0]}}function Le(e){const t=e.querySelectorAll(Pe);if(2!==t.length)throw new Error("Expected 2 inputs for lat and long");return{latInput:t[0],longInput:t[1]}}function $e(e){const t=e.querySelectorAll(Pe);if(2!==t.length)throw new Error("Expected 2 inputs for easting and northing");return{eastingInput:t[0],northingInput:t[1]}}function Ce(e){const t=e.querySelector(Pe);if(null===t)throw new Error("Expected 1 input for osgridref");return t}function De(e){return{zoom:"16",center:e,markers:[{id:"location",coords:e}]}}function je(e,t,n){var r;if(!(t instanceof HTMLDivElement))return;const o=t.querySelector(".app-location-field-inputs");if(!(o instanceof HTMLDivElement))return;const i=t.dataset.locationtype;if(!i||!["latlongfield","eastingnorthingfield","osgridreffield"].includes(i))return;const a=document.createElement("div"),s=`map_${n}`;a.setAttribute("id",s),a.setAttribute("class","map-container");const l=null!=(r=function(e){switch(e.dataset.locationtype){case"latlongfield":return function(e){const{latInput:t,longInput:n}=Le(e),r=Te(t.value,n.value);if(r.valid)return De([r.value.long,r.value.lat])}(e);case"eastingnorthingfield":return function(e){const{eastingInput:t,northingInput:n}=$e(e),r=xe(t.value,n.value);if(!r.valid)return;const o=Ge(r.value);return De([o.long,o.lat])}(e);case"osgridreffield":return function(e){const t=Me(Ce(e).value);if(!t.valid)return;const n=Ue(t.value);return De([n.long,n.lat])}(e);default:throw new Error("Not implemented")}}(t))?r:ze;o.after(a);const u=t.dataset.country,c=Qe(t.dataset.maplayers),d=et(e.apiPath,u);c.includes("sssi")&&d.push(...Q),d.length&&(l.plugins=[W({datasets:d})]);const p=t.dataset.lang||Y,{map:h,interactPlugin:f}=Xe(s,l,e);h.on(qe.mapReady,function(e){switch(i){case"latlongfield":!function(e,t,n){const{latInput:r,longInput:o}=Le(e);function i(){const e=Te(r.value,o.value);if(e.valid){const r=[e.value.long,e.value.lat];Je(t,n,r)}}t.on(qe.interactMarkerChange,function(e){r.value=e.coords[1].toFixed(7),o.value=e.coords[0].toFixed(7)}),r.addEventListener("change",i,!1),o.addEventListener("change",i,!1)}(t,h,e.map);break;case"eastingnorthingfield":!function(e,t,n){const{eastingInput:r,northingInput:o}=$e(e);function i(){const e=xe(r.value,o.value);if(e.valid){const r=Ge(e.value),o=[r.long,r.lat];Je(t,n,o)}}t.on(qe.interactMarkerChange,function(e){const t=Be({lat:e.coords[1],long:e.coords[0]});r.value=t.easting.toFixed(0),o.value=t.northing.toFixed(0)}),r.addEventListener("change",i,!1),o.addEventListener("change",i,!1)}(t,h,e.map);break;case"osgridreffield":!function(e,t,n){const r=Ce(e);t.on(qe.interactMarkerChange,function(e){const t=We({lat:e.coords[1],long:e.coords[0]});r.value=t}),r.addEventListener("change",function(){const e=Me(r.value);if(e.valid){const r=Ue(e.value),o=[r.long,r.lat];Je(t,n,o)}},!1)}(t,h,e.map);break;default:throw new Error("Not implemented")}const n=Ne(p);h.addPanel("info",{focus:!1,showLabel:!0,label:n.helpPanel.label,mobile:{slot:"drawer",open:!0,dismissible:!0,modal:!1},tablet:{slot:"drawer",open:!0,dismissible:!0,modal:!1},desktop:{slot:"drawer",open:!0,dismissible:!0,modal:!1},html:`<ul><li>${n.helpPanel.point1}</li><li>${n.helpPanel.point2}</li><li>${n.helpPanel.point3}</li><li>${n.helpPanel.point4}</li></ul>`}),f.enable()})}function Re(){return Re=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Re.apply(null,arguments)}const Fe=169,Ie={VTS_OUTDOOR_URL:"/api/maps/vts/OS_VTS_3857_Outdoor.json",VTS_DARK_URL:"/api/maps/vts/OS_VTS_3857_Dark.json",VTS_BLACK_AND_WHITE_URL:"/api/maps/vts/OS_VTS_3857_Black_and_White.json",VTS_AERIAL_URL:"/api/maps/vts/esri-aerial.json"};function Be({lat:e,long:t}){return new I(e,t).toOsGrid()}function Ge({easting:e,northing:t}){const n=new F(e,t).toLatLon();return{lat:n.latitude,long:n.longitude}}function We({lat:e,long:t}){return new I(e,t).toOsGrid().toString()}function Ue(e){const t=F.parse(e).toLatLon();return{lat:t.latitude,long:t.longitude}}function He(e){if("Point"===e.geometry.type){const[t,n]=e.geometry.coordinates;return new I(n,t).toOsGrid().toString()}if("LineString"===e.geometry.type){const[t,n]=e.geometry.coordinates[0];return new I(n,t).toOsGrid().toString()}{const[t,n]=e.geometry.coordinates[0][0];return new I(n,t).toOsGrid().toString()}}function Ve(e){if("Point"===e.geometry.type){const[t,n]=e.geometry.coordinates;return new I(n,t).toOsGrid().toString()}{const t=S(e),[n,r]=t.geometry.coordinates;return new I(r,n).toOsGrid().toString()}}const ze={zoom:"6",center:[-2.421975,53.825564]},qe={mapReady:"map:ready",interactMarkerChange:"interact:markerchange",drawReady:"draw:ready",drawCreated:"draw:created",drawEdited:"draw:edited",drawCancelled:"draw:cancelled"};function Ye(e){return function(t){t.submitter instanceof HTMLButtonElement&&e.includes(t.submitter)||t.preventDefault()}}function Ke(e={}){const{assetPath:t="/assets",apiPath:n="/form/api",data:r=Ie}=e,o=document.querySelectorAll(".app-location-field"),i=document.querySelectorAll(".app-geospatial-field");if(o.length){const e=o[0].closest("form");if(null===e)return;const t=Array.from(e.querySelectorAll("button"));e.addEventListener("submit",Ye(t),!1)}if(i.length){const e=i[0].closest("form");if(null===e)return;const t=Array.from(e.querySelectorAll("button"));e.addEventListener("submit",Ye(t),!1)}o.forEach((e,o)=>{je({assetPath:t,apiPath:n,data:r},e,o)}),i.forEach((e,o)=>{ge({assetPath:t,apiPath:n,data:r},e,o)})}function Ze(e){return function(t,n){if(t.startsWith("https://api.os.uk")){if("Tile"===n)return{url:t.replace("https://api.os.uk/maps/vector/v1/vts",`${window.location.origin}${e}`),headers:{}};if("Style"!==n)return{url:`${e}/map-proxy?url=${encodeURIComponent(t)}`,headers:{}}}if(t.startsWith("https://raw.githubusercontent.com/OrdnanceSurvey/OS-Vector-Tile-API-Stylesheets/main")){const n=t.substring(84);return{url:`${e}/maps/vts${n}`,headers:{}}}return{url:t,headers:{}}}}function Xe(e,t,r){var o;const{assetPath:i,apiPath:a,data:u=Ie}=r,c="Ordnance survey logo",f=function(){var e;return d(d({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{id:"interact",load:(e=(0,l.A)(function*(){return(yield n.e(402).then(n.bind(n,706))).manifest}),function(){return e.apply(this,arguments)})})}({markerColor:{outdoor:"#ff0000",dark:"#00ff00"},interactionModes:["placeMarker"],multiSelect:!1});return{map:new s.I(e,Re({enableFullscreen:!0,autoColorScheme:!1,mapProvider:b(),behaviour:"inline",minZoom:6,maxZoom:18,containerHeight:"400px",enableZoomControls:!0,transformRequest:Ze(a)},t,{plugins:[p({mapStyles:[{id:"outdoor",label:"Outdoor",url:u.VTS_OUTDOOR_URL,thumbnail:`${i}/interactive-map/assets/images/outdoor-map-thumb.jpg`,logo:`${i}/interactive-map/assets/images/os-logo.svg`,logoAltText:c,attribution:`Contains OS data ${String.fromCodePoint(Fe)} Crown copyright and database rights ${(new Date).getFullYear()}`,backgroundColor:"#f5f5f0"},{id:"dark",label:"Dark",url:u.VTS_DARK_URL,mapColorScheme:"dark",appColorScheme:"dark",thumbnail:`${i}/interactive-map/assets/images/dark-map-thumb.jpg`,logo:`${i}/interactive-map/assets/images/os-logo-white.svg`,logoAltText:c,attribution:`Contains OS data ${String.fromCodePoint(Fe)} Crown copyright and database rights ${(new Date).getFullYear()}`},{id:"black-and-white",label:"Black/White",url:u.VTS_BLACK_AND_WHITE_URL,thumbnail:`${i}/interactive-map/assets/images/black-and-white-map-thumb.jpg`,logo:`${i}/interactive-map/assets/images/os-logo-black.svg`,logoAltText:c,attribution:`Contains OS data ${String.fromCodePoint(Fe)} Crown copyright and database rights ${(new Date).getFullYear()}`},{id:"aerial",label:"Aerial",url:u.VTS_AERIAL_URL,thumbnail:`${i}/interactive-map/assets/images/aerial-map-thumb.jpg`,logo:`${i}/interactive-map/assets/images/esri-logo.png`,logoAltText:"Powered by Esri",attribution:`Tiles ${String.fromCodePoint(Fe)} Esri — Source: Esri, Maxar, Earthstar Geographics, and the GIS User Community ${(new Date).getFullYear()}`}]}),f,_({osNamesURL:`${a}/geocode-proxy?query={query}`,width:"300px",showMarker:!1}),h({units:"metric"}),...null!=(o=t.plugins)?o:[]]})),interactPlugin:f}}function Je(e,t,n){e.addMarker("location",n),t.flyTo({center:n,zoom:14,essential:!0})}function Qe(e){const t=null==e?void 0:e.trim();return t?t.split(","):[]}function et(e,t){const n=[];return t&&n.push({id:"invalid-area",label:"Invalid areas",geojson:`${e}/maps/countries.geojson?omit=${t}`,showInKey:!1,showInMenu:!1,style:{stroke:"gray",strokeWidth:1,fill:"rgba(211,211,211,0.8)"}},{id:"valid-area",label:"Valid areas",geojson:`${e}/maps/countries.geojson?only=${t}`,showInKey:!1,showInMenu:!1,style:{stroke:"rgba(0,112,60,1)",strokeWidth:1}}),n}},321:(e,t,n)=>{function r(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function o(e){return function(){var t=this,n=arguments;return new Promise(function(o,i){var a=e.apply(t,n);function s(e){r(a,o,i,s,l,"next",e)}function l(e){r(a,o,i,s,l,"throw",e)}s(void 0)})}}n.d(t,{A:()=>o})},585:(e,t,n)=>{function r(e){return r="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},r(e)}function o(e,t,n){return(t=function(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,{A:()=>o})},505:(e,t,n)=>{function r(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}n.d(t,{A:()=>r})},196:(e,t,n)=>{n.d(t,{E:()=>w,I:()=>z,a:()=>M,b:()=>v,g:()=>l,h:()=>C,l:()=>b,r:()=>D,s:()=>L,t:()=>g});var r=n(321),o=n(585),i=n(505),a=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)},s=e=>{var{behaviour:t,hybridWidth:n,maxMobileWidth:r}=e;if("hybrid"!==t)return!1;var o=null!=n?n:r;return window.matchMedia("(max-width: ".concat(o,"px)")).matches},l=e=>{var{behaviour:t}=e;return["mapOnly","buttonFirst"].includes(t)||s(e)};function u(){c.forEach(e=>{!function(e,t){var n;if(!1!==e.config.manageHistoryState){e._isClosingViaBack=!1;var r=e.id===t,o="hybrid"===e.config.behaviour&&!s(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,a(e.config.mapViewQueryParam))})}var c=new Map,d=!1;function p(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 h(e){try{return JSON.parse(e)}catch(e){return console.log(e),null}}function f(e,t){e.innerHTML='<div class="im-c-error">'.concat(t,"</div>")}var m=(e,t,n,r)=>e!==t&&!(null!=n&&n.contains(e))&&e.matches(":not([aria-hidden]):not([data-fm-inert])")&&r.contains(e);function g(e){var t,{containerEl:n,isFullscreen:r,boundaryEl:o=document.body}=e,i=Array.from(o.querySelectorAll("[data-fm-inert]"));if(n&&(i=i.filter(e=>!n.contains(e))),i.forEach(e=>{e.removeAttribute("aria-hidden"),delete e.dataset.fmInert}),r){null===(t=document.activeElement)||void 0===t||t.blur();for(var a=n;null!==(s=a)&&void 0!==s&&s.parentNode&&a!==o&&a!==document.body;){var s,l=a.parentNode;for(var u of l.children)m(u,a,n,o)&&(u.setAttribute("aria-hidden","true"),u.dataset.fmInert="");a=l}}}function _(e){var{isFullscreen:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{config:n,rootEl:r}=e,{pageTitle:o,behaviour:i,containerHeight:l}=n,u=null!=t?t:function(e){var{id:t,behaviour:n,manageHistoryState:r}=e;return"mapOnly"===n||("buttonFirst"===n?!1===r||a(e.mapViewQueryParam)===t:s(e)&&a(e.mapViewQueryParam)===t)}(n);["mapOnly","buttonFirst","hybrid"].includes(i)&&(g({containerEl:r,isFullscreen:u}),document.documentElement.classList.toggle("im-is-fullscreen",u),r.classList.toggle("im-is-fullscreen",u)),["buttonFirst","hybrid"].includes(i)&&function(e){var{pageTitle:t,isFullscreen:n}=e,r=document.title.split(": "),o=r[r.length-1];document.title=n?"".concat(t,": ").concat(o):o}({pageTitle:o,isFullscreen:u});var c=u||"buttonFirst"!==i&&!s(n)?l:"auto";return r.style.height=u?"100%":c,{isFullscreen:u}}function v(){document.body.classList.remove("im-is-loading")}var y="[interactive-map]",b={warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return console.warn(y,...t)},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return console.error(y,...t)}},w={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_FULLSCREEN_CHANGE:"app:fullscreenchange",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"};function E(e){var{id:t,behaviour:n}=e,r=a(e.mapViewQueryParam)===t;return["mapOnly","inline"].includes(n)||"hybrid"===n&&!s(e)||r}var 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},k=["mapViewParamKey"];function O(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 P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach(function(t){(0,o.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var A=window.matchMedia("(pointer: coarse)").matches?"touch":"unknown",N=new Set,T=new Set;function x(e){A!==e&&(A=e,T.forEach(t=>t(e)),N.forEach(t=>t(e)))}function M(){return"unknown"===A?(A="mouse","mouse"):A}function L(e){return N.add(e),()=>{N.delete(e)}}var $=null;function C(){return null!==$}function D(e,t){if(!$)throw new Error("ReverseGeocode not initialised");return $(e,t)}class j{constructor(){this.events={},this._queued={}}on(e,t){if(this.events[e]||(this.events[e]=[]),this.events[e].push(t),void 0!==this._queued[e]){try{t(...this._queued[e])}catch(t){console.error("Error in event handler for '".concat(e,"':"),t)}delete this._queued[e]}return this}once(e,t){var n=this,r=function(){n.off(e,r),t(...arguments)};return this.on(e,r)}off(e,t){return this.events[e]?(this.events[e]=t?this.events[e].filter(e=>e!==t):[],this):this}emit(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(t=>{try{t(...n)}catch(t){console.error("Error in event handler for '".concat(e,"':"),t)}}),this):this}emitWhenReady(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(e,...n):(this._queued[e]=n,this)}destroy(){this.events={},this._queued={}}}if("undefined"!=typeof crypto&&!crypto.randomUUID){var R=0;crypto.randomUUID=()=>(R=Math.max(Date.now(),R+1),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e,t)=>{var n=t<12?Number.parseInt(R.toString(16).padStart(12,"0")[t],16):16*Math.random()|0;return("x"===e?n:3&n|8).toString(16)}))}var F=!Object.hasOwn;F&&(Object.hasOwn=(e,t)=>Object.prototype.hasOwnProperty.call(e,t));var I="undefined"!=typeof AbortController&&!Object.getPrototypeOf((new AbortController).signal).throwIfAborted;if(I&&(Object.getPrototypeOf((new AbortController).signal).throwIfAborted=function(){if(this.aborted){var e=new Error("The operation was aborted.");throw e.name="AbortError",e}}),(I||F)&&"undefined"!=typeof URL&&URL.createObjectURL){var B="text/javascript",G=["if(!Object.hasOwn){Object.hasOwn=function(o,k){return Object.prototype.hasOwnProperty.call(o,k)}}\n",I?'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(""),W=URL.createObjectURL.bind(URL);if(URL.createObjectURL=e=>(e instanceof Blob&&e.type===B&&(e=new Blob([G,e],{type:B})),W(e)),"undefined"!=typeof Worker){var U=Worker;Worker=function(e,t){if("string"==typeof e&&!e.startsWith("blob:")){var n=new Blob(["".concat(G,"importScripts(").concat(JSON.stringify(e),")")],{type:B});e=W(n)}return new U(e,t)},Worker.prototype=U.prototype}}function H(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 V(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?H(Object(n),!0).forEach(function(t){(0,o.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}class z{constructor(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((0,o.A)(this,"_openButton",null),(0,o.A)(this,"_root",null),(0,o.A)(this,"_breakpointDetector",null),(0,o.A)(this,"_interfaceDetectorCleanup",null),(0,o.A)(this,"_hybridBehaviourCleanup",null),(0,o.A)(this,"_isHidden",!1),(0,o.A)(this,"_isClosingViaBack",!1),(0,o.A)(this,"_isLoading",!1),this.id=e,this.rootEl=document.getElementById(e),!this.rootEl)throw new Error('Element with id "'.concat(e,'" not found'));this.eventBus=new j,this.config=this._buildConfig(t),function(e,t){var{mapProvider:n,deviceNotSupportedText:r}=t,o=null==n?void 0:n.checkDeviceCapabilities();return n?!(null==o||!o.isSupported)||(f(e,r),v(),b.warn(null==o?void 0:o.error),!1):(b.warn("No map provider"),!1)}(this.rootEl,this.config)&&(["buttonFirst","hybrid"].includes(this.config.behaviour)&&function(e){d||(globalThis.addEventListener("popstate",u),d=!0),c.set(e.id,e)}(this),this._breakpointDetector=function(e){var t,{maxMobileWidth:n,minDesktopWidth:r,containerEl:o}=e,i="unknown",a=new Set,s=e=>{e!==i&&(i=e,requestAnimationFrame(()=>{i===e&&a.forEach(t=>t(e))}))};if(o){var l=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(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),s=t(a);e.dataset.breakpoint=s,n(s)});return i.observe(e),{initialType:o,cleanup:()=>{i.disconnect(),e.style.containerType="",delete e.dataset.breakpoint}}}(o,e=>function(e,t,n){return e<=t?"mobile":e>=n?"desktop":"tablet"}(e,n,r),s);i=l.initialType,s(l.initialType),t=l.cleanup}else{var u=function(e,t,n){var r={mobile:window.matchMedia("(max-width: ".concat(e,"px)")),desktop:window.matchMedia("(min-width: ".concat(t,"px)"))},o=()=>{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:()=>{r.mobile.removeEventListener("change",o),r.desktop.removeEventListener("change",o)}}}(n,r,s);t=u.cleanup}return{subscribe:e=>(a.add(e),()=>a.delete(e)),getBreakpoint:()=>i,destroy:()=>{var e;null===(e=t)||void 0===e||e(),a.clear()}}}({maxMobileWidth:this.config.maxMobileWidth,minDesktopWidth:this.config.minDesktopWidth,containerEl:this.rootEl}),this._interfaceDetectorCleanup=function(){var e=window.matchMedia("(pointer: coarse)"),t=e=>{x(e.matches?"touch":"mouse")};e.addEventListener("change",t);var n=e=>{var t,n="pen"===(t=e.pointerType)||"touch"===t?"touch":"mouse"===t?"mouse":"unknown";n!==A&&(A=n,T.forEach(e=>e(n)),setTimeout(()=>{N.forEach(e=>e(n))},150))},r=e=>{"Tab"===e.key&&x("keyboard")};return window.addEventListener("pointerdown",n,{passive:!0}),window.addEventListener("keydown",r,{passive:!0}),()=>{e.removeEventListener("change",t),window.removeEventListener("pointerdown",n),window.removeEventListener("keydown",r)}}(),this._initialize())}_buildConfig(e){var t=function(e){var t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach(function(t){(0,o.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},null==e?void 0:e.dataset),n={};for(var r of Object.keys(t))n[r]=h(t[r]);return n}(this.rootEl);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{mapViewParamKey:t}=e,n=(0,i.A)(e,k),r=P(P({},S),n);return void 0!==t&&(console.warn("[InteractiveMap] mapViewParamKey is deprecated — use mapViewQueryParam instead."),r.mapViewQueryParam=t),r}(V(V({id:this.id,title:document.title},t),e))}_initialize(){["buttonFirst","hybrid"].includes(this.config.behaviour)&&(this._openButton=function(e,t,n){var{id:r,buttonText:o,buttonClass:i}=e,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 ");t.insertAdjacentHTML("beforebegin",a);var s=t.previousElementSibling,l=new URL(window.location.href);return l.searchParams.set(e.mapViewQueryParam,r),s.setAttribute("href",l.toString()),s.addEventListener("click",e=>{e.preventDefault(),n(e)}),s}(this.config,this.rootEl,e=>{this._handleButtonClick(e)})),this._hybridBehaviourCleanup=function(e){var{behaviour:t,hybridWidth:n,maxMobileWidth:r}=e.config;if("buttonFirst"===t&&e._breakpointDetector.subscribe(()=>{E(e.config)?e.loadApp():e.removeApp()}),"hybrid"===t){var o=null!=n?n:r,i=window.matchMedia("(max-width: ".concat(o,"px)")),a=()=>{if(E(e.config))if(e._isHidden)e.showApp();else if(null==e._root)e.loadApp();else{var{isFullscreen:t}=_(e);e.eventBus.emit(w.APP_FULLSCREEN_CHANGE,{isFullscreen:t})}else e._root&&e.hideApp()};return i.addEventListener("change",a),()=>i.removeEventListener("change",a)}return null}(this),E(this.config)?this.loadApp():v()}_handleButtonClick(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())}_removeMapParamFromUrl(e,t){var n=new RegExp("[?&]".concat(t,"=[^&]*(&|$)"));return n.test(e)?e.replace(n,(e,t)=>"&"===t?"?":"").replace(/\?$/,""):e}_handleExitClick(){var e;if(this.config.manageHistoryState)if(null!==(e=history.state)&&void 0!==e&&e.isBack){if(this._isClosingViaBack)return;this._isClosingViaBack=!0,history.back(),setTimeout(()=>{this._isClosingViaBack=!1},1e3)}else{this.config.preserveStateOnClose?this.hideApp():this.removeApp();var t=this.config.mapViewQueryParam,n=this._removeMapParamFromUrl(location.href,t);history.replaceState(history.state,"",n)}else this.config.preserveStateOnClose?this.hideApp():this.removeApp()}loadApp(){var e=this;return(0,r.A)(function*(){if(!e._root&&!e._isLoading){e._isLoading=!0,e._openButton&&(e._openButton.style.display="none");try{var{initialiseApp:t}=yield Promise.all([n.e(402),n.e(935)]).then(n.bind(n,967)),{MapProvider:o,mapFramework:i,mapProviderConfig:a}=yield e.config.mapProvider.load();e.config.reverseGeocodeProvider&&function(e,t){var{url:n,transformRequest:o,load:i}=e;$=function(){var e=(0,r.A)(function*(e,r){return(yield i())(n,o,t,e,r)});return function(t,n){return e.apply(this,arguments)}}()}(e.config.reverseGeocodeProvider,a.crs);var s=yield t(e.rootEl,V(V({id:e.id,initialBreakpoint:e._breakpointDetector.getBreakpoint(),initialInterfaceType:M()},e.config),{},{MapProvider:o,mapProviderConfig:a,mapFramework:i,eventBus:e.eventBus,breakpointDetector:e._breakpointDetector,handleExitClick:e._handleExitClick.bind(e)}));e._root=s._root,delete s._root;var l=new Set(["on","off","emit"]);Object.keys(s).forEach(t=>{l.has(t)||(e[t]=s[t])});var{isFullscreen:u}=_(e);e.eventBus.emit(w.APP_OPENED,{statePreserved:!1,isFullscreen:u})}catch(d){var c;throw null===(c=e._openButton)||void 0===c||c.removeAttribute("style"),f(e.rootEl,e.config.genericErrorText),console.error(d),d}finally{e._isLoading=!1}}})()}removeApp(){this._root&&"function"==typeof this.unmount&&(this.unmount(),this._root=null),this._openButton&&(this._openButton.removeAttribute("style"),this._openButton.focus()),_(this,{isFullscreen:!1}),this.eventBus.emit(w.APP_CLOSED,{statePreserved:!1}),this.eventBus.emit(w.MAP_DESTROY,{mapId:this.id})}hideApp(){this._isHidden=!0,this.rootEl.style.display="none",g({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(w.APP_CLOSED,{statePreserved:!0})}showApp(){this._isHidden=!1,this.rootEl.style.display="",this._openButton&&(this._openButton.style.display="none");var{isFullscreen:e}=_(this);this.eventBus.emit(w.APP_OPENED,{statePreserved:!0,isFullscreen:e})}destroy(){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),function(e){c.delete(e.id),0===c.size&&(globalThis.removeEventListener("popstate",u),d=!1)}(this),this.eventBus.destroy()}on(){this.eventBus.on(...arguments)}off(){this.eventBus.off(...arguments)}emit(){this.eventBus.emit(...arguments)}addMarker(e,t,n){this.eventBus.emit(w.APP_ADD_MARKER,{id:e,coords:t,options:n})}updateMarker(e,t){this.eventBus.emit(w.APP_UPDATE_MARKER,{id:e,options:t})}removeMarker(e){this.eventBus.emit(w.APP_REMOVE_MARKER,e)}setMode(e){this.eventBus.emit(w.APP_SET_MODE,e)}addButton(e,t){this.eventBus.emit(w.APP_ADD_BUTTON,{id:e,config:t})}toggleButtonState(e,t,n){this.eventBus.emit(w.APP_TOGGLE_BUTTON_STATE,{id:e,prop:t,value:n})}setContinueEnabled(e){this.toggleButtonState("journeyContinue","disabled",!e)}addPanel(e,t){this.eventBus.emit(w.APP_ADD_PANEL,{id:e,config:t})}removePanel(e){this.eventBus.emit(w.APP_REMOVE_PANEL,e)}showPanel(e){var{focus:t=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.eventBus.emit(w.APP_SHOW_PANEL,{id:e,focus:t})}hidePanel(e){this.eventBus.emit(w.APP_HIDE_PANEL,e)}addControl(e,t){this.eventBus.emit(w.APP_ADD_CONTROL,{id:e,config:t})}fitToBounds(e){this.eventBus.emitWhenReady(w.MAP_FIT_TO_BOUNDS,e)}setView(e){this.eventBus.emitWhenReady(w.MAP_SET_VIEW,e)}open(){this._isHidden?this.showApp():this._root||this.loadApp()}close(){this._handleExitClick()}}},463:(e,t,n)=>{n.d(t,{D:()=>u,m:()=>re});var r=n(452),o=n(247),i=n(585),a=n(505);function s(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var l=n(321),u={expanded:!1,showMarker:!0,placeholder:"Search",minSearchLength:3,maxSuggestions:8,noResultsMessage:"No results available",searchErrorMessage:"Sorry, there was a problem with search"};function c(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 d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach(function(t){(0,i.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var p={TOGGLE_EXPANDED:(e,t)=>d(d({},e),{},{isExpanded:t,areSuggestionsVisible:t,hasFetchedSuggestions:!1,hasSearchError:!1}),SET_KEYBOARD_FOCUS_WITHIN:(e,t)=>d(d({},e),{},{hasKeyboardFocusWithin:t,areSuggestionsVisible:!0}),INPUT_BLUR:(e,t)=>d(d({},e),{},{hasKeyboardFocusWithin:!1,areSuggestionsVisible:e.areSuggestionsVisible&&"keyboard"!==t,selectedIndex:-1}),SET_VALUE:(e,t)=>d(d({},e),{},{value:t}),UPDATE_SUGGESTIONS:(e,t)=>d(d({},e),{},{suggestions:t.results,hasFetchedSuggestions:!0,hasSearchError:t.hasError}),SHOW_SUGGESTIONS:e=>d(d({},e),{},{areSuggestionsVisible:!0,hasFetchedSuggestions:!1,hasSearchError:!1}),HIDE_SUGGESTIONS:e=>d(d({},e),{},{areSuggestionsVisible:!1,hasFetchedSuggestions:!1,hasSearchError:!1}),SET_SELECTED:(e,t)=>d(d({},e),{},{selectedIndex:t,areSuggestionsVisible:t>=0})},h=e=>{var{id:t,isExpanded:n,onClick:r,buttonRef:i,searchIcon:a,showLabel:s}=e;return(0,o.FD)("button",{"aria-label":"Open search",className:"im-c-map-button im-c-search-open-button",onClick:r,"aria-controls":"".concat(t,"-search-form"),ref:i,style:n?{display:"none"}:void 0,children:[a&&(0,o.Y)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:a}}),s&&(0,o.Y)("span",{children:"Search"})]})},f=e=>{var{id:t,pluginState:n,handleSuggestionClick:r}=e;return(0,o.Y)("ul",{id:"".concat(t,"-search-suggestions"),role:"listbox","aria-labelledby":"".concat(t,"-search"),className:"im-c-search-suggestions",style:n.areSuggestionsVisible&&n.suggestions.length?void 0:{display:"none"},children:n.suggestions.map((e,i)=>(0,o.Y)("li",{id:"".concat(t,"-search-suggestion-").concat(i),className:"im-c-search-suggestions__item",role:"option","aria-selected":n.selectedIndex===i,"aria-setsize":n.suggestions.length,"aria-posinset":i+1,onClick:()=>r(e),children:(0,o.Y)("span",{className:"im-c-search-suggestions__label",dangerouslySetInnerHTML:{__html:e.marked}})},e.id))})};function m(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}var g=(e,t,n)=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach(function(t){(0,i.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({display:e.expanded||t.isExpanded?"flex":void 0},"mobile"!==n.breakpoint&&(null==e?void 0:e.width)&&{width:e.width}),_=e=>{var{id:t,pluginState:n,pluginConfig:i,appState:a,inputRef:s,events:l,services:u,children:c}=e,{areSuggestionsVisible:d,hasFetchedSuggestions:p,hasSearchError:h,suggestions:m=[]}=n,{noResultsMessage:_,searchErrorMessage:v}=i;(0,r.vJ)(()=>{d&&p&&u.announce(((e,t,n,r)=>{if(t)return n;if(0===e)return r;var o=1===e?"result":"results";return"".concat(e," ").concat(o," available")})(m.length,h,v,_))},[m,p]);var y=["im-c-search-form",i.expanded&&"im-c-search-form--default-expanded","im-c-panel"].filter(Boolean).join(" "),b=d&&p&&(h||!m.length);return(0,o.FD)("form",{id:"".concat(t,"-search-form"),role:"search",className:y,style:g(i,n,a),"aria-controls":"".concat(t,"-viewport"),onSubmit:e=>l.handleSubmit(e,a,n),children:[(0,o.Y)("button",{type:"submit",style:{display:"none"},"aria-hidden":"true",tabIndex:-1,children:"Submit"}),(0,o.FD)("div",{className:"im-c-search__input-container".concat(n.hasKeyboardFocusWithin?" im-c-search__input-container--keyboard-focus-within":""),children:[(0,o.Y)("label",{htmlFor:"".concat(t,"-search"),className:"im-u-visually-hidden",children:i.placeholder}),(0,o.Y)("input",{id:"".concat(t,"-search"),className:"im-c-search__input",type:"search",role:"combobox","aria-expanded":n.suggestionsVisible,"aria-controls":"".concat(t,"-search-suggestions"),"aria-activedescendant":n.selectedIndex>=0?"".concat(t,"-search-suggestion-").concat(n.selectedIndex):void 0,"aria-describedby":n.value?void 0:"".concat(t,"-search-hint"),"aria-autocomplete":"list",autoComplete:"off",placeholder:i.placeholder,name:"".concat(t,"-search"),spellCheck:!1,enterKeyHint:"search",value:n.value,onClick:l.handleInputClick,onChange:l.handleInputChange,onFocus:()=>l.handleInputFocus(a.interfaceType),onBlur:()=>l.handleInputBlur(a.interfaceType),onKeyDown:e=>l.handleInputKeyDown(e,n),ref:s}),(0,o.Y)("span",{id:"".concat(t,"-search-hint"),className:"im-c-search__hint",children:"When search results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures."}),c]}),b&&(0,o.Y)("div",{className:"im-c-search__status","aria-hidden":"true",children:h?v:_}),(0,o.Y)(f,{id:t,appState:a,pluginState:n,handleSuggestionClick:e=>l.handleSuggestionClick(e,a)})]})},v=e=>{var{defaultExpanded:t,onClick:n,closeIcon:r}=e;return(0,o.Y)("button",{"aria-label":"Close search",className:"im-c-map-button im-c-search-close-button",type:"button",onClick:n,style:t?{display:"none"}:void 0,children:r&&(0,o.Y)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:r}})})},y=e=>{var{defaultExpanded:t,submitIcon:n}=e;return(0,o.Y)("button",{"aria-label":"Search",className:"im-c-map-button im-c-search-submit-button",type:"submit",style:t?void 0:{display:"none"},children:n&&(0,o.Y)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:n}})})};let b=" ";class w{static get separator(){return b}static set separator(e){b=e}static parse(e){if(!isNaN(parseFloat(e))&&isFinite(e))return Number(e);const t=String(e).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==t[t.length-1]&&t.splice(t.length-1),""==t)return NaN;let n=null;switch(t.length){case 3:n=t[0]/1+t[1]/60+t[2]/3600;break;case 2:n=t[0]/1+t[1]/60;break;case 1:n=t[0];break;default:return NaN}return/^-|[WS]$/i.test(e.trim())&&(n=-n),Number(n)}static toDms(e,t="d",n=void 0){if(isNaN(e))return null;if("string"==typeof e&&""==e.trim())return null;if("boolean"==typeof e)return null;if(e==1/0)return null;if(null==e)return null;if(void 0===n)switch(t){case"d":case"deg":n=4;break;case"dm":case"deg+min":n=2;break;case"dms":case"deg+min+sec":n=0;break;default:t="d",n=4}e=Math.abs(e);let r=null,o=null,i=null,a=null;switch(t){default:case"d":case"deg":o=e.toFixed(n),o<100&&(o="0"+o),o<10&&(o="0"+o),r=o+"°";break;case"dm":case"deg+min":o=Math.floor(e),i=(60*e%60).toFixed(n),60==i&&(i=(0).toFixed(n),o++),o=("000"+o).slice(-3),i<10&&(i="0"+i),r=o+"°"+w.separator+i+"′";break;case"dms":case"deg+min+sec":o=Math.floor(e),i=Math.floor(3600*e/60)%60,a=(3600*e%60).toFixed(n),60==a&&(a=(0).toFixed(n),i++),60==i&&(i=0,o++),o=("000"+o).slice(-3),i=("00"+i).slice(-2),a<10&&(a="0"+a),r=o+"°"+w.separator+i+"′"+w.separator+a+"″"}return r}static toLat(e,t,n){const r=w.toDms(w.wrap90(e),t,n);return null===r?"–":r.slice(1)+w.separator+(e<0?"S":"N")}static toLon(e,t,n){const r=w.toDms(w.wrap180(e),t,n);return null===r?"–":r+w.separator+(e<0?"W":"E")}static toBrng(e,t,n){const r=w.toDms(w.wrap360(e),t,n);return null===r?"–":r.replace("360","0")}static fromLocale(e){const t=123456.789.toLocaleString(),n={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(n.thousands,"⁜").replace(n.decimal,".").replace("⁜",",")}static toLocale(e){const t=123456.789.toLocaleString(),n={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(/,([0-9])/,"⁜$1").replace(".",n.decimal).replace("⁜",n.thousands)}static compassPoint(e,t=3){if(![1,2,3].includes(Number(t)))throw new RangeError(`invalid precision ‘${t}’`);e=w.wrap360(e);const n=4*2**(t-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(e*n/360)%n*16/n]}static wrap90(e){if(-90<=e&&e<=90)return e;const t=e;return 1*Math.abs(((t-90)%360+360)%360-180)-90}static wrap180(e){if(-180<=e&&e<=180)return e;const t=360;return((360*e/t-180)%t+t)%t-180}static wrap360(e){if(0<=e&&e<360)return e;const t=360;return(360*e/t%t+t)%t}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};class E{constructor(e,t,n){if(isNaN(e)||isNaN(t)||isNaN(n))throw new TypeError(`invalid vector [${e},${t},${n}]`);this.x=Number(e),this.y=Number(t),this.z=Number(n)}get length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}plus(e){if(!(e instanceof E))throw new TypeError("v is not Vector3d object");return new E(this.x+e.x,this.y+e.y,this.z+e.z)}minus(e){if(!(e instanceof E))throw new TypeError("v is not Vector3d object");return new E(this.x-e.x,this.y-e.y,this.z-e.z)}times(e){if(isNaN(e))throw new TypeError(`invalid scalar value ‘${e}’`);return new E(this.x*e,this.y*e,this.z*e)}dividedBy(e){if(isNaN(e))throw new TypeError(`invalid scalar value ‘${e}’`);return new E(this.x/e,this.y/e,this.z/e)}dot(e){if(!(e instanceof E))throw new TypeError("v is not Vector3d object");return this.x*e.x+this.y*e.y+this.z*e.z}cross(e){if(!(e instanceof E))throw new TypeError("v is not Vector3d object");const t=this.y*e.z-this.z*e.y,n=this.z*e.x-this.x*e.z,r=this.x*e.y-this.y*e.x;return new E(t,n,r)}negate(){return new E(-this.x,-this.y,-this.z)}unit(){const e=this.length;if(1==e)return this;if(0==e)return this;const t=this.x/e,n=this.y/e,r=this.z/e;return new E(t,n,r)}angleTo(e,t=void 0){if(!(e instanceof E))throw new TypeError("v is not Vector3d object");if(!(t instanceof E||null==t))throw new TypeError("n is not Vector3d object");const n=null==t||this.cross(e).dot(t)>=0?1:-1,r=this.cross(e).length*n,o=this.dot(e);return Math.atan2(r,o)}rotateAround(e,t){if(!(e instanceof E))throw new TypeError("axis is not Vector3d object");const n=t.toRadians(),r=this.unit(),o=e.unit(),i=Math.sin(n),a=Math.cos(n),s=1-a,l=o.x,u=o.y,c=o.z,d=[[s*l*l+a,s*l*u-i*c,s*l*c+i*u],[s*l*u+i*c,s*u*u+a,s*u*c-i*l],[s*l*c-i*u,s*u*c+i*l,s*c*c+a]],p=[d[0][0]*r.x+d[0][1]*r.y+d[0][2]*r.z,d[1][0]*r.x+d[1][1]*r.y+d[1][2]*r.z,d[2][0]*r.x+d[2][1]*r.y+d[2][2]*r.z];return new E(p[0],p[1],p[2])}toString(e=3){return`[${this.x.toFixed(e)},${this.y.toFixed(e)},${this.z.toFixed(e)}]`}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};const S={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563}},k={WGS84:{ellipsoid:S.WGS84}};Object.freeze(S.WGS84),Object.freeze(k.WGS84);class O{constructor(e,t,n=0){if(isNaN(e)||null==e)throw new TypeError(`invalid lat ‘${e}’`);if(isNaN(t)||null==t)throw new TypeError(`invalid lon ‘${t}’`);if(isNaN(n)||null==n)throw new TypeError(`invalid height ‘${n}’`);this._lat=w.wrap90(Number(e)),this._lon=w.wrap180(Number(t)),this._height=Number(n)}get lat(){return this._lat}get latitude(){return this._lat}set lat(e){if(this._lat=isNaN(e)?w.wrap90(w.parse(e)):w.wrap90(Number(e)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${e}’`)}set latitude(e){if(this._lat=isNaN(e)?w.wrap90(w.parse(e)):w.wrap90(Number(e)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${e}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(e){if(this._lon=isNaN(e)?w.wrap180(w.parse(e)):w.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${e}’`)}set lng(e){if(this._lon=isNaN(e)?w.wrap180(w.parse(e)):w.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${e}’`)}set longitude(e){if(this._lon=isNaN(e)?w.wrap180(w.parse(e)):w.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${e}’`)}get height(){return this._height}set height(e){if(this._height=Number(e),isNaN(this._height))throw new TypeError(`invalid height ‘${e}’`)}get datum(){return this._datum}set datum(e){this._datum=e}static get ellipsoids(){return S}static get datums(){return k}static parse(...e){if(0==e.length)throw new TypeError("invalid (empty) point");let t,n,r;if("object"==typeof e[0]&&(1==e.length||!isNaN(parseFloat(e[1])))){const o=e[0];if("Point"==o.type&&Array.isArray(o.coordinates)?([n,t,r]=o.coordinates,r=r||0):(null!=o.latitude&&(t=o.latitude),null!=o.lat&&(t=o.lat),null!=o.longitude&&(n=o.longitude),null!=o.lng&&(n=o.lng),null!=o.lon&&(n=o.lon),null!=o.height&&(r=o.height),t=w.wrap90(w.parse(t)),n=w.wrap180(w.parse(n))),null!=e[1]&&(r=e[1]),isNaN(t)||isNaN(n))throw new TypeError(`invalid point ‘${JSON.stringify(e[0])}’`)}if("string"==typeof e[0]&&2==e[0].split(",").length&&([t,n]=e[0].split(","),t=w.wrap90(w.parse(t)),n=w.wrap180(w.parse(n)),r=e[1]||0,isNaN(t)||isNaN(n)))throw new TypeError(`invalid point ‘${e[0]}’`);if(null==t&&null==n&&([t,n]=e,t=w.wrap90(w.parse(t)),n=w.wrap180(w.parse(n)),r=e[2]||0,isNaN(t)||isNaN(n)))throw new TypeError(`invalid point ‘${e.toString()}’`);return new this(t,n,r)}toCartesian(){const e=this.datum?this.datum.ellipsoid:this.referenceFrame?this.referenceFrame.ellipsoid:S.WGS84,t=this.lat.toRadians(),n=this.lon.toRadians(),r=this.height,{a:o,f:i}=e,a=Math.sin(t),s=Math.cos(t),l=Math.sin(n),u=Math.cos(n),c=2*i-i*i,d=o/Math.sqrt(1-c*a*a);return new P((d+r)*s*u,(d+r)*s*l,(d*(1-c)+r)*a)}equals(e){if(!(e instanceof O))throw new TypeError(`invalid point ‘${e}’`);return!(Math.abs(this.lat-e.lat)>Number.EPSILON||Math.abs(this.lon-e.lon)>Number.EPSILON||Math.abs(this.height-e.height)>Number.EPSILON||this.datum!=e.datum||this.referenceFrame!=e.referenceFrame||this.epoch!=e.epoch)}toString(e="d",t=void 0,n=null){if(!["d","dm","dms","n"].includes(e))throw new RangeError(`invalid format ‘${e}’`);const r=(this.height>=0?" +":" ")+this.height.toFixed(n)+"m";return"n"==e?(null==t&&(t=4),`${this.lat.toFixed(t)}, ${this.lon.toFixed(t)}${null==n?"":r}`):`${w.toLat(this.lat,e,t)}, ${w.toLon(this.lon,e,t)}${null==n?"":r}`}}class P extends E{constructor(e,t,n){super(e,t,n)}toLatLon(e=S.WGS84){if(!e||!e.a)throw new TypeError(`invalid ellipsoid ‘${e}’`);const{x:t,y:n,z:r}=this,{a:o,b:i,f:a}=e,s=2*a-a*a,l=s/(1-s),u=Math.sqrt(t*t+n*n),c=i*r/(o*u)*(1+l*i/Math.sqrt(u*u+r*r)),d=c/Math.sqrt(1+c*c),p=d/c,h=isNaN(p)?0:Math.atan2(r+l*i*d*d*d,u-s*o*p*p*p),f=Math.atan2(n,t),m=Math.sin(h),g=u*Math.cos(h)+r*m-o*o/(o/Math.sqrt(1-s*m*m));return new O(h.toDegrees(),f.toDegrees(),g)}toString(e=0){return`[${this.x.toFixed(e)},${this.y.toFixed(e)},${this.z.toFixed(e)}]`}}const A={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563},Airy1830:{a:6377563.396,b:6356256.909,f:1/299.3249646},AiryModified:{a:6377340.189,b:6356034.448,f:1/299.3249646},Bessel1841:{a:6377397.155,b:6356078.962818,f:1/299.1528128},Clarke1866:{a:6378206.4,b:6356583.8,f:1/294.978698214},Clarke1880IGN:{a:6378249.2,b:6356515,f:1/293.466021294},GRS80:{a:6378137,b:6356752.31414,f:1/298.257222101},Intl1924:{a:6378388,b:6356911.946,f:1/297},WGS72:{a:6378135,b:6356750.5,f:1/298.26}},N={ED50:{ellipsoid:A.Intl1924,transform:[89.5,93.8,123.1,-1.2,0,0,.156]},ETRS89:{ellipsoid:A.GRS80,transform:[0,0,0,0,0,0,0]},Irl1975:{ellipsoid:A.AiryModified,transform:[-482.53,130.596,-564.557,-8.15,1.042,.214,.631]},NAD27:{ellipsoid:A.Clarke1866,transform:[8,-160,-176,0,0,0,0]},NAD83:{ellipsoid:A.GRS80,transform:[.9956,-1.9103,-.5215,-62e-5,.025915,.009426,.011599]},NTF:{ellipsoid:A.Clarke1880IGN,transform:[168,60,-320,0,0,0,0]},OSGB36:{ellipsoid:A.Airy1830,transform:[-446.448,125.157,-542.06,20.4894,-.1502,-.247,-.8421]},Potsdam:{ellipsoid:A.Bessel1841,transform:[-582,-105,-414,-8.3,1.04,.35,-3.08]},TokyoJapan:{ellipsoid:A.Bessel1841,transform:[148,-507,-685,0,0,0,0]},WGS72:{ellipsoid:A.WGS72,transform:[0,0,-4.5,-.22,0,0,.554]},WGS84:{ellipsoid:A.WGS84,transform:[0,0,0,0,0,0,0]}};Object.keys(A).forEach(e=>Object.freeze(A[e])),Object.keys(N).forEach(e=>{Object.freeze(N[e]),Object.freeze(N[e].transform)});class T extends O{constructor(e,t,n=0,r=N.WGS84){if(!r||null==r.ellipsoid)throw new TypeError(`unrecognised datum ‘${r}’`);super(e,t,n),this._datum=r}get datum(){return this._datum}static get ellipsoids(){return A}static get datums(){return N}static parse(...e){let t=N.WGS84;if((4==e.length||3==e.length&&"object"==typeof e[2])&&(t=e.pop()),!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);const n=super.parse(...e);return n._datum=t,n}convertDatum(e){if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);return this.toCartesian().convertDatum(e).toLatLon()}toCartesian(){const e=super.toCartesian();return new x(e.x,e.y,e.z,this.datum)}}class x extends P{constructor(e,t,n,r=void 0){if(r&&null==r.ellipsoid)throw new TypeError(`unrecognised datum ‘${r}’`);super(e,t,n),r&&(this._datum=r)}get datum(){return this._datum}set datum(e){if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);this._datum=e}toLatLon(e=void 0){e&&(console.info("datum parameter to Cartesian_Datum.toLatLon is deprecated: set datum before calling toLatLon()"),this.datum=e);const t=this.datum||N.WGS84;if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);const n=super.toLatLon(t.ellipsoid);return new T(n.lat,n.lon,n.height,this.datum)}convertDatum(e){if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);if(!this.datum)throw new TypeError("cartesian coordinate has no datum");let t=null,n=null;null!=this.datum&&this.datum!=N.WGS84||(t=this,n=e.transform),e==N.WGS84&&(t=this,n=this.datum.transform.map(e=>-e)),null==n&&(t=this.convertDatum(N.WGS84),n=e.transform);const r=t.applyTransform(n);return r.datum=e,r}applyTransform(e){const{x:t,y:n,z:r}=this,o=e[0],i=e[1],a=e[2],s=e[3]/1e6+1,l=(e[4]/3600).toRadians(),u=(e[5]/3600).toRadians(),c=(e[6]/3600).toRadians();return new x(o+t*s-n*c+r*u,i+t*c+n*s-r*l,a-t*u+n*l+r*s)}}const M={trueOrigin:{lat:49,lon:-2},scaleFactor:.9996012717,ellipsoid:T.ellipsoids.Airy1830};class L{constructor(e,t){if(this.easting=Number(e),this.northing=Number(t),isNaN(e)||this.easting<0||this.easting>7e5)throw new RangeError(`invalid easting ‘${e}’`);if(isNaN(t)||this.northing<0||this.northing>13e5)throw new RangeError(`invalid northing ‘${t}’`)}toLatLon(e=T.datums.WGS84){const{easting:t,northing:n}=this,{a:r,b:o}=M.ellipsoid,i=M.trueOrigin.lat.toRadians(),a=M.trueOrigin.lon.toRadians(),s=-1e5,l=M.scaleFactor,u=1-o*o/(r*r),c=(r-o)/(r+o),d=c*c,p=c*c*c;let h=i,f=0;do{h=(n-s-f)/(r*l)+h,f=o*l*((1+c+5/4*d+5/4*p)*(h-i)-(3*c+3*c*c+21/8*p)*Math.sin(h-i)*Math.cos(h+i)+(15/8*d+15/8*p)*Math.sin(2*(h-i))*Math.cos(2*(h+i))-35/24*p*Math.sin(3*(h-i))*Math.cos(3*(h+i)))}while(Math.abs(n-s-f)>=1e-5);const m=Math.cos(h),g=Math.sin(h),_=r*l/Math.sqrt(1-u*g*g),v=r*l*(1-u)/Math.pow(1-u*g*g,1.5),y=_/v-1,b=Math.tan(h),w=b*b,E=w*w,S=1/m,k=_*_*_,O=k*_*_,P=t-4e5,A=P*P,N=A*P,x=A*A,L=N*A;h=h-b/(2*v*_)*A+b/(24*v*k)*(5+3*w+y-9*w*y)*x-b/(720*v*O)*(61+90*w+45*E)*(x*A);const C=a+S/_*P-S/(6*k)*(_/v+2*w)*N+S/(120*O)*(5+28*w+24*E)*L-S/(O*_*_*5040)*(61+662*w+1320*E+E*w*720)*(L*A);let D=new $(h.toDegrees(),C.toDegrees(),0,T.datums.OSGB36);return e!=T.datums.OSGB36&&(D=D.convertDatum(e),D=new $(D.lat,D.lon,D.height,D.datum)),D}static parse(e){let t=(e=String(e).trim()).match(/^(\d+),\s*(\d+)$/);if(t)return new L(t[1],t[2]);if(t=e.match(/^[HNST][ABCDEFGHJKLMNOPQRSTUVWXYZ]\s*[0-9]+\s*[0-9]+$/i),!t)throw new Error(`invalid grid reference ‘${e}’`);let n=e.toUpperCase().charCodeAt(0)-"A".charCodeAt(0),r=e.toUpperCase().charCodeAt(1)-"A".charCodeAt(0);n>7&&n--,r>7&&r--;const o=(n-2)%5*5+r%5,i=19-5*Math.floor(n/5)-Math.floor(r/5);let a=e.slice(2).trim().split(/\s+/);if(1==a.length&&(a=[a[0].slice(0,a[0].length/2),a[0].slice(a[0].length/2)]),a[0].length!=a[1].length)throw new Error(`invalid grid reference ‘${e}’`);a[0]=a[0].padEnd(5,"0"),a[1]=a[1].padEnd(5,"0");const s=o+a[0],l=i+a[1];return new L(s,l)}toString(e=10){if(![0,2,4,6,8,10,12,14,16].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);let{easting:t,northing:n}=this;if(0==e){const e={useGrouping:!1,minimumIntegerDigits:6,maximumFractionDigits:3};return`${t.toLocaleString("en",e)},${n.toLocaleString("en",e)}`}const r=Math.floor(t/1e5),o=Math.floor(n/1e5);let i=19-o-(19-o)%5+Math.floor((r+10)/5),a=5*(19-o)%25+r%5;i>7&&i++,a>7&&a++;const s=String.fromCharCode(i+"A".charCodeAt(0),a+"A".charCodeAt(0));return t=Math.floor(t%1e5/Math.pow(10,5-e/2)),n=Math.floor(n%1e5/Math.pow(10,5-e/2)),t=t.toString().padStart(e/2,"0"),n=n.toString().padStart(e/2,"0"),`${s} ${t} ${n}`}}class $ extends T{toOsGrid(){const e=this.datum==T.datums.OSGB36?this:this.convertDatum(T.datums.OSGB36),t=e.lat.toRadians(),n=e.lon.toRadians(),{a:r,b:o}=M.ellipsoid,i=M.trueOrigin.lat.toRadians(),a=M.trueOrigin.lon.toRadians(),s=M.scaleFactor,l=1-o*o/(r*r),u=(r-o)/(r+o),c=u*u,d=u*u*u,p=Math.cos(t),h=Math.sin(t),f=r*s/Math.sqrt(1-l*h*h),m=r*s*(1-l)/Math.pow(1-l*h*h,1.5),g=f/m-1,_=o*s*((1+u+5/4*c+5/4*d)*(t-i)-(3*u+3*u*u+21/8*d)*Math.sin(t-i)*Math.cos(t+i)+(15/8*c+15/8*d)*Math.sin(2*(t-i))*Math.cos(2*(t+i))-35/24*d*Math.sin(3*(t-i))*Math.cos(3*(t+i))),v=p*p*p,y=v*p*p,b=Math.tan(t)*Math.tan(t),w=b*b,E=n-a,S=E*E,k=S*E,O=k*E,P=O*E;let A=_+-1e5+f/2*h*p*S+f/24*h*v*(5-b+9*g)*O+f/720*h*y*(61-58*b+w)*(P*E),N=4e5+f*p*E+f/6*v*(f/m-b)*k+f/120*y*(5-18*b+w+14*g-58*b*g)*P;A=Number(A.toFixed(3)),N=Number(N.toFixed(3));try{return new L(N,A)}catch(t){throw new Error(`${t.message} from (${e.lat.toFixed(6)},${e.lon.toFixed(6)}).toOsGrid()`)}}convertDatum(e){const t=super.convertDatum(e);return new $(t.lat,t.lon,t.height,t.datum)}}var C;function D(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 j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D(Object(n),!0).forEach(function(t){(0,i.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var R,F=500,I=e=>{var t=e.GAZETTEER_ENTRY,n="eng"===t.NAME2_LANG?t.NAME2:t.NAME1;return e.GAZETTEER_ENTRY.NAME1=n,e.GAZETTEER_ENTRY.NAME1_LANG="eng",e},B=(e,t)=>{var n,r,o,i,{MBR_XMIN:a,MBR_YMIN:s,MBR_XMAX:l,MBR_YMAX:u,GEOMETRY_X:c,GEOMETRY_Y:d}=t;if(null==a?(n=c-F,r=d-F,o=c+F,i=d+F):(n=a,r=s,o=l,i=u),"EPSG:27700"===e)return[n,r,o,i];if("EPSG:4326"===e){var p=new L(n,r).toLatLon(),h=new L(o,i).toLatLon();return[p.lon,p.lat,h.lon,h.lat].map(e=>Math.round(1e6*e)/1e6)}throw new Error("Unsupported CRS: ".concat(e))},G=(e,t)=>{var{GEOMETRY_X:n,GEOMETRY_Y:r}=t;if("EPSG:27700"===e)return[n,r];if("EPSG:4326"===e){var o=new L(n,r).toLatLon();return[Math.round(1e6*o.lon)/1e6,Math.round(1e6*o.lat)/1e6]}throw new Error("Unsupported CRS: ".concat(e))},W=function(e,t,n,r){var o,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:8;if(!e||e.error||0===(null===(o=e.header)||void 0===o?void 0:o.totalresults))return[];var a=e.results;return a=((e,t)=>{var n=t.toLowerCase().replace(/,/g,"").split(" ");return e.map(I).filter(e=>n.some(n=>{return e.GAZETTEER_ENTRY.NAME1.toLowerCase().includes(n)||(r=(r=t).replace(/\s/g,""),/^(([A-Z]{1,2}\d[A-Z\d]?|ASCN|STHL|TDCU|BBND|[BFS]IQQ|PCRN|TKCA) ?\d[A-Z]{2}|BFPO ?\d{1,4}|(KY\d|MSR|VG|AI)[ -]?\d{4}|[A-Z]{2} ?\d{2}|GE ?CX|GIR ?0A{2}|SAN ?TA1)$/i.test(r));var r}))})(a,t),a=((e,t)=>e.filter(e=>{var n,r=null==e||null===(n=e.GAZETTEER_ENTRY)||void 0===n||null===(n=n.COUNTRY)||void 0===n?void 0:n.toLowerCase();return r&&t.includes(r)}))(a=(e=>Array.from(new Map(e.map(e=>[e.GAZETTEER_ENTRY.ID,e])).values()))(a),n),(a=a.slice(0,i)).map(e=>j(j({id:e.GAZETTEER_ENTRY.ID,bounds:B(r,e.GAZETTEER_ENTRY),point:G(r,e.GAZETTEER_ENTRY)},((e,t)=>{var n,r,o,i,{NAME1:a,COUNTY_UNITARY:l,DISTRICT_BOROUGH:u,POSTCODE_DISTRICT:c,LOCAL_TYPE:d}=t,p="".concat(["City","Postcode"].includes(d)?"":c+", ").concat("City"===d?"":l||u),h="".concat(a).concat(p?", "+p:"");return{text:h,marked:(n=h,r=e,o=r.replace(/\s+/g,"").split("").join(String.raw(C||(C=s(["s*"],["\\s*"])))),i=new RegExp("(".concat(o,")"),"i"),n.replace(i,"<mark>$1</mark>"))}})(t,e.GAZETTEER_ENTRY)),{},{type:"os-names"}))},U=e=>{var{url:t,options:n}=e;return new Request(t,n)},H=(R=(0,l.A)(function*(e,t,n){var r,o={url:null===(r=e.urlTemplate)||void 0===r?void 0:r.replace("{query}",encodeURIComponent(t)),options:{method:"GET"}};if(e.buildRequest){var i=e.buildRequest(t,()=>o);return i instanceof Request?i:U(i)}return U(n?yield n(o,t):o)}),function(e,t,n){return R.apply(this,arguments)}),V=function(){var e=(0,l.A)(function*(e,t,n){try{var r=yield fetch(t);if(!r.ok)return console.error("Fetch error for ".concat(e.label||"dataset",": ").concat(r.status)),{error:!0};var o=yield r.json();return e.parseResults(o,n)}catch(t){return console.error("Network error for ".concat(e.label||"dataset",":"),t),{error:!0}}});return function(t,n,r){return e.apply(this,arguments)}}(),z=function(){var e=(0,l.A)(function*(e,t,n,r){var o=(e=>e.replaceAll(/[^a-zA-Z0-9\s\-.,]/g,"").trim())(e),i=t.filter(t=>{var n=!t.includeRegex||t.includeRegex.test(e),r=!!t.excludeRegex&&t.excludeRegex.test(o);return n&&!r}),a=[],s=!1;for(var l of i){var u=yield H(l,o,r),c=yield V(l,u,o);if(null!=c&&c.error?s=!0:null!=c&&c.length&&(a=[...a,...c]),l.exclusive&&a.length)break}return n({type:"UPDATE_SUGGESTIONS",payload:{results:a,hasError:s}}),{results:a,sanitisedValue:o}});return function(t,n,r,o){return e.apply(this,arguments)}}();function q(e){var{mapProvider:t,bounds:n,point:r,markers:o,showMarker:i,markerOptions:a}=e;t.fitToBounds(n),i&&o.add("search",r,a)}function Y(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 K(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(n),!0).forEach(function(t){(0,i.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Z(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,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 J(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?X(Object(n),!0).forEach(function(t){(0,i.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Q(e){var t,n,r,{dispatch:o,searchContainerRef:a}=e,s=(t=t=>z(t,e.datasets,o,e.transformRequest),n=null,r=function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];clearTimeout(n),n=setTimeout(()=>{t(...r)},350)},r.cancel=()=>{n&&(clearTimeout(n),n=null)},r),c=(e=>{var{dispatch:t,services:n,viewportRef:r,mapProvider:o,markers:i,datasets:a,transformRequest:s,showMarker:c,markerOptions:d}=e,p="";return{handleOpenClick(){t({type:"TOGGLE_EXPANDED",payload:!0}),n.eventBus.emit("search:open")},handleCloseClick(e,r){t({type:"TOGGLE_EXPANDED",payload:!1}),t({type:"UPDATE_SUGGESTIONS",payload:{results:[],hasError:!1}}),t({type:"SET_VALUE",payload:""}),setTimeout(()=>r.current.focus(),0),i.remove("search"),n.eventBus.emit("search:clear"),n.eventBus.emit("search:close")},handleSubmit:(e,h,f)=>(0,l.A)(function*(){e.preventDefault();var{suggestions:l,selectedIndex:m,value:g}=f,_=null==g?void 0:g.trim();if(t({type:"SET_SELECTED",payload:-1}),t({type:"HIDE_SUGGESTIONS"}),m>=0){var v,y=l[m];return t({type:"SET_VALUE",payload:y.text}),null===(v=r.current)||void 0===v||v.focus(),q({mapProvider:o,bounds:y.bounds,point:y.point,markers:i,showMarker:c,markerOptions:d}),void n.eventBus.emit("search:match",K({query:y.text},y))}if(!((null==_?void 0:_.length)<u.minSearchLength)){var b=l;if(!l.length||_!==p){var{results:w,sanitisedValue:E}=yield z(_,a,t,s);b=w,p=E}if(b.length){var S;null===(S=r.current)||void 0===S||S.focus(),"mobile"===h.breakpoint&&(t({type:"TOGGLE_EXPANDED",payload:!1}),n.eventBus.emit("search:close"));var k=b[0];q({mapProvider:o,bounds:k.bounds,point:k.point,markers:i,showMarker:c,markerOptions:d}),n.eventBus.emit("search:match",K({query:g},k))}}})()}})(e),d=(e=>{var{dispatch:t,debouncedFetchSuggestions:n}=e;return{handleInputClick(){t({type:"SHOW_SUGGESTIONS"})},handleInputFocus(e){t({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:"keyboard"===e})},handleInputBlur(e){t({type:"INPUT_BLUR",payload:e})},handleInputChange(e){var r=e.target.value;if(t({type:"SET_VALUE",payload:r}),r.length<u.minSearchLength)return n.cancel(),t({type:"UPDATE_SUGGESTIONS",payload:{results:[],hasError:!1}}),void t({type:"HIDE_SUGGESTIONS"});t({type:"SHOW_SUGGESTIONS"}),n(r)}}})(J(J({},e),{},{debouncedFetchSuggestions:s})),p=(e=>{var{dispatch:t,services:n,mapProvider:r,markers:o,showMarker:a,markerOptions:s,viewportRef:l}=e,u=(e,t)=>{var n;return t>=0?"".concat(null===(n=e[t])||void 0===n?void 0:n.text,". ").concat(t+1," of ").concat(e.length," is highlighted"):"".concat(e.length," suggestions available")};return{handleSuggestionClick(e,u){var c;t({type:"SET_VALUE",payload:e.text}),t({type:"HIDE_SUGGESTIONS"}),t({type:"SET_SELECTED",payload:-1}),"mobile"===u.breakpoint&&(t({type:"TOGGLE_EXPANDED",payload:!1}),n.eventBus.emit("search:close")),null===(c=l.current)||void 0===c||c.focus(),q({mapProvider:r,bounds:e.bounds,point:e.point,markers:o,showMarker:a,markerOptions:s}),n.eventBus.emit("search:match",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(n),!0).forEach(function(t){(0,i.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Z(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({query:e.text},e))},handleInputKeyDown(e,r){var{suggestions:o,selectedIndex:i}=r;switch(e.key){case"ArrowDown":if(null==o||!o.length)return;if(e.preventDefault(),i<o.length-1){var a=i+1;n.announce(u(o,a)),t({type:"SET_SELECTED",payload:a}),t({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:!1})}break;case"ArrowUp":if(null==o||!o.length)return;e.preventDefault();var s=i>0?i-1:-1;n.announce(u(o,s)),t({type:"SET_SELECTED",payload:s}),t({type:"SET_KEYBOARD_FOCUS_WITHIN",payload:s<0});break;case"Escape":e.preventDefault(),t({type:"HIDE_SUGGESTIONS"}),t({type:"SET_SELECTED",payload:-1})}}}})(e);return J(J(J(J({},c),d),p),{},{handleOutside(t){a.current.contains(t.target)||(o({type:"TOGGLE_EXPANDED",payload:!1}),e.services.eventBus.emit("search:close"))}})}var ee=["marker"];function te(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}var ne={reducer:{initialState:{isExpanded:!1,hasKeyboardFocusWithin:!1,value:"",suggestions:[],areSuggestionsVisible:!1,hasFetchedSuggestions:!1,hasSearchError:!1,selectedIndex:-1},actions:p},controls:[{id:"search",mobile:{slot:"top-right",showLabel:!1},tablet:{slot:"top-left",showLabel:!1},desktop:{slot:"top-left",showLabel:!1},render:function(e){var t,{appConfig:n,iconRegistry:s,pluginState:l,pluginConfig:u,appState:c,mapState:d,services:p,mapProvider:f}=e,{id:m}=n,{interfaceType:g}=c,{expanded:b,customDatasets:w,osNamesURL:E,regions:S,maxSuggestions:k}=u,{dispatch:O,isExpanded:P,areSuggestionsVisible:A,suggestions:N}=l,T=(null==c||null===(t=c.controlConfig)||void 0===t||null===(t=t.search)||void 0===t?void 0:t[null==c?void 0:c.breakpoint].showLabel)||!1,x=s.close,M=s.search,L=(0,r.li)(null),$=(0,r.li)(null),C=(0,r.li)(null),D=c.layoutRefs.viewportRef,j=function(e){var{customDatasets:t=[],osNamesURL:n,crs:r,regions:o=["england","scotland","wales"],maxSuggestions:i}=e;return n?[{name:"osNames",urlTemplate:n,parseResults:(e,t)=>W(e,t,o,r,i),includeRegex:/[a-zA-Z0-9]/,excludeRegex:/^(?:[a-z]{2}\s*(?:\d{3}\s*\d{3}|\d{4}\s*\d{4}|\d{5}\s*\d{5})|\d+\s*,?\s*\d+)$/i},...t]:t}({customDatasets:w,osNamesURL:E,regions:S,maxSuggestions:k,crs:f.crs}),R=(0,r.li)(null);if(!R.current){var{marker:F}=u,I=(0,a.A)(u,ee);R.current=Q(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?te(Object(n),!0).forEach(function(t){(0,i.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):te(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({dispatch:O,datasets:j,services:p,mapProvider:f,viewportRef:D,searchContainerRef:L,markers:d.markers,markerOptions:F},I))}var B=R.current,G=P||!!(b&&A&&N.length);return(0,r.vJ)(()=>{var e;P&&(null===(e=C.current)||void 0===e||e.focus())},[P]),(0,r.vJ)(()=>{if(c.dispatch({type:"TOGGLE_HAS_EXCLUSIVE_CONTROL",payload:P}),G)return D.current.style.pointerEvents="none",document.addEventListener("focusin",B.handleOutside),document.addEventListener("pointerdown",B.handleOutside),()=>{D.current.style.pointerEvents="auto",document.removeEventListener("focusin",B.handleOutside),document.removeEventListener("pointerdown",B.handleOutside)}},[P,g,A,N]),(0,o.FD)("div",{className:"im-c-search",ref:L,children:[!b&&(0,o.Y)(h,{id:m,isExpanded:P,onClick:()=>B.handleOpenClick(c),buttonRef:$,searchIcon:M,showLabel:T}),(0,o.FD)(_,{id:m,pluginState:l,pluginConfig:u,appState:c,inputRef:C,events:B,services:p,children:[(0,o.Y)(v,{defaultExpanded:b,onClick:e=>B.handleCloseClick(e,$,c),closeIcon:x}),(0,o.Y)(y,{defaultExpanded:b,onClick:e=>B.handleCloseClick(e,$,c),submitIcon:M})]})]})}}],icons:[{id:"search",svgContent:'<path d="m21 21-4.34-4.34"></path><circle cx="11" cy="11" r="8"></circle>'}]},re=Object.freeze({__proto__:null,manifest:ne})}},o={};function i(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return r[e].call(n.exports,n,n.exports,i),n.exports}function a(e){const t=e.currentTarget;if("true"===t.dataset.debouncing)return e.preventDefault(),void e.stopImmediatePropagation();t.dataset.debouncing="true",setTimeout(()=>{delete t.dataset.debouncing},1e4)}function s(e){a(e)}function l(e){"Enter"!==e.key&&" "!==e.key||a(e)}i.m=r,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.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);i.r(o);var a={};e=e||[null,t({}),t([]),t(t)];for(var s=2&r&&n;("object"==typeof s||"function"==typeof s)&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach(e=>a[e]=()=>n[e]);return a.default=()=>n,i.d(o,a),o},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce((t,n)=>(i.f[n](e,t),t),[])),i.u=e=>"javascripts/"+{7:"vendor/accessible-autocomplete",264:"vendor/maplibre-gl",402:"vendor/@defra",935:"im-core"}[e]+".min.js",i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},i.l=(e,t,r,o)=>{if(n[e])n[e].push(t);else{var a,s;if(void 0!==r)for(var l=document.getElementsByTagName("script"),u=0;u<l.length;u++){var c=l[u];if(c.getAttribute("src")==e){a=c;break}}a||(s=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",i.nc&&a.setAttribute("nonce",i.nc),a.src=e),n[e]=[t];var d=(t,r)=>{a.onerror=a.onload=null,clearTimeout(p);var o=n[e];if(delete n[e],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach(e=>e(r)),t)return t(r)},p=setTimeout(d.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=d.bind(null,a.onerror),a.onload=d.bind(null,a.onload),s&&document.head.appendChild(a)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;if("string"==typeof import.meta.url&&(e=import.meta.url),!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e+"../"})(),(()=>{var e={804:0};i.f.j=(t,n)=>{var r=i.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 a=i.p+i.u(t),s=new Error;i.l(a,n=>{if(i.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),a=n&&n.target&&n.target.src;s.message="Loading chunk "+t+" failed.\n("+o+": "+a+")",s.name="ChunkLoadError",s.type=o,s.request=a,r[1](s)}},"chunk-"+t,t)}};var t=(t,n)=>{var r,o,a=n[0],s=n[1],l=n[2],u=0;if(a.some(t=>0!==e[t])){for(r in s)i.o(s,r)&&(i.m[r]=s[r]);l&&l(i)}for(t&&t(n);u<a.length;u++)o=a[u],i.o(e,o)&&e[o]&&e[o][0](),e[o]=0},n=self.webpackChunk=self.webpackChunk||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();const u="aria-describedby",c="error-summary-title";function d(e,t,n){var r;const o=document.getElementById("uploadedFilesContainer"),i=o?o.closest("form"):null;if(!(i&&i instanceof HTMLFormElement))return;const a=i.querySelector("p.govuk-body");if(!a)return;const s=function(e,t){let n=null==e?void 0:e.querySelector("#statusInformation");if(!n){n=document.createElement("div"),n.id="statusInformation",n.className="govuk-visually-hidden",n.setAttribute("aria-live","polite");try{!function(e,t,n){var r;null!=t&&t.nextSibling&&t.parentNode===e?e.insertBefore(n,t.nextSibling):(null!=(r=null==t?void 0:t.parentNode)?r:e).appendChild(n)}(e,t,n)}catch(r){try{null==e||e.appendChild(n)}catch(o){document.body.appendChild(n)}}}return n}(i,a),l=n.querySelector('input[type="file"]');l&&l.setAttribute(u,"statusInformation");const c=function(e,t){let n=e.querySelector("dl.govuk-summary-list");if(!n){n=document.createElement("dl"),n.className="govuk-summary-list govuk-summary-list--long-key";const r=e.querySelector(".govuk-button-group");r?e.insertBefore(n,r):e.insertBefore(n,t.nextSibling)}return n}(i,a),d=document.querySelector(`[data-filename="${null==e?void 0:e.name}"]`);d&&d.remove();const p=function(e,t){var n,r;const o=document.createElement("div");return o.className="govuk-summary-list__row",o.setAttribute("data-filename",null!=(n=null==e?void 0:e.name)?n:""),o.innerHTML=`\n <dt class="govuk-summary-list__key">\n ${null!=(r=null==e?void 0:e.name)?r:""}\n </dt>\n <dd class="govuk-summary-list__value">\n <strong class="govuk-tag govuk-tag--yellow">${t}</strong>\n </dd>\n <dd class="govuk-summary-list__actions">\n </dd>\n `,o}(e,t);c.insertBefore(p,c.firstChild),s.textContent=`${null!=(r=null==e?void 0:e.name)?r:""} ${t}`}function p(e,t,n){if(document.querySelector(".govuk-error-summary"))return void(document.getElementById(c)?n.setAttribute(u,c):n.removeAttribute(u));t&&(t.innerHTML=`\n <div class="govuk-error-summary" data-module="govuk-error-summary">\n <div role="alert">\n <h2 class="govuk-error-summary__title" id="${c}">\n There is a problem\n </h2>\n <div class="govuk-error-summary__body">\n <ul class="govuk-list govuk-error-summary__list">\n <li>\n <a href="#file-upload">${e}</a>\n </li>\n </ul>\n </div>\n </div>\n </div>\n `,n.setAttribute(u,c));const r=n.closest(".govuk-form-group");if(r){r.classList.add("govuk-form-group--error"),n.classList.add("govuk-file-upload--error");const t=n.id;let o=document.getElementById(`${t}-error`);o||(o=document.createElement("p"),o.id=`${t}-error`,o.className="govuk-error-message",o.innerHTML=`<span class="govuk-visually-hidden">Error:</span> ${e}`,r.insertBefore(o,n)),n.setAttribute(u,`error-summary-title ${t}-error`)}}function h(){window.history.replaceState(null,"",window.location.href),window.location.href=window.location.pathname}function f(){var e,t,n;const r=document.querySelector('form:has(input[type="file"])'),o=r?r.querySelector('input[type="file"]'):null,i=r?r.querySelector(".upload-file-button"):null,a=null!=(e=Array.from(document.querySelectorAll("button.govuk-button")).find(e=>"Continue"===e.textContent.trim()))?e:null,s=document.querySelector(".govuk-error-summary-container");if(!r||!o||!i)return;const l=null!=(t=null==(n=document.getElementById("uploadedFilesContainer"))?void 0:n.dataset.uploadinglabel)?t:"Uploading…",u=r;let c=[],f=!1;const m=u.dataset.uploadId;o.addEventListener("change",()=>{s&&(s.innerHTML=""),o.files&&o.files.length>0&&(c=Array.from(o.files),i.click())}),i.addEventListener("click",e=>{if(0===c.length)return e.preventDefault(),void p("Select a file",s,o);f?e.preventDefault():(f=!0,function(e,t,n,r,o,i){for(let a=o.length-1;a>=0;a--)d(o[a],i,e);t.focus(),setTimeout(()=>{t.disabled=!0,n.disabled=!0,r.disabled=!0},100)}(u,o,i,a,c,l),function(e,t,n,r,o,i){var a;if(!t.action||!i)return!1;e.preventDefault();const s=new FormData(t),l=!!t.dataset.proxyUrl,u=null!=(a=t.dataset.proxyUrl)?a:t.action,c={method:"POST",body:s,redirect:l?"follow":"manual"};l&&(c.mode="no-cors"),fetch(u,c).then(()=>{!function(e){let t=0;const n=setInterval(()=>{if(t++,t>=300)return clearInterval(n),void h();const r=function(e,t){const n=e.replace(/\/preview\/(draft|live)/g,"").replace(/\/{2,}/g,"/").replace(/\/$/,"").split("/").filter(Boolean);return`${n.length>2?`/${n.slice(0,n.length-2).join("/")}`:""}/upload-status/${t}`}(window.location.pathname,e);fetch(r,{headers:{Accept:"application/json"}}).then(e=>{if(!e.ok)throw new Error("Network response was not ok");return e.json()}).then(e=>{"ready"===e.uploadStatus&&(clearInterval(n),h())}).catch(()=>{clearInterval(n),h()})},1e3)}(i)}).catch(()=>(n.disabled=!1,r.disabled=!1,p("There was a problem uploading the file",o,n),null))}(e,u,o,i,s,m))})}function m(e,t={}){var n;const r=e.getAttribute("tabindex");function o(){var n;null==(n=t.onBlur)||n.call(e),r||e.removeAttribute("tabindex")}r||e.setAttribute("tabindex","-1"),e.addEventListener("focus",function(){e.addEventListener("blur",o,{once:!0})},{once:!0}),null==(n=t.onBeforeFocus)||n.call(e),e.focus()}function g(e=document.body){return!!e&&e.classList.contains("govuk-frontend-supported")}function _(e){return!!e&&"object"==typeof e&&!function(e){return Array.isArray(e)}(e)}function v(e){return!!e&&(e instanceof Element||e instanceof Document)}function y(e,t){return`${e.moduleName}: ${t}`}class b extends Error{constructor(...e){super(...e),this.name="GOVUKFrontendError"}}class w extends b{constructor(e=document.body){const t="noModule"in HTMLScriptElement.prototype?'GOV.UK Frontend initialised without `<body class="govuk-frontend-supported">` from template `<script>` snippet':"GOV.UK Frontend is not supported in this browser";super(e?t:'GOV.UK Frontend initialised without `<script type="module">`'),this.name="SupportError"}}class E extends b{constructor(...e){super(...e),this.name="ConfigError"}}class S extends b{constructor(e){let t="string"==typeof e?e:"";if(_(e)){const{component:n,identifier:r,element:o,expectedType:i}=e;t=r,t+=o?` is not of type ${null!=i?i:"HTMLElement"}`:" not found",n&&(t=y(n,t))}super(t),this.name="ElementError"}}class k extends b{constructor(e){super("string"==typeof e?e:y(e,"Root element (`$root`) already initialised")),this.name="InitError"}}class O{get $root(){return this._$root}constructor(e){this._$root=void 0;const t=this.constructor;if("string"!=typeof t.moduleName)throw new k("`moduleName` not defined in component");if(!(e instanceof t.elementType))throw new S({element:e,component:t,identifier:"Root element (`$root`)",expectedType:t.elementType.name});this._$root=e,t.checkSupport(),this.checkInitialised();const n=t.moduleName;this.$root.setAttribute(`data-${n}-init`,"")}checkInitialised(){const e=this.constructor,t=e.moduleName;if(t&&function(e,t){return e instanceof HTMLElement&&e.hasAttribute(`data-${t}-init`)}(this.$root,t))throw new k(e)}static checkSupport(){if(!g())throw new w}}O.elementType=HTMLElement;const P=Symbol.for("configOverride");class A extends O{[P](e){return{}}get config(){return this._config}constructor(e,t){super(e),this._config=void 0;const n=this.constructor;if(!_(n.defaults))throw new E(y(n,"Config passed as parameter into constructor but no defaults defined"));const r=function(e,t){if(!_(e.schema))throw new E(y(e,"Config passed as parameter into constructor but no schema defined"));const n={},r=Object.entries(e.schema.properties);for(const o of r){const[r,i]=o,a=r.toString();a in t&&(n[a]=N(t[a],i)),"object"===(null==i?void 0:i.type)&&(n[a]=x(e.schema,t,r))}return n}(n,this._$root.dataset);this._config=T(n.defaults,null!=t?t:{},this[P](r),r)}}function N(e,t){const n=e?e.trim():"";let r,o=null==t?void 0:t.type;switch(o||(["true","false"].includes(n)&&(o="boolean"),n.length>0&&isFinite(Number(n))&&(o="number")),o){case"boolean":r="true"===n;break;case"number":r=Number(n);break;default:r=e}return r}function T(...e){const t={};for(const n of e)for(const e of Object.keys(n)){const r=t[e],o=n[e];_(r)&&_(o)?t[e]=T(r,o):t[e]=o}return t}function x(e,t,n){const r=e.properties[n];if("object"!==(null==r?void 0:r.type))return;const o={[n]:{}};for(const[i,a]of Object.entries(t)){let e=o;const t=i.split(".");for(const[r,o]of t.entries())_(e)&&(r<t.length-1?(_(e[o])||(e[o]={}),e=e[o]):i!==n&&(e[o]=N(a)))}return o[n]}function M(e,t,n){let r;const o=function(e){let t,n=document;if(_(e)){const r=e;(v(r.scope)||null===r.scope)&&(n=r.scope),"function"==typeof r.onError&&(t=r.onError)}return v(e)?n=e:null===e?n=null:"function"==typeof e&&(t=e),{scope:n,onError:t}}(n);try{var i;if(!g())throw new w;if(null===o.scope)throw new S({element:o.scope,component:e,identifier:"Scope element (`$scope`)"});r=null==(i=o.scope)?void 0:i.querySelectorAll(`[data-module="${e.moduleName}"]`)}catch(a){return o.onError?o.onError(a,{component:e,config:t}):console.log(a),[]}return Array.from(null!=r?r:[]).map(n=>{try{return void 0!==t?new e(n,t):new e(n)}catch(a){return o.onError?o.onError(a,{element:n,component:e,config:t}):console.log(a),null}}).filter(Boolean)}class L extends A{constructor(e,t={}){super(e,t),this.debounceFormSubmitTimer=null,this.$root.addEventListener("keydown",e=>this.handleKeyDown(e)),this.$root.addEventListener("click",e=>this.debounce(e))}handleKeyDown(e){const t=e.target;" "===e.key&&t instanceof HTMLElement&&"button"===t.getAttribute("role")&&(e.preventDefault(),t.click())}debounce(e){if(this.config.preventDoubleClick)return this.debounceFormSubmitTimer?(e.preventDefault(),!1):void(this.debounceFormSubmitTimer=window.setTimeout(()=>{this.debounceFormSubmitTimer=null},1e3))}}function $(e,t){const n=e.closest(`[${t}]`);return n?n.getAttribute(t):null}L.moduleName="govuk-button",L.defaults=Object.freeze({preventDoubleClick:!1}),L.schema=Object.freeze({properties:{preventDoubleClick:{type:"boolean"}}});class C{constructor(e={},t={}){var n;this.translations=void 0,this.locale=void 0,this.translations=e,this.locale=null!=(n=t.locale)?n:document.documentElement.lang||"en"}t(e,t){if(!e)throw new Error("i18n: lookup key missing");let n=this.translations[e];if("number"==typeof(null==t?void 0:t.count)&&_(n)){const r=n[this.getPluralSuffix(e,t.count)];r&&(n=r)}if("string"==typeof n){if(n.match(/%{(.\S+)}/)){if(!t)throw new Error("i18n: cannot replace placeholders in string if no option data provided");return this.replacePlaceholders(n,t)}return n}return e}replacePlaceholders(e,t){const n=Intl.NumberFormat.supportedLocalesOf(this.locale).length?new Intl.NumberFormat(this.locale):void 0;return e.replace(/%{(.\S+)}/g,function(e,r){if(Object.prototype.hasOwnProperty.call(t,r)){const e=t[r];return!1===e||"number"!=typeof e&&"string"!=typeof e?"":"number"==typeof e?n?n.format(e):`${e}`:e}throw new Error(`i18n: no data found to replace ${e} placeholder in string`)})}hasIntlPluralRulesSupport(){return Boolean("PluralRules"in window.Intl&&Intl.PluralRules.supportedLocalesOf(this.locale).length)}getPluralSuffix(e,t){if(t=Number(t),!isFinite(t))return"other";const n=this.translations[e],r=this.hasIntlPluralRulesSupport()?new Intl.PluralRules(this.locale).select(t):"other";if(_(n)){if(r in n)return r;if("other"in n)return console.warn(`i18n: Missing plural form ".${r}" for "${this.locale}" locale. Falling back to ".other".`),"other"}throw new Error(`i18n: Plural form ".other" is required for "${this.locale}" locale`)}}class D extends A{[P](e){let t={};return("maxwords"in e||"maxlength"in e)&&(t={maxlength:void 0,maxwords:void 0}),t}constructor(e,t={}){var n,r;super(e,t),this.$textarea=void 0,this.$visibleCountMessage=void 0,this.$screenReaderCountMessage=void 0,this.lastInputTimestamp=null,this.lastInputValue="",this.valueChecker=null,this.i18n=void 0,this.maxLength=void 0;const o=this.$root.querySelector(".govuk-js-character-count");if(!(o instanceof HTMLTextAreaElement||o instanceof HTMLInputElement))throw new S({component:D,element:o,expectedType:"HTMLTextareaElement or HTMLInputElement",identifier:"Form field (`.govuk-js-character-count`)"});const i=function(e,t){const n=[];for(const[r,o]of Object.entries(e)){const e=[];if(Array.isArray(o)){for(const{required:n,errorMessage:r}of o)n.every(e=>!!t[e])||e.push(r);"anyOf"!==r||o.length-e.length>=1||n.push(...e)}}return n}(D.schema,this.config);if(i[0])throw new E(y(D,i[0]));this.i18n=new C(this.config.i18n,{locale:$(this.$root,"lang")}),this.maxLength=null!=(n=null!=(r=this.config.maxwords)?r:this.config.maxlength)?n:1/0,this.$textarea=o;const a=`${this.$textarea.id}-info`,s=document.getElementById(a);if(!s)throw new S({component:D,element:s,identifier:`Count message (\`id="${a}"\`)`});this.$errorMessage=this.$root.querySelector(".govuk-error-message"),s.textContent.match(/^\s*$/)&&(s.textContent=this.i18n.t("textareaDescription",{count:this.maxLength})),this.$textarea.insertAdjacentElement("afterend",s);const l=document.createElement("div");l.className="govuk-character-count__sr-status govuk-visually-hidden",l.setAttribute("aria-live","polite"),this.$screenReaderCountMessage=l,s.insertAdjacentElement("afterend",l);const u=document.createElement("div");u.className=s.className,u.classList.add("govuk-character-count__status"),u.setAttribute("aria-hidden","true"),this.$visibleCountMessage=u,s.insertAdjacentElement("afterend",u),s.classList.add("govuk-visually-hidden"),this.$textarea.removeAttribute("maxlength"),this.bindChangeEvents(),window.addEventListener("pageshow",()=>this.updateCountMessage()),this.updateCountMessage()}bindChangeEvents(){this.$textarea.addEventListener("keyup",()=>this.handleKeyUp()),this.$textarea.addEventListener("focus",()=>this.handleFocus()),this.$textarea.addEventListener("blur",()=>this.handleBlur())}handleKeyUp(){this.updateVisibleCountMessage(),this.lastInputTimestamp=Date.now()}handleFocus(){this.valueChecker=window.setInterval(()=>{(!this.lastInputTimestamp||Date.now()-500>=this.lastInputTimestamp)&&this.updateIfValueChanged()},1e3)}handleBlur(){this.valueChecker&&window.clearInterval(this.valueChecker)}updateIfValueChanged(){this.$textarea.value!==this.lastInputValue&&(this.lastInputValue=this.$textarea.value,this.updateCountMessage())}updateCountMessage(){this.updateVisibleCountMessage(),this.updateScreenReaderCountMessage()}updateVisibleCountMessage(){const e=this.maxLength-this.count(this.$textarea.value)<0;this.$visibleCountMessage.classList.toggle("govuk-character-count__message--disabled",!this.isOverThreshold()),this.$errorMessage||this.$textarea.classList.toggle("govuk-textarea--error",e),this.$visibleCountMessage.classList.toggle("govuk-error-message",e),this.$visibleCountMessage.classList.toggle("govuk-hint",!e),this.$visibleCountMessage.textContent=this.getCountMessage()}updateScreenReaderCountMessage(){this.isOverThreshold()?this.$screenReaderCountMessage.removeAttribute("aria-hidden"):this.$screenReaderCountMessage.setAttribute("aria-hidden","true"),this.$screenReaderCountMessage.textContent=this.getCountMessage()}count(e){var t;return this.config.maxwords?(null!=(t=e.match(/\S+/g))?t:[]).length:e.length}getCountMessage(){const e=this.maxLength-this.count(this.$textarea.value),t=this.config.maxwords?"words":"characters";return this.formatCountMessage(e,t)}formatCountMessage(e,t){if(0===e)return this.i18n.t(`${t}AtLimit`);const n=e<0?"OverLimit":"UnderLimit";return this.i18n.t(`${t}${n}`,{count:Math.abs(e)})}isOverThreshold(){if(!this.config.threshold)return!0;const e=this.count(this.$textarea.value);return this.maxLength*this.config.threshold/100<=e}}D.moduleName="govuk-character-count",D.defaults=Object.freeze({threshold:0,i18n:{charactersUnderLimit:{one:"You have %{count} character remaining",other:"You have %{count} characters remaining"},charactersAtLimit:"You have 0 characters remaining",charactersOverLimit:{one:"You have %{count} character too many",other:"You have %{count} characters too many"},wordsUnderLimit:{one:"You have %{count} word remaining",other:"You have %{count} words remaining"},wordsAtLimit:"You have 0 words remaining",wordsOverLimit:{one:"You have %{count} word too many",other:"You have %{count} words too many"},textareaDescription:{other:""}}}),D.schema=Object.freeze({properties:{i18n:{type:"object"},maxwords:{type:"number"},maxlength:{type:"number"},threshold:{type:"number"}},anyOf:[{required:["maxwords"],errorMessage:'Either "maxlength" or "maxwords" must be provided'},{required:["maxlength"],errorMessage:'Either "maxlength" or "maxwords" must be provided'}]});class j extends O{constructor(e){super(e),this.$inputs=void 0;const t=this.$root.querySelectorAll('input[type="checkbox"]');if(!t.length)throw new S({component:j,identifier:'Form inputs (`<input type="checkbox">`)'});this.$inputs=t,this.$inputs.forEach(e=>{const t=e.getAttribute("data-aria-controls");if(t){if(!document.getElementById(t))throw new S({component:j,identifier:`Conditional reveal (\`id="${t}"\`)`});e.setAttribute("aria-controls",t),e.removeAttribute("data-aria-controls")}}),window.addEventListener("pageshow",()=>this.syncAllConditionalReveals()),this.syncAllConditionalReveals(),this.$root.addEventListener("click",e=>this.handleClick(e))}syncAllConditionalReveals(){this.$inputs.forEach(e=>this.syncConditionalRevealWithInputState(e))}syncConditionalRevealWithInputState(e){const t=e.getAttribute("aria-controls");if(!t)return;const n=document.getElementById(t);if(null!=n&&n.classList.contains("govuk-checkboxes__conditional")){const t=e.checked;e.setAttribute("aria-expanded",t.toString()),n.classList.toggle("govuk-checkboxes__conditional--hidden",!t)}}unCheckAllInputsExcept(e){document.querySelectorAll(`input[type="checkbox"][name="${e.name}"]`).forEach(t=>{e.form===t.form&&t!==e&&(t.checked=!1,this.syncConditionalRevealWithInputState(t))})}unCheckExclusiveInputs(e){document.querySelectorAll(`input[data-behaviour="exclusive"][type="checkbox"][name="${e.name}"]`).forEach(t=>{e.form===t.form&&(t.checked=!1,this.syncConditionalRevealWithInputState(t))})}handleClick(e){const t=e.target;t instanceof HTMLInputElement&&"checkbox"===t.type&&(t.getAttribute("aria-controls")&&this.syncConditionalRevealWithInputState(t),t.checked&&("exclusive"===t.getAttribute("data-behaviour")?this.unCheckAllInputsExcept(t):this.unCheckExclusiveInputs(t)))}}j.moduleName="govuk-checkboxes";class R extends A{constructor(e,t={}){super(e,t),this.config.disableAutoFocus||m(this.$root),this.$root.addEventListener("click",e=>this.handleClick(e))}handleClick(e){const t=e.target;t&&this.focusTarget(t)&&e.preventDefault()}focusTarget(e){if(!(e instanceof HTMLAnchorElement))return!1;const t=e.hash.replace("#","");if(!t)return!1;const n=document.getElementById(t);if(!n)return!1;const r=this.getAssociatedLegendOrLabel(n);return!!r&&(r.scrollIntoView(),n.focus({preventScroll:!0}),!0)}getAssociatedLegendOrLabel(e){var t;const n=e.closest("fieldset");if(n){const t=n.getElementsByTagName("legend");if(t.length){const n=t[0];if(e instanceof HTMLInputElement&&("checkbox"===e.type||"radio"===e.type))return n;const r=n.getBoundingClientRect().top,o=e.getBoundingClientRect();if(o.height&&window.innerHeight&&o.top+o.height-r<window.innerHeight/2)return n}}return null!=(t=document.querySelector(`label[for='${e.getAttribute("id")}']`))?t:e.closest("label")}}R.moduleName="govuk-error-summary",R.defaults=Object.freeze({disableAutoFocus:!1}),R.schema=Object.freeze({properties:{disableAutoFocus:{type:"boolean"}}});class F extends O{constructor(e){super(e),this.$menuButton=void 0,this.$menu=void 0,this.menuIsOpen=!1,this.mql=null;const t=this.$root.querySelector(".govuk-js-header-toggle");if(!t)return this;this.$root.classList.add("govuk-header--with-js-navigation");const n=t.getAttribute("aria-controls");if(!n)throw new S({component:F,identifier:'Navigation button (`<button class="govuk-js-header-toggle">`) attribute (`aria-controls`)'});const r=document.getElementById(n);if(!r)throw new S({component:F,element:r,identifier:`Navigation (\`<ul id="${n}">\`)`});this.$menu=r,this.$menuButton=t,this.setupResponsiveChecks(),this.$menuButton.addEventListener("click",()=>this.handleMenuButtonClick())}setupResponsiveChecks(){const e=function(){const e="--govuk-breakpoint-desktop";return{property:e,value:window.getComputedStyle(document.documentElement).getPropertyValue(e)||void 0}}();if(!e.value)throw new S({component:F,identifier:`CSS custom property (\`${e.property}\`) on pseudo-class \`:root\``});this.mql=window.matchMedia(`(min-width: ${e.value})`),"addEventListener"in this.mql?this.mql.addEventListener("change",()=>this.checkMode()):this.mql.addListener(()=>this.checkMode()),this.checkMode()}checkMode(){this.mql&&this.$menu&&this.$menuButton&&(this.mql.matches?(this.$menu.removeAttribute("hidden"),this.$menuButton.setAttribute("hidden","")):(this.$menuButton.removeAttribute("hidden"),this.$menuButton.setAttribute("aria-expanded",this.menuIsOpen.toString()),this.menuIsOpen?this.$menu.removeAttribute("hidden"):this.$menu.setAttribute("hidden","")))}handleMenuButtonClick(){this.menuIsOpen=!this.menuIsOpen,this.checkMode()}}F.moduleName="govuk-header";class I extends A{constructor(e,t={}){super(e,t),this.$input=void 0,this.$button=void 0,this.$status=void 0,this.i18n=void 0,this.id=void 0,this.$announcements=void 0,this.enteredAnotherElement=void 0;const n=this.$root.querySelector("input");if(null===n)throw new S({component:I,identifier:'File inputs (`<input type="file">`)'});if("file"!==n.type)throw new S(y(I,'File input (`<input type="file">`) attribute (`type`) is not `file`'));if(this.$input=n,!this.$input.id)throw new S({component:I,identifier:'File input (`<input type="file">`) attribute (`id`)'});this.id=this.$input.id,this.i18n=new C(this.config.i18n,{locale:$(this.$root,"lang")});const r=this.findLabel();r.id||(r.id=`${this.id}-label`),this.$input.id=`${this.id}-input`,this.$input.setAttribute("hidden","true");const o=document.createElement("button");o.classList.add("govuk-file-upload-button"),o.type="button",o.id=this.id,o.classList.add("govuk-file-upload-button--empty");const i=this.$input.getAttribute("aria-describedby");i&&o.setAttribute("aria-describedby",i);const a=document.createElement("span");a.className="govuk-body govuk-file-upload-button__status",a.setAttribute("aria-live","polite"),a.innerText=this.i18n.t("noFileChosen"),o.appendChild(a);const s=document.createElement("span");s.className="govuk-visually-hidden",s.innerText=", ",s.id=`${this.id}-comma`,o.appendChild(s);const l=document.createElement("span");l.className="govuk-file-upload-button__pseudo-button-container";const u=document.createElement("span");u.className="govuk-button govuk-button--secondary govuk-file-upload-button__pseudo-button",u.innerText=this.i18n.t("chooseFilesButton"),l.appendChild(u),l.insertAdjacentText("beforeend"," ");const c=document.createElement("span");c.className="govuk-body govuk-file-upload-button__instruction",c.innerText=this.i18n.t("dropInstruction"),l.appendChild(c),o.appendChild(l),o.setAttribute("aria-labelledby",`${r.id} ${s.id} ${o.id}`),o.addEventListener("click",this.onClick.bind(this)),o.addEventListener("dragover",e=>{e.preventDefault()}),this.$root.insertAdjacentElement("afterbegin",o),this.$input.setAttribute("tabindex","-1"),this.$input.setAttribute("aria-hidden","true"),this.$button=o,this.$status=a,this.$input.addEventListener("change",this.onChange.bind(this)),this.updateDisabledState(),this.observeDisabledState(),this.$announcements=document.createElement("span"),this.$announcements.classList.add("govuk-file-upload-announcements"),this.$announcements.classList.add("govuk-visually-hidden"),this.$announcements.setAttribute("aria-live","assertive"),this.$root.insertAdjacentElement("afterend",this.$announcements),this.$button.addEventListener("drop",this.onDrop.bind(this)),document.addEventListener("dragenter",this.updateDropzoneVisibility.bind(this)),document.addEventListener("dragenter",()=>{this.enteredAnotherElement=!0}),document.addEventListener("dragleave",()=>{this.enteredAnotherElement||this.$button.disabled||(this.hideDraggingState(),this.$announcements.innerText=this.i18n.t("leftDropZone")),this.enteredAnotherElement=!1})}updateDropzoneVisibility(e){this.$button.disabled||e.target instanceof Node&&(this.$root.contains(e.target)?e.dataTransfer&&this.canDrop(e.dataTransfer)&&(this.$button.classList.contains("govuk-file-upload-button--dragging")||(this.showDraggingState(),this.$announcements.innerText=this.i18n.t("enteredDropZone"))):this.$button.classList.contains("govuk-file-upload-button--dragging")&&(this.hideDraggingState(),this.$announcements.innerText=this.i18n.t("leftDropZone")))}showDraggingState(){this.$button.classList.add("govuk-file-upload-button--dragging")}hideDraggingState(){this.$button.classList.remove("govuk-file-upload-button--dragging")}onDrop(e){e.preventDefault(),e.dataTransfer&&this.canFillInput(e.dataTransfer)&&(this.$input.files=e.dataTransfer.files,this.$input.dispatchEvent(new CustomEvent("change")),this.hideDraggingState())}canFillInput(e){return this.matchesInputCapacity(e.files.length)}canDrop(e){return e.items.length?this.matchesInputCapacity(function(e){let t=0;for(let n=0;n<e.length;n++)"file"===e[n].kind&&t++;return t}(e.items)):!e.types.length||e.types.includes("Files")}matchesInputCapacity(e){return this.$input.multiple?e>0:1===e}onChange(){const e=this.$input.files.length;0===e?(this.$status.innerText=this.i18n.t("noFileChosen"),this.$button.classList.add("govuk-file-upload-button--empty")):(this.$status.innerText=1===e?this.$input.files[0].name:this.i18n.t("multipleFilesChosen",{count:e}),this.$button.classList.remove("govuk-file-upload-button--empty"))}findLabel(){const e=document.querySelector(`label[for="${this.$input.id}"]`);if(!e)throw new S({component:I,identifier:`Field label (\`<label for=${this.$input.id}>\`)`});return e}onClick(){this.$input.click()}observeDisabledState(){new MutationObserver(e=>{for(const t of e)"attributes"===t.type&&"disabled"===t.attributeName&&this.updateDisabledState()}).observe(this.$input,{attributes:!0})}updateDisabledState(){this.$button.disabled=this.$input.disabled,this.$root.classList.toggle("govuk-drop-zone--disabled",this.$button.disabled)}}I.moduleName="govuk-file-upload",I.defaults=Object.freeze({i18n:{chooseFilesButton:"Choose file",dropInstruction:"or drop file",noFileChosen:"No file chosen",multipleFilesChosen:{one:"%{count} file chosen",other:"%{count} files chosen"},enteredDropZone:"Entered drop zone",leftDropZone:"Left drop zone"}}),I.schema=Object.freeze({properties:{i18n:{type:"object"}}});class B extends A{constructor(e,t={}){super(e,t),"alert"!==this.$root.getAttribute("role")||this.config.disableAutoFocus||m(this.$root)}}B.moduleName="govuk-notification-banner",B.defaults=Object.freeze({disableAutoFocus:!1}),B.schema=Object.freeze({properties:{disableAutoFocus:{type:"boolean"}}});class G extends O{constructor(e){super(e),this.$inputs=void 0;const t=this.$root.querySelectorAll('input[type="radio"]');if(!t.length)throw new S({component:G,identifier:'Form inputs (`<input type="radio">`)'});this.$inputs=t,this.$inputs.forEach(e=>{const t=e.getAttribute("data-aria-controls");if(t){if(!document.getElementById(t))throw new S({component:G,identifier:`Conditional reveal (\`id="${t}"\`)`});e.setAttribute("aria-controls",t),e.removeAttribute("data-aria-controls")}}),window.addEventListener("pageshow",()=>this.syncAllConditionalReveals()),this.syncAllConditionalReveals(),this.$root.addEventListener("click",e=>this.handleClick(e))}syncAllConditionalReveals(){this.$inputs.forEach(e=>this.syncConditionalRevealWithInputState(e))}syncConditionalRevealWithInputState(e){const t=e.getAttribute("aria-controls");if(!t)return;const n=document.getElementById(t);if(null!=n&&n.classList.contains("govuk-radios__conditional")){const t=e.checked;e.setAttribute("aria-expanded",t.toString()),n.classList.toggle("govuk-radios__conditional--hidden",!t)}}handleClick(e){const t=e.target;if(!(t instanceof HTMLInputElement)||"radio"!==t.type)return;const n=document.querySelectorAll('input[type="radio"][aria-controls]'),r=t.form,o=t.name;n.forEach(e=>{const t=e.form===r;e.name===o&&t&&this.syncConditionalRevealWithInputState(e)})}}G.moduleName="govuk-radios";class W extends O{constructor(e){var t;super(e);const n=this.$root.hash,r=null!=(t=this.$root.getAttribute("href"))?t:"";if(this.$root.origin!==window.location.origin||this.$root.pathname!==window.location.pathname)return;const o=n.replace("#","");if(!o)throw new S(`Skip link: Target link (\`href="${r}"\`) has no hash fragment`);const i=document.getElementById(o);if(!i)throw new S({component:W,element:i,identifier:`Target content (\`id="${o}"\`)`});this.$root.addEventListener("click",()=>m(i,{onBeforeFocus(){i.classList.add("govuk-skip-link-focused-element")},onBlur(){i.classList.remove("govuk-skip-link-focused-element")}}))}}W.elementType=HTMLAnchorElement,W.moduleName="govuk-skip-link";var U=i(944);const H=function(){M(L),M(D),M(j),M(R),M(F),M(I),M(B),M(G),M(W)},V=function(){const e=document.querySelectorAll('[data-module="govuk-accessible-autocomplete"]');e.length&&i.e(7).then(i.t.bind(i,60,19)).then(t=>{const{default:n}=t;e.forEach(e=>function(e,t){if(!e)return;const n={id:e.id,selectElement:e};t(n);const r=document.querySelector(`#${n.id}`),o=[...e.options].map(e=>e.text);null==r||r.addEventListener("blur",()=>{r.value&&o.includes(r.value)||(e.value="")})}(e.querySelector("select"),n.enhanceSelectElement))}).catch(console.error)},z=function(){const e=document.querySelectorAll(".prevent-multiple-clicks");for(const t of e)t.addEventListener("click",s),t.addEventListener("keydown",l)},q=function(){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",f):f()},Y=function(){if(window.opener){const e=document.querySelector(".js-preview-banner-close");null==e||e.removeAttribute("hidden"),null==e||e.addEventListener("click",e=>{e.preventDefault(),window.close()})}};function K(){H(),V(),z(),q(),Y()}export{K as initAll,V as initAllAutocomplete,H as initAllGovuk,z as initDebounceClick,q as initFileUpload,Y as initPreviewCloseLink};export const geospatialMap=U.g5;export const initMaps=U.Yv;export const locationMap=U.g$;export const map=U.Tj;export const sssiDataset=U.zp;
3
3
  //# sourceMappingURL=shared.min.js.map