PageSourceSearch

https://theascensionapp.lovable.app/assets/LessonView-DKxbuPBF.js

js theascensionapp.lovable.app collected 2026-10-03 03:49:51 UTC 4,156 bytes, 2 lines download raw bytes

1import{g as w,u as C,r as l,j as e,L as S,h as k,m as v,B as L,a as M,s as o}from"./index-5bs4z68M.js";import{u as q}from"./useAuth-b_JHNWa5.js";import{A as h}from"./AppNav-865s7D5S.js";import{u as A,M as E}from"./GlossaryHighlighter-5l2Osdum.js";import{C as B}from"./clock-ByJNGFFL.js";import{C as j}from"./circle-check-Dv5PTzX-.js";import"./index-BL6TXDJb.js";const G=()=>{const{stageSlug:c,lessonSlug:x}=w(),{user:i}=q(),{toast:N}=C(),[t,y]=l.useState(null),[u,p]=l.useState(!1),[f,g]=l.useState(!1),{highlightText:d}=A();l.useEffect(()=>{(async()=>{const{data:s}=await o.from("ascension_stages").select("id").eq("slug",c).maybeSingle();if(!s)return;const{data:a}=await o.from("lessons").select("*").eq("stage_id",s.id).eq("slug",x).maybeSingle();if(a&&(y(a),i)){const{data:r}=await o.from("user_progress").select("completed").eq("user_id",i.id).eq("lesson_id",a.id).maybeSingle();r!=null&&r.completed&&p(!0)}})()},[c,x,i]);const b=async()=>{if(!i||!t)return;g(!0);const{error:n}=await o.from("user_progress").upsert({user_id:i.id,lesson_id:t.id,completed:!0,completed_at:new Date().toISOString()},{onConflict:"user_id,lesson_id"});n||(await o.from("user_streaks").upsert({user_id:i.id,practice_date:new Date().toISOString().split("T")[0]},{onConflict:"user_id,practice_date"}),p(!0),N({title:"✦ Lesson Complete",description:"Your progress has been saved."})),g(!1)};if(!t)return e.jsxs("div",{className:"min-h-screen cosmic-gradient star-field sacred-geometry",children:[e.jsx(h,{}),e.jsx("div",{className:"container py-16 text-center text-muted-foreground",children:"Loading..."})]});const _=n=>n.split(`
2`).map((s,a)=>
2{if(s.startsWith("### "))return e.jsx("h3",{className:"mt-6 mb-2 font-display text-lg font-semibold text-foreground",children:s.replace("### ","")},a);if(s.startsWith("## "))return e.jsx("h2",{className:"mt-8 mb-3 font-display text-xl font-bold text-foreground",children:s.replace("## ","")},a);if(s.startsWith("- ")){const r=s.replace("- ","");return e.jsx("li",{className:"ml-4 list-disc text-muted-foreground leading-relaxed",children:d(m(r))},a)}if(s.match(/^\d+\.\s/)){const r=s.replace(/^\d+\.\s/,"");return e.jsx("li",{className:"ml-4 list-decimal text-muted-foreground leading-relaxed",children:d(m(r))},a)}return s.trim()===""?e.jsx("br",{},a):e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:d(m(s))},a)}),m=n=>n.replace(/\*\*(.+?)\*\*/g,"$1").replace(/\*(.+?)\*/g,"$1");return e.jsxs("div",{className:"min-h-screen cosmic-gradient star-field sacred-geometry",children:[e.jsx(h,{}),e.jsxs("main",{className:"container max-w-2xl py-12 px-4",children:[e.jsxs(S,{to:`/ascension/${c}`,className:"mb-8 inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[e.jsx(k,{className:"h-4 w-4"}),"Back to stage"]}),e.jsxs(v.article,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-3 text-xs text-muted-foreground",children:[e.jsx("span",{className:"uppercase tracking-widest",children:t.lesson_type==="practice"?"Practice":"Lesson"}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(B,{className:"h-3 w-3"}),t.duration_minutes," min"]}),u&&e.jsxs("span",{className:"flex items-center gap-1 text-primary",children:[e.jsx(j,{className:"h-3 w-3"}),"Completed"]})]}),e.jsx("h1",{className:"font-display text-3xl font-bold sm:text-4xl",children:t.title}),t.subtitle&&e.jsx("p",{className:"mt-2 text-lg text-muted-foreground",children:t.subtitle})]}),t.media_url&&e.jsx(E,{url:t.media_url}),e.jsx("div",{className:"prose-cosmic space-y-1",children:t.content&&_(t.content)}),e.jsx("div",{className:"mt-12 border-t border-border/50 pt-8 text-center",children:u?e.jsxs("div",{className:"flex items-center justify-center gap-2 text-primary",children:[e.jsx(j,{className:"h-5 w-5"}),e.jsx("span",{className:"font-display font-semibold",children:"Lesson Complete"})]}):e.jsxs(L,{onClick:b,disabled:f,className:"cosmic-glow px-8",children:[e.jsx(M,{className:"mr-2 h-4 w-4"}),f?"Saving...":"Mark as Complete"]})})]})]})]})};export{G 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.