import{S as t,i as e,a,b as s,u as o,s as r,h as l,n as i,k as n,d as c,o as m,f as p}from"./index-0d9f0c09.js";function h(t){let e;return{c(){e=l("div"),this.c=i,n(e,"id","map")},m(a,o){s(a,e,o),t[4](e)},p:i,i:i,o:i,d(a){a&&c(e),t[4](null)}}}function u(t,e,a){let s,{callback:o=null}=e,{colors:r=null}=e,{map:l=null}=e;function i(t,e){return a(1,l=L.map(s,{center:t,zoom:e})),L.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',minNativeZoom:2,minZoom:2,maxNativeZoom:14,maxZoom:14}).addTo(l),l}return m((()=>{if(o(i),null!=r){let t=s.getElementsByClassName("leaflet-control-layers-overlays")[0].children;for(let e=0;e<t.length;e++)t[e].children[0].children[0].style.accentColor=r[e]}})),t.$$set=t=>{"callback"in t&&a(2,o=t.callback),"colors"in t&&a(3,r=t.colors),"map"in t&&a(1,l=t.map)},[s,l,o,r,function(t){p[t?"unshift":"push"]((()=>{s=t,a(0,s)}))}]}class d extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import 'https://unpkg.com/leaflet@1.9.4/dist/leaflet.css';#map{height:var(--height);width:var(--width,100%);margin-top:var(--margin-top,0);margin-bottom:var(--margin-bottom,0);position:relative;z-index:0}</style>",e(this,{target:this.shadowRoot,props:a(this.attributes),customElement:!0},u,h,r,{callback:2,colors:3,map:1},null),t&&(t.target&&s(t.target,this,t.anchor),t.props&&(this.$set(t.props),o()))}static get observedAttributes(){return["callback","colors","map"]}get callback(){return this.$$.ctx[2]}set callback(t){this.$$set({callback:t}),o()}get colors(){return this.$$.ctx[3]}set colors(t){this.$$set({colors:t}),o()}get map(){return this.$$.ctx[1]}set map(t){this.$$set({map:t}),o()}}customElements.define("map-component",d);export{d as default};
