1import{a as w,j as e}from"./vendor-react-BZ84NtM-.js";import{d as y}from"./vendor-router-BLlC8-tP.js";import{b as k,c as C}from"./use-event-queue-DkKbG30O.js";import{Q as T}from"./index-DDod9xeN.js";import{u as S}from"./index-MiEay11t.js";import{aV as d,L as D,ar as r,as as L,O as m,C as x,aL as Y}from"./vendor-icons-D9mgJH_A.js";import"./vendor-query-CRLLNKPD.js";import"./vendor-radix-xUlI7J_i.js";import"./vendor-motion-Dm8BzVd-.js";function H({eventId:u}){const{isAuthenticated:f}=S(),l=y(),n=w.useMemo(()=>new URLSearchParams(l),[l]).get("token"),{data:i,isLoading:h,isError:p}=k(u,n),{data:c}=C();if(!n)return e.jsxs("div",{className:"min-h-[50vh] flex flex-col items-center justify-center text-center px-4",children:[e.jsx(d,{className:"w-12 h-12 text-destructive mb-4"}),e.jsx("h2",{className:"text-xl font-bold",children:"Invalid Link"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:"No queue ticket token found in the URL."})]});if(h)return e.jsxs("div",{className:"min-h-[50vh] flex flex-col items-center justify-center",children:[e.jsx(D,{className:"w-10 h-10 animate-spin text-[#f26b28] mb-4"}),e.jsx("p",{className:"text-muted-foreground font-bold text-lg",children:"Checking your spot..."})]});if(p||!i)return e.jsxs("div",{className:"min-h-[50vh] flex flex-col items-center justify-center text-center px-4",children:[e.jsx(d,{className:"w-12 h-12 text-destructive mb-4"}),e.jsx("h2",{className:"text-xl font-bold",children:"Ticket Not Found"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:"We couldn't find your ticket. It may have expired or the event has ended."})]});const{queuePosition:b,queueTotal:g,status:a,estimatedWaitMinutes:j,eventTitle:N,qrData:o}=i,s=(()=>{switch(a){case"completed":return{icon:Y,color:"text-emerald-500",bg:"bg-emerald-50",title:"All Done!",message:"You're all set. Thanks for coming!"};case"no_show":return{icon:x,color:"text-amber-500",bg:"bg-amber-50",title:"Missed Spot",message:"You missed your turn in line."};case"cancelled":return{icon:x,color:"text-rose-500",bg:"bg-rose-50",title:"Ticket Cancelled",message:"Your spot in line was cancelled."};case"next_up":return{icon:r,color:"text-[#f26b28]",bg:"bg-[#f26b28]/10",title:"You're up next!",message:"Please head to the front."};case"in_service":return{icon:r,color:"text-[#1a5c50]",bg:"bg-[#1a5c50]/10",title:"It's your turn!",message:"You are currently being helped."};case"pending_payment":return{icon:m,color:"text-amber-600",bg:"bg-amber-50",title:"Payment Pending",message:"Please complete your payment."};default:return{icon:m,color:"text-[#003f6b]",bg:"bg-blue-50",title:"You're in line",message:"Keep this screen open to check your spot."}}})(),v=s.icon;return e.jsxs("div",{className:"max-w-md mx-auto py-8 px-4 min-h-[80vh] flex flex-col items-center justify-center",children:[e.jsxs("div",{className:"bg-white rounded-3xl border shadow-lg overflow-hidden w-full relative",children:[e.jsxs("div",{className:"bg-[#003f6b] p-6 text-center text-white relative overflow-hidden",children:[e.jsx("div",{className:"absolute top-0 right-0 -mr-6 -mt-6 w-24 h-24 rounded-full bg-white/10 blur-xl"}),e.jsx("div",{className:"absolute bottom-0 left-0 -ml-6 -mb-6 w-20 h-20 rounded-full bg-[#f26b28]/20 blur-lg"}),e.jsx(r,{className:"w-10 h-10 text-white/90 mx-auto mb-3"}),e.jsx("h1",{className:"text-xl font-extrabold px-4",children:N})]}),e.jsxs("div",{className:"p-8 flex flex-col items-center text-center",children:[e.jsx("div",{className:`w-20 h-20 rounded-full flex items-center justify-center mb-5 ${s.bg}`,children:e.jsx(v,{className:`w-10 h-10 ${s.color}`})}),e.jsx("h2",{className:"text-2xl font-black text-foreground mb-2",children:s.title}),e.jsx("p",{className:"text-muted-foreground font-medium mb-6",children:s.message}),(a==="waiting"||a==="next_up")&&e.jsxs("div",{className:"grid grid-cols-2 gap-4 w-full mb-8",children:[e.jsxs("div",{className:"bg-muted/30 border rounded-2xl p-4 flex flex-col items-center justify-center",children:[e.jsx("span",{className:"text-xs font-bold text-muted-foreground uppercase tracking-wider mb-1",children:"Your Spot"}),e.jsxs("div",{className:"flex items-baseline gap-1 text-[#f26b28]",children:[e.jsx("span",{className:"text-4xl font-black leading-none",children:b}),e.jsxs("span",{className:"text-sm font-bold text-muted-foreground",children:["/ ",g]})]})]}),e.jsxs("div",{className:"bg-muted/30 border rounded-2xl p-4 flex flex-col items-center justify-center",children:[e.jsx("span",{className:"text-xs font-bold text-muted-foreground uppercase tracking-wider mb-1",children:"Wait Time"}),e.jsxs("div",{className:"flex items-baseline gap-1 text-[#1a5c50]",children:[e.jsx("span",{className:"text-4xl font-black leading-none",children:j||"~"}),e.jsx("span",{className:"text-sm font-bold text-muted-foreground",children:"min"})]})]})]}),o&&e.jsxs("div",{className:"w-full flex flex-col items-center",children:[e.jsx("p",{className:"text-xs font-bold text-muted-foreground uppercase tracking-wider mb-3",children:"Your Ticket QR"}),e.jsx("div",{className:"bg-white p-3 rounded-2xl border-2 shadow-sm inline-block",children:e.jsx(T,{value:o,size:150,fgColor:"#003f6b"})})]})]}),e.jsx("div",{className:"bg-muted/20 border-t p-4 text-center",children:e.jsx("p",{className:"text-xs text-muted-foreground font-semibold",children:"This page updates automatically."})})]}),f&&c?.entries?.length>0&&e.jsxs("div",{className:"w-full max-w-md mx-auto mt-8",children:[e.jsxs("h3",{className:"text-sm font-bold flex items-center gap-2 mb-4 text-foreground
1/80",children:[e.jsx(L,{className:"w-4 h-4 text-[#f26b28]"})," Past Events"]}),e.jsx("div",{className:"space-y-3",children:c.entries.slice(0,3).map(t=>e.jsxs("div",{className:"bg-white rounded-2xl border p-4 shadow-sm",children:[e.jsxs("div",{className:"flex justify-between items-start mb-2",children:[e.jsx("span",{className:"font-bold text-sm truncate pr-2",children:t.eventTitle}),e.jsx("span",{className:"text-[10px] font-bold px-2 py-0.5 rounded-full bg-muted text-muted-foreground shrink-0 capitalize",children:t.status.replace("_"," ")})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[e.jsx("span",{children:new Date(t.createdAt).toLocaleDateString()}),t.serviceName&&e.jsxs("span",{children:["· ",t.serviceName]}),t.dogName&&e.jsxs("span",{children:["· ",t.dogName]})]})]},t.id))})]})]})}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.