PageSourceSearch

https://www.fazergroup.com/dist/assets/LocationMap.B_i72UF2.js

js fazergroup.com collected 2026-09-24 22:51:15 UTC 3,083 bytes, 6 lines download raw bytes

1import{d as D,u as N,o as S,M as U,O as f,a as I,e as w,b as C,C as P,j as z,n as G,h as Z,Q as $,H as b}from"./main.CqmBQMb1.js";import{l as j,m as V,r as _,h as g,b as L}from"./locationMapHelpers.BkZFicZQ.js";const q=(i,s,l)=>{const n=`
2    <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="${i}" stroke="${s}" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
3      <path d="M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z"/>
4      <circle cx="12" cy="10" r="3" fill="${s}"/>
5    </svg>
6  `,r=document.createElement("img");return l?r.src=l:r.src=`data:image/svg+xml;charset=UTF-8,${encodeURIComponent(n)}`,r.width=32,r.height=32,r.style.maxWidth="none",r.style.display="block",r},F=(i,s,l,n)=>{i.replaceChildren(q(s,l,n))},R={class:"w-full"},H={key:0,class:"bg-secondary text-secondary flex aspect-square w-full items-center justify-center text-sm"},Q=15,W=16,O=40,X=D({__name:"LocationMap",props:{locations:{},openCityGroup:{},selectedLocationId:{},customPinUrl:{}},emits:["marker-clicked"],setup(i,{emit:s}){const l=s,n=i,r=b(null),c=b(!1),{t:E}=N();let o=null,d=null,u=null,h="--palette-bg-primary-solid",k="--palette-bg-primary";const m=new Map,y=()=>{m.forEach(e=>e.map=null),m.clear()},v=()=>{y();const e=d;!e||!o||n.locations.forEach(t=>{if(!g(t)||t.contentId==null)return;const a=new e({position:{lat:t.latitude,lng:t.longitude},map:o,title:t.title,gmpClickable:!0});F(a,h,k,n.customPinUrl),a.addListener("click",()=>l("marker-clicked",t)),m.set(t.contentId,a)})},x=e=>{if(!o)return;const t=e.locations?.filter(g)??[];if(!t.length)return;if(t.length===1){o.panTo({lat:t[0].latitude,lng:t[0].longitude}),o.setZoom(Q);return}const a=L(t);a&&o.fitBounds(a,O)},M=e=>{!o||!g(e)||(o.panTo({lat:e.latitude,lng:e.longitude}),o.setZoom(W))},B=()=>{if(n.selectedLocationId==null)return!1;const e=n.locations.find(t=>t.contentId===n.selectedLocationId);return e?(M(e),!0):!1},p=()=>{if(!o)return;const e=L(n.locations);e&&o.fitBounds(e,O)},T=async()=>{if(await j(),!r.value)return;const e=r.value,t=V?.trim()||"DEMO_MAP_ID",[{Map:a},{AdvancedMarkerElement:A}]=await Promise.all([google.maps.importLibrary("maps"),google.maps.importLibrary("marker")]);d=A,h=_(e,"--palette-bg-primary-solid"),k=_(e,"--palette-bg-primary"),o=new a(e,{center:{lat:0,lng:0},zoom:2,mapTypeControl:!1,mapId:t}),u=new ResizeObserver(()=>{o&&google.maps.event.trigger(o,"resize")}),u.observe(e),v(),setTimeout(()=>{p()},100)};return S(async()=>{try{await T()}catch(e){console.error("Google Maps failed to load",e),c.value=!0}}),U(()=>{u?.disconnect(),y(),o=null,d=null}),f(()=>n.locations,async()=>{o&&(v(),setTimeout(()=>{B()||p()},50))},{deep:!0}),f(()=>n.openCityGroup,async(e,t)=>{o&&(e?x(e):t&&p())}),f(()=>n.selectedLocationId,e=>{if(!o||e==null)return;const t=n.locations.find(a=>a.contentId===e);t&&M(t)}),(e,t)=>(I(),w("div",R,[c.value?(I(),w("div",H,[C("p",null,P(z(E)("/locationfinder/map-load-error")),1)])):G("",!0),Z(C("div",{ref_key:"mapContainer",ref:r,class:"aspect-square w-full"},null,512),[[$,!c.value]])]))}});export{X 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.