1import{c as _e,d0 as Ne,r as x,j as e,Z as $,m as F,S as R,a as ve,a4 as ye,W as ke,ao as Ce,s as se,C as le,B as y,q as f,al as L,o as oe,U as B,bf as E,X as de,N as Se,O as Ae,Q as De,R as Ie}from"./index-DsKq7xQs.js";import{u as $e}from"./useRegistrationPageSettings-CgXhpXsE.js";import{u as Re}from"./usePublicRegistration-BBgoBJ-H.js";import{S as ae,a as re,b as ie,c as ne,d as w}from"./select-DTPtu2nq.js";import{S as Me}from"./shopping-cart-BFZnmDyd.js";import{Z as Fe}from"./zap-_QIFA6vj.js";import{F as Le}from"./flame-BBTk9M2U.js";import{S as Ee}from"./star-BhryXKQI.js";import{M as ce}from"./map-pin-DZ1Yz97I.js";import{p as W}from"./parseISO-BNdh0Baw.js";import"./useMutation-BAi7x3yx.js";import"./meta-pixel-DAwDjwzS.js";import"./edgeInvoke-nieUChMx.js";import"./index-BdQq_4o_.js";import"./index-BfGmSBt-.js";const Pe=_e("CircleUserRound",[["path",{d:"M18 20a6 6 0 0 0-12 0",key:"1qehca"}],["circle",{cx:"12",cy:"10",r:"4",key:"1h16sb"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),me=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function P(t){if(!t)return"";const[i,l]=t.split(":"),o=parseInt(i),m=o>=12?"PM":"AM";return`${o%12||12}:${l} ${m}`}function U(t,i){if(!t)return null;const l=W(t),o={month:"short",day:"numeric",year:"numeric"};return i?`${l.toLocaleDateString("en-US",{month:"short",day:"numeric"})} â ${W(i).toLocaleDateString("en-US",o)}`:`Starts ${l.toLocaleDateString("en-US",o)}`}function xe(t){if(!t)return"All ages";const i=String(t).trim(),l=i.match(/^(\d+)\s*[-ââ]\s*(\d+)$/);if(l)return`Ages ${l[1]}â${l[2]}`;const o=i.match(/^(\d+)\s*(\+|and\s*up|&\s*up|\bup\b|and\s*older|or\s*older)$/i);return o?`Ages ${o[1]}+`:`Ages ${i}`}function A(t){return`$${Number(t).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`}function he(t){const i=Number(t?.one_time_fee||0),l=Number(t?.monthly_fee||0),o=Number(t?.drop_in_fee||0),m=t?.fee_type;if(m==="one_time"&&i>0)return{amount:A(i),label:"one time"};if(m==="monthly"&&l>0)return{amount:A(l),label:"per month"};if(i>0)return{amount:A(i),label:"one time"};if(l>0)return{amount:A(l),label:"per month"};const d=Number(t?.tuition_amount||0);if(d>0){const g=t?.tuition_frequency?String(t.tuition_frequency).replace(/_/g," "):"one time";return{amount:A(d),label:g}}return o>0?{amount:A(o),label:"drop-in"}:null}function Te(t){const i=new Date;if(t.online_registration_start){const l=new Date(t.online_registration_start);if(i<l)return!1}if(t.online_registration_end){const l=new Date(t.online_registration_end);if(i>l)return!1}return!0}function qe({cls:t,enrolled:i,inCart:l,isFull:o,days:m,spots:d,capacity:g,busy:b,canAct:j,onToggle:k,onWaitlist:_,onOpenDetails:h}){const C=g>0?Math.min(100,(g-d)/g*100):0,c=!o&&d>0&&d<=5;return e.jsxs(F.div,{whileHover:{y:-6},transition:{type:"spring",stiffness:300,damping:24},onClick:h,role:"button",tabIndex:0,onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),h?.())},className:"group relative rounded-3xl overflow-hidden border border-white/10 bg-gradient-to-br from-[#1a0b2e] via-[#2a0f3d] to-[#1a0b2e] hover:border-fuchsia-400/40 hover:shadow-[0_20px_60px_-10px_rgba(236,72,153,0.45)] transition-all cursor-pointer",children:[e.jsx("div",{className:"pointer-events-none absolute -inset-px rounded-3xl opacity-0 group-hover:opacity-100 transition-opacity bg-[conic-gradient(from_0deg,transparent,rgba(236,72,153,0.35),rgba(168,85,247,0.35),transparent)] blur-[2px]"}),e.jsxs("div",{className:"relative h-32 overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-fuchsia-600/40 via-purple-700/40 to-indigo-800/40"}),e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_30%_20%,rgba(236,72,153,0.45),transparent_55%),radial-gradient(circle_at_80%_80%,rgba(168,85,247,0.4),transparent_55%)]"}),e.jsx("div",{className:"absolute inset-0 opacity-30 mix-blend-overlay bg-[linear-gradient(110deg,transparent_30%,rgba(255,255,255,0.15)_50%,transparent_70%)]"}),e.jsxs("div",{className:"absolute top-3 left-3 flex flex-wrap gap-1.5",children:[i&&e.jsxs(y,{className:"bg-emerald-500/90 hover:bg-success border-0 text-white shadow-lg gap-1",children:[e.jsx(L,{className:"h-3 w-3"})," Enrolled"]}),!i&&c&&e.jsxs(y,{className:"bg-gradient-to-r from-amber-500 to-rose-500 border-0 text-white shadow-lg gap-1",children:[e.jsx(Le,{className:"h-3 w-3"})," Almost Full"]}),!i&&!o&&d>5&&C===0&&e.jsxs(y,{className:"bg-gradient-to-r from-cyan-400 to-fuchsia-500 border-0 text-white shadow-lg gap-1",children:[e.jsx(Ee,{className:"h-3 w-3"})," New"]}),o&&e.jsx(y,{className:"bg-rose-600/90 border-0 text-white shadow-lg",children:"Full"})]}),e.jsx("div",{className:"absolute bottom-0 left-0 right-0 p-4 bg-gradient-to-t from-[#1a0b2e] via-[#1a0b2e]/70 to-transparent",children:e.jsx("h4",{className:"font-bold text-white text-lg leading-tight drop-shadow line-clamp-2",children:t.name})})]}),e.jsxs("div",{className:"relative p-4 space-y-3",children:[e.jsxs("div",{className:"space-y-1.5 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 text-fuchsia-100/90",children:[e.jsx(oe,{className:"h-3.5 w-3.5 text-fuchsia-300 shrink-0"}),e.jsxs("span",{className:"truncate",children:[m," ⢠",P(t.start_time),t.end_time?` â ${P(t.end_time)}`:""]})]}),t.location_name&&e.jsxs("div",{className:"flex items-center gap-2 text-fuchsia-100/70",children:[e.jsx(ce,{className:"h-3.5 w-3.5 text-purple-300 shrink-0"}),e.jsx("span",{className:"truncate",children:t.location_name})]}),Array.isArray(t.instructor_names)&&t.instructor_names.length>0&&e.jsxs("div",{className:"flex items-center gap-2 text-fuchsia-100/70",children:[e.jsx(Pe,{className:"h-3.5 w-3.5 text-warning-text shrink-0"}),e.jsx("span",{className:"truncate",children:t.instructor_names.join(", ")})]})]}),(()=>{const u=he(t);return u?e.jsxs("div",{className:"flex items-baseline gap-1.5",children:[e.jsx("span",{className:"text-xl font-extrabold bg-gradient-to-r from-amber-300 via-pink-300 to-fuchsia-300 bg-clip-text text-transparent",children:u.amount}),e.jsx("span",{className:"text-[11px] uppercase tracking-wide font-semibold text-white/60",children:u.label})]}):null})(),e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-fuchsia-400/30 bg-fuchsia-500/15 px-2.5 py-0.5 text-[11px] font-semibold text-fuchsia-100",children:[e.jsx(B,{className:"h-3 w-3"})," ",xe(t.age_group)]}),t.level&&e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-amber-400/30 bg-amber-500/15 px-2.5 py-0.5 text-[11px] font-semibold text-amber-100",children:[e.jsx(E,{className:"h-3 w-3"})," ",t.level]})]}),g>0&&o&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx(B,{className:"h-3.5 w-3.5 text-rose-300"}),e.jsx("span",{className:"text-rose-300 font-semibold",children:"Class full"})]}),e.jsx("div",{className:"pt-1",onClick:u=>u.stopPropagation(),children:i?e.jsxs(f,{disabled:!0,className:"w-full bg-emerald-500/20 text-emerald-200 border border-emerald-400/30 hover:bg-emerald-500/20",children:[e.jsx(L,{className:"h-4 w-4 mr-1.5"})," Registered"]}):o&&t.allow_waitlist?e.jsx(f,{variant:"outline",className:"w-full bg-white/5 border-white/20 text-white hover:bg-white/10 hover:text-white",disabled:b||!j,onClick:_,children:b?e.jsx($,{className:"h-4 w-4 animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(E,{className:"h-4 w-4 mr-1.5"})," Join Waitlist"]})}):o?e.jsx(f,{disabled:!0,className:"w-full bg-white/5 text-white/40 border border-white/10",children:"Class Full"}):l?e.jsxs(f,{onClick:k,className:"w-full bg-white/10 hover:bg-white/15 text-white border border-white/20",children:[e.jsx(de,{className:"h-4 w-4 mr-1.5"})," Remove from Cart"]}):e.jsxs(f,{onClick:k,disabled:!j,className:"relative w-full bg-gradient-to-r from-fuchsia-500 via-pink-500 to-amber-400 hover:from-fuchsia-400 hover:via-pink-400 hover:to-amber-300 text-white font-bold border-0 shadow-[0_8px_30px_-6px_rgba(236,72,153,0.6)] hover:shadow-[0_12px_40px_-6px_rgba(236,72,153,0.85)] transition-all overflow-hidden group/btn",children:[e.jsx("span",{className:"absolute inset-0 -translate-x-full group-hover/btn:translate-x-full transition-transform duration-700 bg-gradient-to-r from-transparent via-white/30 to-transparent"}),e.jsx(R,{className:"h-4 w-4 mr-1.5"}),"Register Now"]})})]})]})}function Be({cls:t,open:i,onClose:l,enrolled:o,inCart:m,isFull:d,busy:g,canAct:b,onToggle:j,onWaitlist:k}){if(!t)return null;const _=(t.days_of_week?.length?t.days_of_week:t.day_of_week!==null&&t.day_of_week!==void 0?[t.day_of_week]:[]).map(c=>me[c]).join(", "),h=he(t),C=U(t.start_date,t.end_date);return e.jsx(Se,{open:i,onOpenChange:c=>{c||l?.()},children:e.jsxs(Ae,{className:"max-w-2xl border-white/10 bg-gradient-to-br from-[#1a0b2e] via-[#2a0f3d] to-[#1a0b2e] text-white p-0 overflow-hidden",children:[e.jsxs("div",{className:"relative h-28 overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-fuchsia-600/40 via-purple-700/40 to-indigo-800/40"}),e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_30%_20%,rgba(236,72,153,0.45),transparent_55%),radial-gradient(circle_at_80%_80%,rgba(168,85,247,0.4),transparent_55%)]"}),e.jsxs("div",{className:"absolute top-3 left-3 flex flex-wrap gap-1.5",children:[o&&e.jsxs(y,{className:"bg-emerald-500/90 border-0 text-white gap-1",children:[e.jsx(L,{className:"h-3 w-3"})," Enrolled"]}),d&&e.jsx(y,{className:"bg-rose-600/90 border-0 text-white",children:"Full"})]})]}),e.jsxs("div",{className:"px-6 pb-6 pt-2 space-y-4 max-h-[70vh] overflow-y-auto",children:[e.jsx(De,{className:"text-left",children:e.jsx(Ie,{className:"text-2xl font-extrabold text-white leading-tight",children:t.name})}),e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-fuchsia-400/30 bg-fuchsia-500/15 px-2.5 py-1 text-xs font-semibold text-fuchsia-100",children:[e.jsx(B,{className:"h-3.5 w-3.5"})," ",xe(t.age_group)]}),t.level&&e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-amber-400/30 bg-amber-500/15 px-2.5 py-1 text-xs font-semibold text-amber-100",children:[e.jsx(E,{className:"h-3.5 w-3.5"})," ",t.level]}),t.style&&e.jsx("span",{className:"inline-flex items-center gap-1 rounded-full border border-cyan-400/30 bg-cyan-500/15 px-2.5 py-1 text-xs font-semibold text-cyan-100",children:t.style})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-sm",children:[e.jsxs("div",{className:"flex items-start gap-2 text-fuchsia-100/90",children:[e.jsx(oe,{className:"h-4 w-4 text-fuchsia-300 mt-0.5 shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white/50 text-xs uppercase tracking-wide font-semibold",children:"When"}),e.jsxs("div",{children:[_||"â",t.start_time?` ⢠${P(t.start_time)}`:"",t.end_time?` â ${P(t.end_time)}`:""]})]})]}),t.location_name&&e.jsxs("div",{className:"flex items-start gap-2 text-fuchsia-100/90",children:[e.jsx(ce,{className:"h-4 w-4 text-purple-300 mt-0.5 shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white/50 text-xs uppercase tracking-wide font-semibold",children:"Location"}),e.jsx("div",{children:t.location_name})]})]}),C&&e.jsxs("div",{className:"flex items-start gap-2 text-fuchsia-100/90",children:[e.jsx(le,{className:"h-4 w-4 text-warning-text mt-0.5 shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white/50 text-xs uppercase tracking-wide font-semibold",children:"Dates"}),e.jsx("div",{children:C})]})]}),h&&e.jsxs("div",{className:"flex items-start gap-2 text-fuchsia-100/90",children:[e.jsx(R,{className:"h-4 w-4 text-success-text mt-0.5 shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white/50 text-xs uppercase tracking-wide font-semibold",children:"Price"}),e.jsxs("div",{children:[h.amount," ",e.jsx("span",{className:"text-white/60",children:h.label})]})]})]})]}),t.description&&e.jsxs("div",{className:"rounded-2xl border border-white/10 bg-white/5 p-4",children:[e.jsx("div",{className:"text-white/50 text-xs uppercase tracking-wide font-semibold mb-1.5",children:"About this class"}),e.jsx("p",{className:"text-sm text-white/85 whitespace-pre-wrap leading-relaxed",children:t.description})]}),e.jsx("div",{className:"pt-2",children:o?e.jsxs(f,{disabled:!0,className:"w-full bg-emerald-500/20 text-emerald-200 border border-emerald-400/30 hover:bg-emerald-500/20",children:[e.jsx(L,{className:"h-4 w-4 mr-1.5"})," Already Registered"]}):d&&t.allow_waitlist?e.jsx(f,{variant:"outline",className:"w-full bg-white/5 border-white/20 text-white hover:bg-white/10 hover:text-white",disabled:g||!b,onClick:k,children:g?e.jsx($,{className:"h-4 w-4 animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(E,{className:"h-4 w-4 mr-1.5"})," Join Waitlist"]})}):d?e.jsx(f,{disabled:!0,className:"w-full bg-white/5 text-white/40 border border-white/10",children:"Class Full"}):m?e.jsxs(f,{onClick:j,className:"w-full bg-white/10 hover:bg-white/15 text-white border border-white/20",children:[e.jsx(de,{className:"h-4 w-4 mr-1.5"})," Remove from Cart"]}):e.jsxs(f,{onClick:j,disabled:!b,className:"w-full bg-gradient-to-r from-fuchsia-500 via-pink-500 to-amber-400 hover:opacity-90 text-white font-bold border-0 shadow-[0_8px_30px_-6px_rgba(236,72,153,0.6)]",children:[e.jsx(R,{className:"h-4 w-4 mr-1.5"})," Register Now"]})})]})]})})}function We({pageType:t,studioId:i,familyId:l,search:o}){const{toast:m}=Ce(),{data:d,isLoading:g,refetch:b}=$e(i,t),{createCheckout:j,enrollDirect:k,isSubmitting:_}=Re(),[h,C]=x.useState([]),[c,u]=x.useState(""),[D,ue]=x.useState("match"),[pe,fe]=x.useState({}
1),[N,T]=x.useState([]),[O,z]=x.useState(null),[H,V]=x.useState(null);x.useEffect(()=>{(async()=>{const{data:s}=await se.from("students").select("id, first_name, last_name, date_of_birth").eq("family_id",l).eq("studio_id",i).order("first_name");C(s||[]),s&&s.length>0&&u(s[0].id)})()},[l,i]);const Y=async()=>{if(h.length===0)return;const s=h.map(n=>n.id),{data:r}=await se.from("enrollments").select("student_id, class_id").in("student_id",s).eq("status","active"),a={};r?.forEach(n=>{a[n.student_id]||(a[n.student_id]=new Set),a[n.student_id].add(n.class_id)}),fe(a)};x.useEffect(()=>{Y()},[h]);const Z=(d?.seasons||[]).filter(Te),q=d?.classes||[],M=h.find(s=>s.id===c),v=x.useMemo(()=>{const s=M?.date_of_birth;if(!s)return null;const r=W(s);if(isNaN(r.getTime()))return null;const a=new Date;let n=a.getFullYear()-r.getFullYear();const p=a.getMonth()-r.getMonth();return(p<0||p===0&&a.getDate()<r.getDate())&&n--,n},[M]),J=s=>{if(!s)return null;const r=String(s).trim().toLowerCase();if(!r)return null;const a=r.match(/(\d+)\s*[-ââ]\s*(\d+)/);if(a)return[parseInt(a[1]),parseInt(a[2])];const n=r.match(/(\d+)\s*(\+|and\s*up|&\s*up|\bup\b|and\s*older|or\s*older)/);if(n)return[parseInt(n[1]),99];const p=r.match(/(\d+)/);return p?[parseInt(p[1]),99]:null},I=x.useMemo(()=>D==="all"?null:D==="match"?v!=null?[v,v]:null:J(D),[D,v]),G=x.useMemo(()=>{const s=o.trim().toLowerCase();return Z.map(r=>({season:r,classes:q.filter(a=>(Array.isArray(a.season_ids)&&a.season_ids.length>0?a.season_ids:a.season_id?[a.season_id]:[]).includes(r.id)).filter(a=>!s||a.name?.toLowerCase().includes(s)||a.location_name?.toLowerCase().includes(s)).filter(a=>{if(!I)return!0;const n=J(a.age_group);return n?n[0]<=I[1]&&n[1]>=I[0]:!0}).sort((a,n)=>{const p=a.days_of_week?.[0]??a.day_of_week??7,S=n.days_of_week?.[0]??n.day_of_week??7;return p!==S?p-S:(a.start_time||"").localeCompare(n.start_time||"")})})).filter(r=>r.classes.length>0||!s&&!I)},[Z,q,o,I]),K=s=>N.some(r=>r.classId===s&&r.studentId===c),Q=s=>!!pe[c]?.has(s),X=s=>{if(!c){m({title:"Pick a student first",variant:"destructive"});return}T(r=>r.find(n=>n.classId===s&&n.studentId===c)?r.filter(n=>!(n.classId===s&&n.studentId===c)):[...r,{classId:s,studentId:c}])},ee=async s=>{if(c){z(s);try{await k(c,s,i,!0),m({title:"Added to waitlist"}),b(),await Y()}catch(r){m({title:"Could not add to waitlist",description:r.message,variant:"destructive"})}finally{z(null)}}},ge=async()=>{if(N.length!==0)try{const s=await j(i,l,N.map(r=>({class_id:r.classId,student_id:r.studentId})));s.url?window.location.href=s.url:s.success?(m({title:"Registration complete!",description:`${s.enrollments_created||N.length} enrollment(s) created.`}),T([]),b()):s.error&&m({title:"Checkout failed",description:s.error,variant:"destructive"})}catch(s){m({title:"Checkout failed",description:s.message,variant:"destructive"})}};return g?e.jsx("div",{className:"flex items-center justify-center py-24",children:e.jsx($,{className:"h-10 w-10 animate-spin text-fuchsia-400"})}):G.length===0?e.jsxs("div",{className:"rounded-3xl border border-white/10 bg-gradient-to-br from-[#1a0b2e] to-[#2a0f3d] p-12 text-center",children:[e.jsx("div",{className:"mx-auto h-16 w-16 rounded-2xl bg-gradient-to-br from-fuchsia-500 to-purple-600 flex items-center justify-center shadow-[0_10px_40px_-10px_rgba(236,72,153,0.6)]",children:e.jsx(R,{className:"h-8 w-8 text-white"})}),e.jsxs("h3",{className:"mt-4 text-xl font-bold text-white",children:["No open ",t==="series"?"series":t==="team"?"teams":"seasons"," right now"]}),e.jsx("p",{className:"mt-1 text-sm text-white/60",children:"New registrations drop soon â check back!"})]}):e.jsxs("div",{className:"space-y-8 pb-32",children:[e.jsxs("div",{className:"rounded-2xl border border-white/10 bg-white/5 backdrop-blur-sm p-4 flex items-center gap-3 flex-wrap",children:[e.jsx("span",{className:"text-sm text-white/70 font-medium",children:"Registering for:"}),e.jsxs(ae,{value:c,onValueChange:u,children:[e.jsx(re,{className:"w-56 bg-white/10 border-white/20 text-white",children:e.jsx(ie,{placeholder:"Choose a student"})}),e.jsx(ne,{children:h.map(s=>e.jsxs(w,{value:s.id,children:[s.first_name," ",s.last_name]},s.id))})]}),e.jsx("span",{className:"text-sm text-white/70 font-medium ml-1",children:"Age:"}),e.jsxs(ae,{value:D,onValueChange:ue,children:[e.jsx(re,{className:"w-56 bg-white/10 border-white/20 text-white",children:e.jsx(ie,{})}),e.jsxs(ne,{children:[e.jsx(w,{value:"all",children:"All ages"}),e.jsx(w,{value:"match",disabled:v==null,children:v!=null?`Match my dancer (age ${v})`:"Match my dancer (no DOB)"}),e.jsx(w,{value:"3-5",children:"3â5 years"}),e.jsx(w,{value:"6-8",children:"6â8 years"}),e.jsx(w,{value:"9-12",children:"9â12 years"}),e.jsx(w,{value:"13-17",children:"13â17 years"}),e.jsx(w,{value:"18+",children:"18+ years"})]})]})]}),G.map(({season:s,classes:r})=>e.jsxs(F.section,{initial:{opacity:0,y:16}
1,animate:{opacity:1,y:0},transition:{duration:.4},className:"space-y-4",children:[e.jsxs("div",{className:"flex items-end justify-between flex-wrap gap-3 px-1",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-1 w-8 rounded-full bg-gradient-to-r from-fuchsia-500 to-amber-400"}),e.jsx("span",{className:"text-xs uppercase tracking-[0.2em] font-bold text-fuchsia-300",children:t==="series"?"Series":t==="team"?"Team":"Season"})]}),e.jsx("h2",{className:"mt-2 text-2xl md:text-3xl font-extrabold text-white tracking-tight",children:s.name}),U(s.start_date,s.end_date)&&e.jsxs("p",{className:"mt-1 flex items-center gap-1.5 text-sm text-white/60",children:[e.jsx(le,{className:"h-4 w-4"})," ",U(s.start_date,s.end_date)]})]}),e.jsxs(y,{className:"bg-white/10 border border-white/20 text-white/90 backdrop-blur-sm",children:[r.length," ",r.length===1?"class":"classes"]})]}),r.length===0?e.jsxs("div",{className:"rounded-2xl border border-white/10 bg-white/5 p-8 text-center text-white/60 text-sm",children:["No classes available in this ",s.type==="series"?"series":s.type==="team"?"team":"season","."]}):e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-4",children:r.map(a=>{const n=Q(a.id),p=K(a.id),S=a.capacity||0,te=S-(a.enrollment_count||0),be=S>0&&te<=0,we=(a.days_of_week?.length?a.days_of_week:a.day_of_week!==null&&a.day_of_week!==void 0?[a.day_of_week]:[]).map(je=>me[je]).join(", ");return e.jsx(qe,{cls:a,enrolled:n,inCart:p,isFull:be,days:we,spots:Math.max(0,te),capacity:S,busy:O===a.id,canAct:!!c,onToggle:()=>X(a.id),onWaitlist:()=>ee(a.id),onOpenDetails:()=>V(a.id)},a.id)})})]},s.id)),N.length>0&&e.jsx(F.div,{initial:{y:80,opacity:0},animate:{y:0,opacity:1},className:"fixed bottom-0 left-0 right-0 lg:left-64 z-40 p-3 sm:p-4",children:e.jsxs("div",{className:"max-w-5xl mx-auto rounded-2xl border border-white/15 bg-gradient-to-r from-[#1a0b2e]/95 via-[#2a0f3d]/95 to-[#1a0b2e]/95 backdrop-blur-xl shadow-[0_20px_60px_-10px_rgba(236,72,153,0.5)] px-4 sm:px-5 py-3 flex items-center justify-between gap-3 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-10 w-10 rounded-xl bg-gradient-to-br from-fuchsia-500 to-amber-400 flex items-center justify-center shadow-lg",children:e.jsx(Me,{className:"h-5 w-5 text-white"})}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm font-bold text-white",children:[N.length," ",N.length===1?"class":"classes"," ready",M&&e.jsxs("span",{className:"text-fuchsia-200/80 font-normal",children:[" for ",M.first_name]})]}),e.jsx("p",{className:"text-xs text-white/60",children:"Final pricing shown at checkout"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(f,{variant:"ghost",size:"sm",onClick:()=>T([]),disabled:_,className:"text-white/70 hover:text-white hover:bg-white/10",children:"Clear"}),e.jsxs(f,{onClick:ge,disabled:_,className:"bg-gradient-to-r from-fuchsia-500 via-pink-500 to-amber-400 hover:opacity-90 text-white font-bold border-0 shadow-lg",children:[_&&e.jsx($,{className:"h-4 w-4 mr-2 animate-spin"}),e.jsx(Fe,{className:"h-4 w-4 mr-1.5"}),"Continue to Checkout"]})]})]})}),(()=>{const s=q.find(p=>p.id===H);if(!s)return null;const r=s.capacity||0,a=r-(s.enrollment_count||0),n=r>0&&a<=0;return e.jsx(Be,{cls:s,open:!!H,onClose:()=>V(null),enrolled:Q(s.id),inCart:K(s.id),isFull:n,busy:O===s.id,canAct:!!c,onToggle:()=>X(s.id),onWaitlist:()=>ee(s.id)})})()]})}function at(){const{family:t}=Ne(),[i,l]=x.useState("season"),[o,m]=x.useState("");return!t?.studio_id||!t?.id?e.jsx("div",{className:"flex items-center justify-center py-24",children:e.jsx($,{className:"h-8 w-8 animate-spin text-fuchsia-400"})}):e.jsxs("div",{className:"-mx-4 sm:-mx-6 lg:-mx-8 -my-6 min-h-[calc(100vh-4rem)] bg-gradient-to-b from-[#0a0414] via-[#120726] to-[#0a0414] text-white",children:[e.jsxs("div",{className:"relative overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_20%_20%,rgba(236,72,153,0.25),transparent_55%),radial-gradient(circle_at_80%_30%,rgba(168,85,247,0.25),transparent_55%),radial-gradient(circle_at_50%_90%,rgba(245,158,11,0.18),transparent_55%)]"}),e.jsx("div",{className:"absolute inset-0 opacity-[0.06] bg-[linear-gradient(white_1px,transparent_1px),linear-gradient(90deg,white_1px,transparent_1px)] bg-[size:48px_48px]"}),e.jsx("div",{className:"relative px-4 sm:px-6 lg:px-8 pt-10 pb-8 max-w-7xl mx-auto",children:e.jsxs(F.div,{initial:{opacity:0,y:14}
1,animate:{opacity:1,y:0},transition:{duration:.5},children:[e.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border border-fuchsia-400/30 bg-fuchsia-500/10 px-3 py-1 text-xs font-semibold text-fuchsia-200 backdrop-blur-sm",children:[e.jsx(R,{className:"h-3.5 w-3.5"}),"Registration Open ⢠Spots Filling Fast"]}),e.jsxs("h1",{className:"mt-4 text-4xl sm:text-5xl md:text-6xl font-extrabold tracking-tight leading-[1.05]",children:[e.jsx("span",{className:"bg-gradient-to-r from-white via-fuchsia-200 to-amber-200 bg-clip-text text-transparent",children:"Available Classes"}),e.jsx("span",{className:"ml-2 inline-block",children:"â¨"})]}),e.jsx("p",{className:"mt-3 max-w-2xl text-base sm:text-lg text-white/70",children:"Browse open seasons, series, camps, and intensives â then lock in your dancer's spot before they fill up."})]})})]}),e.jsx("div",{className:"sticky top-0 z-30 backdrop-blur-xl bg-[#0a0414]/80 border-y border-white/10",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-3 flex items-center gap-2 sm:gap-3 flex-wrap",children:[e.jsx("div",{className:"inline-flex rounded-full border border-white/15 bg-white/5 p-1",children:["season","series","team"].map(d=>e.jsx("button",{onClick:()=>l(d),className:ve("px-4 sm:px-5 py-1.5 rounded-full text-sm font-semibold transition-all",i===d?"bg-gradient-to-r from-fuchsia-500 to-pink-500 text-white shadow-[0_6px_20px_-6px_rgba(236,72,153,0.7)]":"text-white/70 hover:text-white"),children:d==="season"?"Seasons":d==="series"?"Series":"Teams"},d))}),e.jsxs("div",{className:"relative flex-1 min-w-[180px] max-w-md",children:[e.jsx(ye,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-white/40"}),e.jsx(ke,{value:o,onChange:d=>m(d.target.value),placeholder:"Search classes, locationsâ¦",className:"pl-9 bg-white/10 border-white/15 text-white placeholder:text-white/40 focus-visible:ring-fuchsia-400/40"})]})]})}),e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:e.jsx(We,{pageType:i,studioId:t.studio_id,familyId:t.id,search:o})})]})}export{at 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.