PageSourceSearch

https://startuplive.ngo/assets/MentorEventDashboard-1xIomow0.js

js startuplive.ngo collected 2026-10-09 18:11:39 UTC 32,283 bytes, 1 lines download raw bytes

1import{d as X,r as b,j as e,B as J,c as y,s as _,e as ie,L as I,u as xe,k as ye,X as _e}from"./index-EuY_-FAY.js";import{D as ke}from"./DashboardLayout-Gw2TxiBJ.js";import{E as Se}from"./EventSettingsContent-DjtkJf4y.js";import{A as Ce}from"./MentorApplicationsContent-Bm0qIoL7.js";import{C as Y,c as G,a as ee,b as te}from"./card-CIFW0qNz.js";import{B as $}from"./badge-BiGl0epm.js";import{A as re,a as se,b as ae}from"./avatar-DmtcMqZM.js";import{T as V}from"./target-Cm-J7PgS.js";import{C as pe}from"./clock-C9pzXbgT.js";import{C as Ee}from"./chevron-down-D0i5abe3.js";import{C as Me}from"./chevron-up-BGLh5JIr.js";import{M as $e}from"./map-pin-CiJS0zpt.js";import{A as ue}from"./award-CK-g5_KF.js";import{P as ge}from"./presentation-1PlbYjJw.js";import{U as F}from"./users-B7Eh8ycR.js";import{M as he}from"./mic-B2yxq-CM.js";import{S as fe}from"./sparkles-CDimFECD.js";import{d as be,C as je}from"./eachDayOfInterval-C6Nk_oxa.js";import{C as ne}from"./calendar-TeXraZ6Q.js";import{f as A}from"./format-BJatCrh1.js";import{p as L}from"./parseISO-DmI85Ds7.js";import{i as Le}from"./isSameDay-D8qkwPfC.js";import{S as De,M as Re}from"./MediaGalleryContent-XJA4H3_o.js";import{N as Ie}from"./NetworkingContent-Bb1EhX8P.js";import{S as Ae}from"./StartupsContent-C87fSNlC.js";import{R as Be}from"./ReviewsContent-BqM04mPl.js";import{B as M}from"./button-DwzNqib_.js";import{A as me}from"./Footer-DLYBYlrH.js";import{B as ve}from"./shield-nL0KFzur.js";import{u as ze,a as Te}from"./StartupDetailContent-CsXCRijV.js";import"./list-checks-XjZkVVNc.js";import"./user-DuBvhp_O.js";import"./circle-user-C6EVL7I0.js";import"./search-BN9ssjqw.js";import"./message-square-CX4ymtRO.js";import"./layout-dashboard-a4gKtYLw.js";import"./index-wQwPqDfP.js";import"./index-BMKRCHpo.js";import"./index-BJKYc_OV.js";import"./index-DKmrCAge.js";import"./chevron-right-R-JJXQF-.js";import"./settings-DbY5cOJ-.js";import"./user-plus-tyTYVH-R.js";import"./rocket-D93ZlqmD.js";import"./users-round-B278ejjI.js";import"./ChatSystem-4zb8rVWu.js";import"./input-CwLsOgdz.js";import"./NotificationCenter-DHgRHZeL.js";import"./index-BccXDNaF.js";import"./index-BdQq_4o_.js";import"./DashboardHeader-qK3Qmy-e.js";import"./index-BSIHs9Yh.js";import"./index-C40cg7B2.js";import"./index-BONWbLIr.js";import"./index-BXTDk0Ug.js";import"./check-BFBMQrmy.js";import"./building-2-AqdBhrS9.js";import"./plus-DP6EyEDe.js";import"./arrow-left-lIwOt_N5.js";import"./mail-BVVKtkzs.js";import"./send-CxotHqOi.js";import"./star-DLxjevVK.js";import"./clipboard-list-DnNVBJ_L.js";import"./handshake-ChAu9QXI.js";import"./eye-DWMmm-eV.js";import"./menu-QX_7UXmx.js";import"./FeedbackButton-84GpwsHz.js";import"./dialog-BshpMbXa.js";import"./index-Byc0C5HR.js";import"./textarea-D6vuaKhs.js";import"./label-DHjRMKAW.js";import"./tabs-BkjaH3fl.js";import"./cityCoordinates-BF9Pw5Lr.js";import"./index-CCnnvLwg.js";import"./switch-C1fACMOm.js";import"./index-90AI2Mcq.js";import"./quill.snow-Dj63gIbu.js";import"./select-Zkugu-mn.js";import"./separator-CP7aABc2.js";import"./checkbox-D-yVHPM-.js";import"./command-CJk2AU3Y.js";import"./popover-C1CUfueU.js";import"./CityCountryInput-DzjN59o-.js";import"./useQuery-DeYV4IS5.js";import"./loader-circle-Caxve_ph.js";import"./chevrons-up-down-CWJDjV6L.js";import"./venueAddress-DVUbw9NQ.js";import"./filter-BX-yFJmx.js";import"./timezones-CsxV_3Uh.js";import"./image-rU_ppTuS.js";import"./list-DRGo6gHo.js";import"./save-B2VAfAIz.js";import"./index-DwFUDgNw.js";import"./index-Cb8UU1H3.js";import"./xlsx-DjuO7_Ju.js";import"./alert-dialog-Dzo3XCPR.js";import"./linkedin-CHWP1gWB.js";import"./globe-DmqLM4zl.js";import"./trending-up-DfxLE4nH.js";import"./external-link-SoEG5yvx.js";import"./download-Gq_d9FhN.js";import"./circle-check-DZuRMJvy.js";import"./differenceInMilliseconds-ycH2onZd.js";import"./calendar-D4NNVj7-.js";import"./subDays-1Gd6-EPS.js";import"./chevron-left-nZrh3bY0.js";import"./tooltip-DhO4SW4a.js";import"./index-h3IyJjLp.js";import"./square-pen-DgtJmqsG.js";import"./useInfiniteScroll-CcPzzG0i.js";import"./play-BEepO1Dv.js";import"./eye-off-Cp1ZERv1.js";import"./ellipsis-vertical-eBvHTnN9.js";import"./twitter-7bv0L9_e.js";import"./StartupContactModal-C5e0adbk.js";import"./index-DXqQCM1T.js";import"./table-B7IdTOLn.js";import"./sticky-note-DtyHP69G.js";import"./bookmark-DYmGZhVj.js";import"./hash-DFi8_KFc.js";import"./StartupNotesCard-TXGCFl6_.js";import"./dollar-sign-Lxv_EYwt.js";const ce={ceremony:{gradient:"from-violet-500 to-purple-600",bgLight:"bg-violet-50 dark:bg-violet-950/30",border:"border-violet-200 dark:border-violet-800",text:"text-violet-700 dark:text-violet-300",icon:ue,label:"Ceremony"},presentation:{gradient:"from-blue-500 to-indigo-600",bgLight:"bg-blue-50 dark:bg-blue-950/30",border:"border-blue-200 dark:border-blue-800",text:"text-blue-700 dark:text-blue-300",icon:ge,label:"Presentation"},mentoring:{gradient:"from-emerald-500 to-teal-600",bgLight:"bg-emerald-50 dark:bg-emerald-950/30",border:"border-emerald-200 dark:border-emerald-800",text:"text-emerald-700 dark:text-emerald-300",icon:F,label:"Mentoring"},mentor_presentation:{gradient:"from-cyan-500 to-blue-600",bgLight:"bg-cyan-50 dark:bg-cyan-950/30",border:"border-cyan-200 dark:border-cyan-800",text:"text-cyan-700 dark:text-cyan-300",icon:he,label:"Mentor Presentation"}
1,workshop:{gradient:"from-amber-500 to-orange-600",bgLight:"bg-amber-50 dark:bg-amber-950/30",border:"border-amber-200 dark:border-amber-800",text:"text-amber-700 dark:text-amber-300",icon:fe,label:"Workshop"},break:{gradient:"from-slate-400 to-gray-500",bgLight:"bg-slate-50 dark:bg-slate-950/30",border:"border-slate-200 dark:border-slate-800",text:"text-slate-600 dark:text-slate-400",icon:je,label:"Break"},networking:{gradient:"from-rose-500 to-pink-600",bgLight:"bg-rose-50 dark:bg-rose-950/30",border:"border-rose-200 dark:border-rose-800",text:"text-rose-700 dark:text-rose-300",icon:F,label:"Networking"},session:{gradient:"from-indigo-500 to-purple-600",bgLight:"bg-indigo-50 dark:bg-indigo-950/30",border:"border-indigo-200 dark:border-indigo-800",text:"text-indigo-700 dark:text-indigo-300",icon:ne,label:"Session"}},Ue=n=>ce[n]||ce.mentoring,Pe=(n,u)=>{const m=be(L(u),L(n));if(m<60)return`${m}m`;const d=Math.floor(m/60),r=m%60;return r>0?`${d}h ${r}m`:`${d}h`};function qe({eventId:n}){const{user:u}=X(),[m,d]=b.useState(!0),[r,D]=b.useState([]),[s,C]=b.useState({}),[k,B]=b.useState({}),[z,T]=b.useState({});b.useEffect(()=>{(async()=>{if(!(!(u!=null&&u.id)||!n)){d(!0);try{const{data:c,error:w}=await _.from("mentor_assignments").select("*").eq("event_id",n).eq("mentor_id",u.id).order("created_at",{ascending:!0});if(w)throw w;const f=c||[];if(D(f),f.length===0)return;const j=Array.from(new Set(f.map(o=>o.startup_id).filter(Boolean)));if(j.length){const{data:o,error:a}=await _.from("companies").select("id,name,logo,tagline,city_id,founded_year,team_size,industry,technologies,status,visibility").in("id",j);if(a)throw a;const l={};(o||[]).forEach(p=>{l[p.id]=p}),C(l)}const t=Array.from(new Set(f.map(o=>o.session_id).filter(Boolean)));if(t.length){const{data:o,error:a}=await _.from("event_schedules").select("id,title,start_time,end_time,location,session_type").in("id",t);if(a)throw a;const l={};(o||[]).forEach(p=>{l[p.id]=p}),B(l)}}catch(c){console.error("Error loading mentor sessions:",c)}finally{d(!1)}}})()},[u==null?void 0:u.id,n]);const S=b.useMemo(()=>r.map(i=>({assignment:i,company:i.startup_id?s[i.startup_id]:void 0,schedule:i.session_id?k[i.session_id]:void 0})),[r,s,k]),E=b.useMemo(()=>{const i={};return S.forEach(c=>{if(c.schedule){const w=A(L(c.schedule.start_time),"yyyy-MM-dd");i[w]||(i[w]=[]),i[w].push(c)}else i.unscheduled||(i.unscheduled=[]),i.unscheduled.push(c)}
1),Object.keys(i).forEach(c=>{c!=="unscheduled"&&i[c].sort((w,f)=>{var o,a;const j=((o=w.schedule)==null?void 0:o.start_time)||"",t=((a=f.schedule)==null?void 0:a.start_time)||"";return j.localeCompare(t)})}),i},[S]),U=i=>i?i.split(" ").map(c=>c[0]).join("").slice(0,2).toUpperCase():"SU",P=i=>{T(c=>({...c,[i]:!c[i]}))};if(m)return e.jsx("div",{className:"flex items-center justify-center min-h-64",children:e.jsx(J,{size:32})});if(S.length===0)return e.jsx(Y,{children:e.jsxs(G,{className:"py-12 text-center",children:[e.jsx(V,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"No mentoring sessions assigned yet"}),e.jsx("p",{className:"text-muted-foreground",children:"You will see startups here once mentoring is scheduled."})]})});const R=Object.keys(E).filter(i=>i!=="unscheduled").sort();return E.unscheduled&&R.push("unscheduled"),e.jsxs("div",{className:"space-y-6 overflow-hidden",children:[e.jsx("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4 p-4 md:p-6 rounded-2xl bg-gradient-to-r from-card to-muted/30 border border-border",children:e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h2",{className:"text-xl md:text-2xl font-bold text-foreground flex items-center gap-2 md:gap-3",children:[e.jsx(V,{className:"w-6 h-6 md:w-7 md:h-7 text-primary flex-shrink-0"}),e.jsx("span",{className:"truncate",children:"Mentoring Sessions"})]}),e.jsxs("p",{className:"text-muted-foreground mt-1 text-sm md:text-base",children:[S.length," session",S.length!==1?"s":""," assigned to you"]})]})}),e.jsx("div",{className:"space-y-6",children:R.map(i=>{const c=E[i],w=z[i],f=i==="unscheduled",j=f?null:L(i),t=j&&Le(j,new Date);return e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:y("sticky top-0 z-20 backdrop-blur-md rounded-xl mb-4 transition-all duration-300 cursor-pointer",t?"bg-gradient-to-r from-primary/10 to-primary/5 border-2 border-primary/30":"bg-card/80 border border-border","hover:shadow-md"),onClick:()=>P(i),children:e.jsxs("div",{className:"p-3 md:p-4 flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 md:gap-3 min-w-0",children:[!f&&j&&e.jsxs("div",{className:y("w-10 h-10 md:w-12 md:h-12 rounded-xl flex flex-col items-center justify-center font-bold flex-shrink-0",t?"bg-primary text-primary-foreground shadow-lg":"bg-muted text-muted-foreground"),children:[e.jsx("span",{className:"text-[10px] md:text-xs uppercase tracking-wide",children:A(j,"EEE")}),e.jsx("span",{className:"text-base md:text-lg leading-none",children:A(j,"d")})]}),f&&e.jsx("div",{className:"w-10 h-10 md:w-12 md:h-12 rounded-xl flex items-center justify-center bg-muted text-muted-foreground flex-shrink-0",children:e.jsx(pe,{className:"w-5 h-5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h3",{className:"font-bold text-foreground text-base md:text-lg flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"truncate",children:f?"To Be Scheduled":A(j,"EEEE")}),t&&e.jsx($,{className:"bg-primary text-primary-foreground text-[10px] md:text-xs flex-shrink-0",children:"Today"})]}),e.jsx("p",{className:"text-xs md:text-sm text-muted-foreground truncate",children:f?`${c.length} session${c.length!==1?"s":""} pending scheduling`:`${A(j,"MMM d, yyyy")} • ${c.length} session${c.length!==1?"s":""}`})]})]}),e.jsx("button",{className:"p-1.5 md:p-2 rounded-full hover:bg-muted transition-colors flex-shrink-0",children:w?e.jsx(Ee,{className:"w-4 h-4 md:w-5 md:h-5 text-muted-foreground"}):e.jsx(Me,{className:"w-4 h-4 md:w-5 md:h-5 text-muted-foreground"})})]})}),!w&&e.jsx("div",{className:"pl-1 md:pl-2 animate-fade-in space-y-3",children:c.map(({assignment:o,company:a,schedule:l},p)=>{const g=Ue((l==null?void 0:l.session_type)||"mentoring"),x=g.icon,h=p===c.length-1;return e.jsxs("div",{className:"relative group w-full overflow-hidden",children:[!h&&e.jsx("div",{className:"absolute left-[15px] md:left-[19px] top-10 bottom-0 w-0.5 bg-gradient-to-b from-border via-border to-transparent"}),e.jsxs("div",{className:"flex gap-3 md:gap-4 min-w-0",children:[e.jsx("div",{className:y("relative z-10 flex-shrink-0 w-8 h-8 md:w-10 md:h-10 rounded-full flex items-center justify-center shadow-lg transition-transform duration-300 group-hover:scale-110",`bg-gradient-to-br ${g.gradient}`),children:e.jsx(x,{className:"w-4 h-4 md:w-5 md:h-5 text-white"})}),e.jsx("div",{className:y("flex-1 min-w-0 mb-3 rounded-xl border transition-all duration-300 overflow-hidden",g.bgLight,g.border,"hover:shadow-lg"),children:e.jsx("div",{className:"p-3 md:p-4",children:e.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[l&&e.jsxs("div",{className:"flex items-center gap-2 mb-2 flex-wrap",children:[e.jsx("span",{className:y("font-semibold text-sm",g.text),children:A(L(l.start_time),"HH:mm")}
1),e.jsx("span",{className:"text-muted-foreground text-sm",children:"–"}),e.jsx("span",{className:y("font-semibold text-sm",g.text),children:A(L(l.end_time),"HH:mm")}),e.jsx($,{variant:"outline",className:y("text-xs",g.border,g.text),children:Pe(l.start_time,l.end_time)})]}),e.jsx("h4",{className:"font-semibold text-foreground text-sm md:text-base leading-tight break-words",children:(l==null?void 0:l.title)||"Mentoring Session"}),a&&e.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[e.jsxs(re,{className:"h-6 w-6",children:[e.jsx(se,{src:a.logo||void 0,alt:a.name}),e.jsx(ae,{className:"text-xs",children:U(a.name)})]}),e.jsx("span",{className:"text-sm text-muted-foreground truncate",children:a.name}),a.tagline&&e.jsxs("span",{className:"text-xs text-muted-foreground/70 hidden md:inline truncate",children:["— ",a.tagline]})]}),(l==null?void 0:l.location)&&e.jsxs("div",{className:"flex items-center gap-2 mt-2 text-sm",children:[e.jsx($e,{className:y("w-4 h-4",g.text)}),e.jsx("span",{className:"text-muted-foreground",children:l.location})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($,{className:y("text-xs font-medium whitespace-nowrap bg-gradient-to-r text-white border-0",g.gradient),children:g.label}),e.jsx($,{variant:"outline",className:"text-xs capitalize",children:o.status})]})]})})})]})]},o.id)})})]},i)})})]})}const We=({eventId:n,eventTitle:u})=>{const{user:m}=X(),{eventSlug:d}=ie(),[r,D]=b.useState(null),[s,C]=b.useState([]),[k,B]=b.useState([]),[z,T]=b.useState(!0);b.useEffect(()=>{n&&(m!=null&&m.id)&&S()},[n,m==null?void 0:m.id]);const S=async()=>{try{T(!0);const{data:t}=await _.from("profiles").select("id").eq("user_id",m==null?void 0:m.id).maybeSingle();if(t){const p=await _.from("mentors").select("first_name, last_name, role, company, expertise, status, image").eq("profile_id",t.id).maybeSingle();p.data&&D(p.data)}const o=await _.from("mentor_assignments").select("id, status, startup_id").eq("event_id",n).eq("mentor_id",m==null?void 0:m.id);if(o.data&&o.data.length>0){const p=o.data.map(g=>g.startup_id).filter(Boolean);if(p.length>0){const g=await _.from("companies").select("id, name, logo").in("id",p);if(g.data){const x=o.data.map(h=>{var v,N,q,H;return{id:h.id,status:h.status,startup_id:h.startup_id,startup_name:(N=(v=g.data)==null?void 0:v.find(Q=>Q.id===h.startup_id))==null?void 0:N.name,startup_logo:(H=(q=g.data)==null?void 0:q.find(Q=>Q.id===h.startup_id))==null?void 0:H.logo}});C(x)}else C(o.data)}else C(o.data)}const a=new Date,l=await _.from("event_schedules").select("id, title, start_time, end_time, session_type").eq("event_id",n).in("session_type",["mentoring","mentor_presentation"]).gte("start_time",a.toISOString()).order("start_time",{ascending:!0}).limit(5);l.data&&B(l.data)}catch(t){console.error("Error fetching data:",t)}finally{T(!1)}},E={ceremony:{gradient:"from-violet-500 to-purple-600",bgLight:"bg-violet-50 dark:bg-violet-950/30",border:"border-violet-200 dark:border-violet-800",text:"text-violet-700 dark:text-violet-300",icon:ue,label:"Ceremony"},presentation:{gradient:"from-blue-500 to-indigo-600",bgLight:"bg-blue-50 dark:bg-blue-950/30",border:"border-blue-200 dark:border-blue-800",text:"text-blue-700 dark:text-blue-300",icon:ge,label:"Presentation"},mentoring:{gradient:"from-emerald-500 to-teal-600",bgLight:"bg-emerald-50 dark:bg-emerald-950/30",border:"border-emerald-200 dark:border-emerald-800",text:"text-emerald-700 dark:text-emerald-300",icon:F,label:"Mentoring"},mentor_presentation:{gradient:"from-cyan-500 to-blue-600",bgLight:"bg-cyan-50 dark:bg-cyan-950/30",border:"border-cyan-200 dark:border-cyan-800",text:"text-cyan-700 dark:text-cyan-300",icon:he,label:"Mentor Presentation"},workshop:{gradient:"from-amber-500 to-orange-600",bgLight:"bg-amber-50 dark:bg-amber-950/30",border:"border-amber-200 dark:border-amber-800",text:"text-amber-700 dark:text-amber-300",icon:fe,label:"Workshop"},break:{gradient:"from-slate-400 to-gray-500",bgLight:"bg-slate-50 dark:bg-slate-950/30",border:"border-slate-200 dark:border-slate-800",text:"text-slate-600 dar
1k:text-slate-400",icon:je,label:"Break"},networking:{gradient:"from-rose-500 to-pink-600",bgLight:"bg-rose-50 dark:bg-rose-950/30",border:"border-rose-200 dark:border-rose-800",text:"text-rose-700 dark:text-rose-300",icon:F,label:"Networking"}},U=t=>E[t||"mentoring"]||E.mentoring,P=(t,o)=>{const a=be(L(o),L(t));if(a<60)return`${a}m`;const l=Math.floor(a/60),p=a%60;return p>0?`${l}h ${p}m`:`${l}h`},R=t=>A(L(t),"HH:mm"),i=t=>A(L(t),"EEE, MMM d"),c=t=>{switch(t==null?void 0:t.toLowerCase()){case"live":case"accepted":case"confirmed":return"bg-green-100 text-green-800";case"pending":case"requested":return"bg-yellow-100 text-yellow-800";case"draft":return"bg-gray-100 text-gray-800";default:return"bg-blue-100 text-blue-800"}},w=(t,o)=>`${(t==null?void 0:t[0])||""}${(o==null?void 0:o[0])||""}`.toUpperCase()||"M";if(z)return e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(J,{size:48})});const f=s.filter(t=>t.status==="accepted"||t.status==="assigned"),j=s.filter(t=>t.status==="pending"||t.status==="requested");return e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"bg-gradient-to-r from-purple-50 to-blue-50 rounded-lg p-6",children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:["Welcome, ",(r==null?void 0:r.first_name)||"Mentor","! 👋"]}),e.jsx("p",{className:"text-gray-600",children:u})]}),(r==null?void 0:r.status)&&e.jsx($,{className:c(r.status),children:r.status})]})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs(Y,{children:[e.jsx(ee,{children:e.jsxs(te,{className:"flex items-center gap-2",children:[e.jsx(V,{className:"w-5 h-5 text-purple-600"}),"Your Mentor Profile"]})}),e.jsx(G,{className:"space-y-4",children:r?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(re,{className:"w-16 h-16",children:[e.jsx(se,{src:r.image}),e.jsx(ae,{className:"bg-purple-100 text-purple-700 font-semibold",children:w(r.first_name,r.last_name)})]}),e.jsxs("div",{children:[e.jsxs("p",{className:"font-semibold text-lg",children:[r.first_name," ",r.last_name]}),r.role&&e.jsx("p",{className:"text-sm text-muted-foreground",children:r.role}),r.company&&e.jsx("p",{className:"text-sm text-muted-foreground",children:r.company})]})]}),r.expertise&&r.expertise.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"Expertise:"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.expertise.slice(0,3).map((t,o)=>e.jsx($,{variant:"outline",className:"text-xs",children:t},o)),r.expertise.length>3&&e.jsxs($,{variant:"outline",className:"text-xs",children:["+",r.expertise.length-3," more"]})]})]}),e.jsx(I,{to:`/dashboard/${d}/mentor/profile`,children:e.jsx(M,{variant:"outline",size:"sm",className:"w-full",children:"Edit Profile"})})]}):e.jsxs("div",{className:"text-center py-4",children:[e.jsx("p",{className:"text-muted-foreground mb-4",children:"No mentor profile found"}),e.jsx(I,{to:`/dashboard/${d}/mentor/profile`,children:e.jsx(M,{variant:"outline",size:"sm",children:"Create Profile"})})]})})]}),e.jsxs(Y,{children:[e.jsx(ee,{children:e.jsxs(te,{className:"flex items-center gap-2",children:[e.jsx(F,{className:"w-5 h-5 text-blue-600"}),"Mentoring Sessions"]})}),e.jsxs(G,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"text-center p-3 bg-green-50 rounded-lg",children:[e.jsx("p",{className:"text-2xl font-bold text-green-700",children:f.length}),e.jsx("p",{className:"text-sm text-green-600",children:"Active"})]}),e.jsxs("div",{className:"text-center p-3 bg-yellow-50 rounded-lg",children:[e.jsx("p",{className:"text-2xl font-bold text-yellow-700",children:j.length}),e.jsx("p",{className:"text-sm text-yellow-600",children:"Pending"})]})]}),f.length>0?e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium",children:"Recent Assignments:"}),f.slice(0,3).map(t=>{var o;return e.jsxs("div",{className:"flex items-center gap-3 p-2 bg-gray-50 rounded-lg",children:[e.jsxs(re,{className:"w-8 h-8",children:[e.jsx(se,{src:t.startup_logo}),e.jsx(ae,{className:"bg-blue-100 text-blue-700 text-xs",children:((o=t.startup_name)==null?void 0:o[0])||"S"})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium truncate",children:t.startup_name||"Startup"}),e.jsx($,{className:`${c(t.status)} text-xs`,children:t.status})]})]},t.id)})]}):e.jsx("p",{className:"text-sm text-muted-foreground text-center py-2",children:"No active mentoring sessions yet"}),e.jsx(I,{to:`/dashboard/${d}/mentor/mentoring`,children:e.jsxs(M,{variant:"outline",size:"sm",className:"w-full",children:["View All Sessions ",e.jsx(me,{className:"w-4 h-4 ml-2"})]})})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4 p-4 md:p-6 rounded-2xl bg-gradient-to-r from-card to-muted/30 border border-border",children:e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h2",{className:"text-xl md:text-2xl font-bold text-foreground flex items-center gap-2 md:gap-3",children:[e.jsx(V,{className:"w-6 h-6 md:w-7 md:h-7 text-primary flex-shrink-0"}),e.jsx("span",{className:"truncate",children:"Upcoming Sessions"})]}),e.jsxs("p",{className:"text-muted-foreground mt-1 text-sm md:text-base",children:[k.length," upcoming session",k.length!==1?"s":""]})]})}),k.length>0?e.jsxs("div",{className:"pl-1 md:pl-2 space-y-3",children:[k.map((t,o)=>{const a=U(t.session_type),l=a.icon,p=o===k.length-1;return e.jsxs("div",{className:"relative group w-full overflow-hidden",children:[!p&&e.jsx("div",{className:"absolute left-[15px] md:left-[19px] top-10 bottom-0 w-0.5 bg-gradient-to-b from-border via-border to-transparent"}),e.jsxs("div",{className:"flex gap-3 md:gap-4 min-w-0",children:[e.jsx("div",{className:y("relative z-10 flex-shrink-0 w-8 h-8 md:w-10 md:h-10 rounded-full flex items-center justify-center shadow-lg transition-transform duration-300 group-hover:scale-110",`bg-gradient-to-br ${a.gradient}`),children:e.jsx(l,{className:"w-4 h-4 md:w-5 md:h-5 text-white"})}),e.jsx("div",{className:y("flex-1 min-w-0 mb-3 rounded-xl border transition-all duration-300 overflow-hidden",a.bgLight,a.border,"hover:shadow-lg"),children:e.jsx("div",{className:"p-3 md:p-4",children:e.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2 flex-wrap",children:[e.jsx("span",{className:y("font-semibold text-sm",a.text),children:R(t.start_time)}),e.jsx("span",{className:"text-muted-foreground text-sm",children:"–"}),e.jsx("span",{className:y("font-semibold text-sm",a.text),children:R(t.end_time)}),e.jsx($,{variant:"outline",className:y("text-xs",a.border,a.text),children:P(t.start_time,t.end_time)})]}),e.jsx("h4",{className:"font-semibold text-foreground text-sm md:text-base leading-tight break-words",children:t.title}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:i(t.start_time)})]}),e.jsx($,{className:y("text-xs font-medium whitespace-nowrap bg-gradient-to-r text-white border-0",a.gradient),children:a.label})]})})})]})]},t.id)}),e.jsx(I,{to:`/dashboard/${d}/mentor/schedule`,children:e.jsxs(M,{variant:"outline",size:"sm",className:"w-full mt-2",children:["Full Schedule ",e.jsx(me,{className:"w-4 h-4 ml-2"})]})})]}):e.jsx(Y,{children:e.jsxs(G,{className:"py-12 text-center",children:[e.jsx(ne,{className:"w-12 h-12 mx-auto mb-3 text-muted-foreground opacity-50"}),e.jsx("p",{className:"text-muted-foreground",children:"No upcoming sessions scheduled"}),e.jsx(I,{to:`/dashboard/${d}/mentor/schedule`,children:e.jsx(M,{variant:"outline",size:"sm",className:"mt-3",children:"View Full Schedule"})})]})})]}
1),e.jsxs(Y,{children:[e.jsx(ee,{children:e.jsx(te,{children:"Quick Actions"})}),e.jsx(G,{children:e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[e.jsx(I,{to:`/dashboard/${d}/mentor/startups`,children:e.jsxs(M,{variant:"outline",className:"w-full h-auto flex flex-col gap-2 py-4",children:[e.jsx(ve,{className:"w-6 h-6 text-purple-600"}),e.jsx("span",{className:"text-sm",children:"View Startups"})]})}),e.jsx(I,{to:`/dashboard/${d}/mentor/schedule`,children:e.jsxs(M,{variant:"outline",className:"w-full h-auto flex flex-col gap-2 py-4",children:[e.jsx(ne,{className:"w-6 h-6 text-blue-600"}),e.jsx("span",{className:"text-sm",children:"Schedule"})]})}),e.jsx(I,{to:`/dashboard/${d}/mentor/networking`,children:e.jsxs(M,{variant:"outline",className:"w-full h-auto flex flex-col gap-2 py-4",children:[e.jsx(F,{className:"w-6 h-6 text-green-600"}),e.jsx("span",{className:"text-sm",children:"Network"})]})}),e.jsx(I,{to:`/dashboard/${d}/mentor/profile`,children:e.jsxs(M,{variant:"outline",className:"w-full h-auto flex flex-col gap-2 py-4",children:[e.jsx(V,{className:"w-6 h-6 text-orange-600"}),e.jsx("span",{className:"text-sm",children:"Edit Profile"})]})})]})})]})]})},Oe=({eventId:n,startupId:u})=>{const{eventSlug:m}=ie(),d=xe(),{user:r}=X(),{startup:D,teamMembers:s,crewMembers:C,isLoading:k,isBookmarked:B,isTogglingBookmark:z,isStartingChat:T,toggleBookmark:S,startTeamChat:E,crewCount:U,maxCrewSize:P,startupNumber:R}=ze({startupId:u,eventId:n,userId:r==null?void 0:r.id});return k?e.jsx("div",{className:"flex items-center justify-center min-h-96",children:e.jsx(J,{size:64})}):D?e.jsx(Te,{startup:D,startupId:u,userId:(r==null?void 0:r.id)||"",eventSlug:m||"",role:"mentor",onBack:()=>d(`/dashboard/${m}/mentor/startups`),teamMembers:s,crewMembers:C,isBookmarked:B,isTogglingBookmark:z,onToggleBookmark:S,isStartingChat:T,onStartChat:()=>E(D.name),crewCount:U,maxCrewSize:P,startupNumber:R,showBookmark:!0,showChat:!0,showTeam:!0,showResources:!0}):e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-96 gap-4",children:[e.jsx(ve,{className:"h-16 w-16 text-muted-foreground"}),e.jsx("h2",{className:"text-2xl font-bold",children:"Startup not found"}),e.jsx(M,{onClick:()=>d(-1),children:"Go Back"})]})};function ns(){const{user:n}=X(),{eventSlug:u}=ie(),m=xe(),d=ye(),[r,D]=b.useState(null),[s,C]=b.useState(null),[k,B]=b.useState(!0),[z,T]=b.useState([]),S=d.pathname.endsWith("/settings"),E=d.pathname.endsWith("/mentors"),U=d.pathname.endsWith("/profile"),P=d.pathname.endsWith("/schedule"),R=d.pathname.endsWith("/startups"),i=d.pathname.endsWith("/mentoring"),c=d.pathname.endsWith("/networking"),w=d.pathname.endsWith("/reviews"),f=d.pathname.endsWith("/media"),j=d.pathname.match(/\/mentor\/startups\/([^/]+)$/),t=j?j[1]:null,o=x=>{C(h=>h?{...h,...x}:null)};b.useEffect(()=>{n&&u&&a()},[n,u]);const a=async()=>{var x;try{B(!0);const{data:h,error:v}=await _.from("events").select("*");let N=null;if(h&&!v){const W=K=>K.toLowerCase().replace(/[^a-z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50);N=h.find(K=>W(K.title)===u)}if(v){console.error("Error fetching event:",v),m("/dashboard");return}C({id:N.id,title:N.title,description:N.description||"",location:N.location||"",start_date:N.start_date,end_date:N.end_date,max_participants:N.max_participants,event_type:N.event_type,status:N.status,visibility:N.visibility});const{data:q,error:H}=await _.from("user_roles").select("event_id, role, status").eq("user_id",n==null?void 0:n.id).eq("event_id",N.id);if(H){console.error("Error fetching user roles:",H);return}if(T(q||[]),!(q==null?void 0:q.some(W=>W.role==="mentor"))){m("/dashboard");return}const{data:Z,error:oe}=await _.from("profiles").select("membership_level, name").eq("user_id",n==null?void 0:n.id).single();if(oe){console.error("Error fetching profile:",oe);return}const{data:O,error:le}=await _.from("user_roles").select("event_id, role").eq("user_id",n==null?void 0:n.id);if(le){console.error("Error fetching all roles:",le);return}const Ne=(O==null?void 0:O.map(W=>W.event_id))||[],{data:Fe,error:de}=await _.from("events").select("id, title, location").in("id",Ne);if(de){console.error("Error fetching events:",de);return}const we={id:(n==null?void 0:n.id)||"",name:(Z==null?void 0:Z.name)||((x=n==null?void 0:n.email)==null?void 0:x.split("@")[0])||"User",email:(n==null?void 0:n.email)||"",avatar:void 0,roles:(O==null?void 0:O.map(W=>W.role))||[],primaryRole:"mentor",currentEventId:N.id};D(we)}catch(h){console.error("Error in fetchEventAndUserData:",h),m("/dashboard")}finally{B(!1)}},l=()=>{const x=z.find(h=>h.role==="mentor");return(x==null?void 0:x.status)||"pending"},p=x=>
1{const v={pending:{title:"Application Pending",message:"Your mentor application is currently under review. You'll be notified once it's processed.",icon:e.jsx(pe,{className:"h-12 w-12 text-yellow-500"}),bgColor:"bg-yellow-50 border-yellow-200",textColor:"text-yellow-800"},rejected:{title:"Application Not Approved",message:"Your mentor application was not approved. Please contact the program manager for more information.",icon:e.jsx(_e,{className:"h-12 w-12 text-red-500"}),bgColor:"bg-red-50 border-red-200",textColor:"text-red-800"}}[x];return v?e.jsx("div",{className:"min-h-screen flex items-center justify-center p-4",children:e.jsxs("div",{className:`max-w-md w-full ${v.bgColor} border rounded-lg p-8 text-center`,children:[e.jsx("div",{className:"flex justify-center mb-4",children:v.icon}),e.jsx("h2",{className:`text-xl font-semibold mb-3 ${v.textColor}`,children:v.title}),e.jsx("p",{className:`${v.textColor} mb-6`,children:v.message})]})}):null};if(k)return e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsx(J,{size:64})});if(!r||!s)return e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"text-xl font-semibold mb-2",children:"Access Denied"}),e.jsx("p",{className:"text-muted-foreground",children:"Unable to load dashboard data."})]})});const g=()=>{if(S)return e.jsx(Se,{currentEvent:{id:s.id,title:s.title,description:s.description||"",location:s.location||"",start_date:s.start_date||"",end_date:s.end_date||"",status:s.status||"Draft",visibility:s.visibility||"Private"},onEventUpdate:o});if(E)return e.jsx(Ce,{});if(U)return m("/dashboard/profile"),null;if(c)return e.jsx(Ie,{eventId:s.id});if(i)return e.jsx(qe,{eventId:s.id});if(P)return e.jsx(De,{eventId:s.id,eventStartDate:s.start_date,eventEndDate:s.end_date,canEdit:!1,eventTimezone:s.timezone});if(t)return e.jsx(Oe,{eventId:s.id,startupId:t});if(R)return e.jsx(Ae,{eventId:s.id});if(w)return e.jsx(Be,{eventId:s.id,eventTitle:s.title});if(f)return e.jsx(Re,{});const x=l();return x!=="accepted"?p(x):e.jsx(We,{eventId:s.id,eventTitle:s.title})};return e.jsx(ke,{user:r,currentEvent:{id:s.id,title:s.title,description:s.description||"",location:s.location||"",start_date:s.start_date||"",end_date:s.end_date||"",status:s.status||"Draft",visibility:s.visibility||"Private"},userEventRoles:z.map(x=>({role:x.role,status:x.status,event_id:x.event_id})),currentRole:d.pathname.includes("/mentor")?"mentor":r.primaryRole==="admin"?"program_manager":r.primaryRole,onRoleChange:x=>
1{const v={startup:"startups",startup_founder:"startups",program_manager:"manager",mentor:"mentor",jury_member:"jury",investor:"investor",corporate:"corporate",attendee:"attendant",visitor:"visitor"}[x]||x;m(`/dashboard/${u}/${v}/`)},children:g()})}export{ns 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.