PageSourceSearch

https://technopark-luzern.lovable.app/assets/LeadsPanel-DQQm1H7y.js

js technopark-luzern.lovable.app collected 2026-10-03 03:48:58 UTC 21,695 bytes, 23 lines download raw bytes

1import{l as J,r as n,d as je,s as te,j as e,ae as z,ag as Z,q as D,I as P,B as R,M as fe,m as W,p as V,aP as ye}from"./index-BghHNOje.js";import{B as I}from"./badge-BCCCWQE0.js";import{S as ae}from"./switch-Dlrp5GND.js";import{T as ve,a as be,b as X,c as Ne,d as Se,e as _}from"./table-C5ZVYO-V.js";import{S as re,a as ne,b as ie,c as oe,d as U}from"./select-BuQ2jC-b.js";import{T as we,a as ke,b as Ce,c as Te}from"./tooltip-inqb5Bp-.js";import{B as le,D as ce,E as O,L as me,F as Re,G as Le,H as $e,I as _e}from"./Admin-COX3fs7S.js";import{D as de,a as ue,b as pe,c as he,e as De,f as xe}from"./dialog-Clo9IObs.js";import{T as Ee}from"./textarea-CDQn81xI.js";import{I as ge}from"./IdeaVoiceButton-D58xZGfN.js";import{a as Q,h as ee,R as Fe,s as Me,e as Be}from"./RichMessageField-Dv2WcD1b.js";import{T as Y}from"./triangle-alert-nzYwmCkk.js";import{L as A}from"./loader-circle-B8iw8PN7.js";import{S as qe}from"./sparkles-DEWTNoRx.js";import{S as Ae}from"./send-BJOv5R4x.js";import{S as G}from"./shield-alert-C_wyyMIp.js";import{C as Ie}from"./check-Cs64SJZX.js";import{u as Pe,S as B}from"./useTableSort-B-A7qTri.js";import{I as He}from"./AdminAnalytics-DhvHbfuF.js";import{C as se}from"./clock-CsNJYkxI.js";import{T as Oe}from"./target-De-fDtUY.js";import{S as ze}from"./shield-check-BRJsKqt_.js";import"./index-YvgZ23nC.js";import"./index-B6H0OFpw.js";import"./chevron-up-D-aySBK5.js";import"./mic-wTOzDbDU.js";import"./square-CSGF2uBn.js";import"./popover-CWI6PBxd.js";import"./EmojiPicker-hTPq7zxW.js";import"./highlighter-B0rtIZZO.js";import"./ImageUpload-BrzJdCbp.js";import"./upload-JvDQuh3d.js";import"./circle-check-big-Bp4Yvkwn.js";import"./refresh-cw-ByVvNyh0.js";import"./circle-x-D1uGBboU.js";import"./image-54Sd8WyT.js";import"./download-ByZycj8e.js";import"./generateCategoricalChart-Cd6uk4K5.js";import"./tiny-invariant-BaFNuDhB.js";import"./AreaChart-D9-OApRb.js";import"./PieChart-fIKY4OJB.js";import"./LineChart-B7BO-pYg.js";import"./en-US-Cd7JVTfs.js";import"./format-u92PFBEn.js";import"./chevron-right-C5onmajZ.js";import"./CompanyKPITable-lOTC9Azd.js";import"./checkbox-CIRobcpM.js";import"./dropdown-menu-D9rzll7v.js";import"./index-C-CoiJov.js";import"./circle-Q-DetBwM.js";import"./fileToBase64-DBbj5r96.js";import"./paperclip-iDjXjJLm.js";import"./grip-vertical-DVSLh7fz.js";import"./use-mobile-C1btm3PS.js";import"./rows-3-uqj2mDDe.js";import"./rotate-ccw-CS9N7HZf.js";import"./pencil-BMlAIgGY.js";import"./plus-BjOZUKUH.js";import"./trash-2-DU-Ld5Bw.js";import"./arrow-up-down-BHi3q2zI.js";import"./filter-zM3Z9my0.js";import"./flask-conical-OQsOTUdX.js";import"./circle-check-C1GKZN-7.js";import"./trophy-CZLP0KKC.js";import"./LastRunNote-CEh43I8s.js";import"./useAdminActionRuns-G3KbyO0S.js";import"./tabs-OfzD-Nju.js";import"./typeof-QjJsDpFa.js";import"./TableToolbar-q0tCHeu7.js";import"./useBuildDayAd-DKqeX1fx.js";import"./useSponsors-COha0OWH.js";import"./useStartupOutreach-DCOvgUJt.js";import"./building-2-DbXAZakx.js";import"./star-CLmwwr8q.js";import"./clipboard-check-BKwEZwLf.js";import"./message-square-ChptD4Id.js";import"./mail-question-DWpZ5u2I.js";import"./handshake-DWejDN6F.js";import"./banknote-DqXFxYLR.js";import"./ticket-BXLUp8hu.js";import"./briefcase-DfjVJxEJ.js";const Ze=t=>{const j=new Date(t.created_at).toLocaleString("de-CH",{timeZone:"Europe/Zurich"}),N=(t.message||"").split(`
2`).map(g=>`> ${g}`).join(`
3`);return Q(`
4
5---
6On ${j}, ${t.name} wrote:
7${N}`)},We=({lead:t,open:j,onOpenChange:N,currentNotes:g,onSent:S})=>{const{toast:f}=J(),E=le(),[m,w]=n.useState("Re: Your message to Technopark Luzern"),[u,p]=n.useState(""),[i,L]=n.useState(!1),[d,F]=n.useState(!1),[y,k]=n.useState(null),[$,h]=n.useState(null),x=n.useRef(null),{data:a,isLoading:q}=je({queryKey:["mailbox-status"],queryFn:Be,enabled:j,staleTime:6e4}),C=Q(`Dear ${t.name.split(" ")[0]||t.name},
8
9`),M=n.useCallback(()=>{const o=(g??t.notes??"").trim();return["Write a reply to a contact form enquiry received by Technopark Luzern.","",`Sender: ${t.name}${t.company?` (${t.company})`:""} <${t.email}>`,"Their message:",'"""',(t.message||"(no message)").slice(0,4e3),'"""',"",o?["Internal notes written by the admin. They describe what we still need from this person.","Turn every request in these notes into a friendly, concrete ask in the reply:",'"""',o.slice(0,4e3),'"""'].join(`
10`):"There are no internal notes. Acknowledge the enquiry warmly and offer a call or a visit. Do not invent any requests.","","Structure: w
10arm personal opening that thanks them and refers to their actual enquiry, then the concrete asks, then an inviting close offering a call or a visit at Technopark Luzern.","Reply in the language of their message."].join(`
11`)},[g,t.company,t.email,t.message,t.name,t.notes]),T=n.useCallback(async o=>{F(!0),k(null);try{const{data:l,error:s}=await te.functions.invoke("ms365-reply-draft",{body:{action:"compose",instruction:o!=null&&o.refineWith?`${M()}
12
13Requested changes from the author:
14${o.refineWith}`:M(),recipients:[t.email],subject:m,draft:ee((o==null?void 0:o.base)??"")}});if(s)throw s;const c=String((l==null?void 0:l.draft)??"").trim();if(!c)throw new Error("The AI returned an empty draft.");p(Q(c));const b=String((l==null?void 0:l.subject)??"").trim();b&&w(b)}catch(l){p(s=>s||C),k(l instanceof Error?`Could not draft automatically (${l.message}). Write the reply by hand or try again.`:"Could not draft automatically. Write the reply by hand or try again.")}finally{F(!1)}},[M,t.email,m]);n.useEffect(()=>{if(!j){x.current=null;return}x.current!==t.id&&(x.current=t.id,w("Re: Your message to Technopark Luzern"),p(C),h(null),T())},[j,t.id]);const r=!!(a!=null&&a.connected)&&(a==null?void 0:a.mailbox_ready)!==!1,v=async()=>{const o=u,l=ee(u);if(!l.trim()){h("Write a message before sending.");return}L(!0),h(null);try{await Me({to:t.email,subject:m.trim()||"Re: Your message to Technopark Luzern",body:`${o}${Ze(t)}`});const s=new Date().toISOString();await E.mutateAsync({id:t.id,updates:{status:"replied",first_response_at:t.first_response_at??s,notes:[(g??t.notes??"").trim(),`[${new Date(s).toLocaleString("de-CH",{timeZone:"Europe/Zurich"})}] Replied by email:
15${l}`].filter(Boolean).join(`
16
17`)}}),f({title:"Reply sent",description:`Email delivered to ${t.email}.`}),S==null||S(l),N(!1)}catch(s){h(s instanceof Error?s.message:"Unknown error")}finally{L(!1)}};return e.jsx(de,{open:j,onOpenChange:o=>!i&&N(o),children:e.jsxs(ue,{className:"max-w-xl",children:[e.jsxs(pe,{children:[e.jsxs(he,{children:["Reply to ",t.name]}),e.jsx(De,{children:"Sent from the connected Microsoft 365 mailbox, so the answer lands in your normal Outlook thread."})]}),!q&&!r&&e.jsxs(z,{variant:"destructive",children:[e.jsx(Y,{className:"h-4 w-4"}),e.jsx(Z,{children:(a==null?void 0:a.reason)||"Microsoft 365 is not connected for this project yet. Open Admin → Inbox to connect the mailbox, then reply from here."})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(D,{children:"To"}),e.jsx(P,{value:t.email,readOnly:!0,className:"bg-muted/50"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(D,{htmlFor:"lead-reply-subject",children:"Subject"}),e.jsx(P,{id:"lead-reply-subject",value:m,onChange:o=>w(o.target.value)})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(D,{htmlFor:"lead-reply-body",children:"Message"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(R,{type:"button",variant:"outline",size:"sm",onClick:()=>T(),disabled:d||i,children:[d?e.jsx(A,{className:"h-4 w-4 mr-2 animate-spin"}):e.jsx(qe,{className:"h-4 w-4 mr-2"}),"Regenerate"]}),e.jsx(ge,{context:"Email reply to a contact form lead of Technopark Luzern",hint:`Reply to ${t.name}${t.company?` (${t.company})`:""}`,onResult:({description:o,title:l})=>{const s=[l,o].filter(Boolean).join(`
18
19`).trim();s&&T({refineWith:s,base:u})}})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(Fe,{id:"lead-reply-body",rows:10,value:u,onChange:p,placeholder:"Write your reply…",disabled:d}),d&&e.jsxs("div",{className:"absolute inset-0 flex items-center justify-center gap-2 rounded-md bg-background/70 text-sm text-muted-foreground",children:[e.jsx(A,{className:"h-4 w-4 animate-spin"}),"Drafting reply from your internal notes…"]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Drafted from the enquiry and your internal notes. Edit freely, the original enquiry is quoted underneath automatically."})]}),y&&e.jsxs(z,{children:[e.jsx(Y,{className:"h-4 w-4"}),e.jsx(Z,{children:y})]}),$&&e.jsxs(z,{variant:"destructive",children:[e.jsx(Y,{className:"h-4 w-4"}),e.jsx(Z,{children:$})]})]}),e.jsxs(xe,{className:"gap-2 sm:gap-2",children:[e.jsx(R,{variant:"outline",onClick:()=>N(!1),disabled:i,children:"Cancel"}),e.jsxs(R,{onClick:v,disabled:i||d||!r,children:[i?e.jsx(A,{className:"h-4 w-4 mr-2 animate-spin"}):e.jsx(Ae,{className:"h-4 w-4 mr-2"}),"Send reply"]})]})]})})},Ve=({lead:t,open:j,onOpenChange:N})=>{const{toast:g}=J(),S=le(),[f,E]=n.useState("new"),[m,w]=n.useState(""),[u,p]=n.useState(""),[i,L]=n.useState(!1),[d,F]=n.useState(""),[y,k]=n.useState(!1),[$,h]=n.useState(!1),[x,a]=n.useState({status:"new",notes:"",value:"",isSpam:!1,spamReason:""});if(n.useEffect(()=>{if(t){const r={status:t.status,notes:t.notes||"",value:t.outcome_value_chf!=null?String(t.outcome_value_chf):"",isSpam:!!t.is_spam,spamReason:t.spam_reason||""};
19E(r.status),w(r.notes),p(r.value),L(r.isSpam),F(r.spamReason),a(r),k(!1)}},[t]),!t)return null;const q=[t.source_page,t.source_section,t.source_cta].filter(Boolean).join(" › "),C=f!==x.status||m!==x.notes||u!==x.value||i!==x.isSpam||d!==x.spamReason,M=async()=>{try{await S.mutateAsync({id:t.id,updates:{status:f,notes:m.trim()||null,outcome_value_chf:u.trim()?Number(u):null,is_spam:i,spam_reason:i&&d.trim()||null}}),a({status:f,notes:m,value:u,isSpam:i,spamReason:d}),k(!0),setTimeout(()=>k(!1),2500),g({title:"Lead updated"})}catch(r){g({title:"Could not save",description:r instanceof Error?r.message:"Unknown error",variant:"destructive"})}},T=()=>{C&&!window.confirm("You have unsaved changes. Close without saving?")||N(!1)};return e.jsx(de,{open:j,onOpenChange:N,children:e.jsxs(ue,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[e.jsx(pe,{children:e.jsxs(he,{className:"flex items-center gap-2",children:[t.name,e.jsx(I,{variant:"outline",className:O(f).badge,children:ce(f)}),i&&e.jsx(I,{variant:"outline",className:"border-orange-200 bg-orange-50 text-orange-700 dark:border-orange-900 dark:bg-orange-950 dar
19k:text-orange-300",children:"Spam"})]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-muted-foreground",children:"Email"}),e.jsx("a",{href:`mailto:${t.email}`,className:"text-primary hover:underline break-all",children:t.email})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-muted-foreground",children:"Company"}),e.jsx("p",{children:t.company||"—"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-muted-foreground",children:"Received"}),e.jsx("p",{children:new Date(t.created_at).toLocaleString("de-CH",{timeZone:"Europe/Zurich"})})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-muted-foreground",children:"Source"}),e.jsx("p",{children:q||"Direct visit"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:"Message"}),e.jsx("div",{className:"rounded-md border bg-muted/40 p-3 text-sm whitespace-pre-wrap",children:t.message})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(D,{children:"Status"}),e.jsxs(re,{value:f,onValueChange:r=>E(r),children:[e.jsx(ne,{children:e.jsx(ie,{})}),e.jsx(oe,{children:me.map(r=>e.jsx(U,{value:r.value,children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`h-2 w-2 rounded-full ${O(r.value).dot}`}),r.label]})},r.value))})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(D,{children:"Outcome value (CHF)"}),e.jsx(P,{type:"number",min:0,value:u,onChange:r=>p(r.target.value),placeholder:"Optional"})]})]}),e.jsxs("div",{className:"rounded-md border p-3 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(G,{className:"h-4 w-4 text-orange-600"}),e.jsxs("div",{children:[e.jsx(D,{htmlFor:"lead-spam",className:"cursor-pointer",children:"Mark as spam"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Spam submissions are hidden from the list by default."})]})]}),e.jsx(ae,{id:"lead-spam",checked:i,onCheckedChange:L})]}),i&&e.jsx(P,{value:d,onChange:r=>F(r.target.value),placeholder:"Reason (optional) — e.g. SEO outreach, bot submission"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(D,{children:"Internal notes"}),e.jsx(ge,{context:"Internal note about a contact form lead for Technopark Luzern",hint:`Lead from ${t.name}${t.company?` (${t.company})`:""}`,onResult:({description:r,title:v})=>w(o=>[o,[v,r].filter(Boolean).join(": ")].filter(Boolean).join(`
20`))})]}),e.jsx(Ee,{rows:5,value:m,onChange:r=>w(r.target.value),placeholder:"What was discussed, next steps, outcome…"})]})]}),e.jsxs(xe,{className:"gap-2 sm:gap-2",children:[e.jsxs(R,{variant:"outline",onClick:()=>h(!0),children:[e.jsx(fe,{className:"h-4 w-4 mr-2"}),"Reply by email"]}),e.jsx(R,{variant:"ghost",onClick:T,disabled:S.isPending,children:"Close"}),e.jsxs(R,{onClick:M,disabled:S.isPending||!C&&y,children:[S.isPending?e.jsx(A,{className:"h-4 w-4 mr-2 animate-spin"}):y&&!C?e.jsx(Ie,{className:"h-4 w-4 mr-2"}):null,y&&!C?"Saved":"Save"]})]}),e.jsx(We,{lead:t,open:$,onOpenChange:h,currentNotes:m,onSent:r=>{E("replied");const v=[m,`[${new Date().toLocaleString("de-CH",{timeZone:"Europe/Zurich"})}] Replied by email:
21${r}`].filter(Boolean).join(`
22
23`);w(v),a(o=>({...o,status:"replied",notes:v}))}})]})})},vt=({focusId:t=null})=>{const[j,N]=n.useState(!1),[g,S]=n.useState(""),[f,E]=n.useState(""),[m,w]=n.useState("all"),[u,p]=n.useState(null),i=Pe("received","desc"),L=n.useRef(null);n.useEffect(()=>{const s=setTimeout(()=>E(g.trim()),300);return()=>clearTimeout(s)},[g]);const{data:d,isLoading:F,isFetchingNextPage:y,hasNextPage:k,fetchNextPage:$}=Re({includeSpam:j,search:f,status:m}),h=n.useMemo(()=>((d==null?void 0:d.pages)??[]).flatMap(s=>s.rows),[d]),x=n.useRef(null);n.useEffect(()=>{if(!t||x.current===t)return;const s=h.find(b=>b.id===t);if(s){x.current=t,p(s);return}let c=!1;return(async()=>{const{data:b}=await te.from("contact_submissions").select("*").eq("id",t).maybeSingle();!c&&b&&(x.current=t,p(b))})(),()=>{c=!0}},[t,h]);const{data:a}=Le(),q=$e(),{toast:C}=J();n.useEffect(()=>{const s=L.current;if(!s||!k||typeof IntersectionObserver>"u")return;const c=new IntersectionObserver(b=>{b.some(H=>H.isIntersecting)&&!y&&$()});return c.observe(s),()=>c.disconnect()},[k,y,$,h.length]);const M=async s=>
23{try{await q.mutateAsync({id:s.id,isSpam:!s.is_spam}),C({title:s.is_spam?"Removed from spam":"Marked as spam",description:s.is_spam?`${s.name} is back in the lead list.`:`${s.name} is hidden unless "Show spam" is on.`})}catch(c){C({title:"Could not update",description:c instanceof Error?c.message:"Unknown error",variant:"destructive"})}},T=n.useMemo(()=>i.sort(h,{received:s=>new Date(s.created_at),name:s=>s.name||s.email||"",company:s=>s.company??"",message:s=>s.message??"",source:s=>s.source_page??s.source_section??"",spam:s=>!!s.is_spam,status:s=>s.status??""}),[h,i]),r=(a==null?void 0:a.responseSampleSize)??0,v=(a==null?void 0:a.medianResponseHours)??null,o=v==null||r<3?"—":v<48?`${v.toFixed(1)} h`:`${(v/24).toFixed(1)} d`,l=[{label:"Submissions this year",value:String((a==null?void 0:a.totalThisYear)??0),icon:He},{label:"Open leads",value:String((a==null?void 0:a.openCount)??0),icon:se},{label:"Conversion rate",value:a!=null&&a.handledCount?`${a.conversionRate.toFixed(0)}%`:"—",icon:Oe},{label:"Median response time",value:o,icon:se,hint:r<3?"Not enough data":`n = ${r} · 90 d`,info:"Median time to first response across leads received in the last 90 days. Leads submitted before the leads pipeline went live (15 Aug 2026), spam and event registrations are excluded. Shown only once at least 3 leads qualify."},{label:"Spam share",value:`${((a==null?void 0:a.spamShare)??0).toFixed(0)}%`,icon:G}];return e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"grid gap-4 grid-cols-2 lg:grid-cols-5",children:l.map(({label:s,value:c,icon:b,hint:H,info:K})=>e.jsx(W,{children:e.jsxs(V,{className:"p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground mb-1",children:[e.jsx(b,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"text-xs leading-tight line-clamp-2",children:s}),K&&e.jsx(we,{children:e.jsxs(ke,{children:[e.jsx(Ce,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":`About ${s}`,className:"shrink-0",children:e.jsx(ye,{className:"h-3.5 w-3.5"})})}),e.jsx(Te,{className:"max-w-xs text-xs",children:K})]})})]}),e.jsx("p",{className:"text-2xl font-bold text-foreground",children:c}),H&&e.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:H})]})},s))}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx(P,{placeholder:"Search name, email, company or message…",value:g,onChange:s=>S(s.target.value),className:"max-w-sm"}),e.jsxs(re,{value:m,onValueChange:w,children:[e.jsx(ne,{className:"w-44",children:e.jsx(ie,{})}),e.jsxs(oe,{children:[e.jsx(U,{value:"all",children:"All statuses"}),me.map(s=>e.jsx(U,{value:s.value,children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`h-2 w-2 rounded-full ${O(s.value).dot}`}),s.label]})},s.value))]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ae,{id:"include-spam",checked:j,onCheckedChange:N}),e.jsx(D,{htmlFor:"include-spam",className:"text-sm text-muted-foreground",children:"Show spam"})]})]}),F?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(A,{className:"h-8 w-8 animate-spin text-primary"})}):T.length===0?e.jsx(W,{children:e.jsx(V,{className:"py-12 text-center text-muted-foreground",children:f||m!=="all"?"No submissions match these filters.":"No contact form submissions yet. New submissions appear here automatically."})}):e.jsx(W,{children:e.jsxs(V,{className:"p-0",children:[e.jsxs(ve,{children:[e.jsx(be,{children:e.jsxs(X,{children:[e.jsx(B,{direction:i.directionFor("received"),onSort:()=>i.toggle("received"),children:"Received"}),e.jsx(B,{direction:i.directionFor("name"),onSort:()=>i.toggle("name"),children:"Name"}),e.jsx(B,{direction:i.directionFor("company"),onSort:()=>i.toggle("company"),className:"hidden md:table-cell",children:"Company"}),e.jsx(B,{direction:i.directionFor("message"),onSort:()=>i.toggle("message"),className:"hidden lg:table-cell",children:"Message"}),e.jsx(B,{direction:i.directionFor("source"),onSort:()=>i.toggle("source"),className:"hidden lg:table-cell",children:"Source"}),e.jsx(B,{direction:i.directionFor("spam"),onSort:()=>i.toggle("spam"),children:"Spam"}),e.jsx(B,{direction:i.directionFor("status"),onSort:()=>i.toggle("status"),children:"Status"}),e.jsx(Ne,{className:"text-right",children:"Action"})]})}),e.jsx(Se,{children:T.map(s=>
23e.jsxs(X,{className:`cursor-pointer ${s.is_spam?"opacity-60":""}`,onClick:()=>p(s),children:[e.jsx(_,{className:"whitespace-nowrap text-sm text-muted-foreground",children:new Date(s.created_at).toLocaleDateString("de-CH",{timeZone:"Europe/Zurich"})}),e.jsxs(_,{children:[e.jsx("div",{className:"font-medium",children:s.name}),e.jsx("div",{className:"text-xs text-muted-foreground break-all",children:s.email})]}),e.jsx(_,{className:"hidden md:table-cell text-sm",children:s.company||"—"}),e.jsx(_,{className:"hidden lg:table-cell text-sm text-muted-foreground max-w-xs truncate",children:s.message}),e.jsxs(_,{className:"hidden lg:table-cell text-xs text-muted-foreground",children:[e.jsx("div",{children:s.source_page||"Direct"}),_e(s)&&e.jsx(I,{variant:"outline",className:"mt-1 border-sky-200 bg-sky-50 text-sky-700 dark:border-sky-900 dark:bg-sky-950 dark:text-sky-300",children:"Event registration"})]}),e.jsx(_,{children:s.is_spam?e.jsx(I,{variant:"outline",className:"border-orange-200 bg-orange-50 text-orange-700 dark:border-orange-900 dark:bg-orange-950 dar
23k:text-orange-300",children:"Yes"}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"No"})}),e.jsx(_,{children:e.jsx(I,{variant:"outline",className:O(s.status).badge,children:ce(s.status)})}),e.jsxs(_,{className:"text-right whitespace-nowrap",children:[e.jsx(R,{size:"sm",variant:"ghost",title:s.is_spam?"Not spam":"Mark as spam","aria-label":s.is_spam?"Not spam":"Mark as spam",disabled:q.isPending,onClick:c=>{c.stopPropagation(),M(s)},children:s.is_spam?e.jsx(ze,{className:"h-4 w-4 text-green-600"}):e.jsx(G,{className:"h-4 w-4 text-muted-foreground"})}),e.jsx(R,{size:"sm",variant:"ghost",onClick:c=>{c.stopPropagation(),p(s)},children:"Open"})]})]},s.id))})]}),e.jsx("div",{ref:L,className:"flex items-center justify-center gap-3 py-4 text-sm text-muted-foreground",children:k?e.jsxs(R,{variant:"outline",size:"sm",onClick:()=>$(),disabled:y,children:[y&&e.jsx(A,{className:"h-4 w-4 animate-spin mr-1.5"}),"Load more"]}):e.jsxs("span",{children:[T.length," submission",T.length===1?"":"s"," loaded"]})})]})}),e.jsx(Ve,{lead:u,open:!!u,onOpenChange:s=>!s&&p(null)})]})};export{vt 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.