1import{n as y,aA as W,r as c,o as r,y as w,w as d,a as u,H as _,c as g,F as k,s as I,t as f,q as b,d as S,b as M,A as B}from"./D38POLyw.js";import{G as C}from"./BH8yK4rK.js";import{m as j}from"./SB94ju4J.js";import"./CTwmi89Q.js";const D={data(){return{markers:[],includeBuids:!1,doFitBounds:!1,responseData:{},currentMarkerId:null,showClusterCount:!0,infoWindow:{open:!1,position:null,data:null,index:null,options:{pixelOffset:{width:0,height:-35}}}}},mounted(){this.getMapClusters()},watch:{$route(){location.reload()}},methods:{async getMapClusters(){await j({"include-buids":this.includeBuids},this.$config.public).then(o=>this.setMarkers(o)).catch(o=>{console.error(`Failed to fetch markers: ${o}`)})},setMarkers(o){for(const[t,n]of Object.entries(o)){const e=t.split("::"),s=parseFloat(e[0]),i=parseFloat(e[1]),a=e[2];this.markers.push({position:{lat:s,lng:i},data:{buid:a,jobCount:n,location:null}});const p=this.getLatLngSlab(s,i);this.responseData[p]=n,this.doFitBounds&&this.fitBounds()}},fitBounds(){const o=new google.maps.LatLngBounds;this.markers.forEach(t=>{o.extend(new google.maps.LatLng(t.position.lat,t.position.lng))}),this.$refs.gmap.fitBounds(o)},getClusterJobCount(o){let t=0;for(let n=0;n<o.length;n++){const e=this.getLatLngSlab(o[n].position.toJSON().lat,o[n].position.toJSON().lng);t+=this.responseData[e]}return t},clusterRenderer(){return{render:(o,t)=>{const{markers:n,position:e,count:s}=o,i=this.getClusterJobCount(n),a=this.setClusterSVG(s,t.clusters.markers.mean);return new google.maps.Marker({position:e,icon:{url:`data:image/svg+xml;base64,${a}`,scaledSize:new google.maps.Size(45,45)},label:{text:`${i}`,color:this.showClusterCount?"rgba(255,255,255,0.9)":"transparent",fontSize:"12px"},title:`${i} jobs`,zIndex:Number(google.maps.Marker.MAX_ZINDEX)+s})}}},toggleInfoWindow(o,t){this.infoWindow.position=o.position,this.infoWindow.data=o.data,o.data.location||this.searchLatLngJobs(o.position),this.currentMarkerId==t?this.infoWindow.open==!this.infoWindow.open:(this.infoWindow.open=!0,this.currentMarkerId=t)},resetInfoWindow(){this.infoWindow.open=!1,this.currentMarkerId=null},getLatLngSlab(o,t){return`${o}::${t}`},async searchLatLngJobs(o){let t=this.getLatLngSlab(o.lat,o.lng);const n=await C.get({location:t},this.$config.public);this.infoWindow.data.location=n},async searchLocation(o){if(o.data.location)window.location.href=`/jobs/?location=${encodeURIComponent(o.data.location)}`;else{let t=this.getLatLngSlab(o.position.lat,o.position.lng);const n=await C.get({location:t},this.$config.public);window.location.href=`/jobs/?location=${encodeURIComponent(n)}`}}}},F={zoom:3,center:{lat:35,lng:-94},style:"width: 100%; height:500px;",heading:void 0,mapTypeId:"roadmap",tilt:void 0,options:{disableDefaultUI:!0,mapTypeControl:!1,streetViewControl:!1,fullscreenControl:!1,maxZoom:17}},J={},N={components:{GmvCluster:W.Cluster},mixins:[D],data(){return{doFitBounds:!0,mapProps:F,showClusterCount:!0,clusterOptions:J}},methods:{setClusterSVG(o,t){return window.btoa(` 2<svg fill="#0057b8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240"> 3 <circle cx="120" cy="120" opacity=".6" r="70" /> 4 <circle cx="120" cy="120" opacity=".3" r="90" /> 5 <circle cx="120" cy="120" opacity=".2" r="110" /> 6</svg>`)},async searchLocation(o){if(o.data.location)window.location.href=`/jobs/?r=25&location=${encodeURIComponent(o.data.location)}`;else{let t=this.getLatLngSlab(o.position.lat,o.position.lng);await GeocodeCoordsService.get({location:t},this.$config.public).then(n=>{window.location.href=`/jobs/?location=${encodeURIComponent(n.data)}`})}}}},x={key:0},O={key:0};function V(o,t,n,e,s,i){const a=c("gmv-marker"),p=c("gmv-info-window"),v=c("gmv-cluster"),L=c("gmv-map"),$=B;return r(),w($,null,{default:d(()=>[u(L,_({...s.mapProps},{ref:"gmap"}),{default:d(()=>[u(v,{options:s.clusterOptions,renderer:o.clusterRenderer()},{default:d(()=>[(r(!0),g(k,null,I(o.markers,(l,m)=>(r(),w(a,{key:m,position:l.position,clickable:!0,onClick:h=>i.searchLocation(l),onMouseover:h=>o.toggleInfoWindow(l,m),onMouseout:t[0]||(t[0]=h=>o.resetInfoWindow()),icon:"https://d12wqovxet6953.cloudfront.net/jobmap/images/burnsmcd.png"},null,8,["position","onClick","onMouseover"]))),128)),u(p,{options:o.infoWindow.options,position:o.infoWindow.position,opened:o.infoWindow.open,onCloseclick:t[1]||(t[1]=l=>o.resetInfoWindow())},{default:d(()=>[o.infoWindow.data?(r(),g("div",x,[o.infoWindow.data.location?(r(),g("span",O,f(o.infoWindow.data.location)+":",1)):b("",!0),S(" "+f(o.infoWindow.data.jobCount)+" "+f(o.infoWindow.data.jobCount>0?"jobs":"job")+" ",1),t[2]||(t[2]=M("hr",null,null,-1))])):b("",!0)]),_:1},8,["options","position","opened"])]),_:1},8,["options","renderer"])]),_:1},16)]),_:1})}const U=Object.assign(y(N,[["render",V]]),{__name:"AppMapCluster"});export{U 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.