System.register(["./rolldown-runtime-legacy-Djb2rrqm.js","./index-legacy-Bbj6l0yZ.js","./index.modern-legacy-DpYSJnkR.js","./context-BrD4AniQ-legacy-txE7vzzL.js","./styles-hx5_Dz4D-legacy-CNN4CNPX.js"],function(t,e){var n,i,l,r,o,u,s,a,c,d;return t("default",function({latitude:t,longitude:e,offset:n=[0,-25],onClose:i,children:l}){let[g,h]=(0,c.useState)(null),f=o(),{mapPadding:m,activeMarker:w,clusterPoints:v}=u(),p=(0,c.useRef)(v),y=(0,c.useRef)(w),b=(0,c.useCallback)(t=>{h(t)},[]);(0,c.useEffect)(()=>{let t=p.current!==v,e=y.current===w;t&&e&&void 0!==w&&null!=i&&i(),p.current=v,y.current=w},[v,w,i]),(0,c.useEffect)(()=>{let t,e={width:0,height:0},n=new ResizeObserver(()=>{t&&clearTimeout(t),t=window.setTimeout(()=>{(()=>{if(!f||!g||void 0===w)return;let t=f.getBounds(),n=f.getCenter(),i=f.getDiv(),l=null==g?void 0:g.getBoundingClientRect();if(!t||!n||!l)return;let r=Math.abs(l.width-e.width),o=Math.abs(l.height-e.height);if(0!==e.width&&r<15&&o<15)return;e={width:l.width,height:l.height};let u=i.getBoundingClientRect(),a={width:i.clientWidth,height:i.clientHeight,top:u.top,left:u.left};s(l,{latitude:n.lat(),longitude:n.lng()},{left:t.getSouthWest().lng(),right:t.getNorthEast().lng(),top:t.getNorthEast().lat(),bottom:t.getSouthWest().lat()},a,m,t=>{f.panTo(new google.maps.LatLng(t.latitude,t.longitude))})})()},100)});return g&&n.observe(g),()=>{t&&clearTimeout(t),n.disconnect()}},[f,g,w,m.top,m.bottom,m.left,m.right]),(0,c.useEffect)(()=>{if(!f)return;let t=f.addListener("click",()=>{null==i||i()});return()=>{t.remove()}},[f]);let x=(0,c.useMemo)(()=>Array.isArray(n)?[n[0],n[1]]:[n,n],[n]);return void 0===t||void 0===e?null:(0,d.jsx)(r,{shouldFocus:!0,disableAutoPan:!0,position:{lat:t,lng:e},pixelOffset:x,children:(0,d.jsx)("div",{ref:b,className:a,children:l})})}),{setters:[function(t){n=t.a},function(t){i=t.St,l=t.q},function(t){r=t.a,o=t.s},function(t){u=t.n},function(t){s=t.n,a=t.t}],execute:function(){c=n(i(),1),d=l()}}});
//# sourceMappingURL=Google-DScXSvYv-legacy-BGYqIg4t.js.map