/* empty css */import"../../../theme-BwRovl8e.js";const l=document.getElementById("event-map"),h=l.dataset.h3Resolution,o=L.map(l,{zoomControl:!1,scrollWheelZoom:!1}).setView([52.1326,5.2913],7);L.control.zoom({position:"bottomleft"}).addTo(o);const p=L.control({position:"topright"});p.onAdd=()=>{const t=L.DomUtil.create("div","map-compass");return t.setAttribute("role","img"),t.setAttribute("aria-label","Map compass: north is up"),t.innerHTML='NESW↑',L.DomEvent.disableClickPropagation(t),t};p.addTo(o);L.tileLayer("https://{s}.tile.openstreetmap.de/{z}/{x}/{y}.png",{maxZoom:18,attribution:"© OpenStreetMap contributors"}).addTo(o);const g=JSON.parse(document.getElementById("h3-cells-data").textContent),f=JSON.parse(document.getElementById("map-events-data").textContent),r=L.latLngBounds([]);g.forEach(t=>{L.polygon(t.boundary,{color:"#f59e0b",weight:2,fillColor:"#f59e0b",fillOpacity:.25}).addTo(o).bindPopup('H3 '+t.cell+''+t.reports+" reports · "+t.occurrences+" occurrences · resolution "+h+""),r.extend(L.latLngBounds(t.boundary))});function M(t){return["N","NE","E","SE","S","SW","W","NW"][Math.floor((t+22.5)%360/45)]}function y(t,e,n){const s=e*Math.PI/180,c=t[0]*Math.PI/180,u=t[1]*Math.PI/180,i=n/6378137,d=Math.asin(Math.sin(c)*Math.cos(i)+Math.cos(c)*Math.sin(i)*Math.cos(s)),m=u+Math.atan2(Math.sin(s)*Math.sin(i)*Math.cos(c),Math.cos(i)-Math.sin(c)*Math.sin(d));return[d*180/Math.PI,m*180/Math.PI]}const b=L.divIcon({className:"",html:'
✦
',iconSize:[37,37],iconAnchor:[19,19]});f.forEach(t=>{const e=t.visually_confirmed?"Visually confirmed":"Not visually confirmed";let n=t.occurrences+" occurrence"+(t.occurrences===1?"":"s")+" · "+e+"
Reported "+t.reported_on;if(t.direction_degrees!==null&&(n+="
Compass direction "+Math.round(t.direction_degrees)+"° ("+M(t.direction_degrees)+")",t.direction_accuracy_degrees!==null&&(n+=" (±"+Math.round(t.direction_accuracy_degrees)+"°)")),L.marker(t.center,{icon:b}).addTo(o).bindPopup('Manual report · H3 '+t.cell+''+n+""),t.direction_degrees!==null){const a=y(t.center,t.direction_degrees,900);L.polyline([t.center,a],{color:"#fff7e6",weight:9,opacity:.8}).addTo(o),L.polyline([t.center,a],{color:"#6d45a0",weight:5,opacity:1}).addTo(o);const s=L.divIcon({className:"",html:'
↑
',iconSize:[56,56],iconAnchor:[28,28]});L.marker(a,{icon:s,interactive:!1}).addTo(o)}});r.isValid()&&o.fitBounds(r.pad(.18));const v=document.getElementById("range");document.querySelectorAll("#from-date, #to-date").forEach(t=>{t.addEventListener("change",()=>{v.value="custom"})});