PageSourceSearch

https://www.quicksites.ai/_next/static/chunks/37347.442b5c03a42f0b7f.js

js quicksites.ai collected 2026-10-05 14:39:48 UTC 7,726 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[37347],{37347:(e,t,s)=>{s.r(t),s.d(t,{default:()=>o});var n=s(95155);function l(e){let{name:t}=e,s=function(e){let t=0;for(let s=0;s<e.length;s++)t=(31*t+e.charCodeAt(s))%360;return t}(t);return(0,n.jsx)("div",{className:"flex h-full w-full items-center justify-center",style:{backgroundColor:"hsl(".concat(s," 45% 88%)"),color:"hsl(".concat(s," 55% 28%)")},"aria-hidden":!0,children:(0,n.jsx)("span",{className:"text-3xl font-bold tracking-tight",children:function(e){let t=e.replace(/[^A-Za-z0-9 ]/g," ").split(/\s+/).filter(Boolean).filter((e,t)=>!(0===t&&/^(the|a|an|el|la|los|las)$/i.test(e)));return t.length?1===t.length?t[0].slice(0,2).toUpperCase():(t[0][0]+t[1][0]).toUpperCase():"\xb7"}(t)})})}var r=s(12115);function a(e){let{campaignId:t}=e,[s,l]=r.useState(null),[a,i]=r.useState(!1),[o,c]=r.useState(null),[d,m]=r.useState(!1),x=r.useCallback(async()=>{try{var e;let s=await fetch("/api/admin/restaurant-directory?campaign=".concat(t),{cache:"no-store"});if(!s.ok){m(!0);return}let n=await s.json();l(null!==(e=n.candidates)&&void 0!==e?e:[])}catch(e){m(!0)}},[t]);r.useEffect(()=>{x()},[x]);let u=async(e,s)=>{c(e);try{let r=await fetch("/api/admin/restaurant-directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({campaignId:t,templateId:e,action:s})});if(r.ok){var n;let e=await r.json();l(null!==(n=e.candidates)&&void 0!==n?n:[])}}finally{c(null)}};if(d||!s)return null;let h=s.filter(e=>e.onDirectory),p=s.filter(e=>!e.onDirectory);return(0,n.jsx)("div",{className:"fixed bottom-4 right-4 z-[2147483000] w-[min(26rem,calc(100vw-2rem))] print:hidden",children:a?(0,n.jsxs)("div",{className:"max-h-[70vh] overflow-y-auto rounded-2xl border border-zinc-700 bg-zinc-900 p-4 text-zinc-100 shadow-2xl",children:[(0,n.jsxs)("div",{className:"mb-1 flex items-center justify-between",children:[(0,n.jsx)("h3",{className:"text-sm font-semibold text-zinc-100",children:"Curate this directory"}),(0,n.jsx)("button",{onClick:()=>i(!1),className:"text-zinc-400 hover:text-white","aria-label":"Close",children:"✕"})]}),(0,n.jsx)("p",{className:"mb-3 text-[11px] leading-snug text-zinc-400",children:"Changes this public list only. Nobody is removed from the competition, loses their site, or drops out of outreach."}),(0,n.jsxs)("p",{className:"mb-1.5 text-[11px] font-medium uppercase tracking-wide text-zinc-500",children:["On the list (",h.length,")"]}),(0,n.jsxs)("ul",{className:"space-y-1.5",children:[h.map(e=>(0,n.jsxs)("li",{className:"flex items-center gap-2 rounded-lg bg-zinc-800/60 px-2.5 py-2",children:[(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{className:"block truncate text-sm text-zinc-100",children:e.businessName}),e.extra&&(0,n.jsx)("span",{className:"text-[10px] text-sky-300",children:"added manually"})]}),(0,n.jsx)("button",{disabled:o===e.templateId,onClick:()=>u(e.templateId,e.extra?"remove":"hide"),className:"shrink-0 rounded-md border border-zinc-600 px-2 py-1 text-xs hover:bg-zinc-700 disabled:opacity-50",children:"Hide"})]},e.templateId)),!h.length&&(0,n.jsx)("li",{className:"px-1 text-xs text-zinc-500",children:"Nothing on the list yet."})]}),(0,n.jsxs)("p",{className:"mb-1.5 mt-4 text-[11px] font-medium uppercase tracking-wide text-zinc-500",children:["Not showing (",p.length,")"]}),(0,n.jsxs)("ul",{className:"space-y-1.5",children:[p.map(e=>{var t;return(0,n.jsxs)("li",{className:"flex items-center gap-2 rounded-lg bg-zinc-800/30 px-2.5 py-2",children:[(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{className:"block truncate text-sm text-zinc-300",children:e.businessName}),(0,n.jsx)("span",{className:"block truncate text-[10px] text-zinc-500",children:e.hidden?"hidden by you":null!==(t=e.excludedReason)&&void 0!==t?t:e.inCohort?"in cohort, not shown":"not in this cohort"})]}),(0,n.jsx)("button",{disabled:o===e.templateId,onClick:()=>u(e.templateId,e.hidden?"show":"add"),className:"shrink-0 rounded-md border border-emerald-600/50 bg-emerald-500/10 px-2 py-1 text-xs text-emerald-200 hover:bg-emerald-500/20 disabled:opacity-50",children:e.hidden?"Unhide":"Add"})]},e.templateId)}),!p.length&&(0,n.jsx)("li",{className:"px-1 text-xs text-zinc-500",children:"Nothing else nearby."})]}),(0,n.jsx)("p",{className:"mt-3 text-[11px] text-zinc-500",children:"Reload the page to see the public list update."})]}):(0,n.jsxs)("button",{onClick:()=>i(!0),className:"ml-auto flex items-center gap-2 rounded-full border border-amber-500/40 bg-zinc-900/95 px-4 py-2 text-sm font-medium text-amber-200 shadow-lg backdrop-blur hover:bg-zinc-900",children:["✏️ Curate list ",(0,n.jsxs)("span",{className:"text-amber-400/70",children:["(",h.length,")"]})]})})}function i(e){let{entry:t,featured:s}=e;return(0,n.jsxs)("a",{href:t.url||"#",target:"_blank",rel:"noopener noreferrer",className:"group block overflow-hidden rounded-2xl border border-border bg-card transition hover:border-amber-500/50 hover:bg-muted ".concat(s?"sm:col-span-2":""),children:[(0,n.jsxs)("div",{className:"relative w-full overflow-hidden bg-muted ".concat(s?"aspect-[2/1]":"aspect-[3/2]"),children:[t.hero_url?(0,n.jsx)("img",{src:t.hero_url,alt:t.business_name,className:"h-full w-full object-cover transition duration-300 group-hover:scale-105"}):(0,n.jsx)(l,{name:t.business_name}),t.is_winner&&(0,n.jsx)("span",{className:"absolute left-3 top-3 rounded-full bg-amber-500 px-2.5 py-1 text-xs font-semibold text-zinc-950 shadow",children:"★ Featured"})]}),(0,n.jsxs)("div",{className:"p-4",children:[(0,n.jsx)("div",{className:"text-base font-semibold text-white group-hover:text-amber-300",children:t.business_name}),(0,n.jsx)("div",{className:"mt-1 text-xs text-muted-foreground",children:"View menu & order online →"})]})]})}function o(e){var t,s,l;let{block:o,content:c,previewOnly:d}=e,m=null!==(l=null!==(s=null!=c?c:null==o?void 0:o.content)&&void 0!==s?s:null==o?void 0:o.props)&&void 0!==l?l:{},x=String((null==m?void 0:m.campaign_id)||""),u=Array.isArray(null==m?void 0:m.entries)?m.entries:[],[h,p]=r.useState(null);r.useEffect(()=>{if(!x)return;let e=!0;return fetch("/api/public/restaurant-directory?campaign=".concat(encodeURIComponent(x)),{cache:"no-store"}).then(e=>e.ok?e.json():null).then(t=>{e&&Array.isArray(null==t?void 0:t.entries)&&p(t.entries)}).catch(()=>{}),()=>{e=!1}},[x]);let b=[...null!=h?h:u].sort((e,t)=>
1Number(!!t.is_winner)-Number(!!e.is_winner)||e.business_name.localeCompare(t.business_name)),f=null!==(t=b.find(e=>e.is_winner))&&void 0!==t?t:null,g=f?b.filter(e=>e.template_id!==f.template_id):b,j=(null==m?void 0:m.title)||"";return b.length?(0,n.jsxs)("section",{className:"mx-auto w-full max-w-5xl px-6 py-10",children:[j&&(0,n.jsx)("h2",{className:"mb-6 text-center text-2xl font-bold",children:j}),(0,n.jsxs)("div",{className:"grid grid-cols-1 gap-5 sm:grid-cols-2",children:[f&&(0,n.jsx)(i,{entry:f,featured:!0}),g.map(e=>(0,n.jsx)(i,{entry:e},e.template_id))]}),(0,n.jsxs)("div",{className:"mt-10 border-t border-border pt-4 text-center text-xs text-muted-foreground",children:["Order online, direct from the kitchen \xb7 powered by ","delivered.menu"]}),x&&!d?(0,n.jsx)(a,{campaignId:x}):null]}):(0,n.jsxs)("section",{className:"mx-auto w-full max-w-5xl px-6 py-10",children:[j&&(0,n.jsx)("h2",{className:"mb-4 text-center text-2xl font-bold",children:j}),(0,n.jsx)("div",{className:"rounded-2xl border border-dashed border-border px-6 py-14 text-center text-sm text-muted-foreground",children:d||x?"Restaurants appear here automatically — the live contest cohort, winner featured first.":"Link this block to a restaurant competition (campaign_id) to list its cohort here."})]})}}}]);

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.