PageSourceSearch

https://stepup.one/assets/ModuleList-67ICLran.js

js stepup.one collected 2026-10-02 23:38:51 UTC 5,898 bytes, 1 lines download raw bytes

1import{j as e,r as x}from"./client-BL7zgfj8.js";import{u as z,s as l}from"./App-Lc7KrvjH.js";import{d as P}from"./landingCapture-Bi4VhJiO.js";import{c as A}from"./utils-DG_QnriQ.js";import{B as q}from"./book-open-Ch0hj8Eh.js";import{C as T}from"./clock-Cx1IPKIo.js";import{T as B}from"./trophy-BHJE3fSm.js";import{C as E}from"./circle-check-CtexJiLe.js";import"./main-DBNnQIP9.js";import"./public-brand-C3WeamsF.js";import"./index-Dh9noGnp.js";import"./chevron-down-CfaJy2Ic.js";import"./x-DhP5J42q.js";import"./bundle-mjs-CJM1tISp.js";const L={not_started:{label:"Not Started",className:"bg-gray-100 text-gray-500"},in_progress:{label:"In Progress",className:"bg-amber-50 text-amber-600"},passed:{label:"Passed",className:"bg-green-50 text-green-600"},failed:{label:"Retry Available",className:"bg-red-50 text-red-500"}};function R({slug:r,title:d,description:n,estimatedMinutes:g,passingScore:p,readingProgress:c,quizStatus:m,bestScore:u,hasCertificate:t}){const s=P(),i=L[m];return e.jsxs("button",{onClick:()=>s(`/academy/modules/${r}`),className:"w-full text-left p-6 md:p-8 rounded-sm border border-gray-100 bg-white hover:border-gray-300 hover:shadow-md transition-all group",children:[e.jsxs("div",{className:"flex items-start justify-between mb-4",children:[e.jsx("div",{className:"w-10 h-10 bg-gray-50 rounded-sm flex items-center justify-center text-black group-hover:bg-black group-hover:text-white transition-all",children:e.jsx(q,{className:"w-5 h-5"})}),e.jsx("span",{className:A("text-[10px] font-mono tracking-widest uppercase px-2 py-1 rounded-sm",i.className),children:i.label})]}),e.jsx("h3",{className:"text-lg font-serif italic text-black mb-2 group-hover:underline",children:d}),n&&e.jsx("p",{className:"text-sm text-gray-400 font-light leading-relaxed mb-5 line-clamp-2",children:n}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex justify-between mb-1.5",children:[e.jsx("span",{className:"text-[9px] font-mono text-gray-300 tracking-widest uppercase",children:"Reading Progress"}),e.jsxs("span",{className:"text-[9px] font-mono text-gray-400 tracking-wider",children:[c,"%"]})]}),e.jsx("div",{className:"w-full h-1 bg-gray-100 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-black rounded-full transition-all duration-500",style:{width:`${c}%`}})})]}),e.jsxs("div",{className:"flex items-center gap-4 text-[10px] font-mono text-gray-400 tracking-wider",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(T,{className:"w-3 h-3"})," ",g," min"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(B,{className:"w-3 h-3"})," Pass: ",p,"%"]}),u!==null&&e.jsxs("span",{className:"flex items-center gap-1",children:["Best: ",u,"%"]}),t&&e.jsxs("span",{className:"flex items-center gap-1 text-green-500",children:[e.jsx(E,{className:"w-3 h-3"})," Certified"]})]})]})}function Y(){const{user:r}=z(),[d,n]=x.useState([]),[g,p]=x.useState(new Map),[c,m]=x.useState(!0);x.useEffect(()=>{u()},[r]);const u=async()=>{if(!r)return;const{data:t}=await l.from("suo_modules").select("*").eq("is_published",!0).order("sort_order");if(!t){m(!1);return}n(t);const{data:s}=await l.from("suo_sections").select("id, module_id"),{data:i}=await l.from("suo_reading_progress").select("section_id, completed").eq("user_id",r.id),{data:f}=await l.from("suo_quiz_attempts").select("quiz_id, score, passed").eq("user_id",r.id),{data:h}=await l.from("suo_quizzes").select("id, module_id"),{data:b}=await l.from("suo_certificates").select("module_id").eq("user_id",r.id),y=new Map;for(const o of t){const N=(s==null?void 0:s.filter(a=>a.module_id===o.id))||[],C=N.filter(a=>i==null?void 0:i.some(S=>S.section_id===a.id&&S.completed)),w=N.length>0?Math.round(C.length/N.length*100):0,v=h==null?void 0:h.find(a=>a.module_id===o.id),j=v?(f==null?void 0:f.filter(a=>a.quiz_id===v.id))||[]:[];let _="not_started",k=null;j.length>0?(k=Math.max(...j.map(a=>Number(a.score))),_=j.some(a=>a.passed)?"passed":"failed"):w>0&&(_="in_progress");const M=(b==null?void 0:b.some(a=>a.module_id===o.id))||!1;y.set(o.id,{moduleId:o.id,readingProgress:w,quizStatus:_,bestScore:k,hasCertificate:M})}p(y),m(!1)};return c?e.jsxs("div",{children:[e.jsxs("div",{className:"mb-10",children:[e.jsx("p",{className:"text-[10px] font-mono text-gray-400 tracking-widest uppercase mb-3",children:"Training Modules"}),e.jsx("h1",{className:"text-3xl md:text-4xl font-serif italic text-black",children:"All Modules"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-6",children:[1,2,3].map(t=>
1e.jsx("div",{className:"h-64 rounded-sm border border-gray-100 bg-gray-50 animate-pulse"},t))})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"mb-10",children:[e.jsx("p",{className:"text-[10px] font-mono text-gray-400 tracking-widest uppercase mb-3",children:"Training Modules"}),e.jsx("h1",{className:"text-3xl md:text-4xl font-serif italic text-black mb-2",children:"All Modules"}),e.jsx("p",{className:"text-sm text-gray-400 font-light",children:"Complete each module by reading all sections and passing the quiz."})]}),d.length===0?e.jsxs("div",{className:"text-center py-20 border border-gray-100 rounded-sm",children:[e.jsx(q,{className:"w-8 h-8 text-gray-200 mx-auto mb-4"}),e.jsx("p",{className:"text-sm text-gray-400 font-light",children:"No modules available yet. Content is being prepared."})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-6",children:d.map(t=>{const s=g.get(t.id);return e.jsx(R,{slug:t.slug,title:t.title,description:t.description,estimatedMinutes:t.estimated_minutes,passingScore:t.passing_score,readingProgress:(s==null?void 0:s.readingProgress)??0,quizStatus:(s==null?void 0:s.quizStatus)??"not_started",bestScore:(s==null?void 0:s.bestScore)??null,hasCertificate:(s==null?void 0:s.hasCertificate)??!1},t.id)})})]})}export{Y as ModuleList,Y 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.