PageSourceSearch

https://minervaims.org/assets/MyEvents-BQSzDIBt.js

js minervaims.org collected 2026-10-09 03:33:16 UTC 13,322 bytes, 11 lines download raw bytes

1import{j as t}from"./vendor-query-B-OkVY6w.js";import{r as o}from"./vendor-react-UNf91VA9.js";import{ao as B,O as W,Q as J,t as P,bt as v,Y as C,bg as z,bi as V,bj as U,bk as q,bl as K,bm as Q,bn as X,bo as Z}from"./index-CVKOWYxn.js";import{c as G,W as ee,a as te,H as M}from"./MinervaWorkspace-GZOusLLw.js";import{D as L,R as se,J as ae,C as re,a as ie}from"./JoinMeetingLink-ipVamQX5.js";import{E as Y}from"./CalendarKit-pbWLmbLI.js";import{r as S,a as N,b as T}from"./event-time-CnGVkrWd.js";import{B as ne,E as R,A as oe,r as le,F as de}from"./events-api-DaFbpdZL.js";import{A as ce}from"./attendance-status-CJsDdcFg.js";import{T as pe}from"./ticket-CQb-To2g.js";import{L as k}from"./loader-circle-qu0iMpWN.js";import{M as me}from"./forms-model-Bu9nRvMl.js";import"./vendor-ui-BtDEnNjh.js";import"./vendor-supabase-BtubEpct.js";import"./checkbox-DLcSgs5X.js";import"./check-i990AOOe.js";import"./dialog-Cp8Fxci4.js";import"./AlumniGlobe-RCIlQNj1.js";import"./types-KCKahpl3.js";import"./full_logo_white.svg.asset-CgYquE9T.js";import"./EventPosterPlaceholder-CL5VfHKJ.js";import"./event-place-DxRCNSCg.js";import"./workspace-nav-GS4rx2kf.js";import"./calendar-days-Cx8Wz7Iz.js";import"./users-Dw8EzinI.js";import"./image-3-2QuiYQ.js";import"./search-_0wO5O5i.js";import"./chevron-down-DA0HHuBt.js";import"./download-DMtRHjGI.js";import"./ellipsis-FzSKQwBp.js";import"./circle-check-CBrS9kZS.js";import"./video-OgqBEuB6.js";import"./graduation-cap-2xvFZdHz.js";import"./calendar-ygWZ2E67.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 ue=B("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
7 * @license lucide-react v0.462.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const xe=B("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]),A="[email protected]";function he(i){if(!i.capacity)return"";const l=Math.max(0,i.capacity-i.taken);return l>0?`${l} of ${i.capacity} places left`:`Full${i.waiting?`, ${i.waiting} waiting`:""}`}function Qe({onNavigate:i}){const{session:l}=W(),$=J(),{toast:p}=P(),d=o.useMemo(()=>
11G(),[]),[r,H]=o.useState(null),[g,_]=o.useState(null),[c,x]=o.useState(null),[a,f]=o.useState(null),[m,I]=o.useState("all"),u=o.useCallback(async()=>{try{H(await ne(l,d.start,d.end)),_(null)}catch(e){_(v(e))}},[l,d.start,d.end]);o.useEffect(()=>{u()},[u]);const O=async e=>{x(e.id);try{const s=await le(l,{event_id:e.id});s!=null&&s.waitlisted?p({title:"You are on the waiting list",description:`${e.title} is full${s.position?`: you are number ${s.position}`:""}. If a place opens up you are registered and emailed at once.`}):p({title:s!=null&&s.alreadyRegistered?"You were already registered":`Registered for ${e.title}`,description:e.online?"Your confirmation, with the link to join, is on its way to your inbox. The link is also here and on your Dashboard.":"Your confirmation, with your entry code, is on its way to your inbox."}),await u()}catch(s){p({title:"Could not register",description:v(s),variant:"destructive"})}finally{x(null)}},F=async e=>{x(e.id);try{const s=await de(l,e.id);p({title:(s==null?void 0:s.cancelled)==="waitlist"?"You have left the waiting list":"Registration cancelled",description:(s==null?void 0:s.cancelled)==="waitlist"?void 0:"Your place goes to the next person waiting, if there is one. Thank you for letting us know."}),await u()}catch(s){p({title:"Could not cancel",description:v(s),variant:"destructive"})}finally{x(null),f(null)}},n=(r==null?void 0:r.history)??[],y=n.filter(e=>e.status==="attended").length,j=n.length-y,h=n.filter(e=>e.status==="registered_absent").length,E=n.filter(e=>m==="all"||(m==="attended"?e.status==="attended":e.status!=="attended")),D=(r==null?void 0:r.upcoming)??[],b=D.filter(e=>e.status!=="none"),w=D.filter(e=>e.status==="none");return!r&&!g?t.jsx("div",{className:"h-full",children:t.jsx(ee,{})}):t.jsxs("div",{className:"font-body",children:[t.jsx(te,{title:"My Events",description:`Your events this semester (${d.label}): what you can still register for, what you attended and what you missed.`}),g&&t.jsxs("div",{role:"alert",className:"mb-6 border border-destructive/40 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:[g," ",t.jsx("button",{type:"button","data-ro":!0,onClick:u,className:"ml-1 underline underline-offset-4",children:"Try again"})]}),r&&t.jsxs("div",{className:"space-y-8",children:[t.jsxs("section",{"aria-labelledby":"my-upcoming",className:"space-y-3",children:[t.jsxs("h2",{id:"my-upcoming",className:"flex items-center gap-2 font-serif text-xl text-accent",children:[t.jsx(pe,{"aria-hidden":!0,className:"h-5 w-5"}),"Coming up",t.jsx(M,{page:"events-mine",topic:"register"})]}),b.length>0&&t.jsx("ul",{className:"divide-y divide-separator border border-separator bg-background","aria-label":"Events you are registered for",children:b.map(e=>t.jsxs("li",{className:"flex flex-wrap items-start gap-x-3 gap-y-2 px-3 py-3 sm:flex-nowrap",children:[t.jsx(L,{ymd:e.start_at?S(e.start_at):e.date}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsxs("p",{className:"text-[12px] uppercase tracking-wider text-accent",children:[N(e.start_at||e.date),e.start_at?` · ${T(e.start_at)}`:""]}),t.jsx("p",{className:"font-serif text-[18px] leading-snug text-foreground",children:e.title}),t.jsx("p",{className:"text-[13px] text-muted-foreground",children:[R[e.event_type],e.place].filter(Boolean).join(" · ")}),t.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-4 gap-y-2",children:[t.jsx(se,{state:e.status==="registered"?"registered":"waiting"}),e.join_url&&t.jsx(ae,{url:e.join_url,variant:"button"}),e.online&&e.status==="registered"&&!e.join_url&&t.jsx("span",{className:"text-[13px] text-muted-foreground",children:"The link to join will be in your emails and here once the organisers add it."})]})]}),t.jsx("div",{className:"w-full pl-[3.75rem] sm:w-auto sm:shrink-0 sm:pl-0",children:t.jsxs(C,{"data-ro":!0,variant:"outline",size:"sm",className:"w-full sm:w-auto",disabled:c===e.id,onClick:()=>f(e),children:[c===e.id?t.jsx(k,{className:"h-4 w-4 animate-spin"}):null,e.status==="registered"?"Can't make it":"Leave the waiting list"]})})]},e.id))}),w.length>0?t.jsx("ul",{className:"space-y-2","aria-label":"Events open for registration",children:w.map(e=>t.jsxs("li",{className:"flex flex-wrap items-start gap-x-3 gap-y-2 border border-separator bg-background px-3 py-3 sm:flex-nowrap sm:items-center",children:[t.jsx(L,{ymd:e.start_at?S(e.start_at):e.date}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsxs("p",{className:"text-[12px] uppercase tracking-wider text-accent",children:[N(e.start_at||e.date),e.start_at?` · ${T(e.start_at)}`:""]}),t.jsx("p",{className:"font-serif text-[18px] leading-snug text-foreground",children:e.title}),t.jsx("p",{className:"text-[13px] text-muted-foreground",children:[R[e.event_type],e.place,oe[e.audie
11nce],he(e)].filter(Boolean).join(" · ")})]}),t.jsx("div",{className:"w-full pl-[3.75rem] sm:w-auto sm:shrink-0 sm:pl-0",children:t.jsxs(C,{"data-ro":!0,size:"sm",className:"w-full sm:w-auto",variant:e.capacity&&e.taken>=e.capacity?"outline":"solid",disabled:c===e.id,onClick:()=>O(e),"aria-label":`${e.capacity&&e.taken>=e.capacity?"Join the waiting list for":"Register for"} ${e.title}`,children:[c===e.id?t.jsx(k,{className:"h-4 w-4 animate-spin"}):null,e.capacity&&e.taken>=e.capacity?"Join the waiting list":"Register"]})})]},e.id))}):b.length===0?t.jsxs(Y,{icon:t.jsx(re,{className:"h-5 w-5"}),title:"Nothing open for registration right now",children:["New events appear here as soon as their registration opens.",$.canView("events-on-display")?" Association on Display days are signed up for in Events > Association on Display.":""]}):null,w.length>0&&t.jsx("p",{className:"text-[13px] text-muted-foreground",children:"One click registers you with your account: the confirmation email follows at once, with your entry code, or the link to join for an online event."})]}),t.jsxs("section",{"aria-labelledby":"my-history",className:"space-y-3",children:[t.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[t.jsxs("h2",{id:"my-history",className:"flex items-center gap-2 font-serif text-xl text-accent",children:[t.jsx(ue,{"aria-hidden":!0,className:"h-5 w-5"}),"This semester",t.jsx(M,{page:"events-mine",topic:"history"})]}),n.length>0&&t.jsx("div",{role:"group","aria-label":"Show",className:"inline-flex border border-separator",children:["all","attended","missed"].map(e=>t.jsx("button",{type:"button","data-ro":!0,"aria-pressed":m===e,onClick:()=>I(e),className:`px-3 py-1.5 text-[13px] capitalize transition-colors ${m===e?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-accent"}`,children:e==="all"?`All ${n.length}`:e==="attended"?`Attended ${y}`:`Missed ${j}`},e))})]}),n.length>0&&t.jsx("div",{className:"grid grid-cols-3 border border-separator bg-background",children:[{label:"Attended",value:y,cls:"text-accent"},{label:"Missed",value:j,cls:j?"text-foreground":"text-muted-foreground"},{label:"Events counted",value:n.length,cls:"text-muted-foreground"}].map((e,s)=>t.jsxs("div",{className:`px-4 py-3 ${s?"border-l border-separator":""}`,children:[t.jsx("p",{className:`font-serif text-[28px] leading-none ${e.cls}`,children:e.value}),t.jsx("p",{className:"mt-1 text-[12px] uppercase tracking-wider text-muted-foreground",children:e.label})]},e.label))}),n.length===0?t.jsx(Y,{icon:t.jsx(ie,{className:"h-5 w-5"}),title:"No attendance taken yet this semester",children:"Events appear here once they have taken place and their attendance has been recorded."}):E.length===0?t.jsx("p",{className:"border border-dashed border-separator px-4 py-5 text-sm text-muted-foreground",children:m==="missed"?"You have not missed any event this semester.":"No event attended yet this semester."}):t.jsx("ul",{className:"divide-y divide-separator border border-separator bg-background",children:E.map(e=>t.jsxs("li",{className:"flex flex-col gap-1.5 px-3 py-2.5 sm:flex-row sm:items-center sm:gap-3",children:[t.jsx("span",{className:"w-28 shrink-0 text-[13px] text-muted-foreground",children:N(e.start_at||e.date,{month:"short",weekday:!1})}),t.jsx("span",{className:"min-w-0 flex-1 text-[15px] leading-snug text-foreground",children:e.title}),t.jsx("span",{className:"shrink-0",children:t.jsx(ce,{status:e.status,short:!0})})]},e.id))}),t.jsxs("p",{className:"text-[13px] text-muted-foreground",children:["Counted: the events of ",d.label," held so far where attendance was taken, Association on Display days included, as in People > Members. Attended means you were marked present at the event."]})]}),t.jsxs("section",{"aria-labelledby":"my-correction",className:`border-l-4 p-4 sm:p-5 ${h?"border-amber-500 bg-amber-50":"border-accent bg-accent/[0.04]"}`,children:[t.jsx("h2",{id:"my-correction",className:"font-serif text-lg text-accent",children:"Was your attendance not recorded correctly?"}),t.jsxs("p",{className:"mt-1.5 max-w-3xl text-[15px] leading-relaxed text-foreground",children:[h?`${h===1?"One event shows":`${h} events show`} you as registered but not present. `:"","If you were at an event that shows as missed, tell the Head of Operations",r.head_of_operations?`, ${r.head_of_operations},`:""," on WhatsApp, or write to ",t.jsx("a",{"data-ro":!0,href:`mailto:${A}?subject=${encodeURIComponent("Attendance correction")}`,className:"text-accent underline underline-offset-4",children:A}),", with the event's name and date. The list can be corrected up to two weeks after the event."]}),t.jsxs("div",{className:"mt-3 flex flex-wrap gap-x-5 gap-y-2 text-[13px] text-muted-foreground",children:[t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[t.jsx(xe,{"aria-hidden":!0,
11className:"h-4 w-4"}),"WhatsApp: the Head of Operations"]}),t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[t.jsx(me,{"aria-hidden":!0,className:"h-4 w-4"}),A]}),i&&$.canView("events-on-display")&&t.jsx("button",{type:"button","data-ro":!0,onClick:()=>i("events","events-on-display"),className:"text-accent underline-offset-4 hover:underline",children:"Sign up for Association on Display"})]})]})]}),t.jsx(z,{open:!!a,onOpenChange:e=>{e||f(null)},children:t.jsxs(V,{children:[t.jsxs(U,{children:[t.jsx(q,{children:(a==null?void 0:a.status)==="waitlisted"?"Leave the waiting list?":"Cancel your registration?"}),t.jsx(K,{children:(a==null?void 0:a.status)==="waitlisted"?`You will no longer be offered a place at ${(a==null?void 0:a.title)??"this event"}.`:`Your place at ${(a==null?void 0:a.title)??"this event"} goes to the next person waiting, if there is one, and you receive an email to confirm. You can register again while places are left.`})]}),t.jsxs(Q,{children:[t.jsx(X,{"data-ro":!0,children:"Keep it"}),t.jsxs(Z,{"data-ro":!0,onClick:e=>{e.preventDefault(),a&&F(a)},disabled:!!c,children:[c?t.jsx(k,{className:"h-4 w-4 animate-spin"}):null,(a==null?void 0:a.status)==="waitlisted"?"Leave the list":"Cancel my place"]})]})]})})]})}export{Qe 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.