System.register(["./rolldown-runtime-legacy-Djb2rrqm.js","./index-legacy-Bbj6l0yZ.js","./context-BrD4AniQ-legacy-txE7vzzL.js","./styles-hx5_Dz4D-legacy-CNN4CNPX.js","./mapbox-jb8Zev6T-legacy-C4Ly-PG-.js"],function(t,e){var n,i,o,l,r,u,c,s,d,a;return t("default",function({latitude:t,longitude:e,anchor:n,offset:i=[0,-35],onClose:o,children:g}){let h=(0,d.useRef)(null),{current:f}=c(),{activeMarker:m,clusterPoints:v,mapPadding:p}=l(),w=(0,d.useRef)(v),b=(0,d.useRef)(m);return(0,d.useEffect)(()=>{let t=w.current!==v,e=b.current===m;t&&e&&void 0!==m&&null!=o&&o(),w.current=v,b.current=m},[v,m,o]),(0,d.useEffect)(()=>{let t,e=null==h?void 0:h.current,n={width:0,height:0},i=new ResizeObserver(()=>{t&&clearTimeout(t),t=window.setTimeout(()=>{(()=>{var t;if(!f||!e||void 0===m)return;let i=f.getBounds(),o=f.getCenter(),l=f.getCanvas(),u=null===(t=e.getElement())||void 0===t?void 0:t.getBoundingClientRect();if(!i||!u)return;let c=Math.abs(u.width-n.width),s=Math.abs(u.height-n.height);if(0!==n.width&&c<15&&s<15)return;n={width:u.width,height:u.height};let d=l.getBoundingClientRect(),a={width:l.clientWidth,height:l.clientHeight,top:d.top,left:d.left};r(u,{latitude:o.lat,longitude:o.lng},{left:i.getWest(),right:i.getEast(),top:i.getNorth(),bottom:i.getSouth()},a,{left:p.left||0,right:p.right||0,top:p.top||0,bottom:p.bottom||0},t=>{f.easeTo({center:[t.longitude,t.latitude],duration:500})})})()},100)}),o=null==e?void 0:e.getElement();return o&&i.observe(o),()=>{t&&clearTimeout(t),i.disconnect()}},[f,h,m,p.top,p.bottom,p.left,p.right]),void 0===t||void 0===e?null:(0,a.jsx)(s,{ref:h,className:"mapbox-popup",focusAfterOpen:!0,latitude:t,longitude:e,anchor:n,offset:i,onClose:o,closeButton:!1,children:(0,a.jsx)("div",{className:u,children:g})})}),{setters:[function(t){n=t.a},function(t){i=t.St,o=t.q},function(t){l=t.n},function(t){r=t.n,u=t.t},function(t){c=t.o,s=t.t}],execute:function(){d=n(i(),1),a=o()}}});
//# sourceMappingURL=Mapbox-B7oionsm-legacy-B-L5ZcvQ.js.map