const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DMoIjKgM.js","./BpnUlMNa.js","./BSuDdRC_.js","./DdDSu8zG.js","./BIxlrOKS.js","./C3hoC6Fc.js","./BB_K5-7A.js","./8hArVOJ7.js","./CPCZYp5N.js","./Cc7AFOF1.js","./B-AG0Pur.js","./BkKXvnCO.js","./BDzvEyjh.js","./CFU304S8.js","./DDg0_8L_.js","./DyvNEXVt.js","./GO-r33i_.js","./CuLB3FBG.js","./DQRUkQSq.js","./HPYMLvV_.js","./DqCj9b4m.js","./DAJnrLOn.js","./BXZC2147.js","./DC0CgjZ0.js","./BZ4EKnFQ.js","./CLdyA6-S.js","./DDYYWAo_.js","./D-_Wjm5S.js","./BsDtTzKZ.js","./BfIcU47v.js","./DjbrIdLM.js","./2mccsc9e.js","./C-cvIfNA.js","./DAO5BBHU.js","./Dnqi7248.js","./B9mSb-3l.js","./CnZvnjd2.js","./COhilHc3.js","./entry.BdpeBhx2.css","./v7uNrCTz.js"])))=>i.map(i=>d[i]);
import{d as D,r as i,bE as W,a7 as Q,D as U,u as j,s as K,H as h,bt as G,Q as f,c,e as P,g as J,q as X,w as Y,F as ee,v as oe,h as k,x as o,au as te,i as S,aa as ae,ab as ne,f as se,bj as re,A as ue}from"./BpnUlMNa.js";import{_ as le}from"./DYh8DpIC.js";import{_ as ie}from"./CXgnlbJ0.js";import{E as ce}from"./C-9GnIav.js";const de=ae(()=>ne(()=>import("./DMoIjKgM.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39]),import.meta.url).then(d=>d.default||d)),ve={class:"relative w-full h-full"},_e=D({__name:"bounds",props:{locations:{},hoverLocation:{},loading:{type:Boolean},showZoomControl:{type:Boolean}},setup(d){const v=d,g=i(null),t=i(null),T=se(),z=W(),H=Q(),r=U(),{locale:N}=j(),l=i(!1),y=i(!1),a=i(null),{queryMode:C,bounds:O,search:V,uriQuery:A}=K(z),F=h(()=>r.query.types?!(r.query.types.length===1||r.query.types.length>1&&!r.query.types.includes("3")):!0),p=h(()=>{const{ne_lat:e,ne_lng:n,sw_lat:u,sw_lng:m}=r.query;if(!(!e||!n||!u||!m))return{north:+e,east:+n,south:+u,west:+m}}),Z=h(()=>r.query.q||""),_=G(()=>{var n;if(!((n=t.value)!=null&&n.map))return;a.value=null;const e=t.value.map.getBounds();O.value={north:(e==null?void 0:e.getNorthEast().lat())||0,east:(e==null?void 0:e.getNorthEast().lng())||0,south:(e==null?void 0:e.getSouthWest().lat())||0,west:(e==null?void 0:e.getSouthWest().lng())||0},V.value="",C.value=!1,ue({query:{...A.value}}),l.value=!1},400);return f(()=>{var e;return(e=t.value)==null?void 0:e.ready},e=>{e&&setTimeout(()=>{t.value.$el.addEventListener("pointerdown",()=>{l.value=!1,y.value=!0}),t.value.$el.addEventListener("pointermove",()=>{y.value&&(l.value=!0)}),t.value.$el.addEventListener("pointerup",()=>{l.value&&_(),y.value=!1}),t.value.$el.addEventListener("pointerout",()=>{l.value&&_()}),t.value.$el.addEventListener("mousewheel",_),t.value.map&&p.value&&t.value.map.fitBounds(p.value)},400)}),f(()=>v.locations,()=>{var n;if(!v.locations||p.value||!((n=t.value)!=null&&n.map))return;const e=re(v.locations.map(u=>u.position));e&&t.value.map.fitBounds(e)}),f(Z,()=>{C.value&&t.value.map.fitBounds(p.value)}),f(()=>v.hoverLocation,()=>{a.value=null}),(e,n)=>{var L,w,b,B,E,q,R;const u=le,m=de,x=ie;return c(),P("div",null,[J("div",ve,[X(o(ce),{ref_key:"map",ref:t,"api-key":o(T).public.googleMapsApiKey,class:"w-full h-full rounded-md overflow-hidden",center:{lat:51.399025,lng:10.537576},zoom:6,minZoom:2,maxZoom:11,recycle:!0,zoomControl:e.showZoomControl||!1,fullscreenControl:!1,gestureHandling:"greedy",clickableIcons:!1,mapTypeControlOptions:{mapTypeIds:[]},streetViewControl:!1,libraries:void 0,language:o(N),mapId:"ff91f5adf1f0f7da"},{default:Y(()=>[(c(!0),P(ee,null,oe(e.locations,s=>{var $,M;return c(),k(u,{key:s.id,position:s.position,isCurrentLocation:s.id===(($=o(a))==null?void 0:$.id),isHoverLocation:s.id===e.hoverLocation||s.id===o(g),isBookmarked:o(H).isBookmarked(s.id),showIcon:o(F),isCabin:(M=s.types)==null?void 0:M.includes(3),guestPrice:s.guestPrice,onClick:te(I=>a.value=s,["stop"]),onMouseover:I=>g.value=s.id,onMouseleave:n[0]||(n[0]=I=>g.value=null)},null,8,["position","isCurrentLocation","isHoverLocation","isBookmarked","showIcon","isCabin","guestPrice","onClick","onMouseover"])}),128))]),_:1},8,["api-key","zoomControl","language"]),o(a)?(c(),k(m,{key:0,id:(L=o(a))==null?void 0:L.id,image:(w=o(a))==null?void 0:w.image,title:(b=o(a))==null?void 0:b.title,averageRating:(B=o(a))==null?void 0:B.averageRating,numberOfRatings:(E=o(a))==null?void 0:E.numberOfRatings,guestPrice:(q=o(a))==null?void 0:q.guestPrice,map:o(t),types:(R=o(a))==null?void 0:R.types,onClose:n[1]||(n[1]=s=>a.value=null)},null,8,["id","image","title","averageRating","numberOfRatings","guestPrice","map","types"])):S("",!0),e.loading?(c(),k(x,{key:1,class:"absolute inset-0"})):S("",!0)])])}}});export{_e as _};
