1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./BasicMap-BQWlX_nT.js","./ListenerManager-B9zmCDZv.js","./GoogleMapsLoader-BItwxU3D.js","./sharedMapSettings-P6FgWjOU.js","./main-Q89nzDrl.js","./feed-DGnjkLr1.js","./index--6mjBm2l.js","./feed-DcbYxcRy.css"])))=>i.map(i=>d[i]); 2import{g as a,_ as v}from"./main-Q89nzDrl.js";import{L as A}from"./ListenerManager-B9zmCDZv.js";import{setMarkerUrlColor as b}from"./sharedMapSettings-P6FgWjOU.js";import{s as h,a as T}from"./featuredMapUtils-D8O2z2j4.js";import{d as M}from"./index--6mjBm2l.js";import"./feed-DGnjkLr1.js";const x=function(u){return window.getComputedStyle(u).display!="none"},L="body > *:not(script):not(style)";class C{makeBodyDirectChildrenInertExcept(s){!s||!s.matches("body > *")?console.warn("setting inert was unsuccessful because directBodyDescendentEl was not found or was not a direct body descendent"):(document.querySelectorAll(L).forEach(e=>{e.inert=!0}),s.inert=!1)}makeBodyDirectChildrenNotInert(){document.querySelectorAll(L).forEach(t=>{t.inert=!1})}}const B=(u={})=>({mapEl:null,popoverEl:null,popoverContentEl:null,groupsHolderEl:null,groupsEl:null,groupsToggleEl:null,map:null,markers:[],listingButtons:[],openListingButtonEl:null,openMarker:null,restoreFocusEl:null,ariaLiveEl:null,padIndex:!1,mapTheme:"standard",animationDuration:500,animationProperty:"left",groupDisabledClass:"group--disabled",fauxFullscreenDocumentClass:"fullscreen--map",fauxFullscreenClass:"grouped-map--fullscreen",fauxFullscreenIsOpen:!1,placeholderEl:null,inertBoss:new C,mapOptionOverrides:{panControl:!0,streetViewControl:!0,mapTypeControl:!0},basicMapInstance:void 0,listenerBoss:new A,isPopoverOpen:!1,isGroupsOpen:!1,init(){return this.mapEl=this.$refs?.map??null,this.popoverEl=this.$refs?.popover??null,this.popoverContentEl=this.$refs?.popoverContent??null,this.groupsHolderEl=this.$refs?.groupsHolder??null,this.groupsEl=this.$refs?.groups??null,this.groupsToggleEl=this.$refs?.groupsToggle??null,this.padIndex=u.padIndex??!1,this.mapTheme=u.mapTheme??"standard",()=>this.mounted()},mounted(){this.$el&&(this.$el.hidden=!1,this.ariaLiveEl=document.createElement("div"),this.ariaLiveEl.setAttribute("aria-live","polite"),this.$el.appendChild(this.ariaLiveEl),this.ariaLiveEl.innerText="Loading the grouped map.",this.setUpPopover(),this.setUpMap())},destroy(){this.listenerBoss.removeAll(),this.isPopoverOpen=!1,this.isGroupsOpen=!1},async setUpMap(){if(!this.$el||!this.mapEl){console.error("groupedMap: map element not found");return}const s=this.$el.querySelectorAll("[data-map-item]"),t=[];if(s.forEach(i=>{const n=i.getAttribute("data-lat")||"",l=i.getAttribute("data-lng")||"",c=i.getAttribute("data-title")||"";n&&l&&t.push({lat:n,lng:l,title:c,listingEl:i})}),!t.length)return;const[{default:e},{getDefaultMapOptions:o}]=await Promise.all([v(()=>import("./BasicMap-BQWlX_nT.js"),__vite__mapDeps([0,1,2]),import.meta.url),v(()=>import("./sharedMapSettings-P6FgWjOU.js"),__vite__mapDeps([3,4,5,6,7,1]),import.meta.url)]),r=await o(this.mapTheme);this.basicMapInstance=new e({outerEl:this.$el,mapEl:this.mapEl,mapOptions:{...r,...this.mapOptionOverrides},points:t,onMapReady:(i,n)=>{this.handleMapReady(i,n)}})},handleMapReady(s,t){this.map=s,this.markers=t,this.setUpMarkersAndListings(),this.setUpGroups(),this.setUpFullscreenToggle(),this.setUpLocationToggle()},setUpGroups(){const s=this.$el?.querySelectorAll("[data-map-group]")??[],t=s.length;let e=0;s.forEach(o=>{const r=o.querySelector("[data-map-group-items]"),i=o.querySelector("[data-map-group-count]");let n=0;i&&r&&(n=r.querySelectorAll("[data-map-item]").length,e+=n,n&&(i.innerText=`(${n})`,i.setAttribute("aria-label",n+" points")))}),e&&this.ariaLiveEl&&(this.ariaLiveEl.innerText=`Set up ${t} groups with a total of ${e} locations`),this.groupsToggleEl&&(this.groupsToggleEl.hidden=!1),this.syncGroupsVisibility(),this.listenerBoss.register(window,"resize",()=>{M(()=>{this.syncGroupsVisibility()},100)})},toggleGroups(){this.isGroupsOpen?this.closeGroups():this.openGroups()},openGroups(){!this.groupsToggleEl||!this.groupsEl||!this.groupsHolderEl||(this.groupsToggleEl.setAttribute("aria-expanded","true"),this.groupsEl.setAttribute("aria-hidden","false"),this.groupsToggleEl.innerHTML='<svg class="icon icon--enlarge" role="presentation"><use xlink:href="#arrow-down"></use></svg> Hide List',this.groupsHolderEl.classList.add("is-open"),this.isGroupsOpen=!0)},closeGroups(){!this.groupsToggleEl||!this.groupsEl||!this.groupsHolderEl||(this.groupsToggleEl.setAttribute("aria-expanded","fal
2se"),this.groupsEl.setAttribute("aria-hidden","true"),this.groupsToggleEl.innerHTML='<svg class="icon icon--enlarge" role="presentation"><use xlink:href="#arrow-up"></use></svg> Show List',this.groupsHolderEl.classList.remove("is-open"),this.isGroupsOpen=!1)},syncGroupsVisibility(){if(this.groupsEl){if(!this.groupsToggleEl){this.groupsEl.setAttribute("aria-hidden","false"),this.isGroupsOpen=!0;return}x(this.groupsToggleEl)?this.closeGroups():(this.groupsEl.setAttribute("aria-hidden","false"),this.isGroupsOpen=!0)}},onGroupToggle(s){const t=s.currentTarget;if(!t)return;const e=t.closest("[data-map-group]");if(!e)return;const o=e.getAttribute("data-map-group")||"",r=e.getAttribute("data-group-heading")||"",i=e.querySelector("[data-map-group-items]"),l=(i?.querySelectorAll("[data-map-item]")??[]).length;t.checked?(e.classList.remove(this.groupDisabledClass),i&&(i.hidden=!1),this.setGroupMarkersVisibility(o,!0),this.ariaLiveEl&&(this.ariaLiveEl.innerText=`The ${r} group is enabled. Showing its ${l} locations.`)):(e.classList.add(this.groupDisabledClass),i&&(i.hidden=!0),this.setGroupMarkersVisibility(o,!1),this.ariaLiveEl&&(this.ariaLiveEl.innerText=`The ${r} group is disabled. Hiding its ${l} locations.`))},setGroupMarkersVisibility(s,t){this.markers.forEach(e=>{e.customGroupId===s&&e.setVisible(t)}),requestAnimationFrame(()=>{this.basicMapInstance?.updateMapBounds(!0),this.basicMapInstance?.centerMap()})},setUpMarkersAndListings(){if(!this.$el)return;const s=this.$el.querySelectorAll("[data-map-item]");if(!s.length)return;s.forEach((e,o)=>{let r=String(o+1);this.padIndex&&(r=r.padStart(2,"0")),e.setAttribute("data-map-item",r);const i=e.querySelector("[data-map-item-icon]");i&&(i.innerText=r)});const t=this.markers.length;t&&this.markers.forEach((e,o)=>{const r=e,i=r.point.listingEl,n=i.querySelector("[data-map-item-button]"),l=i.querySelector("[data-map-item-content]");if(!n||!l)return;n.marker=e;const c=i.getAttribute("data-map-item")||"",d=a("--marker-color",i,a("--grouped-map-option-1-bg",i,"")),I=a("--marker-hover-color",i,a("--grouped-map-hover-bg",i,"")),y=a("--marker-fg-color",i,""),g=a("--marker-fg-hover-color",i,""),m=i.getAttribute("data-group")||"";r.customGroupId=m,n.customGroupId=m;const f=i.getAttribute("data-title");f&&e.setTitle(f),n.isSelected=!1,r.isSelected=!1,this.setUpMarkerIconAndLabel(e,d,c,y||void 0),g&&(r.labelHoverColor=g);const p=e.getIcon(),E=Object.assign({},p);b(p,d),r.customDefaultIcon=p,b(E,I),r.customHoverIcon=E,r.customZIndex=t-o,e.setZIndex(r.customZIndex),e.addListener("mouseover",()=>{this.selectPair(n,e)}),e.addListener("mouseout",()=>{this.deselectPair(n,e)}),e.addListener("click",()=>{i.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}),this.openListingInPopover(n,l,e)})}),s.forEach(e=>{const o=e.querySelector("[data-map-item-button]");o&&this.listingButtons.push(o)})},setUpPopover(){!this.popoverEl||!this.popoverContentEl||(this.popoverEl.hidden=!0)},onListingHover(s){const t=s.currentTarget;if(!t)return;const o=t.marker;o&&this.selectPair(t,o)},onListingOut(s){const t=s.currentTarget;if(!t)return;const o=t.marker;o&&this.deselectPair(t,o)},onListingClick(s){const t=s.currentTarget;if(!t)return;const e=t.closest("[data-map-item]"),o=e?.querySelector("[data-map-item-content]");if(!e||!o)return;const i=t.marker;t.getAttribute("aria-expanded")==="false"?this.openListingInPopover(t,o,i??null):this.closePopover(!1)},openListingInPopover(s,t,e=null){if(!this.popoverEl||!this.popoverContentEl)return;this.restoreFocusEl=document.activeElement;const o=!this.popoverEl.hidden;this.closePopover(!1,!1),this.openListingButtonEl=s,this.openMarker=e,e&&this.selectPair(s,e,901),s.setAttribute("aria-expanded","true"),this.popoverContentEl.innerHTML=t.innerHTML,this.popoverEl.hidden=!1,this.isPopoverOpen=!0,this.ariaLiveEl&&(this.ariaLiveEl.innerText="Opened the location details dialog");const r=this.popoverEl.querySelector("h1");if(r)r.setAttribute("tabindex","-1"),r.focus();else{const i=this.popoverEl.querySelector("[data-close]");i&&i.focus()}o||this.popoverEl.animate([{[this.animationProperty]:"-100%"},{[this.animationProperty]:0}],{duration:this.animationDuration,easing:"ease"})},closePopover(s=!0,t=!0){if(!this.popoverEl||!this.popoverContentEl)return;const e=!this.popoverEl.hidden;this.openListingButtonEl&&this.openListingButtonEl.setAttribute("aria-expanded","fal
2se"),this.openListingButtonEl&&this.openMarker&&this.deselectPair(this.openListingButtonEl,this.openMarker,!0),this.openListingButtonEl=null,this.openMarker=null,s&&this.restoreFocusEl&&this.restoreFocusEl.focus();const o=()=>{this.popoverEl.hidden=!0,this.popoverContentEl.innerHTML="",this.isPopoverOpen=!1};e&&t?this.popoverEl.animate([{[this.animationProperty]:0},{[this.animationProperty]:"-100%"}],{duration:this.animationDuration,easing:"ease"}).addEventListener("finish",o,{once:!0,passive:!0}):o(),!e&&this.ariaLiveEl&&(this.ariaLiveEl.innerText="Closed the location detail dialog")},setUpFullscreenToggle(){if(!this.map)return;const s=document.createElement("button");s.innerHTML="Toggle Fullscreen",s.setAttribute("aria-label","Toggle fullscreen"),s.classList.add("custom-map-control"),this.map.controls[google.maps.ControlPosition.TOP_RIGHT].push(s);const t=(e=!1)=>{e?(s.innerHTML='<svg class="icon icon--shrink" role="presentation"><use xlink:href="#shrink"></use></svg>',s.setAttribute("title","Exit fullscreen mode"),s.setAttribute("aria-label","Exit fullscreen mode")):(s.innerHTML='<svg class="icon icon--enlarge" role="presentation"><use xlink:href="#enlarge"></use></svg>',s.setAttribute("title","Enter fullscreen mode"),s.setAttribute("aria-label","Enter fullscreen mode"))};this.listenerBoss.register(document,"fullscreenchange",()=>{const e=document.fullscreenElement!==null;t(e)}),this.listenerBoss.register(window,"keydown",e=>{const o=e;this.fauxFullscreenIsOpen&&(o.key==="Escape"||o.key==="Esc"||o.keyCode===27)&&this.closeFauxFullscreen()}),this.listenerBoss.register(s,"click",()=>{if(document.fullscreenEnabled)document.fullscreenElement!==null?document.exitFullscreen():this.$el&&this.$el.requestFullscreen();else{const e=!document.documentElement.classList.contains(this.fauxFullscreenDocumentClass);e?this.openFauxFullscreen():this.closeFauxFullscreen(),s.focus(),t(e)}}),t(!1)},openFauxFullscreen(){this.$el&&(this.placeholderEl||(this.placeholderEl=document.createElement("div"),this.placeholderEl.classList.add("grouped-map__placeholder")),document.documentElement.classList.add(this.fauxFullscreenDocumentClass),this.$el.parentNode.insertBefore(this.placeholderEl,this.$el),document.body.append(this.$el),this.$el.classList.add(this.fauxFullscreenClass),this.inertBoss.makeBodyDirectChildrenInertExcept(this.$el),this.fauxFullscreenIsOpen=!0)},closeFauxFullscreen(){!this.$el||!this.placeholderEl||(this.inertBoss.makeBodyDirectChildrenNotInert(),document.documentElement.classList.remove(this.fauxFullscreenDocumentClass),this.$el.classList.remove(this.fauxFullscreenClass),this.placeholderEl.parentNode.insertBefore(this.$el,this.placeholderEl),this.$el.parentNode.removeChild(this.placeholderEl),this.fauxFullscreenIsOpen=!1,this.$el.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}))},setUpLocationToggle(){if(!navigator.geolocation||!this.map||!this.basicMapInstance)return;let s=!1,t=null;const e=document.createElement("button");e.innerHTML='<svg class="icon icon--target" role="presentation"><use xlink:href="#target"></use></svg>',e.setAttribute("aria-label","Show your location"),e.classList.add("custom-map-control"),this.map.controls[google.maps.ControlPosition.TOP_RIGHT].push(e);const o="custom-map-control--active-location",r=i=>{i?(e.classList.add(o),e.setAttribute("title","Hide your location"),e.setAttribute("aria-label","Hide your location")):(e.classList.remove(o),e.setAttribute("title","Show your location"),e.setAttribute("aria-label","Show your location"))};this.listenerBoss.register(e,"click",()=>{if(!s)navigator.geolocation.getCurrentPosition(i=>{s=!0,t=new google.maps.Marker({map:this.map,position:{lat:i.coords.latitude,lng:i.coords.longitude},title:"My location",zIndex:900}),this.setUpMarkerIconAndLabel(t,"blue","Me"),this.basicMapInstance.markers.push(t),r(!0),this.basicMapInstance.updateMapBounds(!0),this.basicMapInstance.centerMap(),requestAnimationFrame(()=>{t?.setAnimation(google.maps.Animation.DROP)}),this.ariaLiveEl&&(this.ariaLiveEl.innerText="Your location marker has been added to the map.")},()=>{alert("The geolocation service failed. Please make sure your browser has location privileges.")});else if(t){const i=!t.getVisible();t.setVisible(i),r(i),this.basicMapInstance.updateMapBounds(!0),this.basicMapInstance.centerMap(),i?(requestAnimationFrame(()=>{t?.setAnimation(google.maps.Animation.DROP)}),this.ariaLiveEl&&(this.ariaLiveEl.innerText="Your location marker has been re-added to the map.")):this.ariaLiveEl&&(this.ariaLiveEl.innerText="Your location marker has been removed from the map.")}})},setUpMarkerIconAndLabel(s,t,e,o){T(s,t,e,o)},selectPair(s,t,e=900){if(this.deselectAll(),s.isSelected=!0,s.classList.add("hover"),t){const o=t;o.isSelected=!0;const r=o.customHoverIcon;t.setIcon(r??null),h(t,!0),t.setZIndex(e)}},deselectPair(s,t,e=!1){if(!(s===this.openListingButtonEl&&!e)&&(s.isSelected=!1,s.classList.remove("hover"),t)){const o=t;o.isSelected=!1;const r=o.customDefaultIcon;t.setIcon(r??null),h(t,!1),t.setZIndex(o.customZIndex)}},deselectAll(){this.listingButtons.length&&this.listingButtons.forEach(s=>{const t=s;t.isSelected&&s!==this.openListingButtonEl&&(s.classList.remove("hover"),t.isSelected=!1)}
2),this.markers.length&&this.markers.forEach(s=>{const t=s;if(t.isSelected&&s!==this.openMarker){const e=t.customDefaultIcon;s.setIcon(e??null),h(s,!1),t.isSelected=!1}})}});export{B as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.