PageSourceSearch

https://malibumag.com/assets/DirectoryHomePage-BhRt6Jee.js

js malibumag.com collected 2026-09-24 21:04:19 UTC 11,603 bytes, 8 lines download raw bytes

1import{j as e,A as t,u as R,i as W,s as k}from"./index-obhH_LhV.js";import{h as F,b as l,L as S}from"./react-vendor-iJun6VP1.js";import{S as C,b as $}from"./SiteShell-DO5yyJRk.js";import{P as T}from"./PrerenderReady-NFWVwRf3.js";import{A as L}from"./ArchiveButton-COgkzFkI.js";import"./supabase-vendor-o79c1kQX.js";import"./helpers-CddHt4ev.js";function q({siteName:r,images:i,typeaheadItems:c}){const u=F(),[d,m]=l.useState(0),[g,x]=l.useState(""),[f,h]=l.useState(!1),[y,b]=l.useState(!1),j=l.useRef(null),o=i.length>0;l.useEffect(()=>{if(i.length<=1)return;const s=setInterval(()=>m(n=>(n+1)%i.length),6e3);return()=>clearInterval(s)},[i.length]);const a=l.useMemo(()=>{if(!g.trim())return[];const s=g.toLowerCase();return c.filter(n=>n.name.toLowerCase().includes(s)).slice(0,8)},[g,c]);l.useEffect(()=>{const s=n=>{var w;(w=j.current)!=null&&w.contains(n.target)||h(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[]);const p=s=>{x(""),h(!1),u(s.kind==="section"?`/s/${s.slug}`:`/c/${s.slug}`)};return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
2        @supports (height: 100svh) {
3          .sp-directory-hero {
4            min-height: 100svh !important;
5            height: 100svh !important;
6          }
7        }
8      `}),e.jsxs("section",{className:"sp-directory-hero",style:{position:"relative",minHeight:"100vh",height:"100vh",overflow:"hidden",background:o?t.color.paper:`radial-gradient(120% 100% at 50% 0%, #262C36 0%, ${t.color.paper} 62%)`},children:[o&&i.map((s,n)=>e.jsx("div",{"aria-hidden":n!==d,style:{position:"absolute",inset:0,backgroundImage:`url("${s.url}")`,backgroundSize:"cover",backgroundPosition:"center",opacity:n===d?1:0,transition:"opacity 1.2s ease"}},s.url+n)),o&&e.jsx("div",{style:{position:"absolute",inset:0,background:"linear-gradient(to bottom, rgba(0,0,0,0.30) 0%, rgba(0,0,0,0.20) 38%, rgba(0,0,0,0.72) 100%)"}}),e.jsxs("div",{style:{position:"absolute",top:"34%",left:24,right:24,transform:"translateY(-50%)",color:t.color.white,textAlign:"center"},children:[e.jsxs("h1",{style:{fontFamily:t.font.heading,fontSize:"clamp(40px, 6vw, 64px)",lineHeight:1.05,fontWeight:700,letterSpacing:"-0.02em",margin:0,textShadow:"0 2px 24px rgba(0,0,0,0.55)"},children:["Discover the best of ",r]}),e.jsx("p",{style:{fontFamily:t.font.body,fontSize:"clamp(16px, 1.6vw, 19px)",opacity:.92,marginTop:14,maxWidth:640,marginLeft:"auto",marginRight:"auto",textShadow:"0 1px 12px rgba(0,0,0,0.55)"},children:"The local directory for restaurants, shops, services, and more."})]}),e.jsx("div",{ref:j,style:{position:"absolute",left:24,right:24,bottom:"20%",display:"flex",justifyContent:"center"},children:e.jsxs("div",{style:{position:"relative",width:"100%",maxWidth:640},children:[e.jsx("input",{type:"search",placeholder:"Search restaurants, shops, services…",value:g,onChange:s=>{x(s.target.value),h(!0)},onFocus:()=>{h(!0),b(!0)},onBlur:()=>b(!1),onKeyDown:s=>{s.key==="Enter"&&a[0]&&p(a[0])},style:{width:"100%",padding:"14px 20px",borderRadius:8,fontFamily:t.font.body,fontSize:16,background:"rgba(14,17,20,0.45)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",color:t.color.ink,border:y?`1px solid ${t.color.premium}`:"1px solid rgba(195,199,206,0.45)",boxShadow:y?"0 10px 40px rgba(0,0,0,0.45), 0 0 0 3px rgba(195,199,206,0.15)":"0 10px 40px rgba(0,0,0,0.45)",outline:"none",transition:"border-color 0.2s ease, box-shadow 0.2s ease"}}),f&&a.length>0&&e.jsx("ul",{style:{listStyle:"none",padding:0,margin:"6px 0 0",background:t.color.card,color:t.color.ink,border:`1px solid ${t.color.rule}`,borderRadius:8,boxShadow:"0 12px 32px rgba(0,0,0,0.55)",position:"absolute",left:0,right:0,textAlign:"left",overflow:"hidden",zIndex:5},children:a.map(s=>e.jsx("li",{children:e.jsxs("button",{onClick:()=>p(s),style:{width:"100%",textAlign:"left",padding:"12px 18px",background:"transparent",border:"none",cursor:"pointer",fontFamily:t.font.body,fontSize:15,color:t.color.ink,display:"flex",justifyContent:"space-between",gap:16},onMouseEnter:n=>{n.target.style.background=t.color.surface},onMouseLeave:n=>{n.target.style.background="transparent"},children:[e.jsx("span",{children:s.name}),e.jsx("span",{style:{fontSize:11,color:t.color.inkLight,textTransform:"uppercase",letterSpacing:"0.06em"},children:s.kind})]})},`${s.kind}-${s.slug}`))})]})}),i.length>1&&e.jsx("div",{style:{position:"absolute",bottom:18,left:0,right:0,display:"flex",justifyContent:"center",gap:8},children:i.map((s,n)=>e.jsx("button",{"aria-label":`Hero image ${n+1}`,onClick:()=>m(n),style:{width:8,height:8,borderRadius:"50%",border:"none",padding:0,cursor:"pointer",background:n===d?t.color.white:"rgba(255,255,255,0.4)",transition:"background 0.3s ease"}},n))})]})]})}function U(){const r=R(),i=r.settings,c=(i==null?void 0:i.directory_cities)??[],u=((i==null?void 0:i.directory_hero_images)??[]).slice(0,4),[d,m]=l.useState([]),[g,x]=l.useState([]),[f,h]=l.useState([]),[y,b]=l.useState([]);l.useEffect(()=>{r.id&&(W({title:`${r.name} — local businesses, made findable`,description:`Browse local businesses across ${r.name}: restaurants, shops, services, and more.`,siteName:r.name,type:"website"}),(async()=>{const[o,a,p,s]=await Promise.all([k.from("directory_sections").select("id, name, slug, description").eq("site_id",r.id).eq("is_active",!0).order("position",{ascending:!0}),k.from("directory_categories").select("id, name, slug").eq("site_id",r.id).eq("is_active",!0).order("name",{ascending:!0}),k.from("directory_listings").select("id, name, slug, short_description, card_image_url, logo_url, external_click_url, website_url").eq("site_id",r.id).eq("status","published").eq("tier","premium").limit(4),k.from("magazine_editions").select("slug, title, series, cover_image_url, page_images_base_url, publish_date").eq("site_id",r.id).eq("is_published",!0).eq("status","ready").order("publish_date",{ascending:!1}).limit(20)]);
8m(o.data??[]),x(a.data??[]),h(p.data??[]),b(s.data??[])})())},[r.id,r.name]);const j=[...d.map(o=>({kind:"section",name:o.name,slug:o.slug})),...g.map(o=>({kind:"category",name:o.name,slug:o.slug}))];return e.jsxs(C,{children:[e.jsx(T,{route:"/",when:d.length>0}),e.jsxs("main",{style:{background:t.color.paper,color:t.color.ink,fontFamily:t.font.body},children:[e.jsx(q,{siteName:r.name,images:u.map(o=>({url:o.url,label:o.label})),typeaheadItems:j}),(()=>{const o=I(y);return o.length>0&&e.jsxs("section",{style:{padding:"48px 24px 8px",maxWidth:1200,margin:"0 auto"},children:[e.jsx(v,{kicker:"Seasonal",title:"Shop the season"}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(160px, 1fr))",gap:20},children:o.map(a=>{const p=a.cover_image_url||(a.page_images_base_url?`${a.page_images_base_url}/p1-1200.webp`:null);return e.jsxs(S,{to:`/magazine/${a.slug}`,style:{textDecoration:"none",color:"inherit"},children:[e.jsx("div",{style:{aspectRatio:"3/4",background:p?`url("${$(p,400)}") center/cover no-repeat`:t.color.surface,borderRadius:8,boxShadow:"0 1px 4px rgba(0,0,0,0.12)"}}),e.jsx("div",{style:{fontSize:14,fontWeight:600,color:t.color.ink,marginTop:8,textAlign:"center"},children:a.series??a.title})]},a.slug)})}),e.jsx("div",{style:{marginTop:24},children:e.jsx(L,{})})]})})(),f.length>0&&e.jsxs("section",{style:{padding:"60px 24px",maxWidth:1200,margin:"0 auto"},children:[e.jsx(v,{kicker:"Featured",title:"Premium businesses"}),e.jsx("div",{style:z(4),children:f.map(o=>e.jsx(E,{listing:o},o.id))})]}),e.jsx("section",{id:"sections",style:{padding:"60px 24px",background:t.color.surface,scrollMarginTop:80},children:e.jsxs("div",{style:{maxWidth:1200,margin:"0 auto"},children:[e.jsx(v,{kicker:"Browse",title:"By section"}),d.length===0?e.jsx("div",{style:{color:t.color.inkMid,fontStyle:"italic"},children:"Loading sections…"}):e.jsx("div",{style:z(5),children:d.map(o=>e.jsxs(S,{to:`/s/${o.slug}`,style:_,children:[e.jsx("div",{style:{fontFamily:t.font.heading,fontSize:20,fontWeight:600,color:t.color.ink},children:o.name}),o.description&&e.jsx("div",{style:{fontSize:13,color:t.color.inkMid,marginTop:6,lineHeight:1.4},children:o.description})]},o.id))})]})}),c.length>0&&e.jsx("section",{id:"cities",style:{padding:"60px 24px",scrollMarginTop:80},children:e.jsxs("div",{style:{maxWidth:1200,margin:"0 auto"},children:[e.jsx(v,{kicker:"Where",title:"By city"}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:10},children:c.map(o=>e.jsx(S,{to:`/?city=${encodeURIComponent(o.slug)}`,style:{display:"inline-block",padding:"10px 18px",background:t.color.card,border:`1px solid ${t.color.rule}`,borderRadius:999,color:t.color.ink,textDecoration:"none",fontSize:14,fontWeight:500},children:o.name},o.slug))})]})}),e.jsx("section",{style:{padding:"70px 24px",background:t.color.surface,color:t.color.ink,textAlign:"center"},children:e.jsxs("div",{style:{maxWidth:720,margin:"0 auto"},children:[e.jsx("h2",{style:{fontFamily:t.font.heading,fontSize:36,fontWeight:700,margin:0,letterSpacing:"-0.01em"},children:"List your business"}),e.jsxs("p",{style:{fontSize:17,marginTop:14,opacity:.85,lineHeight:1.5},children:["Reach customers across ",r.name," with a free standard listing — or stand out with premium placement."]}),e.jsx("a",{href:`mailto:${(i==null?void 0:i.support_email)||"[email protected]"}?subject=List my business on ${r.name}`,style:{display:"inline-block",marginTop:26,padding:"14px 32px",background:t.color.primary,color:t.color.white,borderRadius:6,textDecoration:"none",fontWeight:600,fontSize:16},children:"Get listed →"})]})})]})]})}function I(r){const i=new Set,c=[];for(const u of r){const d=u.series??`__no-series-${u.slug}`;if(!i.has(d)&&(i.add(d),c.push(u),c.length===4))break}return c}function v({kicker:r,title:i}){return e.jsxs("div",{style:{marginBottom:32},children:[e.jsx("div",{style:{fontSize:12,textTransform:"uppercase",letterSpacing:"0.14em",color:t.color.primary,fontWeight:600},children:r}),e.jsx("h2",{style:{fontFamily:t.font.heading,fontSize:36,fontWeight:700,margin:"6px 0 0",letterSpacing:"-0.01em",color:t.color.ink},children:i})]})}function z(r){return{display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(${r>=5?200:240}px, 1fr))`,gap:16}}const _={display:"block",padding:"20px 18px",background:t.color.card,border:`1px solid ${t.color.rule}`,borderRadius:10,textDecoration:"none",transition:"transform 0.15s ease, border-color 0.15s ease"};function E({listing:r}){const i=r.external_click_url||r.website_url||`/listing/${r.slug}`,c=i.startsWith("http"),u=e.jsxs(e.Fragment,{children:[r.card_image_url||r.logo_url?e.jsx("div",{style:{aspectRatio:"4/3",background:`url("${$(r.card_image_url||r.logo_url,400)}") center/cover no-repeat`,borderRadius:8}}):e.jsx("div",{style:{aspectRatio:"4/3",background:t.color.surface,borderRadius:8,display:"flex",alignItems:"center",justifyContent:"center",color:t.color.inkLight,fontSize:13},children:r.name}),e.jsxs("div",{style:{marginTop:12},children:[e.jsx("div",{style:{fontSize:10,textTransform:"uppercase",letterSpacing:"0.12em",color:t.color.premium,fontWeight:700},children:"Premium"}),e.jsx("div",{style:{fontFamily:t.font.heading,fontSize:18,fontWeight:600,marginTop:4,color:t.color.ink},children:r.name}),r.short_description&&e.jsx("div",{style:{fontSize:13,color:t.color.inkMid,marginTop:6,lineHeight:1.4},children:r.short_description})]})]});return c?e.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",style:{..._,padding:0,borderColor:t.color.premium},children:e.jsx("div",{style:{padding:14},children:u})}):e.jsx(S,{to:i,style:{..._,padding:14,borderColor:t.color.premium},children:u})}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.