1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3864],{23864:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return d}});var r=n(57437),o=n(2265),i=n(78125),l=n(49393);n(35046),n(20359),n(89003),n(83212),n(26057);var c=n(3548),a=n(46561),u=n(75835);let s=a.z;delete i.Z.Icon.Default.prototype._getIconUrl,i.Z.Icon.Default.mergeOptions(a.b);var d=(0,o.forwardRef)(function(e,t){let{postboxes:n,tiles:d=[],ghostLocations:f,extraMapDots:p,onMarkerClick:m,onMapClick:h,selectedLocation:g=null,minZoomForSelect:v,initialCenter:y=[54,-2],initialZoom:b=6,initialBounds:k=null,fillContainer:w=!1,onMapReady:M,onMapHandleReady:x,onBoundsChange:z,showLocateControl:N=!1,lightweightMarkers:Z=!1,onClusterLoadProgress:L}=e,A=(0,o.useRef)(null),C=(0,o.useRef)(null),E=(0,o.useRef)(null),T=(0,o.useRef)(null),I=(0,o.useRef)(null),R=(0,o.useRef)(null),S=(0,o.useRef)(null),_=(0,o.useRef)(null),O=(0,o.useRef)(null),F=(0,o.useRef)(h),D=(0,o.useRef)(m),U=(0,o.useRef)(M),P=(0,o.useRef)(x),j=(0,o.useRef)(z),V=(0,o.useRef)(L),H=(0,o.useRef)(v);F.current=h,D.current=m,U.current=M,P.current=x,j.current=z,V.current=L,H.current=v;let B=e=>"".concat(e.getSouth(),",").concat(e.getWest(),",").concat(e.getNorth(),",").concat(e.getEast()),G=(0,o.useRef)(null);(0,o.useImperativeHandle)(t,()=>{let e={flyTo(e,t,n){let r=A.current;r&&(r.invalidateSize(),r.flyTo([e,t],null!=n?n:17,{duration:.6}))},setView(e,t,n){let r=A.current;r&&(r.invalidateSize(),r.setView([e,t],null!=n?n:14,{animate:!0,duration:.4}))},locateUser(e){var t;let n=A.current;if(!n)return;n.invalidateSize();let r=null!==(t=null==e?void 0:e.maxZoom)&&void 0!==t?t:17,o=null==e?void 0:e.onFound,i=null==e?void 0:e.onError,l=!1,c=null,a=()=>{l||(l=!0,null!=c&&(clearTimeout(c),c=null),n.off("locationfound",u),n.off("locationerror",s))},u=e=>{a(),null==o||o(e.latlng.lat,e.latlng.lng)},s=e=>{var t;a(),null==i||i({code:e.code,message:null!==(t=e.message)&&void 0!==t?t:"Location error"})};o&&n.once("locationfound",u),i&&n.once("locationerror",s),c=setTimeout(()=>{a(),null==i||i({code:3,message:"Location timed out. Check that location is enabled and try again."})},35e3),n.locate({setView:!0,maxZoom:r,enableHighAccuracy:!1,timeout:3e4,maximumAge:6e4})},getBounds(){let e=A.current;return e?B(e.getBounds()):null},getZoom(){let e=A.current;return e?e.getZoom():b}};return G.current=e,e},[b]);let K=y[0],q=y[1];(0,o.useEffect)(()=>{if(!C.current||A.current)return;let e=i.Z.map(C.current,{zoomControl:!1,touchZoom:!0,doubleClickZoom:!0,scrollWheelZoom:!0,boxZoom:!0,keyboard:!0,dragging:!0,minZoom:3,maxZoom:19}).setView([K,q],b);if(k&&k.trim()){let t=k.split(",").map(e=>parseFloat(e.trim()));if(4===t.length&&t.every(e=>Number.isFinite(e))){let[n,r,o,l]=t,c=i.Z.latLngBounds([n,r],[o,l]);e.fitBounds(c,{padding:[24,24],maxZoom:15})}}if(i.Z.control.zoom({position:"topright"}).addTo(e),N){let t=new l.CO({position:"topright",flyTo:!0,setView:"once",initialZoomLevel:16,locateOptions:{enableHighAccuracy:!1,timeout:25e3,maximumAge:6e4}});t.addTo(e),S.current=t,e.on("locationfound",()=>c.MR.mapLocateMe())}i.Z.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{maxZoom:19,attribution:'\xa9 <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>'}).addTo(e);let t=H.current;e.on("click",n=>{let r=F.current;if(!r)return;let o=e.getZoom();if(null!=t&&o<t){i.Z.popup({className:"min-zoom-popup"}).setLatLng(n.latlng).setContent('<p class="min-zoom-popup-title">Zoom in for best accuracy</p><p class="min-zoom-popup-hint">Required: zoom level '.concat(t,"+ (you're at ").concat(o,"). Use + or scroll to zoom in, then click the map again.</p>")).openOn(e);return}r(n.latlng.lat,n.latlng.lng,o)});let n=()=>{O.current&&clearTimeout(O.current),O.current=setTimeout(()=>{var t;O.current=null,null===(t=j.current)||void 0===t||t.call(j,B(e.getBounds()),e.getZoom())},400)};e.on("moveend",n),e.whenReady(()=>{var e,t;n();let r=G.current;r&&(null===(e=P.current)||void 0===e||e.call(P,r)),null===(t=U.current)||void 0===t||t.call(U)}),A.current=e,e.invalidateSize();let r=null,o=requestAnimationFrame(()=>{e.invalidateSize(),r=setTimeout(()=>
1{e.invalidateSize(),r=null},150)}),a=()=>e.invalidateSize();return window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a),cancelAnimationFrame(o),null!=r&&clearTimeout(r),O.current&&(clearTimeout(O.current),O.current=null),e.off("moveend",n),S.current&&(e.removeControl(S.current),S.current=null),E.current&&(e.removeLayer(E.current),E.current=null),T.current&&(e.removeLayer(T.current),T.current=null),_.current&&(e.removeLayer(_.current),_.current=null),I.current&&(e.removeLayer(I.current),I.current=null),R.current&&(e.removeLayer(R.current),R.current=null),e.remove(),A.current=null}},[K,q,b,k,N]);let Q=(0,o.useMemo)(()=>({...u.f8}),[]),W=(0,o.useMemo)(()=>["Queen Victoria","King Edward VII","King George V","King Edward VIII","King George VI","Queen Elizabeth II","King Charles III","Scottish Crown","Unknown"],[]);return(0,o.useEffect)(()=>{let e=A.current;if(e){if(I.current&&(e.removeLayer(I.current),I.current=null),R.current&&(e.removeLayer(R.current),R.current=null),T.current&&(e.removeLayer(T.current),T.current=null),d.length>0&&E.current&&(e.removeLayer(E.current),E.current=null),f&&f.length>0){let t=i.Z.layerGroup();f.forEach(e=>{let[n,r]=e,o=i.Z.circleMarker([n,r],{radius:10,stroke:!0,color:"#64748b",weight:2,opacity:.9,fill:!0,fillColor:"#94a3b8",fillOpacity:.4});o.bindTooltip("Original position",{permanent:!1,direction:"top",className:"ghost-pin-tooltip"}),o.addTo(t)}),t.addTo(e),I.current=t}if(p&&p.length>0){let t=i.Z.layerGroup(),n=0;p.forEach(e=>{let{lat:r,lng:o,tooltip:l,variant:c,clickUrl:a}=e;if(!Number.isFinite(r)||!Number.isFinite(o))return;let u="nearby"===c,s=!!(null==a?void 0:a.trim()),d=i.Z.circleMarker([r,o],{radius:u?8:9,stroke:!0,color:u?"#475569":"#6d28d9",weight:2,opacity:1,fill:!0,fillColor:u?"#94a3b8":"#c4b5fd",fillOpacity:u?.85:.9,bubblingMouseEvents:!s});if(d.bindTooltip(l,{permanent:!1,direction:"top",className:u?"nearby-pin-tooltip":"exif-pin-tooltip"}),s){let e=a.trim();d.on("click",t=>{i.Z.DomEvent.stop(t),window.open(e,"_blank","noopener,noreferrer")}),d.once("add",()=>{let e=d.getElement();e instanceof HTMLElement&&(e.style.cursor="pointer",e.setAttribute("role","button"),e.setAttribute("aria-label",l))})}d.addTo(t),n+=1}),n>0&&(t.addTo(e),R.current=t)}if(d.length>0){let t=i.Z.layerGroup();return d.forEach(e=>{if(!Number.isFinite(e.lat)||!Number.isFinite(e.lng)||!(e.count>0))return;let n=Math.max(28,Math.min(72,7*Math.sqrt(e.count)));if(e.reign_breakdown&&Object.keys(e.reign_breakdown).length>0&&e.reign_breakdown){let r=e.count,o=[];W.forEach(t=>{let n=e.reign_breakdown[t];n&&n>0&&o.push({color:Q[t]||"#6b7280",count:n})}),Object.keys(e.reign_breakdown).forEach(t=>{W.includes(t)||o.push({color:Q[t]||"#6b7280",count:e.reign_breakdown[t]})});let l=function(e,t,n,r){var o;let i=Math.max(16,Math.round(e)),l=Math.max(0,Math.round(t)),c=String(l),a=i/2,u=i/2,s=i/2-1,d=Math.max(.52*s,10),f=n.filter(e=>e.count>0&&Number.isFinite(e.count)),p=[];if(f.length<=1){let e=(null===(o=f[0])||void 0===o?void 0:o.color)||"#6b7280";p.push('<circle cx="'.concat(a,'" cy="').concat(u,'" r="').concat(s,'" fill="').concat(e,'"/>')),p.push('<circle cx="'.concat(a,'" cy="').concat(u,'" r="').concat(d,'" fill="#ffffff"/>'))}else{let e=-Math.PI/2;for(let{color:t,count:n}of f){let r=n/l*2*Math.PI;if(!(r>0)||!Number.isFinite(r))continue;if(r>=2*Math.PI-1e-6){p.push('<circle cx="'.concat(a,'" cy="').concat(u,'" r="').concat(s,'" fill="').concat(t,'"/>'));break}let o=a+s*Math.cos(e),i=u+s*Math.sin(e),c=a+d*Math.cos(e),f=u+d*Math.sin(e),m=a+s*Math.cos(e+=r),h=u+s*Math.sin(e),g=a+d*Math.cos(e),v=u+d*Math.sin(e),y=r>Math.PI?1:0,b="M ".concat(o," ").concat(i," A ").concat(s," ").concat(s," 0 ").concat(y," 1 ").concat(m," ").concat(h," L ").concat(g," ").concat(v," A ").concat(d," ").concat(d," 0 ").concat(y," 0 ").concat(c," ").concat(f," Z");p.push('<path fill="'.concat(t,'" stroke="#fff" stroke-width="0.75" d="').concat(b,'"/>'))}p.push('<circle cx="'.concat(a,'" cy="').concat(u,'" r="').concat(d,'" fill="#ffffff"/>'))}p.push('<circle cx="'.concat(a,'" cy="').concat(u,'" r="').concat(s,'" fill="none" stroke="rgba(15,23,42,0.12)" stroke-width="1"/>'));let m=i>=52?13:i>
1=46?12:11;return'<div class="tile-donut-wrap" style="width:'.concat(i,"px;height:").concat(i,'px;"><svg width="').concat(i,'" height="').concat(i,'" viewBox="0 0 ').concat(i," ").concat(i,'" aria-hidden="true">').concat(p.join(""),'</svg><span class="tile-donut-count" style="font-size:').concat(m,'px">').concat(c,"</span></div>")}(n,r,o),c=i.Z.marker([e.lat,e.lng],{icon:i.Z.divIcon({html:l,className:"tile-donut-marker leaflet-div-icon",iconSize:[n,n],iconAnchor:[n/2,n/2]}),keyboard:!1}),a=e.county?"".concat(e.county,": ").concat(r):String(e.count);c.bindTooltip(a,{permanent:!1,direction:"top",className:"tile-count-tooltip"}),c.addTo(t)}else{let n=Math.max(12,Math.min(40,4*Math.sqrt(e.count))),r=i.Z.circleMarker([e.lat,e.lng],{radius:n,fillColor:"#2563eb",color:"#1d4ed8",weight:1.5,opacity:.9,fillOpacity:.6}),o=e.county?"".concat(e.county,": ").concat(e.count):String(e.count);r.bindTooltip(o,{permanent:!1,direction:"top",className:"tile-count-tooltip"}),r.addTo(t)}}),t.addTo(e),T.current=t,()=>{T.current===t&&(e.removeLayer(t),T.current=null)}}if(n.length>0){let t=i.Z,r=V.current,o={chunkedLoading:!0,chunkInterval:200,chunkDelay:30,...r?{chunkProgress:(e,t)=>{r(e,t)}}:{}},l=function(e,t){let n=[];for(let r=0;r<e.length;r++){let o=e[r],l=function(e,t){var n,r;let o=function(e,t,n){if("number"==typeof t&&"number"==typeof n&&Number.isFinite(t)&&Number.isFinite(n)&&t>=-90&&t<=90&&n>=-180&&n<=180)return[t,n];if(!e||"string"!=typeof e)return null;let r=e.split(",").map(e=>parseFloat(e.trim()));if(r.length<2)return null;let[o,i]=r;return!Number.isFinite(o)||!Number.isFinite(i)||o<-90||o>90||i<-180||i>180?null:[o,i]}(e.location,e.lat,e.lng);if(!o)return null;let l=e.reign_name||"Unknown",c=t.lightweight?i.Z.divIcon({className:"map-leaf-dot-icon",html:'<span class="map-leaf-dot" style="background:'.concat(null!==(n=u.f8[l])&&void 0!==n?n:u.f8.Unknown,'"></span>'),iconSize:[8,8],iconAnchor:[4,4]}):i.Z.icon({iconUrl:"".concat(s,"-").concat(null!==(r=u.oy[l])&&void 0!==r?r:"grey",".png"),iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34]});return i.Z.marker(o,{reign_name:l,icon:c})}(o,t);l&&(t.onMarkerClick&&l.on("click",e=>{i.Z.DomEvent.stopPropagation(e),t.onMarkerClick(o)}),n.push(l))}return n}(n,{lightweight:Z,onMarkerClick:e=>{var t;return null===(t=D.current)||void 0===t?void 0:t.call(D,e)}}),c=E.current;c?c.clearLayers():(c=t.DonutCluster(o,{key:"reign_name",order:W,arcColorDict:Q}),e.addLayer(c),E.current=c),c.addLayers(l);return}if(E.current){var t,r;null===(t=(r=E.current).clearLayers)||void 0===t||t.call(r)}}},[n,d,f,p,Q,W,Z]),(0,o.useEffect)(()=>{let e=A.current;if(e){if(_.current&&(e.removeLayer(_.current),_.current=null),g){let[t,n]=g,r=i.Z.marker([t,n],{icon:i.Z.icon({iconUrl:"".concat(a.z,"-red.png"),iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34]})});r.addTo(e),_.current=r}return()=>{_.current&&(e.removeLayer(_.current),_.current=null)}}},[g]),(0,r.jsx)("div",{ref:C,className:"map-container w-full h-full rounded-lg ".concat(w?"min-h-0":"min-h-[400px] sm:min-h-[500px]"),style:{zIndex:0,touchAction:"pan-x pan-y"},role:"application","aria-label":"Map"})})},84731:function(e,t,n){"use strict";var r,o,i;i=function(e){function t(e){return+(Math.round(e+"e+2")+"e-2")}function n(e){return e>=1e3&&e<1e6?e=t(e/1e3)+"K":e>=1e6&&e<1e9?e=t(e/1e6)+"M":e>=1e9&&(e=t(e/1e9)+"B"),e}var r=document,o=Math,i={},l=0;function c(e){var t,i,l,a,u,s=r.createElement("div"),d=e.size||100,f=d+10,p=e.data||[{value:1}],m=e.weight||20,h=e.colors||["#555"],g=e.fillColor||"#f1d357",v=e.el,y=d/2,b=o.PI,k=o.sin,w=o.cos,M=0;for(t=0;t<p.length;t++)M+=p[t].value;if(0===M)for(t=0;t<p.length;t++)p[t].value=1,M+=p[t].value;s.className="donut",s.style.width=s.style.height=f+"px",s.style.position="relative",(a=s.appendChild(document.createElement("span"))).className="donut-text",a.setAttribute("style","color: black;display: block;position: absolute;top: 50%;left: 0;z-index: 2;line-height: 0;width: 100%;text-align: center;"),a.innerHTML=n(M),u=document.createElement("div");var x="http://www.w3.org/2000/svg",z=r.createElementNS(x,"svg"),N=-b/2,Z=y-m/2;z.setAttribute("height",f+"px"),z.setAttribute("width",f+"px");var L=r.createElementNS(x,"circle");for(L.setAttribute("cx",f/2),L.setAttribute("cy",f/2),L.setAttribute("r",Z-m/2),L.setAttribute("fill",g),L.setAttribute("fill-opacity",.6),z.appendChild(L),s.appendChild(z),t=0;t<p.length;t++){i=1==(i=p[t].value/M)?.99999:i,l=r.createElementNS(x,"path");var A=y+5,C=i*b*2+N,E=(C-N)%(2*b)>b?1:0,T=A+w(N)*Z,I=A+k(N)*Z,R=A+w(C)*Z,S=A+k(C)*Z,_=p[t].name,O=Array.isArray(h)?h[t%h.length]:h[_]||"#fff";if(N=C,function(e,t){for(var n in t)e.setAttribute(n,t[n])}(l,{d:["M",T,I,"A",Z,Z,0,E,1,R,S].join(" "),stroke:O,"stroke-opacity":"0.7","stroke-width":m,fill:"none","data-name":_,class:"donut-arc"}),c.data(l,p[t]),function(t,r,o){"99.99"===o&&(o="100"),e.onclick&&l.addEventListener("click",function(n){var r=n.target;r.parentNode.stick!==r?r.parentNode.stick=r:r.parentNode.stick=!1,e.onclick(t.name,!!r.parentNode.stick)}),l.addEventListener("mouseenter",function(e){var r=e.target;r.setAttribute("stroke-width",m+5),u.setAttribute("class","legend"),s.zIndex=s.parentNode.style.zIndex,s.parentNode.style.zIndex=1e5,a.innerHTML=n(t.value),r.saved={val:t.value,legend:" "+(t.title||t.name)+": "+o+"% "},u.innerHTML=r.saved.legend}),l.addEventListener("mouseleave",function(e){var t=e.target,r=t.parentNode.stick;if(r!==t){t.setAttribute("stroke-width",m);var o={val:M,legend:""};r&&(o=r.saved),s.parentNode.style.zIndex=s.zIndex,a.innerHTML=n(o.val),u.
1innerHTML=o.legend}})}(p[t],0,(100*i+"").substr(0,5)),z.appendChild(l),p[t].active){z.stick=l;var F=new MouseEvent("mouseenter",{view:window,bubbles:!1,cancelable:!0});l.dispatchEvent(F),l.setAttribute("stroke-width",m)}}return s.appendChild(u),v&&v.appendChild(s),s}c.data=function(e,t){return void 0===t?i[e._DONUT]:(i[e._DONUT=e._DONUT||++l]=t,e)},c.setColor=function(e,t){return e.setAttribute("stroke",t),e},e.DivIcon.prototype.createIcon=function(t){var n=t&&"DIV"===t.tagName?t:document.createElement("div"),r=this.options;if(r.el?n.appendChild(r.el):n.innerHTML=!1!==r.html?r.html:"",r.bgPos){var o=e.Point(r.bgPos);n.style.backgroundPosition=-o.x+"px "+-o.y+"px"}return this._setIconStyles(n,"icon"),n},e.DonutCluster=function(t,n){var r=Object.create(null);return t.iconCreateFunction=function(t){for(var o=t.getAllChildMarkers(),i=[],l=n.key||"reign_name",a=Object.create(null),u=0;u<o.length;u++){var s=o[u].options&&o[u].options[l]||"Unknown";a[s]=(a[s]||0)+1}for(var d=n.order||Object.keys(a).sort(),f=0;f<d.length;f++){var p=d[f];a[p]&&i.push(p+":"+a[p])}Object.keys(a).forEach(function(e){-1===d.indexOf(e)&&i.push(e+":"+a[e])});var m=o.length+"|"+i.join(",");if(r[m])return r[m];var h=function(e,t,n){var r={},o=e.length,i=t.key,l=t.sumField,a=t.order||(t.order=[]),u=t.orderDict||(t.orderDict={}),s=t.title||{},d={};if("function"==typeof n?d=n(e):"object"==typeof n&&(d=n),Array.isArray(t.title)&&t.order){for(var f in s={},t.title)s[t.order[f]]=t.title[f];t.title=s}for(var f in a)u[a[f]]=1;for(var f=0;f<o;f++){var p=e[f].options[i];r[p]||(r[p]=0),u[p]||(u[p]=1,a.push(p)),l?r[p]+=e[f].options[l]:r[p]++}var m=[];for(var f in a){var p=a[f];m.push({value:r[p]||0,name:p,title:s[p],active:d.active&&d.active===p})}var h=d.size||50,g=d.weight||10,v=d.colors,y=c({size:h,weight:g,data:m,onclick:d.onclick,colors:v,fillColor:d.fillColor});return y.config=d,y}(o,n,function(e){var t,r,o,i,l;return n.style?t="function"==typeof n.style?n.style(e):n.style:((l=e.length)<10?(r=40,o=8,i="#6ecc39"):l<100?(r=50,o=10,i="#f1d357"):(r=60,o=12,i="#fd9c73"),t={size:r,weight:o,fill:i}),{size:t.size,weight:t.weight,colors:n.arcColorDict,fillColor:t.fill}}),g=new e.DivIcon({el:h,iconSize:new e.Point(h.config.size+10,h.config.size+10),className:"donut-cluster"});return r[m]=g,g},e.markerClusterGroup(t)}},window,r=[n(60759)],void 0!==(o=i.apply(t,r))&&(e.exports=o)},78125:function(e,t,n){"use strict";var r=n(60759),o=n.n(r);window.L=o(),n(74840),n(84731),t.Z=o()},46561:function(e,t,n){"use strict";n.d(t,{b:function(){return r},z:function(){return o}});let r={iconRetinaUrl:"/assets/map/leaflet/marker-icon-2x.png",iconUrl:"/assets/map/leaflet/marker-icon.png",shadowUrl:"/assets/map/leaflet/marker-shadow.png"},o="/assets/map/markers/marker-icon"},83212:function(){},89003:function(){},20359:function(){}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.