PageSourceSearch

https://malibumag.com/assets/MapPage-B7k_fTms.js

js malibumag.com collected 2026-09-24 21:04:06 UTC 4,041 bytes, 6 lines download raw bytes

1import{u as _,i as P,s as z,j as e}from"./index-obhH_LhV.js";import{f as C,b as l,L as k}from"./react-vendor-iJun6VP1.js";import{S as w}from"./SiteShell-DO5yyJRk.js";import{M}from"./MapView-VczZGM-y.js";import{i as E,u as W,a as q}from"./placeCategories-CiC3M-zQ.js";import"./supabase-vendor-o79c1kQX.js";import"./helpers-CddHt4ev.js";function L(t,s){return t.includes(s)?t.filter(p=>p!==s):[...t,s]}function H({}){var g,f,u;const t=_(),[s,p]=C(),n=l.useMemo(()=>s.getAll("cat").filter(E),[s]),[d,c]=l.useState([]),[x,m]=l.useState(!0),[r,y]=l.useState(null),b=W(t.id,!0);l.useEffect(()=>{P({title:`Map — ${t.name}`,description:`Explore every published place on a map of ${t.name}.`,siteName:t.name,type:"website"})},[t.name]),l.useEffect(()=>{let i=!1;m(!0);let a=z.from("places").select("*").eq("site_id",t.id).eq("is_published",!0).eq("is_permanently_closed",!1).not("latitude","is",null).not("longitude","is",null).limit(500);return n.length===1?a=a.eq("category",n[0]):n.length>1&&(a=a.in("category",n)),a.then(({data:o,error:h})=>{i||(h?(console.error("[MapPage] places query failed",h.message),c([])):c(o??[]),m(!1))}),()=>{i=!0}},[t.id,n.join("|")]);function v(i){const a=new URLSearchParams(s);a.delete("cat"),L(n,i).forEach(o=>a.append("cat",o)),p(a,{replace:!1})}const j={lat:Number(((g=t.settings)==null?void 0:g.map_center_lat)??34.0259),lng:Number(((f=t.settings)==null?void 0:f.map_center_lng)??-118.7798)},S=Number(((u=t.settings)==null?void 0:u.map_default_zoom)??12);return e.jsx(w,{children:e.jsxs("main",{style:{fontFamily:"var(--sp-body-font)"},children:[e.jsxs("div",{style:{maxWidth:1400,margin:"0 auto",padding:"24px 24px 0"},children:[e.jsxs("header",{style:{marginBottom:16},children:[e.jsx("h1",{style:{fontFamily:"var(--sp-heading-font)",fontSize:36,fontWeight:500,letterSpacing:"-0.01em",color:"var(--sp-text-strong)",margin:0},children:"Map"}),e.jsx("p",{style:{margin:"4px 0 0",fontSize:14,color:"var(--sp-text-muted)"},children:x?"Loading…":`${d.length} ${d.length===1?"place":"places"} plotted`})]}),e.jsx("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginBottom:16},children:b.map(({category:i,count:a})=>{const o=n.includes(i);return e.jsxs("button",{type:"button",onClick:()=>v(i),style:{padding:"6px 14px",fontSize:13,fontFamily:"var(--sp-body-font)",fontWeight:500,borderRadius:999,border:`1px solid ${o?"var(--sp-guide-sand, #D4B896)":"var(--sp-border)"}`,background:o?"var(--sp-guide-sand, #D4B896)":"transparent",color:o?"#fff":"var(--sp-text-strong)",cursor:"pointer",whiteSpace:"nowrap"},children:[q(i,"plural")," (",a,")"]},i)})})]}),e.jsxs("div",{style:{maxWidth:1400,margin:"0 auto",padding:"0 24px 80px",display:"grid",gridTemplateColumns:"minmax(0, 1fr) 320px",gap:24},children:[e.jsx(M,{places:d,height:"calc(100vh - 240px)",initialCenter:j,initialZoom:S,onPlaceClick:y}),e.jsx("aside",{style:{background:"#fff",border:"1px solid var(--sp-border)",borderRadius:12,padding:20,height:"fit-content",position:"sticky",top:24},children:r?e.jsxs(e.Fragment,{children:[e.jsx("h3",{style:{fontFamily:"var(--sp-heading-font)",fontSize:22,fontWeight:500,margin:"0 0 8px"},children:r.name}),r.short_description&&e.jsx("p",{style:{fontSize:14,color:"var(--sp-text-mid)",lineHeight:1.5,margin:"0 0 12px"},children:r.short_description}),r.neighborhood&&e.jsx("p",{style:{fontSize:12,color:"var(--sp-text-muted)",margin:"0 0 16px"},children:r.neighborhood}),e.jsx(k,{to:`/place/${r.slug}`,style:{display:"inline-block",padding:"8px 14px",fontSize:13,fontWeight:600,color:"#fff",background:"var(--sp-guide-coral, #E8A598)",borderRadius:8,textDecoration:"none"},children:"View details →"})]}):e.jsx("p",{style:{fontSize:14,color:"var(--sp-text-muted)",margin:0,lineHeight:1.5},children:"Tap a pin to see place details."})})]}),e.jsx("style",{children:`
2          @media (max-width: 900px) {
3            main > div:nth-child(2) { grid-template-columns: 1fr !important; }
4            main > div:nth-child(2) aside { position: static !important; }
5          }
6        `})]})})}export{H 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.