1import{j as e}from"./app-C1iegf7Q.js";import{b as C,f as P,u as H,H as W,L as E}from"./inertia-BpyZy4w-.js";import{g as Q,C as Y,s as Z}from"./content-targeting-form-iobz4Uih.js";import{A as J,c as K,f as X,g as ee,d as re,e as se,b as ie,a as ae}from"./alert-dialog-C1d8fkj9.js";import{B as L}from"./badge-B51Owt1e.js";import{B as u}from"./button-BE4q1_FS.js";import{C as te,c as le,d as ne,b as ce,a as de}from"./card-B-nADP2d.js";import{D as oe,b as me,e as he,f as xe,c as pe,d as ue}from"./dialog-DrkalYDs.js";import{I as d}from"./input-DJt0nBB3.js";import{L as t}from"./label-Czc25Mye.js";import{S as v,e as _,f as b,a as f,c as m}from"./select-Bn8hgKYl.js";import{S as p}from"./switch-DhdMz2rn.js";import{T as S}from"./textarea-CXLxrYIG.js";import{P as R}from"./plus-BJl-aJiX.js";import{D as ge}from"./dollar-sign-Ck66Jney.js";import{G as je}from"./grip-vertical-B7cOZWqO.js";import{C as ve}from"./check-0O-UND6N.js";import{C as U}from"./calendar-C9IvR7oY.js";import{P as _e}from"./pencil-DJkCCH8r.js";import{C as be}from"./copy-DmjhZUbe.js";import{T as V}from"./trash-2-CrI9a2Po.js";import{R as fe}from"./RichTextEditor-CGDxVgC4.js";import{I}from"./image-upload-Dloi17i0.js";import{C as ye}from"./checkbox-Bj_6CKpj.js";import{a as Ne}from"./admin-layout-BhXWbUlP.js";import{A as Ce}from"./arrow-left-DCX0fhKH.js";import{U as ke}from"./users-BCcupCXV.js";import{V as $}from"./video-CJHgxwGi.js";import{E as we}from"./external-link-avvfS30C.js";/* empty css */import"./utils-BiuKVCuu.js";import"./index-CGXdj8xB.js";import"./index-BewtL6Hn.js";import"./index-Dc_FVRD7.js";import"./index-C_n-C52S.js";import"./index-CL12STDK.js";import"./index-XydtsrKA.js";import"./index-BDqbV96p.js";import"./index-Cja0wFUH.js";import"./Combination-Cr5kvm8y.js";import"./index-B1PKR-s8.js";import"./x-DQSeRCcH.js";import"./createLucideIcon-wqc1LSWg.js";import"./index-DdRFMukF.js";import"./index-BdQq_4o_.js";import"./index-B0NHTN87.js";import"./index-C48dRAib.js";import"./index-D4vO54bj.js";import"./index-BRU_LjHB.js";import"./index-Cs5D2gCo.js";import"./index-DyGg2PJd.js";import"./chevron-down-B1YaU0K5.js";import"./chevron-up-CLp5HMgA.js";import"./index-DgRF6w_M.js";import"./index-DJlprK4q.js";import"./index-DV0GpYST.js";import"./index-B9qJRYKv.js";import"./link-DKPEjeqT.js";import"./underline-BUwyLhKb.js";import"./list-BgP0xxm1.js";import"./quote-BLp7dxmt.js";import"./undo-BjvUJKje.js";import"./loader-circle-C_KBZAGS.js";import"./image-vCg-0Xge.js";import"./minus-BxBzNlIL.js";import"./upload-C1CGckSw.js";import"./link-2-D0ZKUr8N.js";import"./image-plus-Drz-1lbN.js";import"./app-logo-Dz0wogSq.js";import"./logo-light-DU4bWymm.js";import"./flash-toast-C6O0iVL1.js";import"./info-D2ZN_yLm.js";import"./triangle-alert-C7AVwNi-.js";import"./circle-x-Bp6Mbpgt.js";import"./circle-check-BMWvzPMx.js";import"./menu-BR3Nc3Gr.js";import"./folder-open-I72SPUVk.js";import"./pound-sterling-D16GLaAZ.js";import"./book-open-DVFlG_9t.js";const k={name:"",description:"",price:"",currency:"GBP",features:"",max_quantity:"",available_from:"",available_until:"",display_order:"0",is_available:!0};function Fe({eventId:a,pricingPlans:D}){const[A,s]=C.useState(!1),[l,y]=C.useState(!1),[g,c]=C.useState(null),[N,w]=C.useState(null),[n,r]=C.useState(k),[h,x]=C.useState(!1),o=()=>{r(k),s(!0)},T=i=>{c(i),r({name:i.name,description:i.description||"",price:i.price.toString(),currency:i.currency,features:i.features?.join(` 2`)||"",max_quantity:i.max_quantity?.toString()||"",available_from:i.available_from?.substring(0,16)||"",available_until:i.available_until?.substring(0,16)||"",display_order:i.display_order.toString(),is_available:i.is_available}),y(!0)},q=i=>{P.post(`/admin/events/${a}/pricing-plans/${i.id}/duplicate`,{},{preserveScroll:!0})},G=i=>{if((i.confirmed_registrations_count||0)>0){alert(`Cannot delete this plan. It has ${i.confirmed_registrations_count} confirmed registration(s).`);return}w(i)},z=()=>{N&&P.delete(`/admin/events/${a}/pricing-plans/${N.id}`,{preserveScroll:!0,onSuccess:()=>w(null)})},M=i=>{i.preventDefault(),x(!0);const j=n.features.split(` 3`).map(B=>
3B.trim()).filter(B=>B.length>0),F={name:n.name,description:n.description||null,price:parseFloat(n.price),currency:n.currency,features:j.length>0?j:null,max_quantity:n.max_quantity?parseInt(n.max_quantity):null,available_from:n.available_from||null,available_until:n.available_until||null,display_order:parseInt(n.display_order),is_available:n.is_available};g?P.put(`/admin/events/${a}/pricing-plans/${g.id}`,F,{preserveScroll:!0,onSuccess:()=>{y(!1),c(null),r(k)},onFinish:()=>x(!1)}):P.post(`/admin/events/${a}/pricing-plans`,F,{preserveScroll:!0,onSuccess:()=>{s(!1),r(k)},onFinish:()=>x(!1)})},O=(i,j)=>`${j==="GBP"?"£":j==="USD"?"$":"â¦"}${parseFloat(i).toFixed(2)}`;return e.jsxs(te,{children:[e.jsx(le,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(ne,{children:"Pricing Plans"}),e.jsx(ce,{children:"Create multiple pricing tiers for this event (Early Bird, Standard, VIP, etc.)"})]}),e.jsxs(u,{type:"button",onClick:o,size:"sm",children:[e.jsx(R,{className:"h-4 w-4 mr-2"}),"Add Plan"]})]})}),e.jsxs(de,{children:[D.length===0?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ge,{className:"h-12 w-12 mx-auto mb-4 opacity-50"}),e.jsx("p",{children:"No pricing plans yet."}),e.jsx("p",{className:"text-sm",children:"Add your first pricing plan to get started."})]}):e.jsx("div",{className:"space-y-3",children:D.map(i=>e.jsxs("div",{className:"flex items-start gap-4 p-4 border rounded-lg hover:bg-accent/50 transition-colors",children:[e.jsx("div",{className:"flex-shrink-0 pt-1 cursor-move",children:e.jsx(je,{className:"h-5 w-5 text-muted-foreground"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"flex items-start justify-between gap-2 mb-2",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h4",{className:"font-semibold",children:i.name}),!i.is_available&&e.jsx(L,{variant:"secondary",children:"Disabled"}),i.max_quantity&&e.jsxs(L,{variant:"outline",children:[i.confirmed_registrations_count||0," / ",i.max_quantity," sold"]})]}),e.jsx("p",{className:"text-2xl font-bold text-primary mt-1",children:O(i.price,i.currency)})]})}),i.description&&e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:i.description}),i.features&&i.features.length>0&&e.jsx("ul",{className:"space-y-1 mb-2",children:i.features.map((j,F)=>e.jsxs("li",{className:"text-sm flex items-start gap-2",children:[e.jsx(ve,{className:"h-4 w-4 text-primary mt-0.5 flex-shrink-0"}),e.jsx("span",{children:j})]},F))}),e.jsxs("div",{className:"flex flex-wrap gap-2 text-xs text-muted-foreground",children:[i.available_from&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(U,{className:"h-3 w-3"}),"From: ",new Date(i.available_from).toLocaleDateString()]}),i.available_until&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(U,{className:"h-3 w-3"}),"Until: ",new Date(i.available_until).toLocaleDateString()]})]})]}),e.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[e.jsx(u,{type:"button",variant:"ghost",size:"sm",onClick:()=>T(i),children:e.jsx(_e,{className:"h-4 w-4"})}),e.jsx(u,{type:"button",variant:"ghost",size:"sm",onClick:()=>q(i),children:e.jsx(be,{className:"h-4 w-4"})}),e.jsx(u,{type:"button",variant:"ghost",size:"sm",onClick:()=>G(i),children:e.jsx(V,{className:"h-4 w-4 text-destructive"})})]})]},i.id))}),e.jsx(oe,{open:A||l,onOpenChange:i=>{i||(s(!1),y(!1),c(null),r(k))},children:e.jsxs(me,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[e.jsxs(he,{children:[e.jsx(xe,{children:g?"Edit Pricing Plan":"Create Pricing Plan"}),e.jsx(pe,{children:g?"Update the pricing plan details.":"Add a new pricing option for this event."})]}),e.jsxs("form",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(t,{htmlFor:"name",children:"Plan Name *"}),e.jsx(d,{id:"name",value:n.name,onChange:i=>r({...n,name:i.target.value}),placeholder:"e.g., Early Bird, Standard, VIP",required:!0})]}),e.jsxs("div",{children:[e.jsx(t,{htmlFor:"description",children:"Description"}),e.jsx(S,{id:"description",value:n.description,onChange:i=>r({...n,description:i.target.value}),placeholder:"Brief description of this pricing tier",rows:2})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(t,{htmlFor:"price",children:"Price *"}),e.jsx(d,{id:"price",type:"number",step:"0.01",min:"0",value:n.price,onChange:i=>r({...n,price:i.target.value}),required:!0})]}),e.jsxs("div",{children:[e.jsx(t,{htmlFor:"currency",children:"Currency *"}),e.jsxs(v,{value:n.currency,onValueChange:i=>r({...n,currency:i}),children:[e.jsx(_,{children:e.jsx(b,{})}),e.jsxs(f,{children:[e.jsx(m,{value:"GBP",children:"GBP (£)"}),e.jsx(m,{value:"USD",children:"USD ($)"}),e.jsx(m,{value:"NGN",children:"NGN (â¦)"})]})]})]})]}),e.jsxs("div",{children:[e.jsx(t,{htmlFor:"features",children:"Features (one per line)"}),e.jsx(S,{id:"features",value:n.features,onChange:i=>r({...n,features:i.target.value}),placeholder:`Event access 4Q&A session 5Workshop materials 6Certificate`,rows:4}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Enter each feature on a new line"})]}),e.jsxs("div",{children:[e.jsx(t,{htmlFor:"max_quantity",children:"Max Quantity (optional)"}),e.jsx(d,{id:"max_quantity",type:"number",min:"1",value:n.max_quantity,onChange:i=>r({...n,max_quantity:i.target.value}),placeholder:"Leave empty for unlimited"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"For limited availability (e.g., Early Bird: 20 spots)"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(t,{htmlFor:"available_from",children:"Available From (optional)"}),e.jsx(d,{id:"available_from",type:"datetime-local",value:n.available_from,onChange:i=>r({...n,available_from:i.target.value})})]}),e.jsxs("div",{children:[e.jsx(t,{htmlFor:"available_until",children:"Available Until (optional)"}),e.jsx(d,{id:"available_until",type:"datetime-local",value:n.available_until,onCh
6ange:i=>r({...n,available_until:i.target.value})})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(t,{htmlFor:"display_order",children:"Display Order"}),e.jsx(d,{id:"display_order",type:"number",min:"0",value:n.display_order,onChange:i=>r({...n,display_order:i.target.value})}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Lower numbers appear first"})]}),e.jsx("div",{className:"flex items-end",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(p,{id:"is_available",checked:n.is_available,onCheckedChange:i=>r({...n,is_available:i})}),e.jsx(t,{htmlFor:"is_available",children:"Available for purchase"})]})})]}),e.jsxs(ue,{children:[e.jsx(u,{type:"button",variant:"outline",onClick:()=>{s(!1),y(!1),c(null),r(k)},disabled:h,children:"Cancel"}),e.jsx(u,{type:"button",onClick:M,disabled:h,children:h?"Saving...":g?"Update Plan":"Create Plan"})]})]})]})}),e.jsx(J,{open:!!N,onOpenChange:()=>w(null),children:e.jsxs(K,{children:[e.jsxs(X,{children:[e.jsx(ee,{children:"Delete Pricing Plan"}),e.jsxs(re,{children:['Are you sure you want to delete "',N?.name,'"? This action cannot be undone.']})]}),e.jsxs(se,{children:[e.jsx(ie,{children:"Cancel"}),e.jsx(ae,{onClick:z,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})]})}function Xr({event:a,categories:D,pricingPlans:A}){const{data:s,setData:l,patch:y,processing:g,errors:c}=H({title:a.title,description:a.description,excerpt:a.excerpt||"",featured_image:a.featured_image||"",category_id:a.category?.id.toString()||"",event_type:a.event_type,is_recurring:a.is_recurring||!1,recurrence_type:a.recurrence_type||"weekly",recurrence_interval:a.recurrence_interval||1,recurrence_days:a.recurrence_days||[],occurrence_count:a.occurrence_count||6,meeting_url:a.meeting_url||"",use_borderless_video:a.use_borderless_video||!1,location_name:a.location_name||"",location_address:a.location_address||"",starts_at:a.starts_at.substring(0,16),ends_at:a.ends_at.substring(0,16),timezone:a.timezone,access_level:a.access_level,members_included:a.members_included||!1,price:a.price?.toString()||"",currency:a.currency,has_pricing_plans:a.has_pricing_plans||!1,max_capacity:a.max_capacity?.toString()||"",allow_waitlist:a.allow_waitlist,is_published:a.is_published,metadata:a.metadata||{},recording_url:a.recording_url||"",recording_price:a.recording_price?.toString()||"",recording_currency:a.recording_currency||"GBP",recording_available:a.recording_available||!1,recording_in_library:a.recording_in_library??!0,speakers:a.speakers||[],use_landing_layout:a.use_landing_layout||!1}),N=Q(s.metadata),w=r=>{l("metadata",Z(s.metadata,r))},n=r=>{r.preventDefault(),y(`/admin/events/${a.id}`)};return e.jsxs(Ne,{children:[e.jsx(W,{title:`Edit: ${a.title} · Admin`}),e.jsx("div",{className:"px-4 py-5 sm:px-6 sm:py-7",children:e.jsxs("div",{className:"mx-auto max-w-4xl",children:[e.jsxs("div",{className:"mb-5",children:[e.jsxs(E,{href:"/admin/events",className:"mb-2 inline-flex items-center gap-1 text-xs font-medium text-ink-3 hover:text-ink",children:[e.jsx(Ce,{className:"h-3.5 w-3.5"})," Back to Events"]}),e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-semibold text-ink",children:"Edit Event"}),e.jsx("p",{className:"mt-0.5 text-sm text-ink-3",children:a.title})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(E,{href:`/admin/events/${a.id}/registrations`,className:"inline-flex items-center gap-1.5 rounded-lg border border-line bg-white px-4 py-2 text-sm font-medium text-ink-2 hover:bg-bg-2",children:[e.jsx(ke,{className:"h-3.5 w-3.5"}),"View Registrations (",a.current_registrations,")"]}),e.jsxs(E,{href:`/admin/events/${a.id}/recording`,className:"inline-flex items-center gap-1.5 rounded-lg border border-line bg-white px-4 py-2 text-sm font-medium text-ink-2 hover:bg-bg-2",children:[e.jsx($,{className:"h-3.5 w-3.5"}),"Manage Recording"]}),e.jsxs("a",{href:`/events/${a.slug}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 rounded-lg border border-line bg-white px-4 py-2 text-sm font-medium text-ink-2 hover:bg-bg-2",children:["View ",e.jsx(we,{className:"h-3.5 w-3.5"})]})]})]})]}),e.jsx("form",{children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"rounded-card border border-line bg-white p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-ink",children:"Basic Information"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(t,{htmlFor:"title",children:"Event Title *"}),e.jsx(d,{id:"title",value:s.title,onChange:r=>l("title",r.target.value),required:!0}),c.title&&e.jsx("p",{className:"mt-1 text-xs text-red",children:c.title})]}),e.jsxs("div",{children:[e.jsx(t,{htmlFor:"excerpt",children:"Excerpt"}),e.jsx(S,{id:"excerpt",value:s.excerpt,onChange:r=>l("excerpt",r.target.value),rows:2,placeholder:"Short description for card previews (max 500 characters)"}),c.excerpt&&e.jsx("p",{className:"mt-1 text-xs text-red",children:c.excerpt})]}),e.jsxs("div",{children:[e.jsx(t,{children:"Description *"}),e.jsx(fe,{value:s.description,onChange:r=>l("description",r),placeholder:"Event description...",error:c.description,minHeight:"200px"}),c.description&&e.jsx("p",{className:"mt-1 text-xs text-red",children:c.description})]}),e.jsxs("div",{children:[e.jsx(t,{htmlFor:"category_id",children:"Category *"}),e.jsxs(v,{value:s.category_id,onValueChange:r=>l("category_id",r),children:[e.jsx(_,{children:e.jsx(b,{placeholder:"Select a category"})}),e.jsx(f,{children:D.map(r=>
6e.jsx(m,{value:r.id.toString(),children:r.name},r.id))})]}),c.category_id&&e.jsx("p",{className:"mt-1 text-xs text-red",children:c.category_id})]}),e.jsxs("div",{children:[e.jsx(t,{children:"Featured Image"}),e.jsx(I,{value:s.featured_image,onChange:r=>l("featured_image",r),directory:"events",allowUrl:!0}),c.featured_image&&e.jsx("p",{className:"mt-1 text-xs text-red",children:c.featured_image})]})]})]}),e.jsxs("div",{className:"rounded-card border border-line bg-white p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-ink",children:"Event Type & Location"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(t,{htmlFor:"event_type",children:"Event Type *"}),e.jsxs(v,{value:s.event_type,onValueChange:r=>l("event_type",r),children:[e.jsx(_,{children:e.jsx(b,{})}),e.jsxs(f,{children:[e.jsx(m,{value:"virtual",children:"Virtual (Online)"}),e.jsx(m,{value:"in_person",children:"In-Person"})]})]})]}),s.event_type==="virtual"?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-line bg-bg-2 p-4",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(t,{htmlFor:"use_borderless_video",children:"Use Borderless Video"}),e.jsx("p",{className:"text-sm text-ink-3",children:s.use_borderless_video?"A video room will be created automatically on Borderless":"Provide your own meeting link (Zoom, Google Meet, etc.)"})]}),e.jsx(p,{id:"use_borderless_video",checked:s.use_borderless_video,onCheckedChange:r=>l("use_borderless_video",r)})]}),!s.use_borderless_video&&e.jsxs("div",{children:[e.jsx(t,{htmlFor:"meeting_url",children:"Meeting URL"}),e.jsx(d,{id:"meeting_url",type:"url",value:s.meeting_url,onChange:r=>l("meeting_url",r.target.value),placeholder:"https://zoom.us/j/..."}),c.meeting_url&&e.jsx("p",{className:"mt-1 text-xs text-red",children:c.meeting_url})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx(t,{htmlFor:"location_name",children:"Location Name"}),e.jsx(d,{id:"location_name",value:s.location_name,onChange:r=>l("location_name",r.target.value),placeholder:"e.g., Community Hall"})]}),e.jsxs("div",{children:[e.jsx(t,{htmlFor:"location_address",children:"Location Address"}),e.jsx(S,{id:"location_address",value:s.location_address,onChange:r=>l("location_address",r.target.value),rows:2,placeholder:"Full address"})]})]})]})]}),e.jsxs("div",{className:"rounded-card border border-line bg-white p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-ink",children:"Date & Time"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(t,{htmlFor:"starts_at",children:"Start Date & Time *"}),e.jsx(d,{id:"starts_at",type:"datetime-local",value:s.starts_at,onChange:r=>l("starts_at",r.target.value),required:!0}),c.starts_at&&e.jsx("p",{className:"mt-1 text-xs text-red",children:c.starts_at})]}),e.jsxs("div",{children:[e.jsx(t,{htmlFor:"ends_at",children:"End Date & Time *"}),e.jsx(d,{id:"ends_at",type:"datetime-local",value:s.ends_at,onChange:r=>l("ends_at",r.target.value),required:!0}),c.ends_at&&e.jsx("p",{className:"mt-1 text-xs text-red",children:c.ends_at})]})]}),e.jsxs("div",{children:[e.jsx(t,{htmlFor:"timezone",children:"Timezone *"}),e.jsx(d,{id:"timezone",value:s.timezone,onChange:r=>l("timezone",r.target.value),placeholder:"e.g., Europe/London, America/Ne
6w_York"})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-line bg-bg-2 p-4",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(t,{htmlFor:"is_recurring",children:"Recurring Event"}),e.jsx("p",{className:"text-sm text-ink-3",children:"Create a series of events that repeat on a schedule"})]}),e.jsx(p,{id:"is_recurring",checked:s.is_recurring,onCheckedChange:r=>l("is_recurring",r)})]}),s.is_recurring&&e.jsxs("div",{className:"space-y-4 border-l-2 border-line-2 pl-4",children:[e.jsxs("div",{children:[e.jsx(t,{htmlFor:"recurrence_type",children:"Repeat Pattern *"}),e.jsxs(v,{value:s.recurrence_type,onValueChange:r=>l("recurrence_type",r),children:[e.jsx(_,{children:e.jsx(b,{})}),e.jsxs(f,{children:[e.jsx(m,{value:"weekly",children:"Weekly"}),e.jsx(m,{value:"daily",children:"Daily"})]})]})]}),e.jsxs("div",{children:[e.jsx(t,{htmlFor:"recurrence_interval",children:"Repeat Every"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(d,{id:"recurrence_interval",type:"number",min:"1",value:s.recurrence_interval,onChange:r=>l("recurrence_interval",parseInt(r.target.value)||1),className:"w-24"}),e.jsx("span",{className:"text-sm text-ink-3",children:s.recurrence_type==="weekly"?"week(s)":"day(s)"})]})]}),s.recurrence_type==="weekly"&&e.jsxs("div",{children:[e.jsx(t,{children:"Days of Week"}),e.jsx("div",{className:"mt-2 grid grid-cols-2 gap-3 sm:grid-cols-4",children:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"].map(r=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(ye,{id:`day-${r}`,checked:s.recurrence_days.includes(r.toLowerCase()),onCheckedChange:h=>{const x=r.toLowerCase();h?l("recurrence_days",[...s.recurrence_days,x]):l("recurrence_days",s.recurrence_days.filter(o=>o!==x))}}),e.jsx(t,{htmlFor:`day-${r}`,className:"cursor-pointer text-sm font-normal",children:r})]},r))})]}),e.jsxs("div",{children:[e.jsx(t,{htmlFor:"occurrence_count",children:"Number of Sessions *"}),e.jsx(d,{id:"occurrence_count",type:"number",min:"2",value:s.occurrence_count,onChange:r=>l("occurrence_count",parseInt(r.target.value)||6),className:"w-32"}),e.jsx("p",{className:"mt-1 text-sm text-ink-3",children:"Total number of times this event will occur"})]}),e.jsxs("div",{className:"rounded-lg bg-bg-2 p-4",children:[e.jsx("p",{className:"mb-1 text-sm font-medium text-ink",children:"Series Preview"}),e.jsxs("p",{className:"text-sm text-ink-3",children:[s.occurrence_count," session",s.occurrence_count!==1?"s":""," â¢"," ","Every ",s.recurrence_interval>1?`${s.recurrence_interval} `:"",s.recurrence_type==="weekly"?"week":"day",s.recurrence_interval>1?"s":"",s.recurrence_type==="weekly"&&s.recurrence_days.length>0&&e.jsxs(e.Fragment,{children:[" on ",s.recurrence_days.map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(", ")]})]})]})]})]})]}),e.jsxs("div",{className:"rounded-card border border-line bg-white p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-ink",children:"Access & Pricing"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(t,{htmlFor:"access_level",children:"Access Level *"}),e.jsxs(v,{value:s.access_level,onValueChange:r=>l("access_level",r),children:[e.jsx(_,{children:e.jsx(b,{})}),e.jsxs(f,{children:[e.jsx(m,{value:"free",children:"Free (Everyone)"}),e.jsx(m,{value:"lite",children:"LITE"}),e.jsx(m,{value:"starter",children:"Starter"}),e.jsx(m,{value:"member",children:"Member Only"}),e.jsx(m,{value:"pro",children:"Pro Only"}),e.jsx(m,{value:"paid",children:"Paid Ticket"})]})]})]}),s.access_level==="paid"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-line bg-bg-2 p-4",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(t,{htmlFor:"has_pricing_plans",children:"Use Pricing Plans"}),e.jsx("p",{className:"text-sm text-ink-3",children:"Enable multiple pricing tiers (Early Bird, Standard, VIP) instead of a single price"})]}),e.jsx(p,{id:"has_pricing_plans",checked:s.has_pricing_plans,onCheckedChange:r=>l("has_pricing_plans",r)})]}),!s.has_pricing_plans&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(t,{htmlFor:"price",children:"Price *"}),e.jsx(d,{id:"price",type:"number",step:"0.01",min:"0",value:s.price,onChange:r=>l("price",r.target.value),placeholder:"0.00"})]}),e.jsxs("div",{children:[e.jsx(t,{htmlFor:"currency",children:"Currency *"}),e.jsxs(v,{value:s.currency,onValueChange:r=>l("currency",r),children:[e.jsx(_,{children:e.jsx(b,{})}),e.jsxs(f,{children:[e.jsx(m,{value:"GBP",children:"GBP (£)"}),e.jsx(m,{value:"USD",children:"USD ($)"}),e.jsx(m,{value:"EUR",children:"EUR (â¬)"})]})]})]})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-line p-4",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(t,{htmlFor:"members_included",children:"Free for Members"}),e.jsx("p",{className:"text-sm text-ink-3",children:"Members attend free. Non-members pay the price above."})]}),e.jsx(p,{id:"members_included",checked:s.members_included,onCheckedChange:r=>l("members_included",r)})]})]})]})]})]}),e.jsxs("div",{className:"rounded-card border border-line bg-white p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-ink",children:"Capacity & Waitlist"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(t,{htmlFor:"max_capacity",children:"Maximum Capacity"}),e.jsx(d,{id:"max_capacity",type:"number",min:"1",value:s.max_capacity,onChange:r=>l("max_capacity",r.target.value),placeholder:"Leave empty for unlimited"}),e.jsxs("p",{className:"mt-1 text-sm text-ink-3",children:["Current registrations: ",a.current_registrations]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(p,{id:"allow_waitlist",checked:s.allow_waitlist,onCheckedChange:r=>l("allow_waitlist",r)}),e.jsx(t,{htmlFor:"allow_waitlist",children:"Allow waitlist when event is full"})]})]})]}),s.access_level==="paid"&&s.has_pricing_plans&&e.jsx(Fe,{eventId:a.id,pricingPlans:A}),e.jsxs("div",{className:"rounded-card border border-line bg-white p-5",children:[e.jsxs("h2",{className:"mb-4 flex items-center gap-2 text-sm font-semibold text-ink",children:[e.jsx($,{className:"h-4 w-4"}),"Recording"]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(p,{id:"recording_available",checked:s.recording_available,onCheckedChange:r=>l("recording_available",r)}),e.jsx(t,{htmlFor:"recording_available",children:"Recording available"})]}),e.jsx("p",{className:"text-sm text-ink-3",children:"Enable this when the event recording is ready to be shared"}),s.recording_available&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx(t,{htmlFor:"recording_url",children:"Recording URL *"}),e.jsx(d,{id:"recording_url",type:"url",value:s.recording_url,onChange:r=>l("recording_url",r.target.value),placeholder:"https://vimeo.com/..."}),c.recording_url&&e.jsx("p",{className:"mt-1 text-xs text-red",children:c.recording_url}),e.jsx("p",{className:"mt-1 text-sm text-ink-3",children:"Paste a YouTube or Vimeo link. It plays inside Borderless."})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(p,{id:"recording_in_library",checked:s.recording_in_library,onCheckedChange:r=>l("recording_in_library",r)}),e.jsxs("div",{children:[e.jsx(t,{htmlFor:"recording_in_library",children:"Show in video library"}),e.jsx("p",{className:"text-sm text-ink-3",children:"List this recording on the public /watch page. Playback stays limited to subscribers and attendees."})]})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(t,{htmlFor:"recording_price",children:"Recording Price (optional)"}),e.jsx(d,{id:"recording_price",type:"number",step:"0.01",min:"0",value:s.recording_price,onChange:r=>l("recording_price",r.target.value),placeholder:"Leave empty for free access"}),e.jsx("p",{className:"mt-1 text-sm text-ink-3",children:"Price for users who didn't attend the event"})]}),e.jsxs("div",{children:[e.jsx(t,{htmlFor:"recording_currency",children:"Currency"}),e.jsxs(v,{value:s.recording_currency,onValueChange:r=>l("recording_currency",r),children:[e.jsx(_,{children:e.jsx(b,{})}),e.jsxs(f,{children:[e.jsx(m,{value:"GBP",children:"GBP (£)"}),e.jsx(m,{value:"USD",children:"USD ($)"}),e.jsx(m,{value:"EUR",children:"EUR (â¬)"})]})]})]})]})]})]})]}),e.jsxs("div",{className:"rounded-card border border-line bg-white p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-ink",children:"Speakers"}),e.jsxs("div",{className:"space-y-4",children:[s.speakers.map((r,h)=>e.jsxs("div",{className:"space-y-3 rounded-lg border border-line p-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm font-medium text-ink-3",children:["Speaker ",h+1]}),e.jsx(u,{type:"button",variant:"ghost",size:"sm",onClick:()=>{const x=s.speakers.filter((o,T)=>T!==h);l("speakers",x)},children:e.jsx(V,{className:"h-4 w-4 text-red"})})]}),e.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-[1fr_120px]",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx(t,{children:"Name *"}),e.jsx(d,{value:r.name,onChange:x=>{const o=[...s.speakers];o[h]={...o[h],name:x.target.value},l("speakers",o)},placeholder:"Speaker name"})]}),e.jsxs("div",{children:[e.jsx(t,{children:"Role"}),e.jsx(d,{value:r.role,onChange:x=>{const o=[...s.speakers];o[h]={...o[h],role:x.target.value},l("speakers",o)},placeholder:"e.g. Property Investor, Immigration Solicitor"})]}),e.jsxs("div",{children:[e.jsx(t,{children:"Bio"}),e.jsx(S,{value:r.bio,onChange:x=>{const o=[...s.speakers];o[h]={...o[h],bio:x.target.value},l("speakers",o)},rows:2,placeholder:"Short bio"})]})]}),e.jsxs("div",{children:[e.jsx(t,{children:"Avatar"}),e.jsx(I,{value:r.avatar,onChange:x=>{const o=[...s.speakers];o[h]={...o[h],avatar:x},l("speakers",o)},directory:"event-speakers"})]})]})]},h)),e.jsxs(u,{type:"button",variant:"outline",size:"sm",onClick:()=>l("speakers",[...s.speakers,{name:"",role:"",bio:"",avatar:""}]),children:[e.jsx(R,{className:"mr-1 h-4 w-4"})," Add Speaker"]}
6)]})]}),e.jsx(Y,{targeting:N,onChange:w}),e.jsxs("div",{className:"rounded-card border border-line bg-white p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-ink",children:"Publishing"}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(p,{id:"is_published",checked:s.is_published,onCheckedChange:r=>l("is_published",r)}),e.jsx(t,{htmlFor:"is_published",children:"Published"})]}),s.is_published?e.jsx("p",{className:"mt-2 text-sm text-ink-3",children:"This event is visible to users"}):e.jsx("p",{className:"mt-2 text-sm text-ink-3",children:"This event is saved as a draft"}),e.jsxs("div",{className:"mt-6 flex items-center space-x-2 border-t border-line-2 pt-4",children:[e.jsx(p,{id:"use_landing_layout",checked:s.use_landing_layout,onCheckedChange:r=>l("use_landing_layout",r)}),e.jsx(t,{htmlFor:"use_landing_layout",children:"Use landing page layout"})]}),e.jsx("p",{className:"mt-2 text-sm text-ink-3",children:"Removes the app sidebar for a full-width marketing layout. Best for events you promote externally."}),e.jsxs("div",{className:"mt-6 space-y-2 border-t border-line-2 pt-4",children:[e.jsx(t,{htmlFor:"whatsapp_group_url",children:"WhatsApp Group URL (optional)"}),e.jsx(d,{id:"whatsapp_group_url",type:"url",placeholder:"https://chat.whatsapp.com/...",value:s.metadata?.whatsapp_group_url||"",onChange:r=>l("metadata",{...s.metadata,whatsapp_group_url:r.target.value})}),e.jsxs("p",{className:"text-sm text-ink-3",children:["Enables the /events/",a.slug,"/wa activation page for FB ad campaigns."]})]})]}),e.jsxs("div",{className:"flex justify-end gap-4",children:[e.jsx(u,{type:"button",variant:"outline",asChild:!0,children:e.jsx(E,{href:"/admin/events",children:"Cancel"})}),e.jsx(u,{type:"button",onClick:n,disabled:g,children:g?"Saving...":"Save Changes"})]})]})})]})})]})}export{Xr 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.