PageSourceSearch

https://eliteweddingsandeventswithcara.com/assets/ExhibitorBookings-QasXVbIn.js

js eliteweddingsandeventswithcara.com collected 2026-09-30 06:37:09 UTC 9,360 bytes, 7 lines download raw bytes

1import{c as U,a1 as H,D as _,j as e,m as I,J as K,B as j,aG as N,C as k,a as C,b as B,a3 as E,d as S,Z as T,U as L,s as h,u}from"./index-DaxYHL_c.js";import{B as $}from"./badge-BgIO1kHT.js";import{T as A,a as z,b as D,c as x,d as P,e as p}from"./table-Dli9Apn1.js";import{T as Q}from"./ticket-JL1qSaR5.js";import{C as Y}from"./circle-x-BKft3PDz.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const G=U("BellRing",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}]]),W=["Invoice ref","Date paid","Tax year (UK)","Event","Venue","Event date","Business name","Contact name","Email","Phone","Business address","Category","Membership tier","Standard fee (GBP)","Discount %","Amount received (GBP)","Payment method","Stripe payment ID","Status"],V=r=>{if(!r)return"";const l=new Date(r),m=l.getFullYear(),c=l.getMonth()>3||l.getMonth()===3&&l.getDate()>=6?m:m-1;return`${c}/${String(c+1).slice(2)}`},b=r=>`"${(r==null?"":String(r)).replace(/"/g,'""').replace(/\r?\n/g," ")}"`,J=r=>r?new Date(r).toISOString().slice(0,10):"",q=(r,l)=>{const m=r.slice().sort((i,n)=>(i.paid_at??i.created_at).localeCompare(n.paid_at??n.created_at)).map(i=>{const n=l[i.show_id];return[i.reference??"",J(i.paid_at),V(i.paid_at),(n==null?void 0:n.name)??"",(n==null?void 0:n.venue)??"",(n==null?void 0:n.event_date)??"",i.business_name,i.contact_name,i.email,i.phone??"",i.business_address??"",i.category,i.membership_tier,Number(i.base_fee??0).toFixed(2),i.discount_pct??0,Number(i.amount_due).toFixed(2),"Stripe (card)",i.stripe_session_id??"",i.status].map(b).join(",")}),c=["","","","","","","TOTAL","","","","","","","","",r.reduce((i,n)=>i+Number(n.amount_due||0),0).toFixed(2),"","",""].map(b).join(",");return[W.map(b).join(","),...m,c].join(`\r
7`)},F=(r,l)=>{const m=new Blob(["\uFEFF"+l],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(m),c=document.createElement("a");c.href=d,c.download=r,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(d)},ae=()=>{const r=H(),{data:l,isLoading:m}=_({queryKey:["admin-exhibitor-shows"],queryFn:async()=>{const{data:s,error:a}=await h.from("exhibitor_shows").select("*").order("event_date",{ascending:!0});if(a)throw a;return s??[]}}),{data:d}=_({queryKey:["admin-exhibitor-bookings"],queryFn:async()=>{const{data:s,error:a}=await h.from("exhibitor_bookings").select("*").order("created_at",{ascending:!1});if(a)throw a;return s??[]}}),{data:c}=_({queryKey:["admin-exhibitor-waitlist"],queryFn:async()=>{const{data:s,error:a}=await h.from("exhibitor_waitlist").select("*").order("created_at",{ascending:!0});if(a)throw a;return s??[]}}),i=async(s,a)=>{const{error:o}=await h.from("exhibitor_shows").update({booking_stage:a}).eq("id",s);if(o){u.error(o.message);return}u.success(a==="closed"?"Bookings closed for this showcase.":a==="elite"?"Open to Elite Vow Collective members only.":"Open to all suppliers."),r.invalidateQueries({queryKey:["admin-exhibitor-shows"]})},n=async s=>{if(!confirm(`Cancel ${s.business_name}'s ${s.category} space?`))return;const{error:a}=await h.from("exhibitor_bookings").update({status:"cancelled",cancelled_at:new Date().toISOString()}).eq("id",s.id);if(a){u.error(a.message);return}u.success("Booking cancelled — the space is back on sale."),r.invalidateQueries({queryKey:["admin-exhibitor-bookings"]})},M=async(s,a)=>{const{data:o,error:g}=await h.functions.invoke("notify-exhibitor-waitlist",{body:{showId:s,category:a}});if(g){u.error("Could not send the waiting list emails.");return}u.success(`Emailed ${(o==null?void 0:o.notified)??0} supplier(s) on the waiting list.`),r.invalidateQueries({queryKey:["admin-exhibitor-waitlist"]})},v=Object.fromEntries((l??[]).map(s=>[s.id,s])),O=s=>{const a=(d??[]).filter(o=>o.show_id===s.id&&o.status==="paid");if(!a.length){u.error("No paid bookings to export for this showcase yet.");return}F(`exhibitor-income-${s.slug}.csv`,q(a,v))},R=()=>{const s=(d??[]).filter(a=>a.status==="paid");if(!s.length){u.error("No paid bookings to export yet.");return}F(`exhibitor-income-all-events-${new Date().toISOString().slice(0,10)}.csv`,q(s,v))};if(m)return e.jsx("div",{className:"flex justify-center py-16",children:e.jsx(I,{className:"w-6 h-6 animate-spin text-primary"})});const w=(s,a)=>(d??[]).filter(o=>o.show_id===s&&o.status==="paid"&&(a?o.category===a:!0));return e.jsxs("div",{className:"space-y-8",children:[e.jsx(K,{children:e.jsx("title",{children:"Exhibitor Bookings | Admin"})}),e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[e.jsx(Q,{className:"w-6 h-6 text-primary"}),"Exhibitor Bookings"]}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Paid stand bookings, category caps and waiting lists for each showcase."}),e.jsxs(j,{size:"sm",variant:"outline",className:"mt-3",onClick:R,children:[e.jsx(N,{className:"w-4 h-4 mr-2"}),"Download full income record (all events)"]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Opens in Excel. Includes invoice reference, date paid, UK tax year, supplier details, fee, discount and amount received for your accounts."})]}),(l??[]).map(s=>{const a=w(s.id),o=Array.from(new Set([...a.map(t=>t.category),...(c??[]).filter(t=>t.show_id===s.id).map(t=>t.category)])).sort(),g=(c??[]).filter(t=>t.show_id===s.id);return e.jsxs(k,{children:[e.jsxs(C,{children:[e.jsx(B,{children:s.name}),e.jsxs(E,{children:[s.date_label??s.event_date," · ",s.venue," · £",Number(s.fee).toFixed(2)," ","per space · cap ",s.space
7s_per_category," per category ·"," ",a.length," paid exhibitor",a.length===1?"":"s"]}),e.jsxs("div",{className:"pt-3 flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium mr-1",children:"Booking is:"}),[{key:"closed",label:"Closed"},{key:"elite",label:"Elite members only"},{key:"general",label:"Open to everyone"}].map(t=>e.jsx(j,{size:"sm",variant:s.booking_stage===t.key?"default":"outline",onClick:()=>i(s.id,t.key),children:t.label},t.key)),e.jsxs(j,{size:"sm",variant:"outline",className:"ml-auto",onClick:()=>O(s),children:[e.jsx(N,{className:"w-4 h-4 mr-2"}),"Download income record"]})]})]}),e.jsxs(S,{className:"space-y-6",children:[o.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2",children:o.map(t=>{const y=w(s.id,t).length,f=y>=s.spaces_per_category;return e.jsxs($,{variant:"outline",className:f?"border-destructive text-destructive":"",children:[t,": ",y,"/",s.spaces_per_category]},t)})}),a.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No paid bookings yet."}):e.jsxs(A,{children:[e.jsx(z,{children:e.jsxs(D,{children:[e.jsx(x,{children:"Business"}),e.jsx(x,{children:"Category"}),e.jsx(x,{children:"Contact"}),e.jsx(x,{children:"Tier"}),e.jsx(x,{children:"Paid"}),e.jsx(x,{children:"Ref"}),e.jsx(x,{})]})}),e.jsx(P,{children:a.map(t=>e.jsxs(D,{children:[e.jsx(p,{className:"font-medium",children:t.business_name}),e.jsx(p,{children:t.category}),e.jsxs(p,{className:"text-xs",children:[t.contact_name,e.jsx("br",{}),t.email,t.phone?e.jsx("br",{}):null,t.phone,t.business_address?e.jsx("span",{className:"block mt-1 whitespace-pre-line text-muted-foreground",children:t.business_address}):null]}),e.jsx(p,{className:"capitalize",children:t.membership_tier}),e.jsxs(p,{children:["£",Number(t.amount_due).toFixed(2),t.discount_pct?e.jsxs("span",{className:"text-xs text-muted-foreground",children:[" ","(-",t.discount_pct,"%)"]}):null,e.jsx("div",{className:"text-xs text-muted-foreground",children:t.paid_at?T(new Date(t.paid_at),"d MMM yyyy"):""})]}),e.jsx(p,{className:"text-xs",children:t.reference}),e.jsx(p,{children:e.jsxs(j,{size:"sm",variant:"ghost",onClick:()=>n(t),children:[e.jsx(Y,{className:"w-4 h-4 mr-1"}),"Cancel"]})})]},t.id))})]}),g.length>0&&e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm font-semibold flex items-center gap-2 mb-2",children:[e.jsx(L,{className:"w-4 h-4 text-primary"}),"Waiting list"]}),e.jsx("div",{className:"space-y-2",children:Array.from(new Set(g.map(t=>t.category))).map(t=>{const y=g.filter(f=>f.category===t);return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded-lg border p-3",children:[e.jsxs("div",{className:"text-sm",children:[e.jsx("strong",{children:t})," — ",y.length," waiting:"," ",e.jsx("span",{className:"text-muted-foreground",children:y.map(f=>f.business_name).join(", ")})]}),e.jsxs(j,{size:"sm",variant:"outline",onClick:()=>M(s.id,t),children:[e.jsx(G,{className:"w-4 h-4 mr-1"}),"Email waiting list"]})]},t)})})]})]})]},s.id)}),(d??[]).some(s=>s.status==="pending")&&e.jsxs(k,{children:[e.jsxs(C,{children:[e.jsx(B,{className:"text-base",children:"Unpaid holds"}),e.jsx(E,{children:"Spaces held during checkout. These expire automatically after 20 minutes and free the space back up."})]}),e.jsx(S,{className:"text-sm text-muted-foreground",children:(d??[]).filter(s=>s.status==="pending").map(s=>e.jsxs("div",{children:[s.business_name," — ",s.category," — started"," ",T(new Date(s.created_at),"d MMM HH:mm")]},s.id))})]})]})};export{ae 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.