1import{d as Ie,r as v,l as o,j as e,a as _,a1 as Pe,x as J,J as y,C as xe,a2 as Re,a3 as ue}from"./index-f--GfbGy.js";import{D as Le}from"./DailyDigestCard-DHsV5P9u.js";import{c as me}from"./cases-Dr9jiCNv.js";import{A as ge}from"./arrow-right-BM8FEdkT.js";import{S as qe}from"./shuffle-CnGVrXuM.js";import"./mail-u4N8664d.js";import"./refresh-cw-DmIXRYyu.js";import"./arrow-up-right-BqiJ1OMg.js";function M({title:h,count:m,subtitle:c,cta:f,to:t,secondary:S}){return e.jsxs(y,{className:"p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-foreground",children:h}),e.jsx("div",{className:"mt-2 text-4xl font-semibold tabular-nums tracking-tight",children:m}),e.jsx("div",{className:"mt-2 text-sm text-muted-foreground",children:c})]}),f&&t&&e.jsx(J,{asChild:!0,size:"sm",className:"shrink-0",children:e.jsxs(_,{to:t,children:[f," ",e.jsx(ge,{className:"h-4 w-4 ms-1"})]})})]}),S&&e.jsx("div",{className:"mt-3 text-sm",children:e.jsxs(_,{to:S.to,className:"text-primary hover:underline",children:[S.label," â"]})})]})}function R({label:h,value:m,hint:c,to:f,delta:t}){const S=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:h}),e.jsxs("div",{className:"mt-1 flex items-baseline gap-2",children:[e.jsx("div",{className:"text-2xl font-semibold tabular-nums tracking-tight",children:m}),t!=null&&e.jsxs("span",{className:`text-xs tabular-nums ${t>=0?"text-emerald-600":"text-red-600"}`,children:[t>=0?"â":"â"," ",Math.abs(t),"%"]})]}),c&&e.jsx("div",{className:"mt-1 text-xs text-muted-foreground truncate",children:c})]});return e.jsx(y,{className:`p-4 ${f?"hover:bg-muted transition-colors":""}`,children:f?e.jsx(_,{to:f,className:"block",children:S}):S})}function O({label:h,to:m}){const c=e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(xe,{className:"h-4 w-4 text-emerald-500 shrink-0"}),e.jsx("span",{className:"text-foreground",children:h}),e.jsx("span",{className:"ms-auto tabular-nums",children:"0"})]});return m?e.jsx(_,{to:m,className:"block hover:opacity-80",children:c}):c}function C({label:h,state:m}){const c=m==="ok"?"bg-emerald-500":m==="warn"?"bg-amber-500":"bg-red-500";return e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx("span",{className:`h-2 w-2 rounded-full ${c}`}),e.jsx("span",{children:h})]})}function $(h){const m=Date.now()-new Date(h).getTime(),c=Math.floor(m/6e4);if(c<1)return"just now";if(c<60)return`${c}m`;const f=Math.floor(c/60);return f<24?`${f}h`:`${Math.floor(f/24)}d`}function W({label:h,state:m,detail:c,to:f}){const t=m==="ok"?"bg-emerald-500":m==="warn"?"bg-amber-500":m==="bad"?"bg-red-500":"bg-muted-foreground";return e.jsxs(_,{to:f,className:"flex items-center gap-2 rounded-full border border-border bg-surface px-3 py-1.5 text-sm hover:bg-muted transition-colors",children:[e.jsx("span",{className:`h-2 w-2 rounded-full ${t}`}),e.jsx("span",{className:"font-medium",children:h}),e.jsx("span",{className:"text-muted-foreground",children:c})]})}function Ge(){const{session:h,loading:m}=Ie(),[c,f]=v.useState(null),[t,S]=v.useState(null),[K,U]=v.useState([]),[l,V]=v.useState(void 0),[d,Q]=v.useState(void 0),[w,P]=v.useState(void 0),[b,X]=v.useState(null),[E,Z]=v.useState(null),[L,ee]=v.useState(null),[N,te]=v.useState(null);async function se(){try{const{data:s,error:n}=await o.functions.invoke("admin-demo-mode",{body:{action:"status"}});if(n)throw n;const r=s?.state;X(r?{enabled:!!r.enabled,run_id:r.run_id??null,enabled_at:r.enabled_at??null}:null)}catch{X(null)}}async function he(){if(!b)return;const s=b.enabled?"disable":"enable";Z(s);try{await o.functions.invoke("admin-demo-mode",{body:{action:s}}),await se(),await B()}finally{Z(null)}}async function ae(){try{const s=await ue.pulse();f(s)}catch{}}async function B(){const s=new Date(Date.now()-6048e5).toISOString(),[n,r,g,p,j,k,x,u,H]=await Promise.all([o.from("feed_items").select("id",{count:"exact",head:!0}
1).eq("moderation_status","pending").is("deleted_at",null),o.from("feed_items").select("id, source_id").eq("moderation_status","pending").is("deleted_at",null).limit(2e3),Promise.resolve({data:null}),o.from("feed_items").select("id",{count:"exact",head:!0}).eq("moderation_status","pending").is("deleted_at",null).is("primary_image_url",null),o.from("feed_sources").select("id, type, status, last_crawled_at"),o.from("feed_reports").select("id, created_at, feed_items!inner(recovery_status)").is("resolved_at",null).order("created_at",{ascending:!0}).limit(500),o.from("support_tickets").select("id, status, first_response_at, is_escalated").in("status",["open","waiting_on_customer","waiting_on_support"]),o.from("organizations").select("id, created_at").gte("created_at",s),o.from("events").select("id, event_type, created_at").like("event_type","%reunited%").gte("created_at",s)]),ie=r.data??[],A=new Map;for(const i of j.data??[])A.set(i.id,i.type);let q=0,de=0;for(const i of ie){const D=A.get(i.source_id);D==="crawler"?q++:(D==="native"||D==="manual")&&de++}const je=p.count??0,ve=n.count??0,z=k.data??[];let oe=0,ce=0;for(const i of z)(i.feed_items?.recovery_status??"").startsWith("found")?ce++:oe++;const _e=z[0]?.created_at?new Date(z[0].created_at).getTime():Date.now(),Ne=Math.max(0,Math.floor((Date.now()-_e)/36e5)),G=x.data??[],ye=G.filter(i=>i.status==="open"&&!i.first_response_at).length,ke=G.filter(i=>i.status==="waiting_on_customer").length,Se=G.filter(i=>i.is_escalated).length,Y=(j.data??[]).filter(i=>i.type==="crawler"),De=Y.length,$e=Date.now()-2*3600*1e3,Te=Y.filter(i=>i.status==="active"&&i.last_crawled_at&&new Date(i.last_crawled_at).getTime()>$e).length,Ae=Y.reduce((i,D)=>D.last_crawled_at&&(!i||new Date(D.last_crawled_at).getTime()>new Date(i).getTime())?D.last_crawled_at:i,null),Ce=(await o.from("feed_items").select("created_at").eq("moderation_status","pending").is("deleted_at",null).order("created_at",{ascending:!0}).limit(1).maybeSingle()).data?.created_at??null;S({feed:{scraped:q,user:de,noPhoto:je,total:ve},reports:{lost:oe,found:ce,oldestHrs:Ne},support:{awaitingFirst:ye,waitingCustomer:ke,escalated:Se},campaigns:{queued:0,bouncedYesterday:0,repliesWaiting:0},signups:{verified:0,firstItem:0,firstClaim:0},scrapersRunning:Te,scrapersTotal:De,lastCrawlAt:Ae,oldestQueueAt:Ce,reunitedWeek:(H.data??[]).length,newBrandsWeek:(u.data??[]).length,newPaidWeek:0})}async function ne(){try{const s=o.from("smoke_runs").select("status, created_at, started_at").order("created_at",{ascending:!1}).limit(1).maybeSingle(),n=ue.testLabListRuns({limit:500}).catch(()=>({runs:[]})),[r,g]=await Promise.all([s,n]);V(r.data?{status:r.data.status,started_at:r.data.started_at??r.data.created_at}:null);const p=g?.runs??[],j=new Map;for(const x of p){if(!x?.case_id)continue;const u=j.get(x.case_id);(!u||new Date(x.created_at).getTime()>new Date(u.created_at).getTime())&&j.set(x.case_id,x)}let k=0;for(const x of me)j.get(x.id)?.status==="pass"&&k++;p.length===0?Q(null):Q({total:me.length,passed:k,latestAt:p[0]?.created_at??null});try{const u=(await o.from("test_runs").select("created_at").eq("source","scheduled").order("created_at",{ascending:!1}).limit(1).maybeSingle()).data?.created_at;if(!u)P(null);else{const H=new Date(new Date(u).getTime()-6e5).toISOString(),A=(await o.from("test_runs").select("status, created_at").eq("source","scheduled").gte("created_at",H).order("created_at",{ascending:!1})).data??[];A.length===0?P(null):P({total:A.length,passed:A.filter(q=>q.status==="pass").length,latestAt:A[0].created_at})}}catch{P(null)}}catch{V(null),Q(null),P(null)}}async function re(){try{const{data:s}=await o.from("tracked_links").select("code, label, click_count").order("click_count",{ascending:!1}).limit(1).maybeSingle();ee(s)}catch{ee(null)}}async function le(){const s=Date.now(),n=new Date(s-24*3600*1e3).toISOString(),r=new Date(s-168*3600*1e3).toISOString();try{const[g,p,j,k,x]=await Promise.all([o.from("tags").select("id",{count:"exact",head:!0}).eq("status","active"),o.from("scans").select("id",{count:"exact",head:!0}).gte("scanned_at",n),o.from("tags").select("id",{count:"exact",head:!0}).gte("activated_at",n),o.from("profiles").select("id",{count:"exact",head:!0}).gte("created_at",n),o.from("events").select("id",{count:"exact",head:!0}).like("event_type","%reunited%").gte("created_at",r)]);te({activatedTags:g.count??0,scans24h:p.count??0,activations24h:j.count??0,signups24h:k.count??0,reunited7d:x.count??0})}catch{te(null)}}v.useEffect(()=>{if(m||!h)return;ae(),B(),ne(),se(),re(),le();const s=setInterval(ae,6e4),n=setInterval(B,6e4),r=setInterval(ne,6e4),g=setInterval(re,6e4),p=setInterval(le,6e4);return()=>{clearInterval(s),clearInterval(n),clearInterval(r),clearInterval(g),clearInterval(p)}},[m,h?.access_token]),v.useEffect(()=>{let s=!0;(async()=>{const{data:r}=await o.from("events").select("id, event_type, organization_id, created_at").order("created_at",{ascending:!1}).limit(10);s&&r&&U(r)})();const n=o.channel("admin-today-events").on("postgres_changes",{event:"INSERT",schema:"public",table:"events"},r=>{U(g=>[r.new,...g].slice(0,10))}).subscribe();return()=>{s=!1,o.removeChannel(n)}},[]);const fe=new Date().toLocaleDateString(void 0,{weekday:"long",month:"long",day:"numeric"}),pe=c?.status?.inbox_depth??0,I=c?.status?.dlq_depth??0,T=c?.status?.incidents_open??0,we=T===0&&I===0,F=T>0?"bad":I>0?"warn":"ok",a=s=>
1s.toLocaleString(),be=t?.feed.total??0;return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:fe}),e.jsxs(_,{to:"/admin/system-health",className:"text-sm text-muted-foreground hover:text-foreground flex items-center gap-2",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Pe,{className:"h-3.5 w-3.5"})," Inbox ",a(pe)]}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:["DLQ ",a(I)]}),e.jsx("span",{children:"·"}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`h-2 w-2 rounded-full ${F==="ok"?"bg-emerald-500":F==="warn"?"bg-amber-500":"bg-red-500"}`}),we?"System healthy":T>0?`${T} open incidents`:"Degraded"]})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(W,{to:"/admin/system-health",label:"Platform",state:T>0?"bad":"ok",detail:T>0?`${T} open`:"Healthy"}),e.jsx(W,{to:"/admin/test-lab",label:"Self-test",state:d===void 0?"loading":d?d.total>0&&d.passed===d.total&&d.latestAt&&Date.now()-new Date(d.latestAt).getTime()<=24*3600*1e3?"ok":"warn":"bad",detail:d===void 0?"â¦":d?`${d.passed}/${d.total}${d.latestAt?` · ${$(d.latestAt)}`:""}`:"Never run"}),e.jsx(W,{to:"/admin/smoke-runs",label:"Prod smoke",state:l===void 0?"loading":!l||!l.started_at?"bad":l.status==="passed"||l.status==="success"?(Date.now()-new Date(l.started_at).getTime())/6e4<=30?"ok":"warn":"bad",detail:l===void 0?"â¦":!l||!l.started_at?"No runs":`${l.status??"?"} · ${$(l.started_at)}`}),e.jsx(W,{to:"/admin/system-health",label:"Scrapers",state:(()=>{if(!t)return"loading";if(t.scrapersTotal===0)return"warn";const s=t.lastCrawlAt?Date.now()-new Date(t.lastCrawlAt).getTime():null;return s==null||s>24*3600*1e3?"bad":s>2*3600*1e3?"warn":"ok"})(),detail:(()=>{if(!t)return"â¦";if(t.scrapersTotal===0)return"None configured";if(!t.lastCrawlAt)return"No crawls";const s=Date.now()-new Date(t.lastCrawlAt).getTime(),n=$(t.lastCrawlAt);return s>24*3600*1e3?`Stalled · ${n}`:s>2*3600*1e3?`Idle · ${n}`:t.scrapersRunning>0?`Fresh · ${n}`:`Idle · ${n}`})()})]}),b&&e.jsxs("div",{className:`flex flex-wrap items-center justify-between gap-3 rounded-lg border px-4 py-3 text-sm ${b.enabled?"border-amber-400 bg-amber-50 text-amber-900":"border-border bg-surface text-muted-foreground"}`,children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`h-2 w-2 rounded-full ${b.enabled?"bg-amber-500":"bg-muted-foreground"}`}),b.enabled?e.jsxs("span",{children:[e.jsx("strong",{children:"Demo data active"})," â flagged rows are mixed into KPIs for buyer walkthroughs",b.enabled_at?` · on since ${$(b.enabled_at)} ago`:"",b.run_id?` · run ${b.run_id}`:""]}):e.jsx("span",{children:"Demo mode is off â the dashboard shows only real data."})]}),e.jsx(J,{size:"sm",variant:b.enabled?"destructive":"secondary",disabled:E!==null,onClick:he,children:E==="enable"?"Seedingâ¦":E==="disable"?"Removingâ¦":b.enabled?"Disable demo mode":"Enable demo mode"})]}),e.jsx(Le,{}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-3",children:[e.jsx(R,{label:"Activated tags",value:N?a(N.activatedTags):"â¦",hint:"Tags with status = active",to:"/admin/tag-campaigns"}),e.jsx(R,{label:"Scans · 24h",value:N?a(N.scans24h):"â¦",hint:"QR scans in the last day",to:"/admin/pulse"}),e.jsx(R,{label:"Activations · 24h",value:N?a(N.activations24h):"â¦",hint:"Tags activated in the last day",to:"/admin/tag-campaigns"}),e.jsx(R,{label:"New signups · 24h",value:a(N?N.signups24h:c?.signups?.d1?.count??0),delta:c?.signups?.d1?.delta_pct??null,hint:"Verified in the last day",to:"/admin/pulse"}),e.jsx(R,{label:"Reunited · 7d",value:a(N?N.reunited7d:t?.reunitedWeek??0),hint:"Owner â finder closed",to:"/admin/reports?status=reunited"})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-5",children:[e.jsxs("div",{className:"lg:col-span-8 space-y-4",children:[(()=>{const s=be||0,n=(t?.reports.lost??0)+(t?.reports.found??0),r=(t?.support.awaitingFirst??0)+(t?.support.waitingCustomer??0),g=t?.campaigns.queued??0,p=[{key:"items",count:s,card:e.jsx(M,{title:"Items waiting for review",count:a(s),subtitle:t?`${a(t.feed.scraped)} scraped, ${a(t.feed.user)} user-submitted, ${a(t.feed.noPhoto)} with no photo`:"Loadingâ¦",cta:"Review next",to:"/admin/feed-queue"}),cleared:e.jsx(O,{label:"Items waiting for review",to:"/admin/feed-queue"})},{key:"reports",count:n,card:e.jsx(M,{title:"Reports to triage",count:a(n),subtitle:t?`${a(t.reports.lost)} lost · ${a(t.reports.found)} found · oldest ${t.reports.oldestHrs}h`:"Loadingâ¦",cta:"Triage next",to:"/admin/reports"}),cleared:e.jsx(O,{label:"Reports to triage",to:"/admin/reports"})},{key:"support",count:r,card:e.jsx(M,{title:"Open support tickets",count:a(r),subtitle:t?`${a(t.support.awaitingFirst)} awaiting first response · ${a(t.support.waitingCustomer)} waiting on customer · ${a(t.support.escalated)} escalated`:"Loadingâ¦",cta:"Open inbox",to:"/admin/support"}),cleared:e.jsx(O,{label:"Open support tickets",to:"/admin/support"})},{key:"outreach",count:g,card:e.jsx(M,{title:"Outreach today",count:a(g),subtitle:t?`${a(t.campaigns.queued)} queued · ${a(t.campaigns.bouncedYesterday)} bounced yesterday · ${a(t.campaigns.repliesWaiting)} replies waiting`:"Loadingâ¦",cta:"Open campaign",to:"/admin/outreach/campaigns"}),cleared:e.jsx(O,{label:"Outreach today",to:"/admin/outreach/campaigns"})}],j=p.filter(u=>u.count>0),k=p.filter(u=>u.count===0),x=!t;return e.jsxs(e.Fragment,{children:[x&&e.jsx(y,{className:"p-5 text-sm text-muted-foreground",children:"Loading attention queueâ¦"}),!x&&j.length===0&&e.jsxs(y,{className:"p-5",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[e.jsx(xe,{className:"h-4 w-4 text-emerald-500"}),"All clear â no queues need attention"]}),e.jsx("div",{className:"mt-3 space-y-2",children:p.map(u=>e.jsx("div",{children:u.cleared},u.key))})]}),!x&&j.map(u=>e.jsx("div",{children:u.card},u.key)),!x&&j.length>0&&k.length>0&&e.jsxs(y,{className:"p-4",children:[e.jsx("div",{className:"mb-2 text-xs uppercase tracking-wide text-muted-foreground",children:"All clear"}),e.jsx("div",{className:"space-y-2",children:k.map(u=>e.jsx("div",{children:u.cleared},u.key))})]})]})})(),e.jsx(y,{className:"p-5",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-foreground",children:[e.jsx("span",{className:`h-2 w-2 rounded-full ${w===void 0||w===null?"bg-muted-foreground":w.passed===w.total&&Date.now()-new Date(w.latestAt).getTime()<3900*1e3?"bg-emerald-500":"bg-amber-500"}`}),"System self-test"]}),e.jsx("div",{className:"mt-2 text-4xl font-semibold tabular-nums tracking-tight",children:w===void 0?"â¦":w===null?"â":`${a(w.passed)}/${a(w.total)}`}),e.jsx("div",{className:"mt-2 text-sm text-muted-foreground",children:w===void 0?"Loadingâ¦":w===null?"Awaiting first scheduled run":`passing · last run ${$(w.latestAt)} ago · auto`})]}),e.jsx(J,{asChild:!0,size:"sm",className:"shrink-0",children:e.jsxs(_,{to:"/admin/test-lab",children:["Open ",e.jsx(ge,{className:"h-4 w-4 ms-1"})]})})]})})]}),e.jsxs("div",{className:"lg:col-span-4 space-y-4",children:[e.jsxs(y,{className:"p-5",children:[e.jsx("div",{className:"text-sm font-medium mb-3",children:"Health"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(C,{label:"API healthy",state:F==="bad"?"bad":"ok"}),(()=>{if(!t)return e.jsx(C,{label:"Scrapers loadingâ¦",state:"warn"});if(t.scrapersTotal===0)return e.jsx(C,{label:"No crawlers configured",
1state:"warn"});const s=t.lastCrawlAt?Date.now()-new Date(t.lastCrawlAt).getTime():null,n=t.oldestQueueAt?Math.floor((Date.now()-new Date(t.oldestQueueAt).getTime())/36e5):null,r=s==null||s>24*3600*1e3?"bad":s>2*3600*1e3||t.scrapersRunning<t.scrapersTotal?"warn":"ok",g=[`Scrapers ${t.scrapersRunning}/${t.scrapersTotal} running`];return g.push(t.lastCrawlAt?`last crawl ${$(t.lastCrawlAt)} ago`:"no crawl yet"),n!=null&&g.push(`oldest queue ${n}h`),e.jsx(C,{label:g.join(" · "),state:r})})(),e.jsx(C,{label:`Webhooks ${I} in DLQ`,state:I===0?"ok":I<10?"warn":"bad"}),l===void 0?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx("span",{className:"h-2 w-2 rounded-full bg-muted"}),e.jsx("span",{children:"Prod smoke â loadingâ¦"})]}):e.jsx(_,{to:"/admin/smoke-runs",className:"block hover:opacity-80",children:e.jsx(C,{label:!l||!l.started_at?"Prod smoke â no runs":l.status==="passed"||l.status==="success"?`Prod smoke â passed ${$(l.started_at)} ago`:`Prod smoke â ${l.status??"failed"} ${$(l.started_at)} ago`,state:!l||!l.started_at||!(l.status==="passed"||l.status==="success")?"bad":(Date.now()-new Date(l.started_at).getTime())/6e4<=30?"ok":"warn"})}),d===void 0?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx("span",{className:"h-2 w-2 rounded-full bg-muted"}),e.jsx("span",{children:"Self-test â loadingâ¦"})]}):e.jsx(_,{to:"/admin/test-lab",className:"block hover:opacity-80",children:e.jsx(C,{label:d?`Self-test â ${d.passed}/${d.total}`:"Self-test â never run",state:(()=>{if(!d)return"bad";const s=d.latestAt&&Date.now()-new Date(d.latestAt).getTime()<=24*3600*1e3,n=d.total>0&&d.passed===d.total;return s&&n?"ok":"warn"})()})})]})]}),e.jsxs(y,{className:"p-5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(Re,{className:"h-4 w-4"})," Live events"]}),e.jsx(_,{to:"/admin/events",className:"text-xs text-muted-foreground hover:underline",children:"See all â"})]}),e.jsxs("div",{className:"font-mono text-xs space-y-1 max-h-[260px] overflow-hidden",children:[K.length===0&&e.jsx("div",{className:"text-muted-foreground",children:"No events yetâ¦"}),K.slice(0,10).map(s=>e.jsxs("div",{className:"flex gap-2 text-muted-foreground",children:[e.jsx("span",{children:new Date(s.created_at).toISOString().slice(11,19)}),e.jsx("span",{className:"text-foreground truncate",children:s.event_type})]},s.id))]})]}),e.jsxs(y,{className:"p-5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(qe,{className:"h-4 w-4"})," Shared links"]}),e.jsx(_,{to:"/admin/links",className:"text-xs text-muted-foreground hover:underline",children:"Manage â"})]}),L?e.jsxs("div",{children:[e.jsx("div",{className:"text-2xl font-semibold tabular-nums",children:a(L.click_count)}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["clicks · ",e.jsx("span",{className:"text-foreground",children:L.label}),e.jsxs("span",{className:"ms-1 font-mono",children:["lo.st/go/",L.code]})]})]}):e.jsx("div",{className:"text-sm text-muted-foreground",children:"No links yet â create one to start tracking."})]}),e.jsxs(y,{className:"p-5",children:[e.jsx("div",{className:"text-sm font-medium mb-3",children:"This week's wins"}),e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("div",{className:"flex items-baseline justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Reunited items"}),e.jsx("span",{className:"tabular-nums font-medium",children:a(t?.reunitedWeek??0)})]}),e.jsxs("div",{className:"flex items-baseline justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"New brand orgs"}),e.jsx("span",{className:"tabular-nums font-medium",children:a(t?.newBrandsWeek??0)})]}),e.jsxs("div",{className:"flex items-baseline justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"New paid plans"}),e.jsx("span",{className:"tabular-nums font-medium",children:a(t?.newPaidWeek??0)})]})]})]})]})]})]})}export{Ge 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.