import{i as e}from"./chunk-aKtaBQYM.js";import{Ft as t,G as n}from"./mui-BgU4WrXF.js";import{N as r,T as i,_t as a}from"./index-bel1r0Sr.js";import{n as o}from"./MapView-Bhqzv-Oc.js";var s=e(t(),1),c=({markers:e,showTitles:t})=>{let c=(0,s.useId)(),l=i(`iconScale`,a(n().breakpoints.up(`md`))?.75:1);return(0,s.useEffect)(()=>(o.addSource(c,{type:`geojson`,data:{type:`FeatureCollection`,features:[]}}),t?o.addLayer({id:c,type:`symbol`,source:c,filter:[`!has`,`point_count`],layout:{"icon-image":`{image}`,"icon-size":l,"icon-allow-overlap":!0,"text-field":`{title}`,"text-allow-overlap":!0,"text-anchor":`bottom`,"text-offset":[0,-2*l],"text-font":r(o),"text-size":12},paint:{"text-halo-color":`white`,"text-halo-width":1}}):o.addLayer({id:c,type:`symbol`,source:c,layout:{"icon-image":`{image}`,"icon-size":l,"icon-allow-overlap":!0}}),()=>{o.getLayer(c)&&o.removeLayer(c),o.getSource(c)&&o.removeSource(c)}),[t,l,c]),(0,s.useEffect)(()=>{o.getSource(c)?.setData({type:`FeatureCollection`,features:e.map(({latitude:e,longitude:t,image:n,title:r})=>({type:`Feature`,geometry:{type:`Point`,coordinates:[t,e]},properties:{image:n||`default-neutral`,title:r||``}}))})},[t,e,c]),null};export{c as t};