PageSourceSearch

https://hackleyglobal.org/assets/RigorHQDashboard-ZsByHsl7.js

js hackleyglobal.org collected 2026-10-09 22:02:19 UTC 79,113 bytes, 4 lines download raw bytes

1import{r as o,j as e,L as y,n as $e}from"./vendor-react-rwTLq11e.js";import{c as k,B as U}from"./Construction-C-jOC9-n.js";import{c as Q,s as C,k as Z,i as re,B as X,D as Ge,b as Ue,q as Qe,j as We,l as ue,p as he,a9 as ze}from"./App-dPk54ARk.js";import{E as Ke}from"./EmailVerificationGate-B0FV8nks.js";import{d9 as le,dv as Ve,cA as V,hJ as ie,hK as Ne,cE as Y,g1 as _e,hi as Ye,dV as J,dE as K,dP as E,hG as Je,dS as ke,c_ as Xe,cP as Ze,hL as et,cL as tt,fS as ee,hf as pe,dZ as st,cY as Ce,hl as Se,cO as Me,hM as at,cG as oe,eG as rt,d4 as ne,dc as lt,cz as ce,hy as it,gm as ot,hN as nt,hO as ct,hP as dt,d5 as Te,e4 as mt,de as Ie,hQ as xt,ed as ut,dy as Re,hR as ht,d7 as pt,dN as bt,cC as gt,cD as ft,ct as wt,cu as de,cI as te,cv as Ae,dO as jt,dd as yt,co as vt,hk as Nt,dk as _t,cN as kt,dq as Pe,d6 as Ee,cx as Le,dl as Ct,dI as St,db as Mt,ec as me,dw as z,dJ as se,cw as De,dU as Tt,dp as Oe,hr as It,h4 as Be,eE as Rt}from"./vendor-DUEJizG2.js";import{g as At}from"./timeGreeting-CpHBVngg.js";import{u as xe}from"./usePersonalTasks-C8xbjnh2.js";import{u as Pt}from"./useGlobalPass-DaZfnmt6.js";import{u as Et}from"./useEntitlements-DPIlwnfT.js";import{u as Lt}from"./useUserProgression-COIlPIZw.js";import{u as Dt}from"./useCoursesInProgress-DPbhwzS9.js";import{u as Ot}from"./useNextHQEvent-BLklc2je.js";import{u as Bt}from"./useConveneFreeMinutes-BTVt5YQw.js";import{s as R}from"./sfx-C3HBdIO4.js";import{u as Ht,A as be,m as T}from"./vendor-motion-BMstwJc_.js";import{C as Ft}from"./card-C4CnatEE.js";import{c as qt,r as $t}from"./libraryRights-BKLuq7iR.js";import{W as Gt}from"./WatchAndLearnBlock-TFz-XRmp.js";import{S as Ut,a as Qt,b as Wt,c as zt,d as Kt}from"./sheet-hgPaiOVV.js";import{W as Vt,U as Yt,C as Jt}from"./UnifiedFeed-Ci1K9eld.js";import"./vendor-radix-ChnVWQGg.js";import"./vendor-jspdf-Cs9lx9fC.js";import"./EmailVerificationBanner-CbJ4RENr.js";import"./vendor-livekit-II1ypI6U.js";import"./avatar-cZR3W0GT.js";function Xt(t){if(!t)return;const s=new Date(t),r=new Date,l=s.getTime()-r.getTime(),c=Math.round(l/864e5);return c<0?`${Math.abs(c)}d overdue`:c===0?"Due today":c===1?"Due tomorrow":c<7?`Due in ${c}d`:s.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Zt({lane:t}){const s=t.icon;return e.jsxs("div",{className:"rounded-2xl border border-white/10 bg-black/40 p-4 flex flex-col min-h-[260px]",children:[e.jsxs("header",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:k("h-7 w-7 rounded-lg border flex items-center justify-center bg-gradient-to-br",t.bg,t.accent),children:e.jsx(s,{className:"h-3.5 w-3.5"})}),e.jsxs("div",{children:[e.jsx("p",{className:k("text-[10px] uppercase tracking-[0.2em] font-semibold",t.accent),children:t.label}),e.jsx("p",{className:"text-[10px] text-white/50",children:t.loading?"Loading…":`${t.items.length} ${t.items.length===1?"item":"items"}`})]})]}),t.viewAll&&e.jsxs(y,{to:t.viewAll.to,className:"text-[10px] uppercase tracking-wider text-white/50 hover:text-gold inline-flex items-center gap-1",children:[t.viewAll.label," ",e.jsx(E,{className:"h-3 w-3"})]})]}),e.jsx("div",{className:"flex-1 space-y-1.5",children:t.loading?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-10 rounded-md bg-white/5 animate-pulse"}),e.jsx("div",{className:"h-10 rounded-md bg-white/5 animate-pulse"}),e.jsx("div",{className:"h-10 rounded-md bg-white/5 animate-pulse"})]}):t.items.length===0?e.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-center py-6",children:[e.jsx(Je,{className:"h-5 w-5 text-white/30 mb-2"}),e.jsx("p",{className:"text-xs text-white/50 mb-3",children:t.emptyLabel}),e.jsx(y,{to:t.emptyCta.to,className:"text-[11px] font-semibold px-3 py-1.5 rounded-md bg-gold/15 border border-gold/40 text-gold hover:bg-gold/25",children:t.emptyCta.label})]}):t.items.slice(0,4).map(r=>{const l=Xt(r.due);return e.jsxs(y,{to:r.to,className:"group flex items-start gap-2 px-2 py-1.5 rounded-md hover:bg-white/5 border border-transparent hover:border-white/10",children:[e.jsx("div",{className:k("mt
1-0.5 h-1.5 w-1.5 rounded-full",t.accent.replace("text-","bg-"))}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-[12.5px] text-white/90 leading-tight truncate",children:r.title}),e.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[r.meta&&e.jsx("p",{className:"text-[10px] text-white/50 truncate",children:r.meta}),l&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-white/60",children:[e.jsx(ke,{className:"h-2.5 w-2.5"})," ",l]}),r.badge&&e.jsx("span",{className:"text-[9px] font-semibold px-1.5 py-0.5 rounded bg-gold/15 text-gold border border-gold/30 uppercase tracking-wider",children:r.badge})]})]}),e.jsx(E,{className:"h-3 w-3 text-white/30 group-hover:text-gold mt-1"})]},r.id)})})]})}function es(){const{user:t}=Q(),[s,r]=o.useState([]),[l,c]=o.useState([]),[a,d]=o.useState([]),[p,i]=o.useState([]),[n,w]=o.useState([]),[b,N]=o.useState([]),[u,x]=o.useState(!0);o.useEffect(()=>{if(!t){x(!1);return}let h=!1;return(async()=>{x(!0);const _=new Date().toISOString(),S=async m=>{try{return await m}catch{return null}},I=await S(C.from("course_assignments").select("id, title, due_date, course_id, courses(title)").gte("due_date",_).order("due_date",{ascending:!0}).limit(6)),F=((I==null?void 0:I.data)||[]).map(m=>{var P;return{id:m.id,title:m.title||"Assignment",meta:((P=m.courses)==null?void 0:P.title)||void 0,due:m.due_date,to:m.course_id?`/courses/${m.course_id}`:"/dashboard"}}),D=await S(C.from("course_week_progress").select("course_id, week_number, completed_at, updated_at, courses(title)").eq("user_id",t.id).is("completed_at",null).order("updated_at",{ascending:!1}).limit(6)),q=((D==null?void 0:D.data)||[]).map(m=>{var P;return{id:`${m.course_id}-${m.week_number}`,title:((P=m.courses)==null?void 0:P.title)||"Continue course",meta:`Week ${m.week_number}`,to:`/courses/${m.course_id}?week=${m.week_number}`,badge:"Resume"}}),$=await S(C.from("events").select("id, title, starts_at, start_at, slug").limit(10)),B=(($==null?void 0:$.data)||[]).map(m=>({id:m.id,title:m.title||"Event",due:m.starts_at||m.start_at,to:m.slug?`/events/${m.slug}`:"/calendar"})).filter(m=>m.due&&m.due>_).sort((m,P)=>(m.due||"").localeCompare(P.due||"")).slice(0,6),f=await S(C.from("portal_messages").select("id, subject, body, created_at, read_at, sender_name").eq("recipient_id",t.id).is("read_at",null).order("created_at",{ascending:!1}).limit(6)),v=((f==null?void 0:f.data)||[]).map(m=>({id:m.id,title:m.subject||(m.body?String(m.body).slice(0,60):"New message"),meta:m.sender_name||void 0,to:"/member-portal/messages",badge:"Unread"})),H=new Date().toISOString().slice(0,10),M=await S(C.from("ppi_daily_sessions").select("id, title, session_date, theme").gte("session_date",H).order("session_date",{ascending:!0}).limit(3)),A=((M==null?void 0:M.data)||[]).map(m=>({id:m.id,title:m.title||m.theme||"PPI Formation Session",meta:m.session_date===H?"Today's PPI Formation":new Date(m.session_date).toLocaleDateString(),to:"/ppi/dashboard",badge:"PPI"})),O=await S(C.from("q_recommendations").select("id, title, action_label, action_url, priority").eq("user_id",t.id).order("priority",{ascending:!1}).limit(4));let G=((O==null?void 0:O.data)||[]).map(m=>({id:m.id,title:m.title||"Growth action",to:m.action_url||"/me-q",badge:m.action_label||"ME-Q"}));if(G.length===0){const m=await S(C.from("mission_notifications").select("id, title, body, action_url, created_at").eq("user_id",t.id).order("created_at",{ascending:!1}).limit(4));G=((m==null?void 0:m.data)||[]).map(P=>({id:P.id,title:P.title||P.body||"Next growth step",to:P.action_url||"/me-q",badge:"Grow"}))}h||(r(F),c(q),d(B),i(v),w(A),N(G),x(!1))})(),()=>{h=!0}},[t==null?void 0:t.id]);const j=o.useMemo(()=>[{key:"tasks",label:"Today's PPI Formation",icon:le,accent:"text-rose-300",bg:"from-rose-900/40 to-black border-rose-500/30",items:n,loading:u,emptyLabel:"No PPI formation session scheduled.",emptyCta:{label:"Open Paraclete Power Institute",to:"/ppi/dashboard"},viewAll:{label:"PPI Dashboard",to:"/ppi/dashboard"}},{key:"assignments",label:"Assignments",icon:Ve,accent:"text-amber-300",bg
1:"from-amber-900/40 to-black border-amber-500/30",items:s,loading:u,emptyLabel:"Nothing due. You're caught up.",emptyCta:{label:"Browse Courses",to:"/hgi"},viewAll:{label:"All",to:"/dashboard#academic-core"}},{key:"courses",label:"Continue Learning",icon:V,accent:"text-violet-300",bg:"from-violet-900/40 to-black border-violet-500/30",items:l,loading:u,emptyLabel:"Start your first course.",emptyCta:{label:"Find a Course",to:"/hgi"},viewAll:{label:"All",to:"/dashboard"}},{key:"events",label:"Upcoming Events",icon:ie,accent:"text-sky-300",bg:"from-sky-900/40 to-black border-sky-500/30",items:a,loading:u,emptyLabel:"No events on your calendar yet.",emptyCta:{label:"Open Calendar",to:"/calendar"},viewAll:{label:"Calendar",to:"/calendar"}},{key:"messages",label:"Needs Response",icon:Ne,accent:"text-emerald-300",bg:"from-emerald-900/40 to-black border-emerald-500/30",items:p,loading:u,emptyLabel:"Inbox zero. Beautiful.",emptyCta:{label:"Open Messages",to:"/member-portal/messages"},viewAll:{label:"Inbox",to:"/member-portal/messages"}},{key:"growth",label:"Growth Actions",icon:Y,accent:"text-gold",bg:"from-amber-800/40 to-black border-gold/30",items:b,loading:u,emptyLabel:"Take ME-Q to unlock personal next steps.",emptyCta:{label:"Start ME-Q",to:"/me-q"},viewAll:{label:"ME-Q",to:"/me-q"}}],[n,s,l,a,p,b,u]),g=s.length+p.length+n.length;return e.jsxs("section",{className:"rounded-2xl border border-gold/25 bg-gradient-to-br from-[#0b0f1d] via-black to-[#0b0f1d] overflow-hidden",children:[e.jsxs("header",{className:"px-5 py-4 border-b border-white/10 flex flex-wrap items-center justify-between gap-3",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-gold/40 to-amber-700/20 border border-gold/40 flex items-center justify-center",children:e.jsx(_e,{className:"h-5 w-5 text-gold"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] uppercase tracking-[0.22em] text-gold/90 font-semibold",children:"My Command Center"}),e.jsx("h2",{className:"font-serif text-xl text-white leading-tight",children:"What should you do today?"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsxs("span",{className:"px-2.5 py-1 rounded-md bg-rose-500/15 border border-rose-400/30 text-rose-200 inline-flex items-center gap-1.5",children:[e.jsx(Ye,{className:"h-3 w-3"}),e.jsx("strong",{children:g})," awaiting you"]}),e.jsxs(y,{to:"/me-q",className:"px-2.5 py-1 rounded-md bg-gold/15 border border-gold/30 text-gold inline-flex items-center gap-1.5 hover:bg-gold/25",children:[e.jsx(J,{className:"h-3 w-3"})," Journey"]}),e.jsxs(y,{to:"/community",className:"px-2.5 py-1 rounded-md bg-white/5 border border-white/10 text-white/80 inline-flex items-center gap-1.5 hover:border-gold/30 hover:text-gold",children:[e.jsx(K,{className:"h-3 w-3"})," Community"]})]})]}),e.jsx("div",{className:"p-4 grid sm:grid-cols-2 xl:grid-cols-3 gap-4",children:j.map(h=>e.jsx(Zt,{lane:h},h.key))})]})}const ae=[{key:"today",label:"Today"},{key:"week",label:"This Week"},{key:"later",label:"Later"}],ts={high:"text-rose-300 border-rose-400/40 bg-rose-500/10",med:"text-amber-300 border-amber-400/40 bg-amber-500/10",low:"text-emerald-300 border-emerald-400/40 bg-emerald-500/10"};function ss(){const{tasks:t,addTask:s,toggleDone:r,deleteTask:l,moveColumn:c,updateTask:a,loading:d}=xe(),[p,i]=o.useState(""),[n,w]=o.useState(null),b=async u=>{const x=p.trim();x&&(await s({title:x,board_column:u}),i(""))},N=u=>t.filter(x=>x.board_column===u);return e.jsxs("section",{id:"daily-work-board",className:"rounded-2xl border border-gold/20 bg-black/40 p-4 scroll-mt-24",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-lg text-white",children:"Daily Work Board"}),e.jsx("p",{className:"text-xs text-white/60",children:"Capture, organize, and schedule what you'll actually do today."})]}),e.jsxs("div",{className:"text-[10px] uppercase tracking-[0.2em] text-gold/70",children:[t.filter(u=>u.status!=="done").length," open"]})]}),e.jsxs("div",{className:"flex gap-2 mb-4",children:[e.jsx("input",{value:p,onChange:u=>i(u.target.value),onKeyDown:u=>{u.key==="Enter"&&b("today")},placeholder:"Add a task to Today and press Enter…",className:"flex-1 rounded-lg border border-white/10 bg-black/60 px-3 py-2 text-sm text-white placeholder:text-white/40 focus:outline-none focus:border-gold/50"}),e.jsxs("button",{onClick:()=>
1b("today"),className:"inline-flex items-center gap-1 px-3 py-2 rounded-lg border border-gold/40 bg-gold/15 text-gold text-xs font-semibold hover:bg-gold/25",children:[e.jsx(Xe,{className:"h-3.5 w-3.5"})," Add"]})]}),e.jsx("div",{className:"grid gap-3 items-start",style:{gridTemplateColumns:"repeat(auto-fit, minmax(220px, 1fr))"},children:ae.map(u=>e.jsxs("div",{className:"rounded-xl border border-white/10 bg-black/50 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("p",{className:"text-[11px] uppercase tracking-[0.2em] font-semibold text-white/70",children:u.label}),e.jsx("span",{className:"text-[10px] text-white/40",children:N(u.key).length})]}),e.jsxs("div",{className:"space-y-2 min-h-[120px]",children:[d&&e.jsx("p",{className:"text-xs text-white/40",children:"Loading…"}),!d&&N(u.key).length===0&&e.jsx("p",{className:"text-[11px] text-white/30 italic",children:"Nothing here yet."}),N(u.key).map(x=>e.jsx(as,{task:x,expanded:n===x.id,onExpand:()=>w(n===x.id?null:x.id),onToggle:()=>r(x),onDelete:()=>l(x.id),onMove:j=>{const g=ae.findIndex(_=>_.key===x.board_column),h=ae[g+j];h&&c(x.id,h.key)},onSchedule:(j,g)=>a(x.id,{scheduled_at:j,duration_min:g}),onUpdate:j=>a(x.id,j)},x.id))]})]},u.key))})]})}function as({task:t,expanded:s,onExpand:r,onToggle:l,onDelete:c,onMove:a,onSchedule:d,onUpdate:p}){var u;const[i,n]=o.useState(((u=t.scheduled_at)==null?void 0:u.slice(0,16))||""),[w,b]=o.useState(t.duration_min??30),N=t.status==="done";return e.jsxs("div",{className:k("rounded-lg border bg-black/60 p-2.5 transition-colors",N?"border-white/5 opacity-60":"border-white/10 hover:border-gold/30"),children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("button",{onClick:l,className:k("h-4 w-4 mt-0.5 rounded border flex items-center justify-center shrink-0",N?"bg-emerald-500/30 border-emerald-400 text-emerald-200":"border-white/30 hover:border-gold"),"aria-label":N?"Mark incomplete":"Mark complete",children:N&&e.jsx(Ze,{className:"h-3 w-3"})}),e.jsxs("button",{onClick:r,className:"flex-1 min-w-0 text-left",children:[e.jsx("p",{className:k("text-sm text-white leading-tight break-words line-clamp-3",N&&"line-through"),title:t.title,children:t.title}),e.jsxs("div",{className:"flex items-center gap-2 mt-1 flex-wrap",children:[e.jsxs("span",{className:k("text-[10px] px-1.5 py-0.5 rounded border inline-flex items-center gap-1",ts[t.priority]),children:[e.jsx(et,{className:"h-2.5 w-2.5"})," ",t.priority]}),t.scheduled_at&&e.jsxs("span",{className:"text-[10px] text-gold inline-flex items-center gap-1",children:[e.jsx(tt,{className:"h-2.5 w-2.5"})," ",ee(new Date(t.scheduled_at),"MMM d, h:mm a")]}),t.recurrence_rule&&t.recurrence_rule!=="none"&&e.jsxs("span",{className:"text-[10px] text-sky-300 inline-flex items-center gap-1",children:[e.jsx(pe,{className:"h-2.5 w-2.5"})," ",t.recurrence_rule]})]})]})]}),s&&e.jsxs("div",{className:"mt-3 space-y-2 border-t border-white/10 pt-2",children:[e.jsx("textarea",{value:t.notes??"",onChange:x=>p({notes:x.target.value}),placeholder:"Notes…",className:"w-full rounded border border-white/10 bg-black/60 px-2 py-1.5 text-xs text-white placeholder:text-white/30 focus:outline-none focus:border-gold/40",rows:2}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("select",{value:t.priority,onChange:x=>p({priority:x.target.value}),className:"rounded border border-white/10 bg-black/60 px-2 py-1 text-[11px] text-white",children:[e.jsx("option",{value:"low",children:"Low"}),e.jsx("option",{value:"med",children:"Med"}),e.jsx("option",{value:"high",children:"High"})]}),e.jsx("input",{type:"datetime-local",value:i,onChange:x=>n(x.target.value),className:"rounded border border-white/10 bg-black/60 px-2 py-1 text-[11px] text-white"}),e.jsx("input",{type:"number",min:5,step:5,value:w,onChange:x=>b(parseInt(x.target.value)||30),className:"w-16 rounded border border-white/10 bg-black/60 px-2 py-1 text-[11px] text-white",title:"Duration (min)"}),e.jsx("button",{onClick:()=>i&&d(new Date(i).toISOString(),w),disabled:!i,className:"px-2 py-1 rounded border border-gold/40 bg-gold/15 text-gold text-[11px] font-semibold hover:bg-gold/25 disabled:opacity-40",children:"Send to Calendar"})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("label",{className:"text-[10px] uppercase tracking-wider text-white/50 inline-flex items-center gap-1",children:[e.jsx(pe,{className:"h-3 w-3"})," Repeat"]}),e.jsxs("select",{value:t.recurrence_rule??"none",onChange:x=>p({recurrence_rule:x.target.value}),className:"rounded border border-white/10 bg-black/60 px-2 py-1 text-[11px] text-white",children:[e.jsx("option",{value:"none",children:"Does not repeat"}),e.jsx("option",{value:"daily",children:"Daily"}
1),e.jsx("option",{value:"weekdays",children:"Weekdays (Mon–Fri)"}),e.jsx("option",{value:"weekly",children:"Weekly"}),e.jsx("option",{value:"monthly",children:"Monthly"})]}),t.recurrence_rule!=="none"&&e.jsx("input",{type:"date",value:t.recurrence_until??"",onChange:x=>p({recurrence_until:x.target.value||null}),className:"rounded border border-white/10 bg-black/60 px-2 py-1 text-[11px] text-white",title:"Repeat until (optional)"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:()=>a(-1),disabled:t.board_column==="today",className:"p-1 rounded hover:bg-white/5 disabled:opacity-30",title:"Move left",children:e.jsx(st,{className:"h-3 w-3 text-white/70"})}),e.jsx("button",{onClick:()=>a(1),disabled:t.board_column==="later",className:"p-1 rounded hover:bg-white/5 disabled:opacity-30",title:"Move right",children:e.jsx(E,{className:"h-3 w-3 text-white/70"})})]}),e.jsx("button",{onClick:c,className:"p-1 rounded hover:bg-rose-500/10 text-rose-300/80",title:"Delete",children:e.jsx(Ce,{className:"h-3 w-3"})})]})]})]})}function ge(){return e.jsxs("div",{className:"relative rounded-2xl border border-gold/25 bg-gradient-to-br from-navy via-black to-[#1a1240] p-5 overflow-hidden group",children:[e.jsx("div",{className:"pointer-events-none absolute -top-24 -right-16 w-64 h-64 rounded-full bg-gold/10 blur-3xl"}),e.jsx("div",{className:"pointer-events-none absolute -bottom-24 -left-10 w-64 h-64 rounded-full bg-[#5aa9e6]/10 blur-3xl"}),e.jsxs("div",{className:"relative flex items-start gap-4",children:[e.jsx("div",{className:"shrink-0 h-12 w-12 rounded-xl bg-gradient-to-br from-gold via-amber-400 to-orange-500 flex items-center justify-center shadow-[0_8px_24px_-8px_rgba(201,168,76,0.6)] transition-transform group-hover:scale-105",children:e.jsx(Y,{className:"h-6 w-6 text-black"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h3",{className:"text-lg font-semibold text-white",children:"Today's Becoming"}),e.jsx("span",{className:"text-[10px] uppercase tracking-widest text-gold/80 bg-gold/10 border border-gold/30 rounded-full px-2 py-0.5",children:"Personal Development"})]}),e.jsx("p",{className:"mt-1 text-sm text-white/70 leading-relaxed",children:"Your daily command center for faith, family, fitness, finance, fun, goals, outcomes, and reminders."}),e.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[e.jsxs(y,{to:"/today",className:"inline-flex items-center gap-1.5 rounded-lg bg-gold text-black text-sm font-medium px-3.5 py-2 hover:bg-amber-300 transition-colors",children:["Open Today ",e.jsx(E,{className:"h-4 w-4"})]}),e.jsxs(y,{to:"/today?add=goals",className:"inline-flex items-center gap-1.5 rounded-lg border border-white/15 bg-white/5 text-white text-sm font-medium px-3 py-2 hover:bg-white/10 transition-colors",children:[e.jsx(_e,{className:"h-4 w-4"})," Add Goal"]}),e.jsxs(y,{to:"/today?add=reminders",className:"inline-flex items-center gap-1.5 rounded-lg border border-white/15 bg-white/5 text-white text-sm font-medium px-3 py-2 hover:bg-white/10 transition-colors",children:[e.jsx(Se,{className:"h-4 w-4"})," Add Reminder"]})]})]})]})]})}function rs(){const t=Pt(),{entitlements:s}=Et(),{data:r}=Lt(),{courses:l}=Dt(20),{event:c}=Ot(),a=Bt(),d=l.filter(b=>!b.isCompleted).length,p=s.filter(b=>b.status==="active"&&!!b.app_id).length,i=(r==null?void 0:r.total_xp)??0,n=a.unlimited?"Unlimited · Global Pass":a.exhausted?"Free minutes used · Upgrade":`${a.remaining} free min left this month`,w=[{key:"convene",title:"My Convene",caption:"Live rooms · Meet · Teach",to:a.exhausted&&!a.unlimited?"/global-pass":"/convene",icon:Me,status:n,accent:"from-red-500/15 to-transparent border-red-400/30 shadow-[0_0_40px_-10px_rgba(239,68,68,0.55)]",iconTone:"bg-red-500/15 text-red-300"},{key:"identity",title:"My Identity",caption:"ME-Q · PhD in Me · Divine Self",to:"/start",icon:at,status:"Genesis 1:26 · Begin here",accent:"from-amber-500/15 to-transparent border-amber-400/30",iconTone:"bg-amber-500/15 text-amber-300"},{key:"path",title:"My Path",caption:"Continue your active journey",to:"/member-portal",icon:oe,status:d>0?`${d} active course${d===1?"":"s"}`:"Choose your next step",accent:"from-sky-500/10 to-transparent border-sky-400/25",iconTone:"bg-sky-500/15 text-sky-300"},{key:"access",title:"My Access",caption:"Global Pass · Entitlements",to:"/global-pass",icon:rt,status:t.active?`Active${t.tier?" · "+t.tier:""}`:"Explore membership",accent:"from-emerald-500/10 to-transparent border-emerald-400/25",iconTone:"bg-emerald-500/15 text-emerald-300"},{key:"library",title:"My Library",caption:"Books · Research · Word Center",to:"/library",icon:V,status:"Open the shelves",accent:"from-violet-500/10 to-transparent border-violet-400/25",iconTone:"bg-violet-500/15 text-violet-300"},{key:"apps",title:"My Apps",caption:"Owned apps · Bundles · Access",to:"/account/access",secondaryTo:"/apps",secondaryLabel:"Browse more",icon:ne,status:p>0?`${p} unlocked`:"See your access",accent:"from-gold/15 to-transparent border-gold/30",iconTone:"bg-gold/15 text-gold"},{key:"live",title:"My Live",caption:"KCTV · Inspirethon · HG Radio",to:"/inspirethon",icon:lt,status:c?`Next: ${c.label}`:"Check the schedule",accent:"from-rose-500/10 to-transparent border-rose-400/25",iconTone:"bg-rose-500/15 text-rose-300"},{key:"community",title:"My Community",caption:"Discussions · Moments",to:"/community",icon:ce,status:"Join the conversation",accent:"from-indigo-500/10 to-transparent border-indigo-400/25",iconTone:"bg-indigo-500/15 text-indigo-300"},{key:"workboard",title:"My Workboard",caption:"Today · This Week · Later",to:"#daily-work-board",icon:it,status:"Capture what matters today",accent:"from-teal-500/10 to-transparent border-teal-400/25",iconTone:"bg-teal-500/15 text-teal-300",internalAnchor:!0},{key:"proof",title:"My Proof",caption:"Progress · Certificates · XP",to:"/member-portal/progress",icon:J,status:i>
10?`${i.toLocaleString()} XP earned`:"Earn your first badge",accent:"from-fuchsia-500/10 to-transparent border-fuchsia-400/25",iconTone:"bg-fuchsia-500/15 text-fuchsia-300"}];return e.jsxs("section",{"aria-label":"RIGORHQ Home Screen",className:"rounded-2xl border border-gold/15 bg-black/30 p-4",children:[e.jsxs("header",{className:"flex items-end justify-between mb-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.22em] text-gold/80",children:"Home Screen"}),e.jsx("h2",{className:"font-serif text-lg text-white leading-tight",children:"Your RIGORHQ, at a glance"})]}),e.jsx("p",{className:"hidden sm:block text-[11px] text-white/40 italic max-w-[240px] text-right",children:"Identity comes before assignment. The first degree is divine self."})]}),e.jsx("div",{className:"grid gap-2.5",style:{gridTemplateColumns:"repeat(auto-fit, minmax(220px, 1fr))"},children:w.map(b=>e.jsx(ls,{tile:b},b.key))})]})}function ls({tile:t}){const s=t.icon,r=e.jsxs("div",{className:`group h-full rounded-xl border bg-gradient-to-br ${t.accent} p-3 transition-all hover:border-gold/50 hover:-translate-y-0.5`,children:[e.jsxs("div",{className:"flex items-start justify-between mb-2",children:[e.jsx("div",{className:`h-9 w-9 rounded-lg flex items-center justify-center ${t.iconTone}`,children:e.jsx(s,{className:"h-4.5 w-4.5"})}),e.jsx(E,{className:"h-3.5 w-3.5 text-white/30 group-hover:text-gold transition-colors"})]}),e.jsx("div",{className:"font-serif text-sm text-white leading-tight",children:t.title}),e.jsx("div",{className:"text-[10.5px] text-white/50 mt-0.5 leading-snug",children:t.caption}),e.jsx("div",{className:"text-[10.5px] text-gold/80 mt-2 leading-snug truncate",title:t.status,children:t.status}),t.secondaryTo&&t.secondaryLabel&&e.jsxs(y,{to:t.secondaryTo,onClick:l=>l.stopPropagation(),className:"mt-2 inline-block text-[10px] text-white/50 hover:text-gold underline decoration-dotted underline-offset-2",children:[t.secondaryLabel," →"]})]});return t.internalAnchor?e.jsx("a",{href:t.to,className:"block",children:r}):e.jsx(y,{to:t.to,className:"block",children:r})}function is(){const{tasks:t}=xe(),s=o.useMemo(()=>{const l=new Date,c=ot(l,7);return t.filter(a=>a.scheduled_at&&a.status!=="done").filter(a=>{const d=new Date(a.scheduled_at);return d>=new Date(l.getFullYear(),l.getMonth(),l.getDate())&&d<=c}).sort((a,d)=>new Date(a.scheduled_at).getTime()-new Date(d.scheduled_at).getTime()).slice(0,10)},[t]),r=l=>nt(l)?"Today":ct(l)?"Tomorrow":ee(l,"EEE, MMM d");return e.jsxs("section",{className:"rounded-2xl border border-white/10 bg-black/40 p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ie,{className:"h-4 w-4 text-gold"}),e.jsx("h3",{className:"font-serif text-base text-white",children:"Next 7 Days"})]}),e.jsxs(y,{to:"/calendar",className:"text-[11px] text-gold hover:underline inline-flex items-center gap-1",children:["Open ",e.jsx(E,{className:"h-3 w-3"})]})]}),s.length===0?e.jsx("p",{className:"text-xs text-white/40 italic py-6 text-center",children:"Schedule a task to see it on your calendar."}):e.jsx("ul",{className:"space-y-2 max-h-[320px] overflow-y-auto pr-1",children:s.map(l=>{const c=new Date(l.scheduled_at);return e.jsxs("li",{className:"rounded-lg border border-white/10 bg-black/50 px-3 py-2",children:[e.jsxs("p",{className:"text-[10px] uppercase tracking-[0.15em] text-gold/80",children:[r(c)," · ",ee(c,"h:mm a")]}),e.jsx("p",{className:"text-sm text-white leading-tight mt-0.5 truncate",children:l.title}),l.duration_min&&e.jsxs("p",{className:"text-[10px] text-white/40 mt-0.5",children:[l.duration_min," min"]})]},l.id)})})]})}function os(){const{user:t}=Q(),[s,r]=o.useState([]),[l,c]=o.useState(!0),a=o.useCallback(async()=>{if(!t){r([]),c(!1);return}const{data:i}=await C.from("personal_notes").select("*").eq("user_id",t.id).order("created_at",{ascending:!1}).limit(50);r(i||[]),c(!1)},[t==null?void 0:t.id]);o.useEffect(()=>{a()},[a]);const d=o.useCallback(async i=>{if(!t)return null;let n=null;if(i.audioBlob){const b=`${t.id}/${Date.now()}.webm`,{error:N}=await C.storage.from("personal-notes").upload(b,i.audioBlob,{contentType:"audio/webm",upsert:!1});N||(n=b)}const{data:w}=await C.from("personal_notes").insert({user_id:t.id,title:i.title??null,body_text:i.body_text??null,transcript:i.transcript??null,source:i.source,audio_path:n,duration_sec:i.duration_sec??null}).select().single();return w&&r(b=>[w,...b]),w},[t==null?void 0:t.id]),p=o.useCallback(async i=>{r(n=>n.filter(w=>w.id!==i)),await C.from("personal_notes").delete().eq("id",i)},[]);return{notes:s,loading:l,addNote:d,deleteNote:p,reload:a}}function fe(){if(typeof window>"u")return null;const t=window;return t.SpeechRecognition||t.webkitSpeechRecognition||null}function ns(){const{notes:t,addNote:s,deleteNote:r}=os(),{addTask:l}
1=xe(),[c,a]=o.useState(""),[d,p]=o.useState(!1),[i,n]=o.useState(""),[w,b]=o.useState(0),N=o.useRef(null),u=o.useRef([]),x=o.useRef(null),j=o.useRef(null),g=!!fe();o.useEffect(()=>()=>h(),[]);function h(){var f,v;try{(f=N.current)==null||f.stop()}catch{}try{(v=x.current)==null||v.stop()}catch{}j.current&&(window.clearInterval(j.current),j.current=null)}const _=async()=>{n(""),b(0),u.current=[];try{const f=await navigator.mediaDevices.getUserMedia({audio:!0}),v=MediaRecorder.isTypeSupported("audio/webm")?"audio/webm":"",L=new MediaRecorder(f,v?{mimeType:v}:void 0);L.ondataavailable=M=>{M.data.size>0&&u.current.push(M.data)},L.onstop=async()=>{f.getTracks().forEach(O=>O.stop());const M=new Blob(u.current,{type:"audio/webm"}),A=S.current.trim();await s({source:"voice",transcript:A||null,body_text:A||null,title:A?A.split(`
2`)[0].slice(0,80):"Voice note",audioBlob:M,duration_sec:Math.round(I.current)}),n(""),b(0)},N.current=L,L.start();const H=fe();if(H){const M=new H;M.continuous=!0,M.interimResults=!0,M.lang=navigator.language||"en-US",M.onresult=A=>{let O="";for(let G=0;G<A.results.length;G++)O+=A.results[G][0].transcript;n(O)},M.onerror=()=>{};try{M.start()}catch{}x.current=M}j.current=window.setInterval(()=>b(M=>M+1),1e3),p(!0)}catch(f){console.error("mic error",f),alert("Microphone permission was denied or unavailable.")}},S=o.useRef(""),I=o.useRef(0);o.useEffect(()=>{S.current=i},[i]),o.useEffect(()=>{I.current=w},[w]);const F=()=>{p(!1),h()},D=async()=>{const f=c.trim();f&&(await s({source:"typed",body_text:f,title:f.split(`
3`)[0].slice(0,80)}),a(""))},q=async(f,v)=>{if(!v)return;const L=v.split(`
4`)[0].slice(0,120);await l({title:L,notes:v,board_column:"today"})},$=async f=>{const{data:v}=await C.storage.from("personal-notes").createSignedUrl(f,300);v!=null&&v.signedUrl&&new Audio(v.signedUrl).play().catch(()=>{})},B=Ht();return e.jsx(Z,{delay:.05,children:e.jsxs("section",{className:"relative rounded-2xl border border-gold/25 bg-gradient-to-br from-black via-black to-navy/40 p-4 overflow-hidden",children:[e.jsx(be,{children:d&&!B&&e.jsx(T.div,{initial:{opacity:0}
4,animate:{opacity:1},exit:{opacity:0},className:"pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_center,rgba(244,63,94,0.15),transparent_70%)] animate-pulse"},"rec-glow")}),e.jsxs("div",{className:"relative flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(T.span,{animate:B?void 0:{rotate:[0,10,-6,0]},transition:{duration:4,repeat:1/0,ease:"easeInOut"},className:"inline-flex h-8 w-8 items-center justify-center rounded-full border border-gold/40 bg-gold/10 text-gold",children:e.jsx(Y,{className:"h-4 w-4"})}),e.jsx("h2",{className:"font-serif text-lg text-white leading-none",children:"Capture"})]}),!g&&e.jsx("span",{className:"text-[10px] text-amber-300/80",children:"Voice unavailable in this browser"})]}),e.jsxs("div",{className:"relative grid md:grid-cols-[1fr_auto] gap-2",children:[e.jsx("textarea",{value:d?i||"Listening…":c,onChange:f=>!d&&a(f.target.value),onKeyDown:f=>{(f.metaKey||f.ctrlKey)&&f.key==="Enter"&&(R.success(),D())},readOnly:d,placeholder:"Type or tap the mic. ⌘↵ to save.",rows:3,className:k("rounded-lg border bg-black/60 px-3 py-2 text-sm text-white placeholder:text-white/40 focus:outline-none transition-colors",d?"border-rose-400/50 italic":"border-white/10 focus:border-gold/50")}),e.jsxs("div",{className:"flex md:flex-col gap-2",children:[e.jsx(re,{delay:.1,children:e.jsxs("button",{onClick:()=>{d?(R.stop(),F()):(R.record(),_())},onMouseEnter:()=>R.tick(),className:k("w-full inline-flex items-center justify-center gap-1 px-3 py-2 rounded-lg border text-xs font-semibold transition-colors",d?"border-rose-400/60 bg-rose-500/20 text-rose-100":"border-white/15 bg-black/60 text-white hover:border-gold/40"),children:[d?e.jsx(dt,{className:"h-3.5 w-3.5"}):e.jsx(Te,{className:"h-3.5 w-3.5"}),d?`${Math.floor(w/60)}:${String(w%60).padStart(2,"0")}`:"Voice"]})}),e.jsx(re,{delay:.18,children:e.jsxs("button",{onClick:()=>{R.success(),D()},onMouseEnter:()=>R.tick(),disabled:!c.trim()||d,className:"w-full inline-flex items-center justify-center gap-1 px-3 py-2 rounded-lg border border-gold/40 bg-gold/15 text-gold text-xs font-semibold hover:bg-gold/25 disabled:opacity-40",children:[e.jsx(mt,{className:"h-3.5 w-3.5"})," Save"]})})]})]}),d&&!B&&e.jsx("div",{className:"mt-3 flex items-end justify-center gap-1 h-8",children:Array.from({length:22}).map((f,v)=>e.jsx(T.span,{className:"w-1 rounded-full bg-gradient-to-t from-rose-500/40 to-gold",animate:{height:[4,18+v*7%14,6]},transition:{duration:.7+v%5*.1,repeat:1/0,ease:"easeInOut",delay:v*.03}},v))}),t.length>0&&e.jsxs("div",{className:"mt-4 relative",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-[0.2em] text-white/50 mb-2",children:"Recent"}),e.jsx("ul",{className:"space-y-2 max-h-[260px] overflow-y-auto pr-1",children:e.jsx(be,{initial:!1,children:t.slice(0,10).map((f,v)=>e.jsx(T.li,{layout:!0,initial:B?{opacity:0}:{opacity:0,y:12,scale:.96},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,x:-20},transition:{delay:v*.03,type:"spring",stiffness:240,damping:20},className:"rounded-lg border border-white/10 bg-black/50 p-2.5 hover:border-gold/30",children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("p",{className:"text-[10px] text-white/40",children:[ee(new Date(f.created_at),"MMM d, h:mm a")," · ",f.source]}),e.jsx("p",{className:"text-sm text-white whitespace-pre-wrap mt-0.5",children:f.body_text||f.transcript||e.jsx("span",{className:"italic text-white/40",children:"—"})})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[f.audio_path&&e.jsx("button",{onClick:()=>{R.pop(),$(f.audio_path)},className:"p-1.5 rounded hover:bg-white/5 text-gold",title:"Play audio",children:e.jsx(Ie,{className:"h-3.5 w-3.5"})}),e.jsx("button",{onClick:()=>{R.chime(),q(f.id,f.body_text||f.transcript)},className:"p-1.5 rounded hover:bg-white/5 text-emerald-300",title:"Convert to task",children:e.jsx(xt,{className:"h-3.5 w-3.5"})}),e.jsx("button",{onClick:()=>{R.stop(),r(f.id)},className:"p-1.5 rounded hover:bg-rose-500/10 text-rose-300/80",title:"Delete",children:e.jsx(Ce,{className:"h-3.5 w-3.5"})})]})]})},f.id))})})]})]})})}const we=5;function je(){const{user:t}=Q(),[s,r]=o.useState([]),[l,c]=o.useState(!0);return o.useEffect(()=>{let a=!1;return(async()=>{c(!0);const{data:d}=await C.from("library_hub_items").select("id,title,subtitle,short_description,excerpt,description,thumbnail_url,reader_type,content_mode,rights_status,estimated_read_time,external_link,purchase_url,visibility,featured,status,show_in_rigor_reader,show_in_dashboard_reader").eq("show_in_dashboard_reader",!0).eq("show_in_rigor_reader",!0).in("status",["published"]).order("featured",{ascending:!1}).order("sort_order",{ascending:!0}).limit(we+3);if(a)return;const p=(d||[]).filter(i=>i.visibility==="public"?!0:i.visibility==="admin_only"?!1:!!t).slice(0,we);r(p),c(!1)})(),()=>{a=!0}},[t]),l||s.length===0?null:e.jsxs("section",{"aria-labelledby":"rigor-reader-mini-title",className:"rounded-2xl border border-white/10 bg-gradient-to-br from-[#1B2A1F]/70 to-black/40 p-4",children:[e.jsxs("header",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(V,{className:"h-4 w-4 text-[#c9a84c] shrink-0"}),e.jsx("h2",{id:"rigor-reader-mini-title",className:"font-serif text-base text-white truncate",children:"RIGOR Reader"}),e.jsx(X,{className:"bg-[#c9a84c]/20 text-[#c9a84c] border-[#c9a84c]/30 text-[9px] uppercase tracking-wider",children:"Reading Room"})]}),e.jsx(U,{asChild:!0,size:"sm",variant:"ghost",className:"text-[#D2B48C] hover:bg-[#c9a84c]/10 h-7 text-xs",children:e.jsxs(y,{to:"/library/reader",children:["Open Library ",e.jsx(E,{className:"h-3 w-3 ml-1"})]})})]}),e.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-3",children:s.map(a=>{const d=a.content_mode==="source_card"||a.content_mode==="external_link",p=qt(a.rights_status),i=a.visibility==="paid_only"&&!t,n=a.short_description||a.excerpt||a.description||"";return e.jsxs(Ft,{className:"bg-black/40 border-white/10 hover:border-[#c9a84c]/50 transition-colors overflow-hidden flex flex-col",children:[a.thumbnail_url&&e.jsx("div",{className:"aspect-[16/9] overflow-hidden bg-black/50",children:e.jsx("img",{src:a.thumbnail_url,alt:"",loading:"lazy",className:"w-full h-full object-cover"})}),e.jsxs("div",{className:"p-3 flex flex-col gap-2 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[a.featured&&e.jsxs(X,{className:"bg-[#c9a84c]/90 text-black border-0 text-[9px] font-bold uppercase",children:[e.jsx(Y,{className:"h-2.5 w-2.5 mr-0.5"})," Featured"]}),a.reader_type&&e.jsx(X,{variant:"outline",className:"text-[9px] uppercase tracking-wider border-white/20 text-white/70",children:a.reader_type}),a.rights_status&&e.jsx(X,{variant:"outline",className:"text-[9px] uppercase tracking-wider border-[#6
4B8E23]/50 text-[#D2B48C]",children:$t(a.rights_status)})]}),e.jsx("h3",{className:"font-serif text-sm text-white line-clamp-2 leading-snug",children:a.title}),a.subtitle&&e.jsx("p",{className:"text-[11px] text-white/60 line-clamp-1",children:a.subtitle}),n&&e.jsx("p",{className:"text-[11px] text-white/70 line-clamp-2",children:n}),e.jsx("div",{className:"flex items-center gap-2 text-[10px] text-white/50 mt-auto",children:a.estimated_read_time?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(ke,{className:"h-3 w-3"}),a.estimated_read_time," min"]}):null}),i?e.jsxs("div",{className:"rounded-md border border-white/10 bg-black/40 px-2 py-1.5 text-[10px] text-white/70 inline-flex items-center gap-1",children:[e.jsx(ut,{className:"h-3 w-3"})," Sign in to unlock"]}):e.jsx("div",{className:"flex items-center gap-1.5 flex-wrap",children:d?e.jsxs(e.Fragment,{children:[e.jsx(U,{asChild:!0,size:"sm",variant:"outline",className:"h-7 text-[10px] border-[#c9a84c]/40 text-[#D2B48C] hover:bg-[#c9a84c]/10",children:e.jsx(y,{to:`/library/reader/${a.id}`,children:"Read Card"})}),(a.external_link||a.purchase_url)&&e.jsx(U,{asChild:!0,size:"sm",variant:"ghost",className:"h-7 text-[10px] text-white/60 hover:text-[#c9a84c]",children:e.jsxs("a",{href:a.external_link||a.purchase_url,target:"_blank",rel:"noopener noreferrer nofollow",children:["View Source ",e.jsx(Re,{className:"h-3 w-3 ml-1"})]})})]}):e.jsxs(e.Fragment,{children:[e.jsx(U,{asChild:!0,size:"sm",className:"h-7 text-[10px] bg-[#c9a84c] text-black hover:bg-[#c9a84c]/80 font-bold",children:e.jsx(y,{to:`/library/reader/${a.id}`,children:p?"Read Here":"Open"})}),e.jsx(U,{asChild:!0,size:"sm",variant:"ghost",className:"h-7 text-[10px] text-white/60 hover:text-[#c9a84c]",children:e.jsxs(y,{to:`/library/reader/${a.id}`,children:["Full Reader ",e.jsx(E,{className:"h-3 w-3 ml-1"})]})})]})})]})]},a.id)})})]})}function cs(t,s=6,r=5*60*1e3){const[l,c]=o.useState(0),[a,d]=o.useState([]),[p,i]=o.useState(0),[n,w]=o.useState(!0),[b,N]=o.useState(null),u=o.useRef(!0),x=o.useCallback(async(g,h=!1)=>{h||w(!0);try{const{data:_,error:S}=await C.functions.invoke(`kingdom-syndication?feed=${t}&page=${g}&pageSize=${s}`,{method:"GET"});if(S)throw S;if(!u.current)return;d((_==null?void 0:_.items)??[]),i((_==null?void 0:_.total)??0),N(null)}catch(_){if(!u.current)return;N(_ instanceof Error?_.message:"Feed unavailable")}finally{u.current&&w(!1)}},[t,s]);o.useEffect(()=>(u.current=!0,x(l),()=>{u.current=!1}),[x,l]),o.useEffect(()=>{if(!r)return;const g=window.setInterval(()=>void x(l,!0),r);return()=>window.clearInterval(g)},[x,l,r]);const j=Math.max(1,Math.ceil(p/s));return{items:a,total:p,page:l,pageCount:j,loading:n,error:b,setPage:c,refresh:()=>x(l,!0)}}function He(t){if(!t)return null;const s=new Date(t);return Number.isNaN(s.getTime())?null:s.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function ds({item:t,accent:s,onOpen:r}){const l=He(t.date);return e.jsxs(T.button,{type:"button",onClick:()=>r(t),whileHover:{y:-2},transition:{type:"spring",stiffness:260,damping:22},className:"group flex w-full gap-3 rounded-xl border border-white/10 bg-black/25 p-3 text-left hover:border-gold/40 hover:bg-black/40 transition-colors",children:[t.image?e.jsx("img",{src:t.image,alt:t.title,loading:"lazy",decoding:"async",className:"h-16 w-20 sm:h-20 sm:w-28 shrink-0 rounded-lg object-cover border border-white/10"}):e.jsx("div",{className:"h-16 w-20 sm:h-20 sm:w-28 shrink-0 rounded-lg border border-white/10 bg-white/5"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[10px] uppercase tracking-wide",children:[t.category&&e.jsx("span",{className:k("rounded-full border px-2 py-0.5",s),children:t.category}),l&&e.jsx("span",{className:"text-white/50",children:l})]}),e.jsx("h3",{className:"mt-1 font-serif text-sm text-white leading-snug line-clamp-2 group-hover:text-gold transition-colors",children:t.title}),t.summary&&e.jsx("p",{className:"mt-1 text-xs text-white/60 line-clamp-2",children:t.summary}),e.jsxs("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-white/45",children:[e.jsx("span",{className:"truncate",children:t.author||t.organization}),e.jsxs("span",{className:"ml-auto inline-flex items-center gap-1 text-gold opacity-0 group-hover:opacity-100 transition-opacity",children:["Read ",e.jsx(E,{className:"h-3 w-3"})]})]})]})]})}function ms({item:t,accent:s,sourceLabel:r,onClose:l}){const c=t?He(t.date):null;return e.jsx(Ut,{open:!!t,onOpenChange:a=>{a||l()},children:e.jsx(Qt,{side:"right",className:"w-full sm:max-w-lg overflow-y-auto",children:t&&e.jsxs(e.Fragment,{children:[e.jsxs(Wt,{className:"text-left",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[10px] uppercase tracking-wide",children:[t.category&&e.jsx("span",{className:k("rounded-full border px-2 py-0.5",s),children:t.category}),c&&e.jsx("span",{className:"text-muted-foreground",children:c})]}),e.jsx(zt,{className:"font-serif text-xl leading-snug",children:t.title}
4),e.jsx(Kt,{children:[t.author,t.organization||r].filter(Boolean).join(" · ")})]}),t.image&&e.jsx("img",{src:t.image,alt:t.title,loading:"lazy",decoding:"async",className:"mt-4 w-full rounded-xl border border-border object-cover"}),t.summary?e.jsx("p",{className:"mt-4 whitespace-pre-line text-sm leading-relaxed text-foreground/85",children:t.summary}):e.jsx("p",{className:"mt-4 text-sm text-muted-foreground",children:"No summary was published for this item. Open the source to read the full story."}),e.jsxs("div",{className:"mt-6 flex flex-col gap-2 sm:flex-row",children:[e.jsx(U,{asChild:!0,className:"sm:flex-1",children:e.jsxs("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(Re,{className:"mr-2 h-4 w-4"})," Read full story on ",r]})}),e.jsx(U,{variant:"outline",onClick:l,className:"sm:w-auto",children:"Back to dashboard"})]})]})})})}function Fe({feed:t,title:s,subtitle:r,sourceLabel:l,sourceUrl:c,accent:a,icon:d,pageSize:p=5}){const{items:i,page:n,pageCount:w,loading:b,error:N,setPage:u,refresh:x}=cs(t,p),[j,g]=o.useState(null);return e.jsxs(e.Fragment,{children:[e.jsx(Z,{children:e.jsxs("section",{className:"rounded-2xl border border-white/10 bg-black/30 overflow-hidden",children:[e.jsxs("header",{className:"flex flex-wrap items-center gap-3 border-b border-white/10 px-4 py-3",children:[e.jsx("span",{className:k("grid h-8 w-8 place-items-center rounded-lg border",a),children:e.jsx(d,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{className:"font-serif text-base text-white leading-tight",children:s}),e.jsx("p",{className:"text-[11px] text-white/50 truncate",children:r})]}),e.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:x,"aria-label":"Refresh feed",className:"grid h-7 w-7 place-items-center rounded-md border border-white/10 text-white/60 hover:text-gold hover:border-gold/40",children:e.jsx(bt,{className:k("h-3.5 w-3.5",b&&"animate-spin")})}),e.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"text-[11px] text-gold hover:underline whitespace-nowrap",children:l})]})]}),e.jsxs("div",{className:"p-3 space-y-2.5 min-h-[180px]",children:[b&&i.length===0&&Array.from({length:3}).map((h,_)=>e.jsx("div",{className:"h-[92px] rounded-xl border border-white/5 bg-white/5 animate-pulse"},_)),!b&&N&&e.jsx("p",{className:"text-xs text-white/50 px-1 py-6 text-center",children:"This feed is temporarily unavailable. It will reconnect automatically."}),!b&&!N&&i.length===0&&e.jsx("p",{className:"text-xs text-white/50 px-1 py-6 text-center",children:"No published items yet. New releases appear here automatically."}),i.map(h=>e.jsx(ds,{item:h,accent:a,onOpen:g},h.id))]}),w>1&&e.jsxs("footer",{className:"flex items-center justify-between border-t border-white/10 px-4 py-2.5",children:[e.jsxs("button",{type:"button",disabled:n===0,onClick:()=>u(Math.max(0,n-1)),className:"inline-flex items-center gap-1 text-xs text-white/70 disabled:opacity-30 hover:text-gold",children:[e.jsx(gt,{className:"h-3.5 w-3.5"})," Newer"]}),e.jsxs("span",{className:"text-[11px] text-white/45",children:["Page ",n+1," of ",w]}),e.jsxs("button",{type:"button",disabled:n+1>=w,onClick:()=>u(n+1),className:"inline-flex items-center gap-1 text-xs text-white/70 disabled:opacity-30 hover:text-gold",children:["Older ",e.jsx(ft,{className:"h-3.5 w-3.5"})]})]})]})}),e.jsx(ms,{item:j,accent:a,sourceLabel:l,onClose:()=>g(null)})]})}function xs(){return e.jsx(Fe,{feed:"articles",title:"Kingdom Articles & News",subtitle:"Leadership, theology, education & publishing — syndicated from KCiPH",sourceLabel:"kciph.app",sourceUrl:"https://kciph.app/articles",accent:"border-gold/40 bg-gold/10 text-gold",icon:ht})}function us(){return e.jsx(Fe,{feed:"press",title:"Kingdom Press Releases",subtitle:"Announcements, milestones, launches & media coverage — PraiseBreak PR",sourceLabel:"praisebreakpr.com",sourceUrl:"https://praisebreakpr.com/pr/stories",accent:"border-maroon/50 bg-maroon/20 text-white",icon:pt})}function hs(){return e.jsxs("div",{className:"grid gap-5 lg:grid-cols-2 items-start",children:[e.jsx(xs,{}),e.jsx(us,{})]})}const ps=1,bs="b7486817-11ee-4f44-93ab-4686a0b97d93",gs="9a273670-821f-4910-987d-f537ef410205",fs="/__l5e/assets-v1/b7486817-11ee-4f44-93ab-4686a0b97d93/meq-logo.png",ws="a/v1/9a273670-821f-4910-987d-f537ef410205/b7486817-11ee-4f44-93ab-4686a0b97d93/meq-logo.png",js="meq-logo.png",ys=252044,vs="image/png",Ns="2026-07-07T21:45:05Z",_s={version:ps,asset_id:bs,project_id:gs,url:fs,r2_key:ws,original_filename:js,size:ys,content_type:vs,created_at:Ns},qe=[{view:"home",label:"Home",icon:wt,subs:[{label:"Headquarters",to:"/dashboard"},{label:"Today",to:"/today"},{label:"Public Site",to:"/"}]},{view:"journey",label:"My Journey",icon:oe,subs:[{label:"Guided Pathway",to:"/start"},{label:"Progress",to:"/member-portal/progress"},{label:"ME-Q Assessment",to:"/me-q"}]},{view:"learning",label:"Learning",icon:de,subs:[{label:"Courses",to:"/hgi"},{label:"Certifications",to:"/hgi#certs"},{label:"Learning Paths",to:"/phd-in-me"}]},{view:"community",label:"Community",icon:ce,subs:[{label:"Feed",to:"/community"},{label:"Groups",to:"/community#groups"},{label:"Events",to:"/calendar"},{label:"Prayer",to:"/community#prayer"}]},{view:"opportunities",label:"Opportunities",icon:te,subs:[{label:"Jobs & Leadership",to:"/global-leadership"},{label:"Scholarships",to:"/scholarships"},{label:"Partnerships",to:"/institutes/partner"}]},{view:"resources",label:"Resources",icon:Ae,subs:[{label:"Library",to:"/library"},{label:"Books",to:"/word"},{label:"Media",to:"/inspirethon"},{label:"RIGOR Reader",to:"/rigor-reader"}]},{view:"apps",label:"Apps",icon:ne,subs:[{label:"App Store",to:"/apps"},{label:"Institutes",to:"/institutes"},{label:"Global Pass",to:"/global-pass"}]}];function ye({active:t,onSelect:s,className:r}){return e.jsx("nav",{"aria-label":"Primary",className:k("no-scrollbar w-full rounded-2xl border border-gold/15 bg-[hsl(220_50%_16%_/_0.75
4)] backdrop-blur-sm p-2 space-y-2","lg:sticky lg:top-0 lg:max-h-[calc(100vh-140px)] lg:overflow-y-auto",r),children:qe.map(l=>{const c=l.icon,a=t===l.view;return e.jsxs("div",{className:"space-y-0.5",children:[e.jsxs("button",{type:"button",onClick:()=>s(l.view),"aria-current":a?"page":void 0,className:k("w-full flex items-center gap-2.5 px-2.5 py-2 rounded-lg border text-left transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gold/50",a?"bg-gold/15 text-gold border-gold/35":"text-white/85 border-transparent hover:text-white hover:bg-white/5"),children:[e.jsx(c,{className:k("h-4 w-4 shrink-0",a?"text-gold":"text-white/60")}),e.jsx("span",{className:"truncate text-[12px] font-bold uppercase tracking-[0.12em]",children:l.label})]}),e.jsx("div",{className:"pl-3 ml-3 border-l border-white/10 space-y-0.5",children:l.subs.map(d=>e.jsx(y,{to:d.to,className:"block px-2.5 py-1.5 rounded-md text-[12.5px] font-medium text-white/70 hover:text-gold hover:bg-white/5",children:d.label},d.label))})]},l.view)})})}function ks({className:t}){const[s,r]=o.useState([]),[l,c]=o.useState(null),[a,d]=o.useState(!1),p=o.useRef(null);if(o.useEffect(()=>{let n=!1;return(async()=>{const{data:w}=await C.from("homepage_reels").select("id, title, category, video_url, thumbnail_url, display_order").eq("is_active",!0).order("display_order",{ascending:!0}).limit(14);n||r(w??[])})(),()=>{n=!0}},[]),s.length===0)return null;const i=l===null?null:s[l]??null;return e.jsxs(e.Fragment,{children:[e.jsx("section",{"aria-label":"Featured reels",className:k("rounded-2xl border border-gold/20 bg-[hsl(220_50%_16%_/_0.7)] p-3",t),children:e.jsx("div",{className:"no-scrollbar flex gap-3 overflow-x-auto",children:s.map((n,w)=>e.jsxs("button",{type:"button",onClick:()=>{c(w),d(!1)},className:"group shrink-0 w-[86px] text-left focus-visible:outline-none",children:[e.jsx("span",{className:"block rounded-full p-[2px] bg-gradient-to-tr from-gold via-amber-400 to-rose-400",children:e.jsx("span",{className:"block rounded-full p-[2px] bg-[hsl(220_58%_11%)]",children:e.jsxs("span",{className:"relative block h-[74px] w-[74px] overflow-hidden rounded-full bg-black/60",children:[n.thumbnail_url?e.jsx("img",{src:n.thumbnail_url,alt:n.title,loading:"lazy",className:"h-full w-full object-cover transition-transform group-hover:scale-105"}):e.jsx("video",{src:n.video_url,muted:!0,playsInline:!0,preload:"metadata",className:"h-full w-full object-cover"}),e.jsx("span",{className:"absolute inset-0 flex items-center justify-center bg-black/25",children:e.jsx(jt,{className:"h-5 w-5 text-white drop-shadow"})})]})})}),e.jsx("span",{className:"mt-1.5 block truncate text-[11px] font-medium text-white/80 text-center",children:n.title})]},n.id))})}),e.jsx(Ge,{open:i!==null,onOpenChange:n=>!n&&c(null),children:e.jsx(Ue,{className:"max-w-md border-gold/30 bg-black p-0 overflow-hidden",children:i&&e.jsxs("div",{className:"relative",children:[e.jsx("video",{ref:p,src:i.video_url,poster:i.thumbnail_url??void 0,autoPlay:!0,muted:a,playsInline:!0,controls:!1,controlsList:"nodownload noplaybackrate",disablePictureInPicture:!0,onContextMenu:n=>n.preventDefault(),onEnded:()=>c(n=>n!==null&&n+1<s.length?n+1:null),className:"w-full max-h-[78vh] bg-black object-contain"},i.id),e.jsxs("div",{className:"absolute top-2 right-2 flex gap-2",children:[e.jsx("button",{type:"button","aria-label":a?"Unmute":"Mute",onClick:()=>d(n=>!n),className:"h-9 w-9 rounded-full bg-black/60 text-white flex items-center justify-center hover:bg-black/80",children:a?e.jsx(yt,{className:"h-4 w-4"}):e.jsx(Ie,{className:"h-4 w-4"})}),e.jsx("button",{type:"button","aria-label":"Close",onClick:()=>c(null),className:"h-9 w-9 rounded-full bg-black/60 text-white flex items-center justify-center hover:bg-black/80",children:e.jsx(vt,{className:"h-4 w-4"})})]}),e.jsx("p",{className:"absolute bottom-0 inset-x-0 bg-gradient-to-t from-black/85 to-transparent px-4 pb-4 pt-8 text-sm font-semibold text-white",children:i.title})]})})})]})}const Cs=[{label:"My Profile",to:"/member-portal/profile",icon:_t},{label:"Messages",to:"/member-portal/messages",icon:kt},{label:"Notifications",to:"/member-portal",icon:Se},{label:"My Progress",to:"/member-portal/progress",icon:de}
4,{label:"My Network",to:"/community#network",icon:ce},{label:"Organizations",to:"/institutes",icon:Pe}],Ss=[{label:"Apps",to:"/apps",icon:ne},{label:"Library",to:"/library",icon:V},{label:"Community",to:"/community",icon:K},{label:"Opportunities",to:"/global-leadership",icon:te},{label:"Convene",to:"/convene",icon:Me},{label:"Store",to:"/merchandise",icon:Ee},{label:"Give",to:"/give",icon:Le},{label:"Settings",to:"/account-settings",icon:Ct}];function Ms({name:t,role:s,headline:r,avatarUrl:l,className:c}){const{user:a,signOut:d}=Q(),p=t.split(" ").map(i=>i[0]).slice(0,2).join("");return e.jsxs("aside",{className:k("no-scrollbar space-y-3 lg:sticky lg:top-[76px] lg:max-h-[calc(100vh-96px)] lg:overflow-y-auto",c),"aria-label":"Profile and quick access",children:[e.jsxs("div",{className:"rounded-2xl border border-gold/20 bg-black/40 backdrop-blur-sm p-4 text-center",children:[e.jsx(y,{to:"/member-portal/profile",className:"inline-block",children:l?e.jsx("img",{src:l,alt:`${t} profile photo`,className:"h-20 w-20 rounded-full object-cover border-2 border-gold/50 mx-auto"}):e.jsx("span",{className:"h-20 w-20 rounded-full bg-gradient-to-br from-gold/35 to-amber-700/20 border-2 border-gold/50 flex items-center justify-center text-gold text-xl font-bold mx-auto",children:p})}),e.jsx("p",{className:"mt-2.5 text-sm font-bold text-white truncate",children:t}),e.jsx("p",{className:"text-[11px] font-medium text-white/70 truncate",children:r??"The Headquarters of Becoming"}),e.jsx("span",{className:"mt-1.5 inline-block text-[9px] font-bold px-1.5 py-0.5 rounded bg-gold/15 text-gold border border-gold/30 uppercase tracking-wider",children:s}),(a==null?void 0:a.email)&&e.jsx("p",{className:"mt-2 text-[11px] font-medium text-white/50 truncate",children:a.email}),e.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2",children:[e.jsx(y,{to:"/member-portal/profile",className:"px-2 py-1.5 rounded-lg text-[11px] font-bold bg-gold/15 text-gold border border-gold/35 hover:bg-gold/25",children:"View Profile"}),e.jsx(y,{to:"/account-settings",className:"px-2 py-1.5 rounded-lg text-[11px] font-bold text-white/85 border border-white/15 hover:bg-white/5",children:"Edit Profile"})]})]}),e.jsx("div",{className:"rounded-2xl border border-white/10 bg-black/40 backdrop-blur-sm p-2",children:Cs.map(({label:i,to:n,icon:w})=>e.jsxs(y,{to:n,className:"flex items-center gap-2.5 px-2.5 py-2 rounded-lg text-[13px] font-semibold text-white/85 hover:text-gold hover:bg-white/5",children:[e.jsx(w,{className:"h-4 w-4 shrink-0 text-white/60"}),e.jsx("span",{className:"truncate",children:i})]},i))}),e.jsxs("div",{className:"rounded-2xl border border-white/10 bg-black/40 backdrop-blur-sm p-3",children:[e.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.18em] text-gold/80 mb-2",children:"Command"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:Ss.map(({label:i,to:n,icon:w})=>e.jsxs(y,{to:n,className:"flex flex-col items-center justify-center gap-1 py-2.5 rounded-xl border border-white/10 text-white/80 hover:text-gold hover:border-gold/40 hover:bg-white/5 transition-colors",children:[e.jsx(w,{className:"h-4 w-4"}),e.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",children:i})]},i))}),e.jsxs("button",{type:"button",onClick:()=>d(),className:"mt-2 w-full flex items-center justify-center gap-2 px-2 py-2 rounded-lg text-[12px] font-bold text-white/70 border border-white/10 hover:text-rose-300 hover:border-rose-400/40",children:[e.jsx(Nt,{className:"h-3.5 w-3.5"})," Sign Out"]})]})]})}const Ts=["Discover","Develop","Deploy","Demonstrate","Duplicate"],Is={Beginner:0,Developing:1,Activated:2,Multiplying:3};function Rs({name:t}){const{user:s}=Q(),[r,l]=o.useState(null),[c,a]=o.useState({}),[d,p]=o.useState(null),[i,n]=o.useState(null);o.useEffect(()=>{if(!s)return;let g=!1;return(async()=>{var L,H,M,A;const h=async O=>{try{return await O}catch{return null}},[_,S,I,F,D]=await Promise.all([h(C.from("user_progression_state").select("current_state, total_xp").eq("user_id",s.id).maybeSingle()),h(C.from("user_entitlements").select("id",{count:"exact",head:!0}).eq("user_id",s.id).eq("app_id","global_pass").eq("status","active")),h(C.from("profiles").select("avatar_url").eq("id",s.id).maybeSingle()),h(C.from("member_profiles").select("headshot_url").eq("user_id",s.id).maybeSingle()),h(C.from("me_q_submissions").select("score, max_score, identity_type, created_at").eq("user_id",s.id).order("created_at",{ascending:!1}).limit(1).maybeSingle())]);if(g)return;const q=_==null?void 0:_.data;q&&l({state:q.current_state||"Beginner",total_xp:q.total_xp||0}),a({passTier:((S==null?void 0:S.count)||0)>0?"Active":void 0});const $=(L=I==null?void 0:I.data)==null?void 0:L.avatar_url,B=(H=F==null?void 0:F.data)==null?void 0:H.headsh
4ot_url,f=((M=s==null?void 0:s.user_metadata)==null?void 0:M.avatar_url)||((A=s==null?void 0:s.user_metadata)==null?void 0:A.picture);p($||B||f||null);const v=D==null?void 0:D.data;v&&typeof v.score=="number"&&n({score:v.score,max:v.max_score||100,identity_type:v.identity_type||null})})(),()=>{g=!0}},[s==null?void 0:s.id]);const b=r?Is[r.state]??0:0,N=(r==null?void 0:r.state)==="Multiplying"?r.total_xp:(r==null?void 0:r.state)==="Activated"?1500:(r==null?void 0:r.state)==="Developing"?750:250,u=r?Math.min(100,Math.round(r.total_xp/N*100)):0,x=[oe,le,se,J,z],j=t.split(" ").filter(Boolean).slice(0,2).map(g=>{var h;return(h=g[0])==null?void 0:h.toUpperCase()}).join("")||"U";return e.jsx(Z,{children:e.jsxs("section",{className:"relative rounded-2xl border border-gold/25 bg-gradient-to-br from-[hsl(345_48%_16%)] via-[hsl(345_42%_11%)] to-[hsl(348_38%_8%)] overflow-hidden",children:[e.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-40","aria-hidden":!0,children:[...Array(18)].map((g,h)=>e.jsx(T.span,{className:"absolute h-1 w-1 rounded-full bg-gold",style:{to
4p:`${h*37%100}%`,left:`${h*53%100}%`},animate:{opacity:[.1,.9,.1],scale:[.6,1.4,.6]},transition:{duration:2+h%5*.6,repeat:1/0,ease:"easeInOut",delay:h*.15}},h))}),e.jsx(T.div,{"aria-hidden":!0,className:"pointer-events-none absolute -top-24 -right-24 h-72 w-72 rounded-full bg-gold/10 blur-3xl",animate:{scale:[1,1.15,1],opacity:[.35,.55,.35]},transition:{duration:8,repeat:1/0,ease:"easeInOut"}}),e.jsxs("div",{className:"relative p-6",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("h1",{className:"font-serif text-2xl md:text-3xl text-white leading-tight",children:[e.jsx(We,{text:`${At()}, ${t}`,accent:t.split(" ").slice(-1)[0],accentClassName:"text-gold"})," ",e.jsx(T.span,{className:"inline-block",animate:{rotate:[0,-12,10,0],y:[0,-3,0]},transition:{duration:3.5,repeat:1/0,ease:"easeInOut"},children:e.jsx(z,{className:"inline h-6 w-6 text-gold -mt-1"})})]}),e.jsx(Z,{delay:.4,children:e.jsxs("p",{className:"mt-2 flex flex-wrap items-center gap-2 text-[11px] uppercase tracking-[0.3em] text-gold/80 font-semibold",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(le,{className:"h-3 w-3"})," Become"]}),e.jsx("span",{className:"text-white/20",children:"·"}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(se,{className:"h-3 w-3"})," Build"]}),e.jsx("span",{className:"text-white/20",children:"·"}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(De,{className:"h-3 w-3"})," Broadcast"]})]})})]}),e.jsxs(y,{to:"/member-portal/profile",className:"shrink-0 relative group","aria-label":"Open profile",children:[e.jsx(T.div,{"aria-hidden":!0,className:"absolute inset-0 rounded-full bg-gradient-to-tr from-gold via-amber-400 to-rose-400 blur-md opacity-70",animate:{rotate:360,scale:[1,1.08,1]},transition:{rotate:{duration:14,repeat:1/0,ease:"linear"},scale:{duration:3.5,repeat:1/0,ease:"easeInOut"}}}),e.jsxs(T.div,{className:"relative h-16 w-16 md:h-20 md:w-20 rounded-full border-2 border-gold overflow-hidden bg-black flex items-center justify-center shadow-[0_0_25px_rgba(212,175,55,0.35)]",whileHover:{scale:1.08},whileTap:{scale:.96},transition:{type:"spring",stiffness:260,damping:18},children:[d?e.jsx("img",{src:d,alt:t,className:"h-full w-full object-cover"}):e.jsx("span",{className:"font-serif text-xl md:text-2xl text-gold",children:j}),e.jsx(T.span,{"aria-hidden":!0,className:"absolute inset-0 rounded-full border-2 border-gold/60",animate:{scale:[1,1.3],opacity:[.6,0]},transition:{duration:2.2,repeat:1/0,ease:"easeOut"}})]})]})]}),e.jsxs("div",{className:"mt-6 grid lg:grid-cols-[260px_1fr] gap-5 items-center",children:[e.jsx(re,{delay:.2,hover:!0,children:e.jsxs("div",{className:"rounded-xl border border-gold/25 bg-black/60 p-4 relative overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(T.div,{className:"h-16 w-16 rounded-xl bg-gradient-to-br from-gold/40 via-amber-700/20 to-black border border-gold/40 flex items-center justify-center relative",animate:{rotate:[0,4,-4,0],scale:[1,1.05,1]},transition:{duration:5,repeat:1/0,ease:"easeInOut"},children:[e.jsx(Tt,{className:"h-8 w-8 text-gold"}),e.jsx(T.span,{className:"absolute inset-0 rounded-xl border border-gold/50",animate:{opacity:[.2,.7,.2],scale:[1,1.15,1]},transition:{duration:2.4,repeat:1/0}})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] uppercase tracking-[0.18em] text-white/60",children:"State"}),e.jsx("p",{className:"font-serif text-lg text-white leading-tight",children:(r==null?void 0:r.state)||"Ready"}),r&&e.jsxs("span",{className:"inline-block mt-1 text-[10px] font-semibold px-2 py-0.5 rounded border border-gold/40 text-gold",children:[r.total_xp," XP"]})]})]}),e.jsxs("div",{className:"mt-3",children:[e.jsx("div",{className:"h-1.5 bg-white/10 rounded-full overflow-hidden",children:e.jsx(T.div,{className:"h-full bg-gradient-to-r from-gold via-amber-400 to-gold",initial:{width:0},animate:{width:`${Math.max(u,r?2:6)}%`},transition:{delay:.5,duration:1.2,ease:"easeOut"}})}),e.jsx("p",{className:"text-[11px] text-white/60 mt-1",children:r?`${u}% → next`:"Begin your identity journey"})]}),e.jsxs(y,{to:"/me-q",onClick:()=>R.chime(),className:"mt-3 group relative flex items-center gap-3 rounded-lg border border-gold/40 bg-gradient-to-r from-black via-navy/60 to-black px-3 py-2 hover:border-gold hover:shadow-[0_0_18px_rgba(212,175,55,0.35)] transition","aria-label":i?"View ME-Q results":"Start ME-Q assessment",children:[e.jsx(T.img,{src:_s.url,alt:"ME-Q · My Identity Intelligence Quotient",className:"h-10 w-auto shrink-0 drop-shadow-[0_2px_6px_rgba(212,175,55,0.45)]",animate:{y:[0,-2,0]},transition:{duration:3.2,repeat:1/0,ease:"easeInOut"}}),e.jsx("div",{className:"min-w-0 flex-1",children:i?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-[10px] uppercase tracking-[0.2em] text-gold/80 font-semibold",children:"ME-Q Score"}),e.jsxs("p",{className:"text-sm text-white font-serif leading-tight",children:[e.jsx("span",{className:"text-gold text-lg font-bold",children:i.score}),e.jsxs("span",{className:"text-white/50 text-xs",children:[" / ",i.max]}),i.identity_type&&e.jsxs("span",{className:"ml-2 text-[10px] uppercase tracking-wider text-white/60",children:["· ",i.identity_type]})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-[10px] uppercase tracking-[0.2em] text-gold/80 font-semibold",children:"Start ME-Q"}),e.jsx("p",{className:"text-xs text-white/70 leading-tight",children:"Discover your identity intelligence."})]})}),e.jsx(E,{className:"h-4 w-4 text-gold group-hover:translate-x-0.5 transition-transform"})]})]})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] uppercase tracking-[0.22em] text-gold/70 mb
4-3 text-center lg:text-left font-semibold",children:"Journey"}),e.jsxs(ue,{className:"relative flex items-center justify-between",delay:.35,stagger:.09,children:[e.jsx("div",{className:"absolute inset-x-6 top-[22px] h-px bg-gradient-to-r from-gold/30 via-white/15 to-white/5"}),Ts.map((g,h)=>{const _=x[h]||se,S=h<b,I=h===b;return e.jsxs(T.div,{variants:he,whileHover:{y:-4,scale:1.08},onHoverStart:()=>R.pop(),onClick:()=>R.chime(),className:"relative flex flex-col items-center gap-2 cursor-pointer",children:[e.jsxs("div",{className:k("h-11 w-11 rounded-full border-2 flex items-center justify-center text-xs font-semibold relative",S&&"bg-emerald-500/20 border-emerald-400 text-emerald-300",I&&"bg-gold/20 border-gold text-gold",!S&&!I&&"bg-white/5 border-white/15 text-white/40"),children:[I&&e.jsx(T.span,{className:"absolute inset-0 rounded-full border-2 border-gold",animate:{scale:[1,1.35,1],opacity:[.7,0,.7]},transition:{duration:2,repeat:1/0,ease:"easeOut"}}),S?"✓":e.jsx(_,{className:k("h-4 w-4",I&&"text-gold")})]}),e.jsx("span",{className:k("text-[10px] uppercase tracking-wider",I?"text-gold font-semibold":"text-white/50"),children:g})]},g)})]})]})]}),e.jsx(ue,{className:"mt-6 grid grid-cols-2 lg:grid-cols-4 gap-3",delay:.55,stagger:.06,children:[{label:"Institute",value:c.institute||"—",icon:Pe,tone:"emerald"},{label:"Cohort",value:c.cohort||"—",icon:K,tone:"violet"},{label:"Certification",value:c.certification||"—",icon:Oe,tone:"amber"},{label:"Global Pass",value:c.passTier||"Off",icon:z,tone:"sky"}].map(g=>e.jsxs(T.div,{variants:he,whileHover:{y:-3,scale:1.03},onHoverStart:()=>R.tick(),className:"rounded-xl border border-white/10 bg-black/40 p-3 flex items-center gap-3 hover:border-gold/30 transition-colors cursor-default",children:[e.jsx(T.div,{className:k("h-9 w-9 rounded-lg flex items-center justify-center border",g.tone==="emerald"&&"bg-emerald-500/10 border-emerald-500/30 text-emerald-300",g.tone==="violet"&&"bg-violet-500/10 border-violet-500/30 text-violet-300",g.tone==="amber"&&"bg-amber-500/10 border-amber-500/30 text-amber-300",g.tone==="sky"&&"bg-sky-500/10 border-sky-500/30 text-sky-300"),whileHover:{rotate:[0,-8,8,0]},transition:{duration:.6},children:e.jsx(g.icon,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-[0.16em] text-white/50",children:g.label}),e.jsx("p",{className:"text-sm font-semibold text-white truncate",children:g.value})]})]},g.label))})]})]})})}function As(){const{user:t}=Q(),[s,r]=o.useState(void 0);return o.useEffect(()=>{if(!t){r(null);return}let l=!1;return(async()=>{var c;try{const{data:a}=await C.from("course_week_progress").select("course_id, week_number, updated_at, courses(title)").eq("user_id",t.id).is("completed_at",null).order("updated_at",{ascending:!1}).limit(1),d=(a||[])[0];
4l||r(d?{courseId:d.course_id,week:d.week_number,title:((c=d.courses)==null?void 0:c.title)||"Continue your course"}:null)}catch{l||r(null)}})(),()=>{l=!0}},[t==null?void 0:t.id]),e.jsxs("section",{className:"grid lg:grid-cols-2 gap-5",children:[e.jsxs("div",{className:"rounded-2xl border border-white/10 bg-black/40 p-4",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-[0.2em] text-gold/80 font-semibold",children:"Continue Learning"}),e.jsxs("div",{className:"mt-3 flex gap-4",children:[e.jsx("div",{className:"h-24 w-24 rounded-xl bg-gradient-to-br from-indigo-900 via-navy to-black border border-white/10 flex items-center justify-center shrink-0",children:e.jsx(V,{className:"h-8 w-8 text-sky-300/80"})}),e.jsx("div",{className:"flex-1 min-w-0",children:s===void 0?e.jsx("p",{className:"text-xs text-white/50",children:"Loading…"}):s?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"font-serif text-base text-white leading-tight truncate",children:s.title}),e.jsxs("p",{className:"text-xs text-white/60 mt-1",children:["Week ",s.week]}),e.jsx("div",{className:"mt-3 flex items-center gap-2",children:e.jsx(y,{to:`/courses/${s.courseId}?week=${s.week}`,className:"inline-flex items-center gap-1 text-xs font-semibold px-3 py-1.5 rounded-md bg-violet-500/20 border border-violet-400/40 text-violet-100 hover:bg-violet-500/30",children:"Resume Learning"})})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"font-serif text-base text-white leading-tight",children:"No course in progress"}),e.jsx("p",{className:"text-xs text-white/60 mt-1",children:"Start a course to see it here."}),e.jsx(y,{to:"/hgi",className:"mt-3 inline-flex items-center gap-1 text-xs font-semibold px-3 py-1.5 rounded-md bg-gold/15 border border-gold/40 text-gold hover:bg-gold/25",children:"Browse Courses"})]})})]})]}),e.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/40 p-4",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-[0.2em] text-gold/80 font-semibold",children:"Quick Access"}),e.jsx("div",{className:"mt-3 grid grid-cols-2 sm:grid-cols-4 lg:grid-cols-5 gap-2.5",children:[{label:"My Courses",icon:de,to:"/dashboard#academic-core"},{label:"My Cohorts",icon:K,to:"/community"},{label:"My Certificates",icon:Oe,to:"/member-portal/progress"},{label:"Assessments",icon:It,to:"/me-q"},{label:"Library",icon:Ae,to:"/library"},{label:"Messages",icon:Ne,to:"/member-portal/messages"},{label:"Groups",icon:K,to:"/community"},{label:"Events",icon:ie,to:"/community#events"},{label:"My Rigor Reader",icon:Be,to:"/rigor-reader",image:ze.url},{label:"My Tools",icon:Rt,to:"/word"},{label:"Rigor Regalia",icon:Ee,to:"/merchandise"},{label:"RHQ Podcast",icon:Te,to:"/podcast"}].map(l=>e.jsxs(y,{to:l.to,className:"group relative rounded-xl border border-border/60 bg-card/50 p-3 flex flex-col items-center justify-center gap-1.5 text-foreground/85 hover:border-gold/40 hover:text-gold hover:bg-card/80 transition-colors",children:[l.image?e.jsx("img",{src:l.image,alt:"",className:"h-6 w-6 rounded-full object-cover"}):e.jsx(l.icon,{className:"h-4 w-4 text-muted-foreground group-hover:text-gold transition-colors"}),e.jsx("span",{className:"text-[10px] font-semibold text-center leading-tight",children:l.label})]},l.label))})]})]})}const Ps=[{title:"Grow Spiritually",count:8,icon:Y,tone:"from-amber-700/40 to-black",border:"border-amber-500/30"},{title:"Improve My Marriage",count:5,icon:Le,tone:"from-rose-700/40 to-black",border:"border-rose-500/30"},{title:"Make More Money",count:7,icon:J,tone:"from-emerald-700/40 to-black",border:"border-emerald-500/30"},{title:"Start A Ministry",count:6,icon:z,tone:"from-violet-700/40 to-black",border:"border-violet-500/30"},{title:"Build A Business",count:6,icon:te,tone:"from-sky-700/40 to-black",border:"border-sky-500/30"},{title:"Heal & Restore",count:9,icon:me,tone:"from-teal-700/40 to-black",border:"border-teal-500/30"}];function Es(){return e.jsxs("section",{children:[e.jsxs("div",{className:"flex items-end justify-between mb-3",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"font-serif text-lg text-white",children:["Discover Solutions ",e.jsx("span",{className:"text-white/40 text-sm font-sans",children:"(RIGORHQ App Store)"})]}),e.jsx("p",{className:"text-xs text-white/60",children:"The PhD In Me Systems™ — find systems, tools, and communities to grow your purpose."})]}),e.jsx(y,{to:"/apps",className:"text-xs text-gold hover:underline",children:"Open App Store →"})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3",children:Ps.map(t=>e.jsxs(y,{to:"/apps",className:k("relative rounded-2xl border bg-gradient-to-br p-4 h-44 flex flex-col justify-between hover:scale-[1.015] transition-transform",t.tone,t.border),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(t.icon,{className:"h-5 w-5 text-gold"}),e.jsxs("span",{className:"text-[10px] uppercase tracking-wider text-white/60",children:[t.count," Systems"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] text-white/60 uppercase tracking-wider",children:"I Want To"}),e.jsx("p",{className:"font-serif text-base text-white leading-tight",children:t.title}),e.jsxs("span",{className:"mt-2 inline-flex items-center gap-1 text-[11px] font-semibold text-gold",children:["Launch ",e.jsx(E,{className:"h-3 w-3"})]})]})]},t.title))})]})}const Ls=[{name:"LoveAndGrowRich.app",tag:"Build wealth. Build legacy.",icon:J,to:"/apps"},{name:"KingdomCulture.app",tag:"Live and lead the culture.",icon:z,to:"/apps"},{name:"Theotherapy",tag:"Healing for mind, soul & spirit.",icon:me,to:"/apps"},{name:"Bible Scholar",tag:"Study. Understand. Apply.",icon:Be,to:"/bible"},{name:"KCTV",tag:"Kingdom content for the world.",icon:De,to:"/inspirethon"}];function ve(){return e.jsxs("section",{children:[e.jsx("h2",{className:"font-serif text-lg text-white mb-3",children:"RIGORHQ App Store · Highlights"}
4),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3",children:Ls.map(t=>e.jsxs(y,{to:t.to,className:"rounded-2xl border border-white/10 bg-black/50 overflow-hidden hover:border-gold/40 transition-colors group",children:[e.jsxs("div",{className:"h-24 bg-gradient-to-br from-navy/60 via-black to-black flex items-center justify-center border-b border-white/5 relative overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_center,rgba(212,175,55,0.12),transparent_70%)]"}),e.jsx(t.icon,{className:"h-8 w-8 text-gold/80 group-hover:scale-110 transition-transform relative"})]}),e.jsxs("div",{className:"p-3",children:[e.jsx("p",{className:"text-sm font-semibold text-white",children:t.name}),e.jsx("p",{className:"text-[11px] text-white/60 mt-0.5",children:t.tag})]})]},t.name))})]})}function na(){const t=$e(),{user:s,isLoading:r,isAdmin:l,hasStaffAccess:c,isFaculty:a,isMember:d}=Q(),[p,i]=o.useState(null),[n,w]=o.useState(null),[b,N]=o.useState("home");o.useEffect(()=>{!r&&!s&&t("/auth")},[s,r,t]),o.useEffect(()=>{s&&(async()=>{var h;const[{data:j},{data:g}]=await Promise.all([C.from("member_profiles").select("display_name, headshot_url").eq("user_id",s.id).maybeSingle(),C.from("profiles").select("avatar_url").eq("id",s.id).maybeSingle()]);j&&i(j),w((j==null?void 0:j.headshot_url)||(g==null?void 0:g.avatar_url)||((h=s.user_metadata)==null?void 0:h.avatar_url)||null)})()},[s]);const u=o.useMemo(()=>{var g,h;const j=(p==null?void 0:p.display_name)||((g=s==null?void 0:s.user_metadata)==null?void 0:g.full_name)||((h=s==null?void 0:s.email)==null?void 0:h.split("@")[0])||"Scholar";return j.startsWith("Dr.")?j:`Dr. ${j.split(" ").slice(-1)[0]}`},[p,s]),x=l?"Administrator":c?"Staff":a?"Faculty":d?"Member":"Student";return e.jsx(Ke,{message:"You must verify your email before entering Headquarters.",children:e.jsxs("div",{className:"fixed inset-x-0 bottom-0 top-[var(--site-header-h,96px)] z-30 bg-gradient-to-b from-[hsl(220_55%_14%)] via-[hsl(220_58%_11%)] to-[hsl(220_60%_9%)] text-white overflow-hidden flex flex-col",children:[e.jsx("nav",{"aria-label":"Workspace sections",className:"md:hidden no-scrollbar flex gap-2 overflow-x-auto px-3 py-2 border-b border-white/10 bg-[hsl(220_58%_11%_/_0.9)]",children:qe.map(j=>e.jsx("button",{type:"button",onClick:()=>N(j.view),className:k("shrink-0 rounded-full border px-3.5 py-2 text-[12px] font-bold uppercase tracking-[0.1em] transition-colors",b===j.view?"bg-gold/20 text-gold border-gold/40":"bg-white/5 text-white/75 border-white/10"),children:j.label},j.view))}),e.jsx("main",{"data-scroll-container":!0,className:"no-scrollbar flex-1 overflow-y-auto overscroll-contain",children:e.jsxs("div",{className:"mx-auto max-w-[1800px] px-3 lg:px-5 py-4 lg:py-5 pb-6",children:[e.jsx(ks,{className:"mb-4 lg:mb-6"}),e.jsxs("div",{className:"grid gap-4 lg:gap-6 md:grid-cols-[240px_minmax(0,1fr)] lg:grid-cols-[248px_minmax(0,1fr)_284px] xl:grid-cols-[264px_minmax(0,1fr)_300px] items-start",children:[e.jsx(ye,{active:b,onSelect:N,className:"hidden md:block"}),e.jsxs("div",{className:"min-w-0 space-y-5",children:[e.jsx(Ds,{view:b,name:u}),e.jsx(ye,{active:b,onSelect:N,className:"md:hidden"})]}),e.jsx(Ms,{name:u,role:x,avatarUrl:n,className:"hidden lg:block"})]})]})}),e.jsx(Vt,{className:"shrink-0 rounded-none border-x-0 border-b-0 border-t border-gold/20 bg-[hsl(220_58%_11%_/_0.95)]"})]})})}function Ds({view:t,name:s}){return t==="community"?e.jsxs(e.Fragment,{children:[e.jsx(W,{title:"Community",subtitle:"Updates, achievements, events, and people across RIGORHQ."}),e.jsx(Yt,{filter:"all",pageSize:15})]}):t==="journey"?e.jsxs(e.Fragment,{children:[e.jsx(W,{title:"My Journey",subtitle:"Your daily becoming work, calendar, and captures."}),e.jsx(ge,{}),e.jsxs("div",{className:"grid lg:grid-cols-[1fr_320px] gap-5 items-start",children:[e.jsx(ss,{}),e.jsx(is,{})]}),e.jsx(ns,{})]}):t==="learning"?e.jsxs(e.Fragment,{children:[e.jsx(W,{title:"Learning",subtitle:"Courses, cohorts, certifications, and paths."}),e.jsx(es,{}),e.jsx(As,{})]}):t==="resources"?e.jsxs(e.Fragment,{children:[e.jsx(W,{title:"Resources",subtitle:"Reader, library, media, and research."}),e.jsx(je,{}),e.jsx(Gt,{}),e.jsx(Qe,{variant:"dark"}),e.jsx(hs,{})]}
4):t==="apps"?e.jsxs(e.Fragment,{children:[e.jsx(W,{title:"Apps",subtitle:"Your systems, platforms, and institutes."}),e.jsx(rs,{}),e.jsx(Es,{}),e.jsx(ve,{})]}):t==="opportunities"?e.jsxs(e.Fragment,{children:[e.jsx(W,{title:"Opportunities",subtitle:"Leadership, scholarships, partnerships, and service."}),e.jsx("div",{className:"grid sm:grid-cols-2 gap-3",children:[{to:"/global-leadership",label:"Jobs & Leadership",icon:te},{to:"/scholarships",label:"Scholarships",icon:St},{to:"/institutes/partner",label:"Partnerships",icon:Mt},{to:"/charities",label:"Volunteering",icon:me}].map(r=>e.jsxs(y,{to:r.to,className:"flex items-center gap-3 rounded-xl border border-white/10 bg-black/40 px-4 py-3 hover:border-gold/40 hover:bg-white/5 transition-colors",children:[e.jsx(r.icon,{className:"h-4 w-4 text-gold"}),e.jsx("span",{className:"text-sm font-semibold text-white",children:r.label}),e.jsx(E,{className:"h-4 w-4 text-white/40 ml-auto"})]},r.label))}),e.jsx(ve,{})]}):e.jsxs(e.Fragment,{children:[e.jsx(Rs,{name:s}),e.jsx(Jt,{}),e.jsx(ge,{}),e.jsx(je,{})]})}function W({title:t,subtitle:s}){return e.jsxs("header",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[e.jsx("h1",{className:"font-serif text-2xl font-semibold text-white",children:t}),e.jsx("p",{className:"text-[13px] font-medium text-white/70",children:s})]})}export{na 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.