PageSourceSearch

https://app.century.tech/assets/Course-ClDW90-U.js

js century.tech collected 2026-09-24 09:17:32 UTC 16,158 bytes, 1 lines download raw bytes

1import{j as e,c as B,bs as ne,r as d,bF as Me,aF as oe,a3 as ie,aj as Ae,Y as Pe,gj as Le,bi as H,G as z,et as J,bd as E,m as ae,M as ce,ae as I,e as x,aJ as $,e1 as le,a1 as Re,S as de,H as Ee,gk as _e,gl as we,X as Oe,bu as ke,bx as De}from"./index-D83OPrL5.js";import{ag as Be,W as j,bz as W,ae as ue,br as L,bs as pe,Q as p,R as X,U as w,V as O,X as k,c as Ue,d as Fe,B as Ve,e as He,b9 as Y,_ as ze,bA as We,bB as K,ao as _,ak as Ge,bC as Q,au as G,av as $e,M as Z,bD as ee,bw as Qe}from"./AppTemplate-4nKKFM5k.js";import{u as qe,C as Je}from"./useNuggetPath-BKOjsIFZ.js";import{m as Xe}from"./index-B1NIE-OO.js";import{S as Ye}from"./SearchBox-o6HOLq3q.js";import{T as Ke}from"./useLogin-gOhnuXe5.js";import{C as se,a as te}from"./PercentageBar-Bi95LF6V.js";import{w as Ze,u as es}from"./ErrorBoundary-DV-Wud-8.js";import"./AccessIllustration-C-K-QNH4.js";import"./SessionError-Ct87nne5.js";import"./c3po-CKT89GAP.js";import"./behaviours-DxKjOcZV.js";import"./rlp.graphql-DGdIrIPa.js";import"./useQuery-4UlWzMoZ.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"[email protected]"};var s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="29ece828-945b-4189-8408-c5b2ee7110f2",t._sentryDebugIdIdentifier="sentry-dbid-29ece828-945b-4189-8408-c5b2ee7110f2")}catch{}})();const me=({children:t,classNameExt:s,qa:r})=>e.jsx("div",{className:B("cds-accordian",s&&s),"data-testid":r,children:t}),ge=({children:t,qa:s,isDisabled:r,isDisbaled:i,isOpen:o=!1})=>{var a;const u=(a=r??i)!==null&&a!==void 0?a:!1;return e.jsx("div",{className:B("cds-accordian__section",o&&"cds-accordian__section--open",u&&"cds-accordian__section--disabled"),"data-testid":s,children:t})},he=({children:t,qa:s,onClick:r})=>e.jsx("button",{className:"cds-accordian__trigger",onClick:r,"data-testid":s,children:t}),fe=({children:t,qa:s})=>e.jsx("div",{className:"cds-accordian__content","data-testid":s,children:t}),xe=({children:t,qa:s})=>e.jsx("div",{className:"cds-accordian__header","data-testid":s,children:t}),D=({children:t,qa:s})=>e.jsx("span",{className:"cds-accordian__status","data-testid":s,children:t}),ss=t=>{if(!t||typeof t!="string")return t;const s=t.trim().split(" ");if(s.length===1)return e.jsx(D,{children:s[0]});const r=s.pop(),i=s.join(" ");return e.jsxs(e.Fragment,{children:[i," ",e.jsx(D,{children:r})]})},je=({children:t,qa:s,sectionTitle:r})=>{const i=ss(r);return e.jsx("div",{className:"cds-accordian__title","data-testid":s,children:i})};Object.assign(me,{Section:ge,Status:D,Trigger:he,Content:fe,Header:xe,Title:je});let re=!1;const C=Object.assign(t=>(re||(re=!0,console.warn("[CDS] CdsAccordian is deprecated and will be removed in a future major release. Use CdsAccordion instead.")),e.jsx(me,Object.assign({},t))),{displayName:"CdsAccordian",Section:ge,Status:D,Trigger:he,Content:fe,Header:xe,Title:je});C.Section.displayName="CdsAccordion.Section";C.Status.displayName="CdsAccordion.Status";C.Trigger.displayName="CdsAccordion.Trigger";C.Content.displayName="CdsAccordion.Content";C.Header.displayName="CdsAccordion.Header";C.Title.displayName="CdsAccordion.Title";const ts=({children:t,classNameExt:s,qa:r})=>e.jsx("div",{className:B("cds-jump-navigation",s&&s),"data-testid":r,children:t}),Ce=({children:t,disabled:s,isCurrent:r,id:i})=>e.jsx("div",Object.assign({className:B("cds-jump-navigation__item",r&&"cds-jump-navigation__item--current",s&&"cds-jump-navigation__item--disabled")},i&&{id:i},{children:t})),q=Object.assign(ts,{Item:Ce});q.displayName="JumpNavigation";Ce.displayName="JumpNavigation.Item";const rs=()=>{const{studyGroupId:t}=ne(),[s,r]=d.useState(null),[i,o]=d.useState(null),[a,u]=d.useState(null),[c,m]=d.useState(null),[h,n]=d.useState(!1),[f,b]=d.useState(!1),{getApi:S}=Me(),y=oe(),T=ie(),N=Ae(),M=Pe(T,"learn-courses","nuggetMode"),l=typeof M=="string"?M:N?"linear-complete":"linear",g=Le(),A=(!s||!i||!a)&&h||f&&!c,P=qe(s,l,"standard",t,T,1200);d.useEffect(()=>{!P.nuggetPathLoading&&!P.nuggetPathError&&P.nuggetPathNugget&&o(P.nuggetPathNugget.nuggets)},[P.nuggetPathLoading,o]),d.useEffect(()=>{(async()=>
1{if(!(s&&a||h))try{const[v,F]=await Promise.all([S(H.Learn,2,`/courses/${t}`),S(H.Accounts,2,`/study-groups/${t}`)]);v.search="select=icon,iconCode,subject,completion",z({url:v,token:y.current}).then(V=>r(V)),z({url:F,token:y.current}).then(V=>u(V)),n(!0)}catch{J(new Error("Unable to fetch study group"),"error",{tags:{studyGroupId:t}})}})()},[t,T,s,a,h,S,y]),d.useEffect(()=>{(async()=>{try{if(a&&!c&&!f){const v=await S(H.Learn,void 0,`/courses/courseplans/${a.coursePlan}`);z({url:v,token:y.current}).then(F=>m(F)),b(!0)}}catch{J(new Error("Unable to fetch courseplan"),"error",{tags:{coursePlan:a?.coursePlan}})}})()},[c,f,a,S,y]);const ye=d.useMemo(()=>c&&s?ns(c,s):null,[c,s]),Te=d.useMemo(()=>c&&s?os(c,s,N):null,[c,s,N]),Ne=d.useMemo(()=>!i||!s?null:is(i,s),[i,s]);return{course:s,studyGroupInfo:a,loadingData:A,nuggetList:Ne,strands:ye,topics:Te,courseCompletion:c&&s?as(c,s,g):null}};function ns(t,s){const r=[];if(s.strands=s.strands?s.strands.filter(i=>i.name.indexOf("Diagnostic")===-1):[],s.strands.length>0){const i=t.length>0?t[0].strands:void 0;s.strands.forEach((o,a)=>{const u=i?.find(c=>c.strandId===o.id);r.push({id:o.id,name:o.name,nuggetIds:o.nuggets.map(c=>typeof c=="string"?c:c._id),completion:u?Math.round(u.nuggetsPercentProgress/100):0,score:u?Math.round(u.percentScore/100):0,extraClass:a===0?"current-strand":""})})}return r}function os(t,s,r){const i=[];if(s.topics=s.topics?s.topics.filter(o=>r||o.name.indexOf("Diagnostic")===-1):[],s.topics.length>0){const o=t.length>0?t[0].strands:void 0;s.topics.forEach((a,u)=>{const c=o?.find(m=>m.strandId===a.topicId);i.push({id:a.topicId,name:a.name,subtopics:a.subtopics.map(m=>({id:m.subtopicId,name:m.name,nuggetIds:m.nuggets.map(h=>h.nuggetId)})),completion:c?Math.round(c.nuggetsPercentProgress/100):0,score:c?Math.round(c.percentScore/100):0,extraClass:u===0?"current-strand":""})})}return i}function is(t,s){return t.map(r=>{const i=!!r.lastResult?.endTime&&r.lastResult.endTime!==r.activity?.lastAttempt?.endTime;let o=null;for(const a of s.topics){for(const u of a.subtopics)if(u.nuggets.some(m=>r.nugget.nuggetId===m.nuggetId)){o={topicId:a.topicId,topicName:a.name,subtopicId:u.subtopicId,subtopicName:u.name};break}if(o)break}return{id:r.nugget.nuggetId,bestResult:r.activity?E(r.activity.bestAttempt.percentScore):null,lastCompletion:E(r.lastResult?.percentComplete),lastResult:E(r.activity?.lastAttempt.percentScore),currentResult:i?E(r.lastResult?.percentScore):null,totalAttempts:r.activity?r.activity.totalAttempts:0,strand:r.courses[0].strands[0].name,topicId:o?.topicId,topicName:o?.topicName,subtopicId:o?.subtopicId,subtopicName:o?.subtopicName,subject:r.courses[0].subject.name,name:r.nugget.name,hasIncompleteAttempt:i,type:r.orderingFactorMainContributor.orderingFactorType,hasNoQuestions:r.activity?r.activity.bestAttempt.percentScore===-1:!1}})}function as(t,s,r){return t.length===0?null:{courseId:s._id,courseName:s.name,coursePlanId:t[0].coursePlanId,userName:r,isCompletable:s.completion&&s.completion.isCompletable||!1,progress:Math.round((t[0].nuggetsPercentProgress||0)/100),score:Math.round((t[0].percentScore||0)/100),nuggetsCompleted:t[0].nuggetsCompleted,nuggetsInCourse:t[0].nuggetsInCourse,hasCertificate:s.completion&&s.completion.hasCertificate||!1,iconCode:s.iconCode||"",icon:s.icon,subject:s.subject}}function cs(t,s,r){return r.trim()===""?t:t.filter(i=>{const o=s(i);return o?o.toLowerCase().match(r.toLowerCase().replace(/(\W)/g,"\\$1"))!==null:!1})}const be=()=>{const t=Be();return d.useCallback((r,i,o)=>{!r||!i?.current||(t||o?i.current.querySelector(`[id="${r}"]`)?.scrollIntoView({inline:"center",block:"nearest",behavior:"smooth"}):Xe.scroller.scrollTo(r,{container:i.current,delay:200,duration:800,isDynamic:!0,smooth:"easeInOutQuart"}))},[t])},Ie=d.createContext({course:null,nuggetList:null,strands:null,topics:null,studyGroupInfo:null,courseCompletion:null,loadingData:!1,filteredNuggets:[],filter:"",setFilter:t=>{},scrollToNugget:(t,s)=>{},nuggetListRef:null}),R=()=>d.useContext(Ie),ls=t=>{const s=rs(),[r,i]=d.useState(""),o=d.useRef(null),a=d.useMemo(()=>s.nuggetList?cs(s.nuggetList,m=>m.name,r):[],[s.nuggetList,r]),u=be(),c=(m,h)=>{const n=h.nuggetIds.find(f=>a?.some(b=>b.id===f));!n||!o?.current||(u(n,o),ae.track(ce.LearnCourseTopicSelection,{[I.CourseId]:s.course?.courseId,[I.CourseName]:s.course?.name,[I.TopicId]:m.id,[I.TopicName]:m.name,[I.SubtopicId]:h.id,[I.SubtopicName]:h.name}))};return e.jsx(Ie.Provider,{value:{...s,filteredNuggets:a,filter:r,setFilter:i,scrollToNugget:c,nuggetListRef:o},children:t.children})},ds=()=>{const{courseCompletion:t}=R();return t?e.jsxs(j,{children:[e.jsx(j.Header,{children:e.jsx(j.Title,{children:e.jsx(x,{id:"course-nuggets-course-progress",defaultMessage:"Course Progress"})})}),e.jsx(j.Body,{children:e.jsxs(W,{children:[e.jsx(W.Rings,{children:e.jsx(ue,{completionPercentage:t.progress,scorePercentage:t.score,size:48})}),e.jsx(W.Legend,{children:e.jsxs(L,{direction:pe.ROW,children:[e.jsxs(p,{size:X.MEDIUM,children:[e.jsxs(p.Label,{children:[e.jsx(p.Indicator,{children:e.jsx(w,{type:k.COMPLETION,size:O.MEDIUM,score:t.progress})}),e.jsx(x,{id:"course-nuggets-last-completion",defaultMessage:"Completion"})]}),e.jsxs(p.Value,{children:[t.progress,e.jsx(p.Unit,{children:"%"}),e.jsxs(p.Total,{children:[t.nuggetsCompleted,"/",t.nuggetsInCourse]})]})]}),e.jsxs(p,{size:X.MEDIUM,children:[e.jsxs(p.Label,{children:[e.jsx(p.Indicator,{children:e.jsx(w,{type:k.SCORE,size:O.MEDIUM,score:t.score})}),e.jsx(x,{id:"average-score",defaultMessage:"Average Score"})]}),e.jsxs(p.Value,{children:[t.score,e.jsx(p.Unit,{children:"%"})]})]})]})})]})}),e.jsx("br",{}),e.jsx(Je,{size:"tiny",courseCompletion:t,pageName:"study-session"})]}):null},us=t=>e.jsx(Ue,{children:e.jsxs(Fe,{children:[e.jsx(Ve,{children:e.jsx($,{to:"/learn/my-courses",children:e.jsx(x,{id:"go-back",defaultMessage:"go-back"})})}),e.jsxs(He,{children:[e.jsx("h1",{children:t.courseName}),e.jsx(Y,{children:e.jsx(Y.Item,{children:e.jsx($,{to:"/learn/my-courses",children:e.jsx(x,{id:"study-session-breadcrumb-main-path-default",defaultMessage:"go-back"})})})})]})]})}),Se=t=>{const{filteredNuggets:s,scrollElementSelector:r=".cds-widget__body--scrollable"}=t,[i,o]=d.useState(null),[a,u]=d.useState(null);return d.useEffect(()=>{const c=document.querySelector(r);if(!c||!s)return;const m=n=>n.getBoundingClientRect().top>=c.getBoundingClientRect().top,h=()=>{const n=s?.find(f=>{const b=document.getElementById(f.id);return!!(b&&m(b))});n?.subtopicId&&a!==n?.subtopicId&&(o(n?.topicId),u(n?.subtopicId))};return h(),c.addEventListener("scroll",le.throttle(h,500)),()=>c.removeEventListener("scroll",h)},[a,s,r]),{currentActiveTopic:i,currentActiveSubtopic:a}},ps=t=>{const{addBreadcrumb:s,clearBreadcrumbs:r}=d.useContext(ze),{filteredNuggets:i}=t,{course:o}=R(),{studyGroupId:a}=ne(),u=Re(),[c,m]=d.useState(void 0),h=oe();return d.useEffect(()=>{r(),s({title:u.formatMessage({id:"study-session-breadcrumb-main-path-default",defaultMessage:"My Courses"}),path:"/learn/my-courses"}),s({title:o?.name||"",path:`/learn/study-groups/${a}`})},[a,u,o,s,r]),Se({filteredNuggets:i}),d.useEffect(()=>{o?.icon&&We(o.icon,h.current,m)},[o,h]),i?e.jsx(K,{children:i.map(n=>e.jsx(K.Item,{children:e.jsx($,{id:n.id,to:`/learn/my-courses/study-groups/${a}/nuggets/${n.id}/?startedFrom=${n.type}`,state:{reason:n.type,viewLocation:"MyCourses"},children:e.jsxs(_,{children:[e.jsx(_.Thumbnail,{children:e.jsx(ue,{completionPercentage:n.lastCompletion,scorePercentage:n.lastResult,size:112,children:e.jsx(Ge,{item:{iconCode:o?.iconCode,subject:n.subject,iconUrl:c}})})}),e.jsxs(_.Main,{children:[e.jsx(_.Structure,{children:e.jsxs("ul",{children:[e.jsx("li",{children:n.topicName}
1),e.jsx("li",{children:n.subtopicName})]})}),e.jsx(Ee.ItemTitleBig,{children:n.name}),(!!n.lastCompletion||!!n.lastResult||!!n.bestResult)&&e.jsxs(L,{direction:pe.ROW,children:[e.jsx(L.Item,{children:e.jsxs(p,{children:[e.jsxs(p.Label,{children:[e.jsx(p.Indicator,{children:e.jsx(w,{type:k.COMPLETION,size:O.SMALL,score:n.lastCompletion||0})}),e.jsx(x,{id:"course-nuggets-last-completion",defaultMessage:"Completion"})]}),e.jsxs(p.Value,{children:[n.lastCompletion||0,e.jsx(p.Unit,{children:"%"})]})]})}),e.jsx(L.Item,{children:e.jsxs(p,{children:[e.jsxs(p.Label,{children:[e.jsx(p.Indicator,{children:e.jsx(w,{type:k.SCORE,size:O.SMALL,score:n.lastResult||0})}),e.jsx(x,{id:"course-nuggets-last-score",defaultMessage:"Last Score"})]}),e.jsxs(p.Value,{children:[n.lastResult<0||n.hasNoQuestions?e.jsx(x,{id:"not-applicable",defaultMessage:"N/A"}):n.lastResult||0,n.lastResult<0||n.hasNoQuestions?null:e.jsx(p.Unit,{children:"%"})]})]})}),e.jsx(L.Item,{children:e.jsxs(p,{children:[e.jsx(p.Label,{children:e.jsx(x,{id:"course-nuggets-best-score",defaultMessage:"Best Score"})}),e.jsxs(p.Value,{children:[n.bestResult&&n.bestResult<0||n.hasNoQuestions?e.jsx(x,{id:"not-applicable",defaultMessage:"N/A"}):n.bestResult||0,n.bestResult&&n.bestResult<0||n.hasNoQuestions?null:e.jsx(p.Unit,{children:"%"})]})]})})]})]})]})})},n.id))}):e.jsx(de,{type:"independent"})},ms=()=>{const{filteredNuggets:t,setFilter:s,course:r,nuggetListRef:i}=R(),o=d.useRef(),a=u=>{s(u),o.current&&clearTimeout(o.current),u.trim()&&(o.current=setTimeout(()=>{ae.track(ce.LearnCourseNuggetFilter,{[I.CourseId]:r?.courseId,[I.CourseName]:r?.name,[I.Value]:u})},2e3))};return e.jsx(Q.Main,{children:e.jsxs(j,{children:[e.jsxs(j.Header,{children:[e.jsx(j.Title,{children:e.jsx(x,{id:"course-nuggets-nuggets",defaultMessage:"Nuggets"})}),e.jsx(j.Controls,{children:e.jsx(Ye,{performSearch:a,placeholderId:"search-placeholder",defaultPlaceholder:"Search"})})]}),e.jsx(j.Body,{isScrollable:!0,ref:i,children:e.jsx(ps,{filteredNuggets:t})})]})})},gs=t=>{const{isSubtopicViewDisabled:s}=t,{topics:r,filteredNuggets:i,scrollToNugget:o}=R(),a=d.useRef(null),u=d.useRef(!1),[c,m]=d.useState([]),h=i?i.map(l=>l.id):[],n=d.useCallback(l=>c.includes(l),[c]),{currentActiveTopic:f,currentActiveSubtopic:b}=Se({filteredNuggets:i}),S=l=>{s?m([l]):n(l)?m(g=>g.filter(A=>A!==l)):m(g=>[...g,l])},y=l=>l.subtopics.every(T),T=l=>l.nuggetIds.every(g=>!h.includes(g)),N=(l,g)=>{u.current=!0,o(l,g)},M=be(),U=d.useCallback(()=>{f&&b&&a?.current&&(m([f]),M(s?f:b,a,!0))},[f,b,a,M,s]);return d.useEffect(()=>{const l=le.debounce(()=>{u.current?u.current=!1:U()},600);return l(),()=>{l.cancel()}},[U,f]),r?e.jsxs(j,{children:[e.jsx(j.Header,{children:e.jsx(j.Title,{children:e.jsx(x,{id:"topics-label",defaultMessage:"Topics"})})}),e.jsx(j.Body,{isScrollable:!0,ref:a,children:e.jsx(q,{children:e.jsx(C,{children:r.map(l=>e.jsx(q.Item,{isCurrent:!1,disabled:y(l),children:e.jsx("div",{id:l.id,children:e.jsxs(C.Section,{isOpen:n(l.id),children:[e.jsxs(C.Trigger,{onClick:()=>{S(l.id),s&&N(l,l.subtopics[0])},children:[e.jsxs(C.Header,{children:[e.jsx(C.Title,{sectionTitle:l.name}),e.jsx(Ke.Helper,{noMargin:!0,children:e.jsx(x,{id:"nuggets-label-number",defaultMessage:"{count} Nuggets",values:{count:l.subtopics.reduce((g,A)=>g+A.nuggetIds.length,0)}})})]}),e.jsxs(G,{vSpacing:$e.TIGHT,children:[e.jsx(G.Item,{children:e.jsx(se,{type:te.COMPLETION,value:l.completion,hasTooltip:!0})}),e.jsx(G.Item,{children:e.jsx(se,{type:te.SCORE,value:l.score,hasTooltip:!0})})]})]}),!s&&e.jsx(C.Content,{children:e.jsx(_e,{isOpen:n(l.id),children:e.jsx(Z,{children:l.subtopics?.map(g=>e.jsx("div",{id:g.id,children:e.jsx(Z.Item,{disabled:T(g),active:g.id===b,onClick:()=>N(l,g),children:g.name},g.id)},g.id))})})})]})},l.id)},l.id))})})})]}):null},hs=()=>{const{course:t}=R();es("learn-course");const s=ie(),r=we(s)||Oe(s,"learn","isSubtopicViewDisabled");return t?e.jsxs(ke,{children:[e.jsx(us,{courseName:t.name}),e.jsx(De,{children:e.jsxs(Q,{courseStructure:r?ee.TOPICS:ee.TOPICS_SUBTOPICS,children:[e.jsx(ms,{}),e.jsxs(Q.Sidebar,{children:[e.jsx(ds,{}),e.jsx(gs,{isSubtopicViewDisabled:r})]})]})}),e.jsx(Qe,{})]}):e.jsx(de,{type:"independent"})},fs=()=>e.jsx(ls,{children:e.jsx(hs,{})}),Rs=Ze(fs);
1export{Rs 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.