1import{r as o,j as e}from"./vendor-query-Cpjl6gpd.js";import{Z as N,b,A as v,B as x,s as w}from"./index-CPnQ97PF.js";import{C as m,a as d}from"./card-CYK9gNoR.js";import{b as l,V as C}from"./vibe-shift-content-CfKogdy8.js";import{P as u}from"./PortalHeader-BK9AlQub.js";import y from"./confetti.module-CZ9IzIrC.js";import{m as a}from"./proxy-B4G-aOz9.js";import{T as _}from"./trophy-CxOEPvvp.js";import{S as E}from"./sparkles-CgA1Szov.js";import{H as F}from"./house-BOaV26N1.js";import{c as S,L as f}from"./vendor-react-ClNFnALs.js";import"./vendor-ui-AHajMRc9.js";import"./bunny-stream-DB9S9tQI.js";import"./use-portal-data-Cj3d3dEo.js";import"./avatar-D7O0dhm4.js";import"./globe-DVeOF4Wt.js";import"./log-out-DKZosRBA.js";function J(){const{courseId:i}=S(),{user:c}=N(),[p,h]=o.useState([]),[g,j]=o.useState(!0);return o.useEffect(()=>{const t=Date.now()+3e3,n=()=>{y({particleCount:3,angle:60,spread:55,origin:{x:0},colors:["#9b87f5","#D6BCFA","#F2FCE2"]}),y({particleCount:3,angle:120,spread:55,origin:{x:1},colors:["#9b87f5","#D6BCFA","#F2FCE2"]}),Date.now()<t&&requestAnimationFrame(n)};n()},[]),o.useEffect(()=>{(async()=>{if(!c||!i)return;const{data:t}=await w.from("challenge_responses").select("day_number, gratitude_response").eq("user_id",c.id).eq("course_id",i).order("day_number");if(t){const n=t.filter(r=>r.gratitude_response).map(r=>({day:r.day_number,theme:C[r.day_number]?.theme||`Day ${r.day_number}`,response:r.gratitude_response}));h(n)}j(!1)})()},[c,i]),g?e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-background via-accent/5 to-primary/5",children:[e.jsx(u,{}),e.jsx("div",{className:"flex items-center justify-center min-h-[60vh]",children:e.jsx("div",{className:"w-8 h-8 border-2 border-primary border-t-transparent rounded-full animate-spin"})})]}):e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-background via-primary/10 to-accent/10",children:[e.jsx(u,{}),e.jsxs("main",{className:"container max-w-2xl mx-auto px-4 py-8 space-y-8",children:[e.jsxs(a.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:"text-center space-y-6",children:[e.jsx(a.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.3,type:"spring",stiffness:200},className:"w-24 h-24 mx-auto rounded-full bg-gradient-to-br from-primary to-primary/70 flex items-center justify-center shadow-lg",children:e.jsx(_,{className:"w-12 h-12 text-primary-foreground"})}),e.jsx(a.h1,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.4},className:"text-4xl md:text-5xl font-bold text-foreground",children:l.title}),e.jsx(a.p,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.5},className:"text-xl text-muted-foreground",children:l.subtitle})]}),e.jsx(a.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.6},children:e.jsx(m,{className:"border-primary/20 bg-gradient-to-br from-background to-primary/5",children:e.jsx(d,{className:"p-6 md:p-8",children:e.jsx("p",{className:"text-lg text-muted-foreground leading-relaxed text-center",children:l.message})})})}),p.length>0&&e.jsxs(a.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.7},className:"space-y-4",children:[e.jsxs("h2",{className:"text-xl font-semibold text-foreground flex items-center gap-2",children:[e.jsx(b,{className:"w-5 h-5 text-primary"}),"Your Gratitude Journey"]}),e.jsx("div",{className:"space-y-3",children:p.map((s,t)=>e.jsx(a.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.8+t*.1},children:e.jsx(m,{className:"border-accent/20",children:e.jsx(d,{className:"p-4",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-accent/20 flex items-center justify-center shrink-0",children:e.jsx("span",{className:"text-sm font-bold text-accent-foreground",children:s.day})}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm font-medium text-muted-foreground mb-1",children:["Day ",s.day,": ",s.theme]}),e.jsxs("p",{className:"text-foreground",children:['"',s.response,'"']})]})]})})})},s.day))})]}),e.jsxs(a.div,{initial:{opacity:0,y:20}
1,animate:{opacity:1,y:0},transition:{delay:1},className:"space-y-4",children:[e.jsxs("h2",{className:"text-xl font-semibold text-foreground flex items-center gap-2",children:[e.jsx(E,{className:"w-5 h-5 text-primary"}),"What's Next?"]}),e.jsx(m,{className:"border-secondary/30",children:e.jsx(d,{className:"p-6",children:e.jsx("ul",{className:"space-y-3",children:l.nextSteps.map((s,t)=>e.jsxs(a.li,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:1.1+t*.1},className:"flex items-start gap-3",children:[e.jsx(v,{className:"w-5 h-5 text-primary mt-0.5 shrink-0"}),e.jsx("span",{className:"text-muted-foreground",children:s})]},t))})})})]}),e.jsxs(a.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:1.3},className:"flex flex-col sm:flex-row gap-4 justify-center pt-4",children:[e.jsx(x,{asChild:!0,size:"lg",className:"gap-2",children:e.jsxs(f,{to:"/portal",children:[e.jsx(F,{className:"w-5 h-5"}),"Return to Portal"]})}),e.jsx(x,{asChild:!0,variant:"outline",size:"lg",className:"gap-2",children:e.jsx(f,{to:`/portal/courses/${i}`,children:"Review Challenge"})})]})]})]})}export{J 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.