@clickview/lite 0.104.0-rc.5 → 0.104.0-rc.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.vite/manifest.json +167 -166
- package/dist/bundles.json +1 -1
- package/dist/en.json +1 -1
- package/dist/scripts/{CEv1_bDW.chunk.js → -brFp4w1.chunk.js} +2 -2
- package/dist/scripts/{CEv1_bDW.chunk.js.map → -brFp4w1.chunk.js.map} +1 -1
- package/dist/scripts/{D9wxi5or2.chunk.js → B2_RD6Px2.chunk.js} +2 -2
- package/dist/scripts/{D9wxi5or2.chunk.js.map → B2_RD6Px2.chunk.js.map} +1 -1
- package/dist/scripts/{C46OeU6w2.chunk.js → B338pwKt2.chunk.js} +2 -2
- package/dist/scripts/{C46OeU6w2.chunk.js.map → B338pwKt2.chunk.js.map} +1 -1
- package/dist/scripts/{8JGe5Ug_2.chunk.js → B5GEXNkP2.chunk.js} +2 -2
- package/dist/scripts/{8JGe5Ug_2.chunk.js.map → B5GEXNkP2.chunk.js.map} +1 -1
- package/dist/scripts/BTWmC6pW.chunk.js +5 -0
- package/dist/scripts/BTWmC6pW.chunk.js.map +1 -0
- package/dist/scripts/{CV-fOLNI2.chunk.js → Bpf3Tyy12.chunk.js} +2 -2
- package/dist/scripts/{CV-fOLNI2.chunk.js.map → Bpf3Tyy12.chunk.js.map} +1 -1
- package/dist/scripts/{DPZnaz74.chunk.js → C1OiUBQI.chunk.js} +2 -2
- package/dist/scripts/{DPZnaz74.chunk.js.map → C1OiUBQI.chunk.js.map} +1 -1
- package/dist/scripts/{CjOMeOwb2.chunk.js → CGv0OFnc2.chunk.js} +2 -2
- package/dist/scripts/{CjOMeOwb2.chunk.js.map → CGv0OFnc2.chunk.js.map} +1 -1
- package/dist/scripts/{B82m7K0U.chunk.js → CJGWbJ4m.chunk.js} +2 -2
- package/dist/scripts/{B82m7K0U.chunk.js.map → CJGWbJ4m.chunk.js.map} +1 -1
- package/dist/scripts/Cr6TXzQQ2.chunk.js.map +1 -1
- package/dist/scripts/{CAD-W-lP.chunk.js → DFFJpTVB.chunk.js} +2 -2
- package/dist/scripts/{CAD-W-lP.chunk.js.map → DFFJpTVB.chunk.js.map} +1 -1
- package/dist/scripts/{DICsRDM42.chunk.js → Dz8KlJhf2.chunk.js} +2 -2
- package/dist/scripts/{DICsRDM42.chunk.js.map → Dz8KlJhf2.chunk.js.map} +1 -1
- package/dist/scripts/{D0b_r0MV.chunk.js → KjTtF4IH.chunk.js} +2 -2
- package/dist/scripts/{D0b_r0MV.chunk.js.map → KjTtF4IH.chunk.js.map} +1 -1
- package/dist/scripts/{app-BzH1hkoU.js → app-CyGIKC-k.js} +3 -3
- package/dist/scripts/{app-BzH1hkoU.js.map → app-CyGIKC-k.js.map} +1 -1
- package/dist/scripts/{Bkp6sdnZ2.chunk.js → dVOiGqhu2.chunk.js} +2 -2
- package/dist/scripts/{Bkp6sdnZ2.chunk.js.map → dVOiGqhu2.chunk.js.map} +1 -1
- package/dist/scripts/{BCqRKj1E2.chunk.js → s6NJOjzU2.chunk.js} +2 -2
- package/dist/scripts/{BCqRKj1E2.chunk.js.map → s6NJOjzU2.chunk.js.map} +1 -1
- package/package.json +1 -1
- package/dist/scripts/DCT6XY8t.chunk.js +0 -5
- package/dist/scripts/DCT6XY8t.chunk.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as e}from"./DAXXjFlN.chunk.js";import{r as t}from"./snXCXfT6.chunk.js";import{x as n,y as r}from"./BftnFbcr.chunk.js";import"./DFZS3Ffo.chunk.js";import{n as i,t as a}from"./B785hxeE.chunk.js";import{t as o}from"./CQyJ7YGa.chunk.js";import{t as s}from"./ChzgIDQv.chunk.js";import{t as c}from"./C2w0pmFW.chunk.js";import{t as l}from"./wrLrTezN.chunk.js";import{t as u}from"./BXTI9cmX.chunk.js";import{C as d,p as f,u as p}from"./BX0wDJmp.chunk.js";import{t as m}from"./C1SLt-ar.chunk.js";import{N as h,P as g,U as _,l as v,y,z as b}from"./NlCAcBdo.chunk.js";import{n as x}from"./1LRpIhCn.chunk.js";import{t as S}from"./RjGIOTdP.chunk.js";import{n as C,t as w}from"./DTGfiG8Y.chunk.js";import{a as T,i as E,r as D,t as O}from"./Cr6TXzQQ2.chunk.js";import{n as k,t as A}from"./CmcCVXi32.chunk.js";import{t as ee}from"./Dat7ugzw2.chunk.js";import{t as j}from"./DGmmTRu72.chunk.js";import{t as M}from"./DZX1tZ-D2.chunk.js";import{t as N}from"./xwiwWcv12.chunk.js";import{t as P}from"./CVHQXNzi2.chunk.js";import{t as F}from"./CqrjHjAN.chunk.js";import{t as te}from"./eoAypzU3.chunk.js";import{t as ne}from"./D_gWf2lC.chunk.js";import{t as re}from"./_GCZ-60i.chunk.js";import{t as I}from"./7-GJWRH82.chunk.js";import{t as ie}from"./dLd5d3X22.chunk.js";import{t as L}from"./CZc2Wh_b2.chunk.js";import{t as R}from"./DpCWroEe2.chunk.js";import{t as ae}from"./QCFxJYkI2.chunk.js";import{t as oe}from"./CduNFx13.chunk.js";import{t as se}from"./BUnh3rN0.chunk.js";import{t as z}from"./BJZXCSV9.chunk.js";import{n as ce,t as le}from"./C6-aC3vu.chunk.js";import{t as ue}from"./B3gsVN-_.chunk.js";import{t as de}from"./Dfw0sxVt2.chunk.js";import{t as B}from"./B_-pJtOI2.chunk.js";import{n as V,t as H}from"./CpFtf-tI2.chunk.js";import{t as fe}from"./CXnhm0VS2.chunk.js";import{t as pe}from"./YmXEsLuD.chunk.js";import{t as U}from"./CEtJop-5.chunk.js";import{t as me}from"./BUoougrH.chunk.js";import{t as he}from"./CzuHD4Ht.chunk.js";import{t as ge}from"./CCdnFnNP.chunk.js";import{n as _e,r as ve,t as ye}from"./DkPhyvJ2.chunk.js";import{t as be}from"./ClpxGEGl.chunk.js";import{t as W}from"./C7HU4huj.chunk.js";import{t as G}from"./5ONJSThP.chunk.js";import{t as xe}from"./C7GcQtj3.chunk.js";import{t as K}from"./9kSpxveW.chunk.js";import{t as Se}from"./DDJBf9pK2.chunk.js";import{n as Ce}from"./ChnNWPOK2.chunk.js";import{t as we}from"./vsyhrSK92.chunk.js";import{t as Te}from"./DBHDBu1Y.chunk.js";import{t as Ee}from"./Dsv4OsIs.chunk.js";import{t as De}from"./1IFtXPNY.chunk.js";import{t as Oe}from"./DewCxv4i.chunk.js";import{t as ke}from"./DMaQV7L2.chunk.js";import{t as Ae}from"./CCb14vhF.chunk.js";import{t as q}from"./B8gP8YoA.chunk.js";import{t as je}from"./DmKYYMW8.chunk.js";import{n as Me,r as Ne,t as Pe}from"./H6xxoFyN2.chunk.js";import{t as Fe}from"./CSRpjM7n2.chunk.js";import{t as Ie}from"./DELN_PAD2.chunk.js";import{t as Le}from"./AEt1phMH2.chunk.js";import{t as Re}from"./_42F7SIA2.chunk.js";import{n as ze,t as Be}from"./DzgAvoez.chunk.js";import{t as Ve}from"./fm4MaUp7.chunk.js";import{t as He}from"./C9XBZFiR.chunk.js";import{t as Ue}from"./BnuuRu_J2.chunk.js";import{n as We,t as Ge}from"./CY_30Xdt.chunk.js";import{a as Ke,o as qe,t as Je}from"./DCT6XY8t.chunk.js";import{o as Ye,r as Xe}from"./CpgHBpMp.chunk.js";import{t as Ze}from"./CwYrnhdi.chunk.js";import{t as Qe}from"./CC5Dr9aG.chunk.js";import{r as $e}from"./yk6K0dmz2.chunk.js";import{n as et,t as tt}from"./CvtZ8ZFA2.chunk.js";import{t as J}from"./BCqRKj1E2.chunk.js";import{t as nt}from"./C8aOMmXJ2.chunk.js";import{t as rt}from"./8JGe5Ug_2.chunk.js";import{n as it,t as at}from"./Cg2g-9Kl2.chunk.js";import{n as ot,r as st,t as ct}from"./BgOLbASl2.chunk.js";import{t as lt}from"./C7YBocZE.chunk.js";import{t as ut}from"./D6xnEQSC.chunk.js";var Y=e(c()),X=l(),dt=`subject.classificationHeaderDetails`,ft=({className:e})=>(0,X.jsx)(`span`,{className:e,children:`•`});function pt(e){let{dashboardVideoCount:t,childDashboardVideoCount:n,dashboardResourceCount:r,childDashboardResourceCount:i,childClassificationCount:a}=x.getCounts(e.classification),o=t+n,s=r+i;return(0,X.jsxs)(`p`,{className:`mb-n1 font-size-normal fw-normal mt-1`,children:[!!a&&(0,X.jsx)(V,{namespace:dt,phrase:`topics`,options:{count:a.toLocaleString(),smartCount:a}}),!!o&&(0,X.jsxs)(X.Fragment,{children:[a>0&&(0,X.jsx)(ft,{className:`mx-2`}),(0,X.jsx)(V,{namespace:dt,phrase:`videos`,options:{count:o.toLocaleString(),smartCount:o}})]}),!!s&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(ft,{className:`mx-2`}),(0,X.jsx)(V,{namespace:dt,phrase:`resources`,options:{count:s.toLocaleString(),smartCount:s}})]})]})}var Z=`subjects.curatedClassificationEmptyState`,mt=o.encloseNamespace(Z);function ht(e){let n=e.dashboard?.status===A.Archived;return(0,X.jsx)(H.Provider,{value:Z,children:(0,X.jsxs)(z,{children:[(0,X.jsx)(z.Image,{src:e.imageUrl,altText:mt(`headingForNP`)}),e.isReadonly?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(z.Heading,{children:(0,X.jsx)(V,{namespace:Z,phrase:`headingForCurator`})}),(0,X.jsx)(z.Info,{children:(0,X.jsx)(V,{namespace:Z,phrase:`info`})}),(0,X.jsx)(t,{title:n?o.getPhrase(Z,`archivedCtaTooltip`):``,spanHack:!0,children:(0,X.jsx)(z.Cta,{text:o.getPhrase(Z,`add`),appLink:e.addWidgetApplink?.(),className:`btn btn-dark`,icon:Se,disabled:n})})]}):(0,X.jsx)(z.Heading,{children:(0,X.jsx)(V,{phrase:`headingForNP`})})]})})}var gt={container:`_container_1n8qw_1`,mobile:`_mobile_1n8qw_7`};function _t(e){let[t,n]=Y.useState(!1);function r(){let n={actionType:t?b.Hide:b.Open,entity:v.TableOfContents,location:y.Dashboard};re.logUserAction(e.analyticsData,n)}function i(){n(!t),r()}return(0,X.jsxs)(`div`,{className:`${gt.mobile} d-inline-flex gap-1`,children:[t&&(0,X.jsxs)(`div`,{className:`bg-white px-3 pt-3 pb-2 border border-dark rounded-1 ps-3`,children:[(0,X.jsx)(`h2`,{className:`h5`,children:e.title}),(0,X.jsx)(ct,{items:e.widgets.map(e=>({name:e.name,id:e.id,tocIndentation:e.metadata.tocIndentation})),activeId:e.activeId,appLink:e.appLink,analyticsData:e.analyticsData,setControlledId:e.setControlledId,getAppLink:e.getAppLink,onItemClick:()=>n(!1)})]}),(0,X.jsx)(`div`,{className:gt.container,children:(0,X.jsx)(se,{className:`btn btn-outline-dark`,svg:Ie,onClick:i})})]})}function vt(e){return(0,X.jsx)(`aside`,{className:`col-3 order-1`,children:(0,X.jsxs)(`div`,{className:`${gt.container} ps-3`,children:[(0,X.jsx)(`h2`,{className:`h5`,children:e.title}),(0,X.jsx)(ct,{items:e.widgets.map(e=>({name:e.name,id:e.id,tocIndentation:e.metadata.tocIndentation})),activeId:e.activeId,appLink:e.appLink,analyticsData:e.analyticsData,setControlledId:e.setControlledId,getAppLink:e.getAppLink})]})})}function yt(e){function t(e){let t=R.getCurrentRoute().appLink,n=t.params?{...t.params}:{};return n.tocId=e.id,{...t,params:n}}return(0,X.jsx)(X.Fragment,{children:e.isSmallScreen?(0,X.jsx)(_t,{...e,getAppLink:t}):(0,X.jsx)(vt,{...e,getAppLink:t})})}var bt=`subjects.teacherOnlyEmptyState`,xt=o.encloseNamespace(bt);function St(e){return(0,X.jsx)(H.Provider,{value:bt,children:(0,X.jsxs)(z,{children:[(0,X.jsx)(z.Image,{src:e.imageUrl,altText:xt(`heading`)}),(0,X.jsx)(z.Heading,{children:(0,X.jsx)(V,{phrase:`heading`})}),(0,X.jsx)(z.Info,{children:(0,X.jsx)(V,{phrase:`info`})}),(0,X.jsx)(z.Cta,{text:xt(`cta`),appLink:e.ctaAppLink?.(),className:`btn btn-dark`})]})})}function Ct(e,t){let{isSystemGeneratedDashboard:n,systemGeneratedVideoWidget:r}=Y.useMemo(()=>e?{isSystemGeneratedDashboard:D.isSystemGeneratedDashboard(e.widgets),systemGeneratedVideoWidget:e.widgets.find(e=>e.widgetId===E.ClassificationPinnedVideos&&e.templateId!==T.ThumbnailVerticalList)}:{isSystemGeneratedDashboard:!1,systemGeneratedVideoWidget:null},[e?.id]),i=p(!!r&&Oe.dashboardWidgetContent(r?.id,D.getWidgetParams(r.widgetId,r.templateId,D.getDashboardTargetType(e),t?.map(e=>e.masterId)),r?.templateId));return n?{widgets:e?.widgets?.filter(e=>e.widgetId!==E.ClassificationPinnedVideos||e.templateId===T.ThumbnailVerticalList)??[],videoList:i.data?.content??[],videoListWidgetId:r?.id}:{widgets:m.sortBy(e?.widgets,`index`)}}var wt=`subjects.classificationComingSoon`,Tt=o.encloseNamespace(wt);function Et(e){let t=!!e.data.followers?.data?.length;function n(){e.onToggleFollow?.()}return(0,X.jsx)(H.Provider,{value:wt,children:(0,X.jsxs)(z,{className:`pt-0`,children:[(0,X.jsx)(z.Image,{src:e.imageUrl,altText:Tt(`comingSoon`)}),(0,X.jsx)(z.Heading,{children:(0,X.jsx)(V,{phrase:`comingSoon`})}),(0,X.jsx)(z.Info,{children:(0,X.jsx)(V,{phrase:e.showSignUp?`infoAnon`:`info`})}),e.canFollowSubjects&&(0,X.jsx)(be,{svg:t?pe:U,onClick:n,showSpinner:e.showFollowButtonSpinner,className:`btn follow-btn me-2 ${t?`btn-outline-dark`:`btn-dark`}`,children:(0,X.jsx)(V,{phrase:t?`following`:`follow`})}),e.showSignUp&&!e.canFollowSubjects&&(0,X.jsx)(oe,{appLink:e.signUpAppLink,className:`btn btn-dark d-none d-lg-inline-block`,analyticsOptions:{actionType:b.Click,location:y.ClassificationComingSoon,entity:v.AppLink,workflowPhase:_.Start,descriptor:h.SignUp},analyticsData:{},tag:`button`,children:Tt(`signUp`)})]})})}function Dt(e){return(0,X.jsx)(at,{audiences:e.audiences,activeAudiences:e.activeAudiences,disabled:e.disabled,appLink:e.appLink,disablePersist:e.disablePersist,tooltip:e.tooltip})}function Ot(e){return(0,X.jsx)(`svg`,{...e,children:(0,X.jsx)(`path`,{d:`M4.5 4a.5.5 0 0 0 0 1h16a.5.5 0 0 1 .5.5v12a.5.5 0 0 0 1 0v-12A1.5 1.5 0 0 0 20.5 4zM9 10.26a.256.256 0 0 1 .39-.218l4.482 2.74a.256.256 0 0 1 0 .437L9.39 15.958A.256.256 0 0 1 9 15.739zM18.5 6A1.5 1.5 0 0 1 20 7.5v11a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 2 18.5v-11A1.5 1.5 0 0 1 3.5 6zm-15 1a.5.5 0 0 0-.5.5v11a.5.5 0 0 0 .5.5h15a.5.5 0 0 0 .5-.5v-11a.5.5 0 0 0-.5-.5z`,fill:`currentColor`})})}function kt(e){let[t,n]=ie(`directory:product:tip:switcher`,{on:!1,tab:e||`new-releases`});return Y.useEffect(()=>{e&&n(`tab`,e)},[e]),Y.useEffect(()=>{let e=null;return t.on&&(e=window.setInterval(()=>{t.tab===`new-releases`||t.tab===`all-topics`?n(`tab`,t.tab===`new-releases`?`all-topics`:`new-releases`):n(`tab`,t.tab===`curated-topic`?`video-list`:`curated-topic`)},2e3)),()=>{window.clearInterval(e)}},[t.on,t.tab]),{tab:t.tab,isHighlighting:t.on,start:()=>n(`on`,!0),stop:()=>{n({on:!1,tab:e||t.tab})}}}var Q={curatedTopicTab:`_curatedTopicTab_1ji5o_1`,tabTransition:`_tabTransition_1ji5o_4`},$=`shared.classificationDashboard`;function At(e,t,n,i){let a=t.lg||t.xl||t.xxl||t.xs;function s(){let e=i?Q.tabTransition:``;return t.xs?e+` w-100`:a?e=` ${Q.curatedTopicTab}`:e}return x.isTopLevelTopic(e.classification)?[{name:a?o.getPhrase($,`newReleases`):``,appLink:e.appLinks?.classification?.(e.classification),active:n===`new-releases`,svg:Ze,analyticsData:{id:`new-releases`,classificationId:e.classification.id,classificationName:e.classification.name,presentationId:e.presentation.id,presentationDescription:e.presentation.description,name:o.getPhrase($,`newReleases`),url:r.getHref(e.appLinks?.classification?.(e.classification))},analyticsOptions:{actionType:b.Click,entity:v.Url,location:y.MagicTabs},className:`${t.xs?`w-100`:``} ${i?Q.tabTransition:``}`},{name:a?o.getPhrase($,`allTopics`):``,appLink:e.appLinks?.classificationDirectory?.(e.classification),active:n===`all-topics`,svg:qe,analyticsData:{id:`all-topics`,classificationId:e.classification.id,classificationName:e.classification.name,presentationId:e.presentation.id,presentationDescription:e.presentation.description,name:o.getPhrase($,`allTopics`),url:r.getHref(e.appLinks?.classificationDirectory?.(e.classification))},analyticsOptions:{actionType:b.Click,entity:v.Url,location:y.MagicTabs},className:`${t.xs?`w-100`:``} ${i?Q.tabTransition:``}`}]:[{name:a?o.getPhrase($,`topic`):``,appLink:e.appLinks?.classification?.(e.classification),active:n===`curated-topic`,svg:Ke,analyticsData:{id:`curated-topic`,classificationId:e.classification.id,classificationName:e.classification.name,presentationId:e.presentation.id,presentationDescription:e.presentation.description,name:o.getPhrase($,`topic`),url:r.getHref(e.appLinks?.classification?.(e.classification))},analyticsOptions:{actionType:b.Click,entity:v.Url,location:y.MagicTabs},className:s()},{name:a?o.getPhrase($,`curriculum`):``,appLink:e.appLinks?.classificationCurriculum?.(e.classification),active:n===`curriculum`,svg:Ot,analyticsData:{id:`curriculum`,classificationId:e.classification.id,classificationName:e.classification.name,presentationId:e.presentation.id,presentationDescription:e.presentation.description,name:o.getPhrase($,`curriculum`),url:r.getHref(e.appLinks?.classificationCurriculum?.(e.classification))},analyticsOptions:{actionType:b.Click,entity:v.Url,location:y.MagicTabs},className:`${t.xs?`w-100`:``} ${i?Q.tabTransition:``}`}]}function jt(e){let t=G(),{tab:n,isHighlighting:r}=kt(e.activeTab);return(0,X.jsx)(Ve,{borderRadius:`sm`,className:t.xs?`w-100`:``,listClassName:`d-flex flex-nowrap`,tabs:At(e,t,n,r)})}function Mt(e,t,n,r,i){return!!(i||r&&!t?.length||!S.shouldShowAudiences(e)||n===`curriculum`)}function Nt(e){let t=G(),n=e.forceHideAudiences||Mt(e.audiences,e.activeAudiences,e.activeTab,e.isEmpty,e.isComingSoon);function r(){return!e.classification||!e.dashboard||D.isSystemGeneratedDashboard(e.dashboard.widgets)?!1:x.isTopLevelTopic(e.classification)?e.hasTopicDirectoryDashboard:!!(e.classification.externalMetadata?.isCurated&&e.hasTopicCurriculumDashboard)}function i(){let i=`d-flex flex-column py-3 mb-3`;return e.isComingSoon||(i+=` border-bottom`),(r()||n)&&!t.xs?i:i+` row-gap-3`}function a(){if(n)return t.xs?`d-flex flex-column justify-content-between row-gap-3`:`d-flex align-items-center justify-content-between`;let e=``;return e+=`d-flex align-items-center justify-content-between mb-1`,t.xs&&(e+=` row-gap-3 mb-0`),e}function o(){let e=`d-flex align-items-end justify-content-between`;return t.xs&&(e+=` row-gap-3 flex-wrap`),e}return(0,X.jsxs)(`div`,{className:i(),children:[(0,X.jsxs)(`div`,{className:a(),children:[(0,X.jsx)(Be,{breadcrumbs:e.getBreadcrumbs?.()}),r()&&n&&(0,X.jsx)(jt,{classification:e.classification,activeTab:e.activeTab,appLinks:e.appLinks,presentation:e.presentation})]}),(0,X.jsxs)(`div`,{className:o(),children:[!n&&(0,X.jsx)(Dt,{audiences:e.audiences,activeAudiences:e.activeAudiences,appLink:e.appLinks.audience?.(),disabled:e.disableAudiences,tooltip:e.audienceTooltip,disablePersist:!e.isViewingCurrentPresentation}),r()&&!n&&(0,X.jsx)(jt,{classification:e.classification,activeTab:e.activeTab,appLinks:e.appLinks,presentation:e.presentation})]})]})}var Pt=`shared.classificationDashboard`;function Ft(e){return e.widgetId===E.Blurb&&e.templateId===T.Heading}function It(e){return e.widgetId===E.CuratedClassifications||e.widgetId===E.Classifications}var Lt=[E.ClassificationAllVideos];function Rt(e,t){let n=e[t];return n?Lt.includes(n.widgetId)&&t===e.length-1:!1}function zt(e){let t=e?.[0];return t?O.hasNoContent(t.widgetId)?!1:!t.content||Array.isArray(t.content)&&!t.content.length:!0}Bt.defaultProps={appLinks:{}};function Bt(e){let{widgets:t,videoList:n,videoListWidgetId:r}=Ct(e.dashboard,e.activeAudiences),i=W(K.LGDown),s=Y.useRef(new Set),c=Y.useMemo(()=>t.reduce((e,t)=>(e[t.id]=!1,e),{}),[t?.length]),[l,u]=Y.useState(c),[d,f]=Y.useState(e.tableOfContentsId),[p,m]=Y.useState(``),h=Array.from(s.current);ot(h,d),st({setActiveId:m,headingElements:h,controlledId:d,setControlledId:f});let g=e.classification.type===C.Hub,_=!!e.dashboard?.metadata?.channelId;function v(){return e.isComingSoon||e.isTeacherOnly?!1:!e.dashboard||e.dashboard.status===A.Archived&&!e.isReadonly||e.dashboard.status===A.Draft&&!e.isPreviewing||!t?.length?!0:n&&n.length?!1:Object.values(l).every(e=>!!e)}function b(t,n,r,i){let a=D.getWidgetParams(n,r,D.getDashboardTargetType(e.dashboard),e.activeAudiences?.map(e=>e.masterId),e.curriculums.preferredCurriculum?.id);return i&&e.getWidgetContentRequestWithCursor?e.getWidgetContentRequestWithCursor(t,a,r,i):e.getWidgetContentRequest(t,a,r)}let S=v();Y.useEffect(()=>{S&&u(c)},[t?.length]);let w=Y.useCallback((n,r)=>{if(l[n]===r)return;let i={...l,[n]:r};if(D.isType(e.dashboard,k.ClassificationDirectory)){u(i);return}let a=0;for(;a<t.length;){let e=t[a];if(!Ft(e)){a++;continue}let n=!0,r=a+1;for(;n&&r<t.length;){let e=t[r];if(Ft(e))break;!i[e.id]&&!It(e)&&(n=!1),r++}a=r,i[e.id]=n}u(i)},[l,t]);function T(e){return Ft(e)&&l[e.id]}function ee(){let t=D.getDashboardTargetType(e.dashboard);return!(e.moviesAndTv||t===k.ClassificationCurriculum)}function j(e,n){if(e.widgetId===E.ClassificationDashboardExternalMedia){let r=t[n-1];return l[r.id]?e.name.replace(`Other videos`,`Videos`):e.name}return e.name}let M=t.filter(e=>!T(e)&&!!e.metadata?.showInTableOfContents),N=t.every(It),P=M.length>=2,F=P&&!i,te=e.settings?.hasTopicDirectories&&x.isTopLevelTopic(e.classification)&&!e.isTertiaryCustomerWithoutExchange&&!g;return(0,X.jsxs)(`div`,{className:`bg-white px-4 ${ee()?`dashboard-spacing-lg`:``}`,children:[(0,X.jsx)(Ge,{type:_?`channel-topic`:`default`,logo:_&&e.channel?._logo.value,logoBgColour:_&&e.channel?._colour.value,heading:e.classification.name,banner:e.classification.banner,imageCdnUrl:e.imageCdnUrl,actions:e.getBannerActions?.(),actionsDropdownClassName:`btn btn-outline-dark`,specialEvent:e.specialEvent,calendarTheme:{background:`bg-light-blue`,border:`border-light-blue`},showComingSoon:e.isComingSoon,detailsComponent:te?()=>(0,X.jsx)(pt,{classification:e.classification}):null}),g?(0,X.jsx)(`div`,{className:`py-3 mb-3 border-bottom`,children:(0,X.jsx)(`div`,{className:`mt-3`,children:(0,X.jsx)(nt,{children:()=>(0,X.jsx)(`p`,{className:`mb-0`,children:e.classification.description})})})}):(0,X.jsx)(Nt,{forceHideAudiences:_,dashboard:e.dashboard,classification:e.classification,presentation:e.presentation,appLinks:e.appLinks,activeTab:e.tab,audiences:e.audiences,activeAudiences:e.activeAudiences,getBreadcrumbs:e.getBreadcrumbs,hasTopicDirectoryDashboard:e.hasTopicDirectoryDashboard,hasTopicCurriculumDashboard:e.hasTopicCurriculumDashboard,isComingSoon:e.isComingSoon,isEmpty:S,isViewingCurrentPresentation:e.isViewCurrentPresentation,disableAudiences:N||e.isReadonly,audienceTooltip:N?o.getPhrase(Pt,`audienceTooltip`):``}),e.isComingSoon&&(0,X.jsx)(Et,{imageUrl:e.comingSoonImageUrl,data:e.classification,canFollowSubjects:e.canFollowSubjects,showFollowButtonSpinner:e.showFollowButtonSpinner,onToggleFollow:()=>e.onToggleFollow(e.classification,y.ClassificationComingSoon),showSignUp:!e.hasLocalPermissions(a.FollowComingSoonTopics),signUpAppLink:e.appLinks.signUp?.()}),!e.isComingSoon&&(0,X.jsxs)(`div`,{className:`${F?`row no-wrap`:``}`,children:[P&&(0,X.jsx)(yt,{widgets:M,title:e.classification.name,activeId:p,clickable:!e.isReadonly,analyticsData:e.analyticsData,setControlledId:f,isSmallScreen:i}),(0,X.jsx)(`div`,{className:F?`col-9 order-0`:``,children:t.map((n,r)=>T(n)?(0,X.jsx)(Y.Fragment,{},n.id):Lt.includes(n.widgetId)?(0,X.jsx)(J,{index:r,item:n,infiniteFetch:Rt(t,r)&&!!e.getWidgetContentRequestWithCursor,dashboardTarget:D.getDashboardTargetType(e.dashboard),getName:e=>j(e,r),getWidgetMetadata:e=>e.metadata,getContent:e=>e.content,getCursor:e=>e.cursor,getRequest:e=>b(n.id,n.widgetId,n.templateId,e),isEmptyPredicate:zt,audiences:e.audiences,appLinks:e.appLinks,commonVideoProps:e.commonVideoProps,hasPermissions:e.hasPermissions,hasLocalPermissions:e.hasLocalPermissions,resultsTransformers:O.getWidgetResultsTransformers(),presentation:e.presentation,analyticsData:e.analyticsData,imageCdnUrl:e.imageCdnUrl,imageUrls:e.imageUrls,resourceThumbnailFallbackImageUrl:e.resourceThumbnailFallbackImageUrl,lazyLoad:e.lazyLoad,headingElementRef:s,hasTableOfContents:F,isScrollToTargetWidget:e.scrollToWidgetId===n.id,isBot:e.isBot,isPreviewing:e.isReadonly,isEditing:e.isReadonly,curriculums:e.curriculums,contentType:e.contentType,setIsEmpty:e=>w(n.id,e),getSelectedItems:null,appLinkOptions:null},n.id):(0,X.jsx)(Je,{widgetCollection:k.Classification,headingElementRef:s,id:n.id,name:j(n,r),description:n.description,classification:e.classification,templateId:n.templateId,widgetTypeId:n.widgetId,audiences:e.audiences,getContentRequest:b,setIsEmpty:w,appLinks:e.appLinks,presentation:e.presentation,analyticsData:e.analyticsData,isScrollToTargetWidget:e.scrollToWidgetId===n.id,imageCdnUrl:e.imageCdnUrl,imageUrls:e.imageUrls,onSubmitFeedback:e.onSubmitFeedback,onDownloadAllClick:e.onDownloadAllClick,metadata:n.metadata,isBot:e.isBot,hasTableOfContents:F,lazyLoad:e.lazyLoad,dashboardTarget:D.getDashboardTargetType(e.dashboard),widgetIndex:r,hasPermissions:e.hasPermissions,hasLocalPermissions:e.hasLocalPermissions,isPreviewing:e.isReadonly,contentType:e.contentType,resourceThumbnailFallbackImageUrl:e.resourceThumbnailFallbackImageUrl,onToggleFollowClassification:e.onToggleFollow,settings:e.settings,isEditing:e.isReadonly,isTertiaryCustomerWithoutExchange:e.isTertiaryCustomerWithoutExchange,commonVideoProps:e.commonVideoProps,curriculums:e.curriculums,limitTotalItems:!1,seeMoreLink:null,onClickRemoveItem:null,badgeComponent:null},n.id))}),!!n?.length&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Re,{name:o.getPhrase(Pt,`videos`)}),(0,X.jsx)(Xe,{videos:n,getVideoAppLink:(t,n)=>e.appLinks.videoType(t,{...n,contextId:r,includeContext:n.includeContext}),hasPermissions:e.hasPermissions,presentationAudiences:e.audiences,getPreviewQuestionsAppLink:e.appLinks.previewQuestions,commonVideoProps:e.commonVideoProps})]})]}),S&&(0,X.jsx)(ht,{dashboard:e.dashboard,isReadonly:e.isReadonly,imageUrl:e.emptyImageUrl,addWidgetApplink:e.appLinks.widgetWizard}),e.isTeacherOnly&&(0,X.jsx)(St,{imageUrl:e.emptyImageUrl,ctaAppLink:()=>e.appLinks.allTopics(e.classification.presentationId)})]})}function Vt(){return(0,X.jsxs)(`div`,{className:`bg-white px-4`,children:[(0,X.jsx)(We,{}),(0,X.jsxs)(`div`,{className:`d-flex flex-column row-gap-3 py-3 mb-3 border-bottom`,children:[(0,X.jsx)(ze,{}),(0,X.jsx)(it,{})]})]})}var Ht={follow:()=>`{gateway}/v1/users/me/classifications/following`,unfollow:e=>M.urlBuilder(`{gateway}/v1/users/me/classifications/following`,{id:e})},Ut={follow(e,t,n,r){return{url:Ht.follow(),key:`follow:${e.join(`,`)}`,type:d.POST,data:e,formatData:()=>e.map(e=>({id:e,followers:{data:[t]}})),success:n,error:r,invalidationKeys:[...e.map(e=>`classification:${e}`),`my:subject:preferences`,`classifications`]}},unfollow(e,t,n,r){return{url:Ht.unfollow(e),key:`unfollow:${e.join(`,`)}`,type:d.DELETE,formatData:()=>e.map(e=>({id:e,followers:{data:[]}})),success:n,error:r,invalidationKeys:[...e.map(e=>`classification:${e}`),`my:subject:preferences`,`classifications`]}}},Wt={followButton:`_followButton_1ylet_2`},Gt=o.encloseNamespace(`subjects.classification`);function Kt(e){let{classification:t,analyticsData:n}=e,[r,a]=Y.useState(!1),o=fe(),s=f(),{hasPermissions:c}=ue(),l=p(F.currentUser()),u=W(K.MDDown),d=W(K.SMDown),m=c(i.FollowSubjects);function h(e,r){if(!m||!t)return;let i=e.id.toString()===t.id?.toString();i&&a(!0);let c=x.isFollowing(e),u=c?Ut.unfollow:Ut.follow;s(u([e.id],l.data?.id)).then(()=>{re.logUserAction(n,{location:r,actionType:b.Follow,workflowPhase:_.Complete,descriptor:c?g.Off:g.On,entity:v.Classification}),i||o.success(Gt(c?`unfollowed`:`followed`,{name:e.name}))}).finally(()=>{i&&a(!1)})}function S(){if(!m||!t)return[];let e=!!t.followers?.data?.length;return[{label:d?``:Gt(e?`following`:`follow`),onClick:()=>h(t,y.Banner),svg:e?pe:U,className:`btn follow-btn ${e?`btn-outline-dark`:`btn-dark`} ${Wt.followButton}`,button:!0,tooltip:e||u?void 0:Gt(`followBtnTooltip`),showSpinner:r}]}return{canFollowSubjects:m,showFollowButtonSpinner:r,onToggleFollow:h,getFollowBannerActions:S}}var qt=`subjects.topicNotFoundError`,Jt=class extends s{constructor(){super(`Topic doesn't exist`)}get name(){return`TopicNotFoundError`}get heading(){return o.getPhrase(qt,`heading`)}get description(){return o.getPhrase(qt,`description`)}get cta(){return{text:o.getPhrase(qt,`cta`),appLink:{application:u.SUBJECT,action:te.Subjects.PRESENTATION_TOPICS,args:[null]}}}};function Yt(e,t,n){let{hasTopicDirectories:r,hasTopicVideoListFeature:i}=j(null),{dashboard:a,isPreviewing:o,isTeacherOnly:s}=q({classificationId:e,queryParams:t,targetType:k.Classification}),{dashboard:c}=q({classificationId:e,queryParams:t,targetType:k.ClassificationDirectory}),{dashboard:l}=q({classificationId:e,queryParams:t,targetType:k.ClassificationCurriculum});function u(){switch(n){case k.Classification:return a;case k.ClassificationDirectory:return c;case k.ClassificationCurriculum:return l}}return{dashboard:u(),hasTopicDirectoryDashboard:r&&!!c.data,hasTopicCurriculumDashboard:i&&!!l.data,isTeacherOnly:s,isPreviewing:o}}Zt.defaultProps={queryParams:{}};var Xt=o.encloseNamespace(`subjects.classification`);function Zt(e){let t=f(),{hasPermissions:r,hasLocalPermissions:a}=ue(),s=j(null),c=p(ne.config()),l=p(F.currentUser()),{openInCurationStudioLabel:u,isUserCurator:d,getOpenInCurationStudioLink:m}=$e(),h=Ae(),g=p(r(i.CanSubmitFeedback)&&l.data?.isAuthenticated&&N.customer(l.data.customerId)),w=p(L.classification(e.id,l.data?.id)),T=w.data?.type===C.Hub,E=T?w.data?.id:e.queryParams.hubTopic,O=p(w.data&&L.presentationById(w.data.presentationId)),k=p(w.data&&ke.audiencesByPresentationId(w.data.presentationId)),A=p(w.data&&Le.nextTopicSpecialEvent(e.id,w.data.presentationId)),ee=p(l.data?.isAuthenticated&&De.libraries()),{availablePresentations:M,canAccessPresentation:te}=xe(),ie=p(L.path(e.id)),{dashboard:R,hasTopicDirectoryDashboard:oe,hasTopicCurriculumDashboard:se,isPreviewing:z,isTeacherOnly:V}=Yt(e.id,e.queryParams,e.targetType),H=we(),pe=de(),U=p(L.regionAlternatives(e.id)),_e=B.getPreferredRegionAlternative(U.data,l.data?.contentRegion);le(ce.getClassificationMetadata({content:{classification:w.data,dashboard:R.data},phraseContext:{phraseHandler:Xt,titlePhrase:`pageTitle`,descriptionPhrase:`pageDescription`},canonicalLink:B.getCanonicalLink({stripPresentationSlug:!0,customAppLink:me.getAppLink({...w.data,name:_e?.name||w.data?.name},e.queryParams,M),hrefTransformer:B.createRegionHrefTransformer(U.data,l.data?.contentRegion)}),allowIndexing:B.allowIndexing(),hrefLang:B.getContentHrefLang(U.data,()=>me.getAppLink(w.data,{},M))})),He(w,{notFound:Jt}),Ce({id:e.id,app:`topics`});let{commonVideoProps:ve}=Ue({locationContext:y.VideoThumbnail,mtv:e.queryParams.mtv,hubTopic:E}),be=et({location:tt.VideoItem,presentationSlug:e.presentationSlug}),W=Y.useMemo(()=>S.getActiveAudiencesFromParams(k.data,e.queryParams),[k.data,e.queryParams]),G=W?.map(e=>e.masterId)??[],K={presentationId:O.data?.id,presentationName:O.data?.name,currentClassificationId:w.data?.id,currentClassificationName:w.data?.name,followingCurrentClassification:!!w.data?.followers?.data?.length,activeAudienceNames:W?.length?W.map(e=>e.name):null,activeAudienceIds:G.length?G:null},{canFollowSubjects:Se,showFollowButtonSpinner:q,onToggleFollow:Fe,getFollowBannerActions:Ie}=Kt({classification:w.data,analyticsData:K}),Re=w.data?.status===Te.ComingSoon&&!z,ze=D.getDashboardTargetType(R.data),Be=ut(),Ve=fe();async function We(e,t,n){try{await Be(e,t,n)}catch{Ve.error(o.getPhrase(`shared.downloadResource`,`downloadResourcesError`))}}async function Ge(e){let a=await t(Me.submitFeedback({type:Ne.Footer,user:Pe.getUserInfo(l.data,g.data),tags:Pe.getTags(l.data,ae.Primary,r(i.StudentExperience),[`topics`,`in product feedback`])},{reaction:e.type,feedback:e.content,location:`Topic Footer`,presentationName:O.data.description,presentationId:O.data.id,dashboardName:R.data.name,dashboardId:R.data.id,classificationName:w.data.name,classificationId:w.data.id,currentPageUrl:n.GetCurrentUrl()}));return re.logUserAction({feedbackType:e.type,content:e.content,presentationId:O.data.id,classificationId:w.data.id,dashboardId:R.data.id},{actionType:b.Submit,location:y.ClassificationFooter,entity:v.Feedback,workflowPhase:_.Complete}),a}function Ke(){if(T||J)return[];let e=Ie();return d?[...e.map(e=>({...e,className:`${e.className} me-2`})),{label:u,href:m(P.Subject,w.data?.id,O.data?.id),openInNewTab:!0}]:e}let qe=ye(w.data,ze,{...e.queryParams,hubTopic:E},l.data,e.presentationSlug,M),Je=Qe({name:w.data?.name});function Xe(){if(te(O.data?.id))return()=>Je}function Ze(e,t,n,r){let{hasTwig:i,hasTigtag:a}=je.hasTwigOrTigtag(ee.data,l.data);return Oe.dashboardWidgetContent(e,t,n,O.data,{hideTigTag:!a,hideTwig:!i,cursor:r})}let J=R.data?.metadata?.channelId,nt=p(J&&Ee.partnerProfile(R.data?.metadata?.channelId));return!(c.data&&R.hasCompleted&&w.data&&O.data&&ie.data&&M&&k.data&&A.hasCompleted&&(!J||nt.hasCompleted))&&!T?(0,X.jsx)(Vt,{}):(0,X.jsx)(Ye.Provider,{value:be,children:(0,X.jsxs)(`div`,{className:`position-relative`,children:[!!(z&&R.data)&&(0,X.jsx)(rt,{status:R.data.status,type:`topic`}),(0,X.jsx)(Bt,{dashboard:R.data,classification:w.data,channel:nt.data,getWidgetContentRequest:Ze,getWidgetContentRequestWithCursor:Ze,getBreadcrumbs:Xe(),hasPermissions:r,hasLocalPermissions:a,presentation:O.data,curriculums:h,onToggleFollow:Fe,getBannerActions:Ke,audiences:e.queryParams.mtv?null:k.data,activeAudiences:W,analyticsData:K,imageCdnUrl:c.data.imageCdnUrl,imageUrls:lt,resourceThumbnailFallbackImageUrl:I.Fallbacks.RESOURCE_THUMBNAIL,emptyImageUrl:V?I.EmptyStates.Topics.TEACHER_ONLY:I.EmptyStates.Topics.TOPIC,isComingSoon:Re,showFollowButtonSpinner:q,comingSoonImageUrl:I.EmptyStates.Topics.COMING_SOON,appLinks:{...qe,signUp:ge.getSignUpAppLink,widgetWizard:()=>null,previewQuestions:e=>he.getPreviewQuestionsAppLink(e)},isPreviewing:z,canFollowSubjects:Se,onSubmitFeedback:r(i.CanSubmitFeedback)&&Ge,tableOfContentsId:e.queryParams.tocId,lazyLoad:!B.isBot(),moviesAndTv:e.queryParams.mtv,isTeacherOnly:V,specialEvent:A.data,isBot:B.isBot(),hasTopicDirectoryDashboard:oe,hasTopicCurriculumDashboard:se,tab:x.getActiveTopicTab(w.data,e.targetType),settings:s,isTertiaryCustomerWithoutExchange:H&&!pe?.hasProduct(ae.Exchange),commonVideoProps:ve,onDownloadAllClick:We})]})})}var Qt=o.encloseNamespace(`liveClassification.classificationView`);$t.defaultProps={queryParams:{}};function $t(e){let{commonVideoProps:t}=Ue({locationContext:y.VideoThumbnail}),n=et({location:tt.VideoItem,presentationSlug:e.presentationSlug}),r=Ae(),i=ut(),a=fe();async function s(e,t,n){try{await i(e,t,n)}catch{a.error(o.getPhrase(`shared.downloadResource`,`downloadResourcesError`))}}let{openInCurationStudioLabel:c,isUserCurator:l,getOpenInCurationStudioLink:u}=$e(`clickview-live`),d=p(ne.config()),f=p(F.currentUser()),m=p(L.classification(e.id,f.data?.id)),{dashboard:h,presentation:g,isPreviewing:_}=q({targetType:k.Classification,classificationId:e.id,queryParams:e.queryParams}),v=p(g&&ke.presentationAudiences(w.StreamableLearning,g.id)),b=p(L.path(e.id,w.StreamableLearning)),x=_e(m.data,e.queryParams,e.presentationSlug);le(ce.getClassificationMetadata({content:{classification:m.data,dashboard:h.data},phraseContext:{phraseHandler:Qt,titlePhrase:`pageTitle`,descriptionPhrase:`pageDescription`},canonicalLink:B.getCanonicalLink({stripPresentationSlug:!0,customAppLink:x.classification(m.data)}),allowIndexing:B.allowIndexing()})),He(m,{notFound:Jt});let C=Y.useMemo(()=>S.getActiveAudiencesFromParams(v.data,e.queryParams),[v.data,e.queryParams]),T=C?.map(e=>e.masterId)??[],E={presentationId:g?.id,presentationName:g?.name,currentClassificationId:m.data?.id,currentClassificationName:m.data?.name,followingCurrentClassification:!!m.data?.followers?.data?.length,activeAudienceNames:C?.length?C.map(e=>e.name):null,activeAudienceIds:T.length?T:null},{canFollowSubjects:D,showFollowButtonSpinner:O,onToggleFollow:A,getFollowBannerActions:j}=Kt({classification:m.data,analyticsData:E});function M(){let e=j();return l?[...e.map(e=>({...e,className:`${e.className} me-2`})),{label:c,href:u(P.Subject,m.data?.id,g?.id),openInNewTab:!0}]:e}function N(){return()=>ve({appLinks:x,classification:m.data,path:b.data,presentationSlug:e.presentationSlug})}return d.data&&h.hasCompleted&&m.data&&g&&b.data&&v.data?(0,X.jsx)(Ye.Provider,{value:n,children:(0,X.jsxs)(`div`,{className:`position-relative`,children:[!!(_&&h.data)&&(0,X.jsx)(rt,{status:h.data.status,type:`topic`}),(0,X.jsx)(Bt,{dashboard:h.data,classification:m.data,getWidgetContentRequest:Oe.dashboardWidgetContent,getBreadcrumbs:N(),hasPermissions:()=>!1,hasLocalPermissions:()=>!1,presentation:g,getBannerActions:M,onToggleFollow:A,showFollowButtonSpinner:O,audiences:v.data,activeAudiences:C,analyticsData:E,imageCdnUrl:d.data.imageCdnUrl,imageUrls:lt,resourceThumbnailFallbackImageUrl:I.Live.Fallbacks.RESOURCE_THUMBNAIL,emptyImageUrl:I.Live.EmptyStates.Topics.TOPIC,appLinks:x,isPreviewing:_,isViewCurrentPresentation:!0,canFollowSubjects:D,tableOfContentsId:e.queryParams.tocId,lazyLoad:!B.isBot(),isTeacherOnly:!1,contentType:ee.Livestream,hasTopicDirectoryDashboard:!1,hasTopicCurriculumDashboard:!1,isTertiaryCustomerWithoutExchange:!1,tab:`curated-topic`,curriculums:r,commonVideoProps:t,onDownloadAllClick:s})]})}):(0,X.jsx)(Vt,{})}var en=Fe({[w.Subject]:e=>(0,X.jsx)(Zt,{presentationSlug:e.presentationSlug,id:e.id,queryParams:e.queryParams,targetType:e.targetType},`${e.id}:${e.targetType}`),[w.StreamableLearning]:e=>e.targetType===k.Classification?(0,X.jsx)($t,{presentationSlug:e.presentationSlug,id:e.id,queryParams:e.queryParams},`${e.id}:${e.targetType}`):null});en.displayName=`BaseClassificationView`;export{en as BaseClassificationView};
|
|
2
|
-
//# sourceMappingURL=
|
|
1
|
+
import{o as e}from"./DAXXjFlN.chunk.js";import{r as t}from"./snXCXfT6.chunk.js";import{x as n,y as r}from"./BftnFbcr.chunk.js";import"./DFZS3Ffo.chunk.js";import{n as i,t as a}from"./B785hxeE.chunk.js";import{t as o}from"./CQyJ7YGa.chunk.js";import{t as s}from"./ChzgIDQv.chunk.js";import{t as c}from"./C2w0pmFW.chunk.js";import{t as l}from"./wrLrTezN.chunk.js";import{t as u}from"./BXTI9cmX.chunk.js";import{C as d,p as f,u as p}from"./BX0wDJmp.chunk.js";import{t as m}from"./C1SLt-ar.chunk.js";import{N as h,P as g,U as _,l as v,y,z as b}from"./NlCAcBdo.chunk.js";import{n as x}from"./1LRpIhCn.chunk.js";import{t as S}from"./RjGIOTdP.chunk.js";import{n as C,t as w}from"./DTGfiG8Y.chunk.js";import{a as T,i as E,r as D,t as O}from"./Cr6TXzQQ2.chunk.js";import{n as k,t as A}from"./CmcCVXi32.chunk.js";import{t as ee}from"./Dat7ugzw2.chunk.js";import{t as j}from"./DGmmTRu72.chunk.js";import{t as M}from"./DZX1tZ-D2.chunk.js";import{t as N}from"./xwiwWcv12.chunk.js";import{t as P}from"./CVHQXNzi2.chunk.js";import{t as F}from"./CqrjHjAN.chunk.js";import{t as te}from"./eoAypzU3.chunk.js";import{t as ne}from"./D_gWf2lC.chunk.js";import{t as re}from"./_GCZ-60i.chunk.js";import{t as I}from"./7-GJWRH82.chunk.js";import{t as ie}from"./dLd5d3X22.chunk.js";import{t as L}from"./CZc2Wh_b2.chunk.js";import{t as R}from"./DpCWroEe2.chunk.js";import{t as ae}from"./QCFxJYkI2.chunk.js";import{t as oe}from"./CduNFx13.chunk.js";import{t as se}from"./BUnh3rN0.chunk.js";import{t as z}from"./BJZXCSV9.chunk.js";import{n as ce,t as le}from"./C6-aC3vu.chunk.js";import{t as ue}from"./B3gsVN-_.chunk.js";import{t as de}from"./Dfw0sxVt2.chunk.js";import{t as B}from"./B_-pJtOI2.chunk.js";import{n as V,t as H}from"./CpFtf-tI2.chunk.js";import{t as fe}from"./CXnhm0VS2.chunk.js";import{t as pe}from"./YmXEsLuD.chunk.js";import{t as U}from"./CEtJop-5.chunk.js";import{t as me}from"./BUoougrH.chunk.js";import{t as he}from"./CzuHD4Ht.chunk.js";import{t as ge}from"./CCdnFnNP.chunk.js";import{n as _e,r as ve,t as ye}from"./DkPhyvJ2.chunk.js";import{t as be}from"./ClpxGEGl.chunk.js";import{t as W}from"./C7HU4huj.chunk.js";import{t as G}from"./5ONJSThP.chunk.js";import{t as xe}from"./C7GcQtj3.chunk.js";import{t as K}from"./9kSpxveW.chunk.js";import{t as Se}from"./DDJBf9pK2.chunk.js";import{n as Ce}from"./ChnNWPOK2.chunk.js";import{t as we}from"./vsyhrSK92.chunk.js";import{t as Te}from"./DBHDBu1Y.chunk.js";import{t as Ee}from"./Dsv4OsIs.chunk.js";import{t as De}from"./1IFtXPNY.chunk.js";import{t as Oe}from"./DewCxv4i.chunk.js";import{t as ke}from"./DMaQV7L2.chunk.js";import{t as Ae}from"./CCb14vhF.chunk.js";import{t as q}from"./B8gP8YoA.chunk.js";import{t as je}from"./DmKYYMW8.chunk.js";import{n as Me,r as Ne,t as Pe}from"./H6xxoFyN2.chunk.js";import{t as Fe}from"./CSRpjM7n2.chunk.js";import{t as Ie}from"./DELN_PAD2.chunk.js";import{t as Le}from"./AEt1phMH2.chunk.js";import{t as Re}from"./_42F7SIA2.chunk.js";import{n as ze,t as Be}from"./DzgAvoez.chunk.js";import{t as Ve}from"./fm4MaUp7.chunk.js";import{t as He}from"./C9XBZFiR.chunk.js";import{t as Ue}from"./BnuuRu_J2.chunk.js";import{n as We,t as Ge}from"./CY_30Xdt.chunk.js";import{a as Ke,o as qe,t as Je}from"./BTWmC6pW.chunk.js";import{o as Ye,r as Xe}from"./CpgHBpMp.chunk.js";import{t as Ze}from"./CwYrnhdi.chunk.js";import{t as Qe}from"./CC5Dr9aG.chunk.js";import{r as $e}from"./yk6K0dmz2.chunk.js";import{n as et,t as tt}from"./CvtZ8ZFA2.chunk.js";import{t as J}from"./s6NJOjzU2.chunk.js";import{t as nt}from"./C8aOMmXJ2.chunk.js";import{t as rt}from"./B5GEXNkP2.chunk.js";import{n as it,t as at}from"./Cg2g-9Kl2.chunk.js";import{n as ot,r as st,t as ct}from"./BgOLbASl2.chunk.js";import{t as lt}from"./C7YBocZE.chunk.js";import{t as ut}from"./D6xnEQSC.chunk.js";var Y=e(c()),X=l(),dt=`subject.classificationHeaderDetails`,ft=({className:e})=>(0,X.jsx)(`span`,{className:e,children:`•`});function pt(e){let{dashboardVideoCount:t,childDashboardVideoCount:n,dashboardResourceCount:r,childDashboardResourceCount:i,childClassificationCount:a}=x.getCounts(e.classification),o=t+n,s=r+i;return(0,X.jsxs)(`p`,{className:`mb-n1 font-size-normal fw-normal mt-1`,children:[!!a&&(0,X.jsx)(V,{namespace:dt,phrase:`topics`,options:{count:a.toLocaleString(),smartCount:a}}),!!o&&(0,X.jsxs)(X.Fragment,{children:[a>0&&(0,X.jsx)(ft,{className:`mx-2`}),(0,X.jsx)(V,{namespace:dt,phrase:`videos`,options:{count:o.toLocaleString(),smartCount:o}})]}),!!s&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(ft,{className:`mx-2`}),(0,X.jsx)(V,{namespace:dt,phrase:`resources`,options:{count:s.toLocaleString(),smartCount:s}})]})]})}var Z=`subjects.curatedClassificationEmptyState`,mt=o.encloseNamespace(Z);function ht(e){let n=e.dashboard?.status===A.Archived;return(0,X.jsx)(H.Provider,{value:Z,children:(0,X.jsxs)(z,{children:[(0,X.jsx)(z.Image,{src:e.imageUrl,altText:mt(`headingForNP`)}),e.isReadonly?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(z.Heading,{children:(0,X.jsx)(V,{namespace:Z,phrase:`headingForCurator`})}),(0,X.jsx)(z.Info,{children:(0,X.jsx)(V,{namespace:Z,phrase:`info`})}),(0,X.jsx)(t,{title:n?o.getPhrase(Z,`archivedCtaTooltip`):``,spanHack:!0,children:(0,X.jsx)(z.Cta,{text:o.getPhrase(Z,`add`),appLink:e.addWidgetApplink?.(),className:`btn btn-dark`,icon:Se,disabled:n})})]}):(0,X.jsx)(z.Heading,{children:(0,X.jsx)(V,{phrase:`headingForNP`})})]})})}var gt={container:`_container_1n8qw_1`,mobile:`_mobile_1n8qw_7`};function _t(e){let[t,n]=Y.useState(!1);function r(){let n={actionType:t?b.Hide:b.Open,entity:v.TableOfContents,location:y.Dashboard};re.logUserAction(e.analyticsData,n)}function i(){n(!t),r()}return(0,X.jsxs)(`div`,{className:`${gt.mobile} d-inline-flex gap-1`,children:[t&&(0,X.jsxs)(`div`,{className:`bg-white px-3 pt-3 pb-2 border border-dark rounded-1 ps-3`,children:[(0,X.jsx)(`h2`,{className:`h5`,children:e.title}),(0,X.jsx)(ct,{items:e.widgets.map(e=>({name:e.name,id:e.id,tocIndentation:e.metadata.tocIndentation})),activeId:e.activeId,appLink:e.appLink,analyticsData:e.analyticsData,setControlledId:e.setControlledId,getAppLink:e.getAppLink,onItemClick:()=>n(!1)})]}),(0,X.jsx)(`div`,{className:gt.container,children:(0,X.jsx)(se,{className:`btn btn-outline-dark`,svg:Ie,onClick:i})})]})}function vt(e){return(0,X.jsx)(`aside`,{className:`col-3 order-1`,children:(0,X.jsxs)(`div`,{className:`${gt.container} ps-3`,children:[(0,X.jsx)(`h2`,{className:`h5`,children:e.title}),(0,X.jsx)(ct,{items:e.widgets.map(e=>({name:e.name,id:e.id,tocIndentation:e.metadata.tocIndentation})),activeId:e.activeId,appLink:e.appLink,analyticsData:e.analyticsData,setControlledId:e.setControlledId,getAppLink:e.getAppLink})]})})}function yt(e){function t(e){let t=R.getCurrentRoute().appLink,n=t.params?{...t.params}:{};return n.tocId=e.id,{...t,params:n}}return(0,X.jsx)(X.Fragment,{children:e.isSmallScreen?(0,X.jsx)(_t,{...e,getAppLink:t}):(0,X.jsx)(vt,{...e,getAppLink:t})})}var bt=`subjects.teacherOnlyEmptyState`,xt=o.encloseNamespace(bt);function St(e){return(0,X.jsx)(H.Provider,{value:bt,children:(0,X.jsxs)(z,{children:[(0,X.jsx)(z.Image,{src:e.imageUrl,altText:xt(`heading`)}),(0,X.jsx)(z.Heading,{children:(0,X.jsx)(V,{phrase:`heading`})}),(0,X.jsx)(z.Info,{children:(0,X.jsx)(V,{phrase:`info`})}),(0,X.jsx)(z.Cta,{text:xt(`cta`),appLink:e.ctaAppLink?.(),className:`btn btn-dark`})]})})}function Ct(e,t){let{isSystemGeneratedDashboard:n,systemGeneratedVideoWidget:r}=Y.useMemo(()=>e?{isSystemGeneratedDashboard:D.isSystemGeneratedDashboard(e.widgets),systemGeneratedVideoWidget:e.widgets.find(e=>e.widgetId===E.ClassificationPinnedVideos&&e.templateId!==T.ThumbnailVerticalList)}:{isSystemGeneratedDashboard:!1,systemGeneratedVideoWidget:null},[e?.id]),i=p(!!r&&Oe.dashboardWidgetContent(r?.id,D.getWidgetParams(r.widgetId,r.templateId,D.getDashboardTargetType(e),t?.map(e=>e.masterId)),r?.templateId));return n?{widgets:e?.widgets?.filter(e=>e.widgetId!==E.ClassificationPinnedVideos||e.templateId===T.ThumbnailVerticalList)??[],videoList:i.data?.content??[],videoListWidgetId:r?.id}:{widgets:m.sortBy(e?.widgets,`index`)}}var wt=`subjects.classificationComingSoon`,Tt=o.encloseNamespace(wt);function Et(e){let t=!!e.data.followers?.data?.length;function n(){e.onToggleFollow?.()}return(0,X.jsx)(H.Provider,{value:wt,children:(0,X.jsxs)(z,{className:`pt-0`,children:[(0,X.jsx)(z.Image,{src:e.imageUrl,altText:Tt(`comingSoon`)}),(0,X.jsx)(z.Heading,{children:(0,X.jsx)(V,{phrase:`comingSoon`})}),(0,X.jsx)(z.Info,{children:(0,X.jsx)(V,{phrase:e.showSignUp?`infoAnon`:`info`})}),e.canFollowSubjects&&(0,X.jsx)(be,{svg:t?pe:U,onClick:n,showSpinner:e.showFollowButtonSpinner,className:`btn follow-btn me-2 ${t?`btn-outline-dark`:`btn-dark`}`,children:(0,X.jsx)(V,{phrase:t?`following`:`follow`})}),e.showSignUp&&!e.canFollowSubjects&&(0,X.jsx)(oe,{appLink:e.signUpAppLink,className:`btn btn-dark d-none d-lg-inline-block`,analyticsOptions:{actionType:b.Click,location:y.ClassificationComingSoon,entity:v.AppLink,workflowPhase:_.Start,descriptor:h.SignUp},analyticsData:{},tag:`button`,children:Tt(`signUp`)})]})})}function Dt(e){return(0,X.jsx)(at,{audiences:e.audiences,activeAudiences:e.activeAudiences,disabled:e.disabled,appLink:e.appLink,disablePersist:e.disablePersist,tooltip:e.tooltip})}function Ot(e){return(0,X.jsx)(`svg`,{...e,children:(0,X.jsx)(`path`,{d:`M4.5 4a.5.5 0 0 0 0 1h16a.5.5 0 0 1 .5.5v12a.5.5 0 0 0 1 0v-12A1.5 1.5 0 0 0 20.5 4zM9 10.26a.256.256 0 0 1 .39-.218l4.482 2.74a.256.256 0 0 1 0 .437L9.39 15.958A.256.256 0 0 1 9 15.739zM18.5 6A1.5 1.5 0 0 1 20 7.5v11a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 2 18.5v-11A1.5 1.5 0 0 1 3.5 6zm-15 1a.5.5 0 0 0-.5.5v11a.5.5 0 0 0 .5.5h15a.5.5 0 0 0 .5-.5v-11a.5.5 0 0 0-.5-.5z`,fill:`currentColor`})})}function kt(e){let[t,n]=ie(`directory:product:tip:switcher`,{on:!1,tab:e||`new-releases`});return Y.useEffect(()=>{e&&n(`tab`,e)},[e]),Y.useEffect(()=>{let e=null;return t.on&&(e=window.setInterval(()=>{t.tab===`new-releases`||t.tab===`all-topics`?n(`tab`,t.tab===`new-releases`?`all-topics`:`new-releases`):n(`tab`,t.tab===`curated-topic`?`video-list`:`curated-topic`)},2e3)),()=>{window.clearInterval(e)}},[t.on,t.tab]),{tab:t.tab,isHighlighting:t.on,start:()=>n(`on`,!0),stop:()=>{n({on:!1,tab:e||t.tab})}}}var Q={curatedTopicTab:`_curatedTopicTab_1ji5o_1`,tabTransition:`_tabTransition_1ji5o_4`},$=`shared.classificationDashboard`;function At(e,t,n,i){let a=t.lg||t.xl||t.xxl||t.xs;function s(){let e=i?Q.tabTransition:``;return t.xs?e+` w-100`:a?e=` ${Q.curatedTopicTab}`:e}return x.isTopLevelTopic(e.classification)?[{name:a?o.getPhrase($,`newReleases`):``,appLink:e.appLinks?.classification?.(e.classification),active:n===`new-releases`,svg:Ze,analyticsData:{id:`new-releases`,classificationId:e.classification.id,classificationName:e.classification.name,presentationId:e.presentation.id,presentationDescription:e.presentation.description,name:o.getPhrase($,`newReleases`),url:r.getHref(e.appLinks?.classification?.(e.classification))},analyticsOptions:{actionType:b.Click,entity:v.Url,location:y.MagicTabs},className:`${t.xs?`w-100`:``} ${i?Q.tabTransition:``}`},{name:a?o.getPhrase($,`allTopics`):``,appLink:e.appLinks?.classificationDirectory?.(e.classification),active:n===`all-topics`,svg:qe,analyticsData:{id:`all-topics`,classificationId:e.classification.id,classificationName:e.classification.name,presentationId:e.presentation.id,presentationDescription:e.presentation.description,name:o.getPhrase($,`allTopics`),url:r.getHref(e.appLinks?.classificationDirectory?.(e.classification))},analyticsOptions:{actionType:b.Click,entity:v.Url,location:y.MagicTabs},className:`${t.xs?`w-100`:``} ${i?Q.tabTransition:``}`}]:[{name:a?o.getPhrase($,`topic`):``,appLink:e.appLinks?.classification?.(e.classification),active:n===`curated-topic`,svg:Ke,analyticsData:{id:`curated-topic`,classificationId:e.classification.id,classificationName:e.classification.name,presentationId:e.presentation.id,presentationDescription:e.presentation.description,name:o.getPhrase($,`topic`),url:r.getHref(e.appLinks?.classification?.(e.classification))},analyticsOptions:{actionType:b.Click,entity:v.Url,location:y.MagicTabs},className:s()},{name:a?o.getPhrase($,`curriculum`):``,appLink:e.appLinks?.classificationCurriculum?.(e.classification),active:n===`curriculum`,svg:Ot,analyticsData:{id:`curriculum`,classificationId:e.classification.id,classificationName:e.classification.name,presentationId:e.presentation.id,presentationDescription:e.presentation.description,name:o.getPhrase($,`curriculum`),url:r.getHref(e.appLinks?.classificationCurriculum?.(e.classification))},analyticsOptions:{actionType:b.Click,entity:v.Url,location:y.MagicTabs},className:`${t.xs?`w-100`:``} ${i?Q.tabTransition:``}`}]}function jt(e){let t=G(),{tab:n,isHighlighting:r}=kt(e.activeTab);return(0,X.jsx)(Ve,{borderRadius:`sm`,className:t.xs?`w-100`:``,listClassName:`d-flex flex-nowrap`,tabs:At(e,t,n,r)})}function Mt(e,t,n,r,i){return!!(i||r&&!t?.length||!S.shouldShowAudiences(e)||n===`curriculum`)}function Nt(e){let t=G(),n=e.forceHideAudiences||Mt(e.audiences,e.activeAudiences,e.activeTab,e.isEmpty,e.isComingSoon);function r(){return!e.classification||!e.dashboard||D.isSystemGeneratedDashboard(e.dashboard.widgets)?!1:x.isTopLevelTopic(e.classification)?e.hasTopicDirectoryDashboard:!!(e.classification.externalMetadata?.isCurated&&e.hasTopicCurriculumDashboard)}function i(){let i=`d-flex flex-column py-3 mb-3`;return e.isComingSoon||(i+=` border-bottom`),(r()||n)&&!t.xs?i:i+` row-gap-3`}function a(){if(n)return t.xs?`d-flex flex-column justify-content-between row-gap-3`:`d-flex align-items-center justify-content-between`;let e=``;return e+=`d-flex align-items-center justify-content-between mb-1`,t.xs&&(e+=` row-gap-3 mb-0`),e}function o(){let e=`d-flex align-items-end justify-content-between`;return t.xs&&(e+=` row-gap-3 flex-wrap`),e}return(0,X.jsxs)(`div`,{className:i(),children:[(0,X.jsxs)(`div`,{className:a(),children:[(0,X.jsx)(Be,{breadcrumbs:e.getBreadcrumbs?.()}),r()&&n&&(0,X.jsx)(jt,{classification:e.classification,activeTab:e.activeTab,appLinks:e.appLinks,presentation:e.presentation})]}),(0,X.jsxs)(`div`,{className:o(),children:[!n&&(0,X.jsx)(Dt,{audiences:e.audiences,activeAudiences:e.activeAudiences,appLink:e.appLinks.audience?.(),disabled:e.disableAudiences,tooltip:e.audienceTooltip,disablePersist:!e.isViewingCurrentPresentation}),r()&&!n&&(0,X.jsx)(jt,{classification:e.classification,activeTab:e.activeTab,appLinks:e.appLinks,presentation:e.presentation})]})]})}var Pt=`shared.classificationDashboard`;function Ft(e){return e.widgetId===E.Blurb&&e.templateId===T.Heading}function It(e){return e.widgetId===E.CuratedClassifications||e.widgetId===E.Classifications}var Lt=[E.ClassificationAllVideos];function Rt(e,t){let n=e[t];return n?Lt.includes(n.widgetId)&&t===e.length-1:!1}function zt(e){let t=e?.[0];return t?O.hasNoContent(t.widgetId)?!1:!t.content||Array.isArray(t.content)&&!t.content.length:!0}Bt.defaultProps={appLinks:{}};function Bt(e){let{widgets:t,videoList:n,videoListWidgetId:r}=Ct(e.dashboard,e.activeAudiences),i=W(K.LGDown),s=Y.useRef(new Set),c=Y.useMemo(()=>t.reduce((e,t)=>(e[t.id]=!1,e),{}),[t?.length]),[l,u]=Y.useState(c),[d,f]=Y.useState(e.tableOfContentsId),[p,m]=Y.useState(``),h=Array.from(s.current);ot(h,d),st({setActiveId:m,headingElements:h,controlledId:d,setControlledId:f});let g=e.classification.type===C.Hub,_=!!e.dashboard?.metadata?.channelId;function v(){return e.isComingSoon||e.isTeacherOnly?!1:!e.dashboard||e.dashboard.status===A.Archived&&!e.isReadonly||e.dashboard.status===A.Draft&&!e.isPreviewing||!t?.length?!0:n&&n.length?!1:Object.values(l).every(e=>!!e)}function b(t,n,r,i){let a=D.getWidgetParams(n,r,D.getDashboardTargetType(e.dashboard),e.activeAudiences?.map(e=>e.masterId),e.curriculums.preferredCurriculum?.id);return i&&e.getWidgetContentRequestWithCursor?e.getWidgetContentRequestWithCursor(t,a,r,i):e.getWidgetContentRequest(t,a,r)}let S=v();Y.useEffect(()=>{S&&u(c)},[t?.length]);let w=Y.useCallback((n,r)=>{if(l[n]===r)return;let i={...l,[n]:r};if(D.isType(e.dashboard,k.ClassificationDirectory)){u(i);return}let a=0;for(;a<t.length;){let e=t[a];if(!Ft(e)){a++;continue}let n=!0,r=a+1;for(;n&&r<t.length;){let e=t[r];if(Ft(e))break;!i[e.id]&&!It(e)&&(n=!1),r++}a=r,i[e.id]=n}u(i)},[l,t]);function T(e){return Ft(e)&&l[e.id]}function ee(){let t=D.getDashboardTargetType(e.dashboard);return!(e.moviesAndTv||t===k.ClassificationCurriculum)}function j(e,n){if(e.widgetId===E.ClassificationDashboardExternalMedia){let r=t[n-1];return l[r.id]?e.name.replace(`Other videos`,`Videos`):e.name}return e.name}let M=t.filter(e=>!T(e)&&!!e.metadata?.showInTableOfContents),N=t.every(It),P=M.length>=2,F=P&&!i,te=e.settings?.hasTopicDirectories&&x.isTopLevelTopic(e.classification)&&!e.isTertiaryCustomerWithoutExchange&&!g;return(0,X.jsxs)(`div`,{className:`bg-white px-4 ${ee()?`dashboard-spacing-lg`:``}`,children:[(0,X.jsx)(Ge,{type:_?`channel-topic`:`default`,logo:_&&e.channel?._logo.value,logoBgColour:_&&e.channel?._colour.value,heading:e.classification.name,banner:e.classification.banner,imageCdnUrl:e.imageCdnUrl,actions:e.getBannerActions?.(),actionsDropdownClassName:`btn btn-outline-dark`,specialEvent:e.specialEvent,calendarTheme:{background:`bg-light-blue`,border:`border-light-blue`},showComingSoon:e.isComingSoon,detailsComponent:te?()=>(0,X.jsx)(pt,{classification:e.classification}):null}),g?(0,X.jsx)(`div`,{className:`py-3 mb-3 border-bottom`,children:(0,X.jsx)(`div`,{className:`mt-3`,children:(0,X.jsx)(nt,{children:()=>(0,X.jsx)(`p`,{className:`mb-0`,children:e.classification.description})})})}):(0,X.jsx)(Nt,{forceHideAudiences:_,dashboard:e.dashboard,classification:e.classification,presentation:e.presentation,appLinks:e.appLinks,activeTab:e.tab,audiences:e.audiences,activeAudiences:e.activeAudiences,getBreadcrumbs:e.getBreadcrumbs,hasTopicDirectoryDashboard:e.hasTopicDirectoryDashboard,hasTopicCurriculumDashboard:e.hasTopicCurriculumDashboard,isComingSoon:e.isComingSoon,isEmpty:S,isViewingCurrentPresentation:e.isViewCurrentPresentation,disableAudiences:N||e.isReadonly,audienceTooltip:N?o.getPhrase(Pt,`audienceTooltip`):``}),e.isComingSoon&&(0,X.jsx)(Et,{imageUrl:e.comingSoonImageUrl,data:e.classification,canFollowSubjects:e.canFollowSubjects,showFollowButtonSpinner:e.showFollowButtonSpinner,onToggleFollow:()=>e.onToggleFollow(e.classification,y.ClassificationComingSoon),showSignUp:!e.hasLocalPermissions(a.FollowComingSoonTopics),signUpAppLink:e.appLinks.signUp?.()}),!e.isComingSoon&&(0,X.jsxs)(`div`,{className:`${F?`row no-wrap`:``}`,children:[P&&(0,X.jsx)(yt,{widgets:M,title:e.classification.name,activeId:p,clickable:!e.isReadonly,analyticsData:e.analyticsData,setControlledId:f,isSmallScreen:i}),(0,X.jsx)(`div`,{className:F?`col-9 order-0`:``,children:t.map((n,r)=>T(n)?(0,X.jsx)(Y.Fragment,{},n.id):Lt.includes(n.widgetId)?(0,X.jsx)(J,{index:r,item:n,infiniteFetch:Rt(t,r)&&!!e.getWidgetContentRequestWithCursor,dashboardTarget:D.getDashboardTargetType(e.dashboard),getName:e=>j(e,r),getWidgetMetadata:e=>e.metadata,getContent:e=>e.content,getCursor:e=>e.cursor,getRequest:e=>b(n.id,n.widgetId,n.templateId,e),isEmptyPredicate:zt,audiences:e.audiences,appLinks:e.appLinks,commonVideoProps:e.commonVideoProps,hasPermissions:e.hasPermissions,hasLocalPermissions:e.hasLocalPermissions,resultsTransformers:O.getWidgetResultsTransformers(),presentation:e.presentation,analyticsData:e.analyticsData,imageCdnUrl:e.imageCdnUrl,imageUrls:e.imageUrls,resourceThumbnailFallbackImageUrl:e.resourceThumbnailFallbackImageUrl,lazyLoad:e.lazyLoad,headingElementRef:s,hasTableOfContents:F,isScrollToTargetWidget:e.scrollToWidgetId===n.id,isBot:e.isBot,isPreviewing:e.isReadonly,isEditing:e.isReadonly,curriculums:e.curriculums,contentType:e.contentType,setIsEmpty:e=>w(n.id,e),getSelectedItems:null,appLinkOptions:null},n.id):(0,X.jsx)(Je,{widgetCollection:k.Classification,headingElementRef:s,id:n.id,name:j(n,r),description:n.description,classification:e.classification,templateId:n.templateId,widgetTypeId:n.widgetId,audiences:e.audiences,getContentRequest:b,setIsEmpty:w,appLinks:e.appLinks,presentation:e.presentation,analyticsData:e.analyticsData,isScrollToTargetWidget:e.scrollToWidgetId===n.id,imageCdnUrl:e.imageCdnUrl,imageUrls:e.imageUrls,onSubmitFeedback:e.onSubmitFeedback,onDownloadAllClick:e.onDownloadAllClick,metadata:n.metadata,isBot:e.isBot,hasTableOfContents:F,lazyLoad:e.lazyLoad,dashboardTarget:D.getDashboardTargetType(e.dashboard),widgetIndex:r,hasPermissions:e.hasPermissions,hasLocalPermissions:e.hasLocalPermissions,isPreviewing:e.isReadonly,contentType:e.contentType,resourceThumbnailFallbackImageUrl:e.resourceThumbnailFallbackImageUrl,onToggleFollowClassification:e.onToggleFollow,settings:e.settings,isEditing:e.isReadonly,isTertiaryCustomerWithoutExchange:e.isTertiaryCustomerWithoutExchange,commonVideoProps:e.commonVideoProps,curriculums:e.curriculums,limitTotalItems:!1,seeMoreLink:null,onClickRemoveItem:null,badgeComponent:null},n.id))}),!!n?.length&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Re,{name:o.getPhrase(Pt,`videos`)}),(0,X.jsx)(Xe,{videos:n,getVideoAppLink:(t,n)=>e.appLinks.videoType(t,{...n,contextId:r,includeContext:n.includeContext}),hasPermissions:e.hasPermissions,presentationAudiences:e.audiences,getPreviewQuestionsAppLink:e.appLinks.previewQuestions,commonVideoProps:e.commonVideoProps})]})]}),S&&(0,X.jsx)(ht,{dashboard:e.dashboard,isReadonly:e.isReadonly,imageUrl:e.emptyImageUrl,addWidgetApplink:e.appLinks.widgetWizard}),e.isTeacherOnly&&(0,X.jsx)(St,{imageUrl:e.emptyImageUrl,ctaAppLink:()=>e.appLinks.allTopics(e.classification.presentationId)})]})}function Vt(){return(0,X.jsxs)(`div`,{className:`bg-white px-4`,children:[(0,X.jsx)(We,{}),(0,X.jsxs)(`div`,{className:`d-flex flex-column row-gap-3 py-3 mb-3 border-bottom`,children:[(0,X.jsx)(ze,{}),(0,X.jsx)(it,{})]})]})}var Ht={follow:()=>`{gateway}/v1/users/me/classifications/following`,unfollow:e=>M.urlBuilder(`{gateway}/v1/users/me/classifications/following`,{id:e})},Ut={follow(e,t,n,r){return{url:Ht.follow(),key:`follow:${e.join(`,`)}`,type:d.POST,data:e,formatData:()=>e.map(e=>({id:e,followers:{data:[t]}})),success:n,error:r,invalidationKeys:[...e.map(e=>`classification:${e}`),`my:subject:preferences`,`classifications`]}},unfollow(e,t,n,r){return{url:Ht.unfollow(e),key:`unfollow:${e.join(`,`)}`,type:d.DELETE,formatData:()=>e.map(e=>({id:e,followers:{data:[]}})),success:n,error:r,invalidationKeys:[...e.map(e=>`classification:${e}`),`my:subject:preferences`,`classifications`]}}},Wt={followButton:`_followButton_1ylet_2`},Gt=o.encloseNamespace(`subjects.classification`);function Kt(e){let{classification:t,analyticsData:n}=e,[r,a]=Y.useState(!1),o=fe(),s=f(),{hasPermissions:c}=ue(),l=p(F.currentUser()),u=W(K.MDDown),d=W(K.SMDown),m=c(i.FollowSubjects);function h(e,r){if(!m||!t)return;let i=e.id.toString()===t.id?.toString();i&&a(!0);let c=x.isFollowing(e),u=c?Ut.unfollow:Ut.follow;s(u([e.id],l.data?.id)).then(()=>{re.logUserAction(n,{location:r,actionType:b.Follow,workflowPhase:_.Complete,descriptor:c?g.Off:g.On,entity:v.Classification}),i||o.success(Gt(c?`unfollowed`:`followed`,{name:e.name}))}).finally(()=>{i&&a(!1)})}function S(){if(!m||!t)return[];let e=!!t.followers?.data?.length;return[{label:d?``:Gt(e?`following`:`follow`),onClick:()=>h(t,y.Banner),svg:e?pe:U,className:`btn follow-btn ${e?`btn-outline-dark`:`btn-dark`} ${Wt.followButton}`,button:!0,tooltip:e||u?void 0:Gt(`followBtnTooltip`),showSpinner:r}]}return{canFollowSubjects:m,showFollowButtonSpinner:r,onToggleFollow:h,getFollowBannerActions:S}}var qt=`subjects.topicNotFoundError`,Jt=class extends s{constructor(){super(`Topic doesn't exist`)}get name(){return`TopicNotFoundError`}get heading(){return o.getPhrase(qt,`heading`)}get description(){return o.getPhrase(qt,`description`)}get cta(){return{text:o.getPhrase(qt,`cta`),appLink:{application:u.SUBJECT,action:te.Subjects.PRESENTATION_TOPICS,args:[null]}}}};function Yt(e,t,n){let{hasTopicDirectories:r,hasTopicVideoListFeature:i}=j(null),{dashboard:a,isPreviewing:o,isTeacherOnly:s}=q({classificationId:e,queryParams:t,targetType:k.Classification}),{dashboard:c}=q({classificationId:e,queryParams:t,targetType:k.ClassificationDirectory}),{dashboard:l}=q({classificationId:e,queryParams:t,targetType:k.ClassificationCurriculum});function u(){switch(n){case k.Classification:return a;case k.ClassificationDirectory:return c;case k.ClassificationCurriculum:return l}}return{dashboard:u(),hasTopicDirectoryDashboard:r&&!!c.data,hasTopicCurriculumDashboard:i&&!!l.data,isTeacherOnly:s,isPreviewing:o}}Zt.defaultProps={queryParams:{}};var Xt=o.encloseNamespace(`subjects.classification`);function Zt(e){let t=f(),{hasPermissions:r,hasLocalPermissions:a}=ue(),s=j(null),c=p(ne.config()),l=p(F.currentUser()),{openInCurationStudioLabel:u,isUserCurator:d,getOpenInCurationStudioLink:m}=$e(),h=Ae(),g=p(r(i.CanSubmitFeedback)&&l.data?.isAuthenticated&&N.customer(l.data.customerId)),w=p(L.classification(e.id,l.data?.id)),T=w.data?.type===C.Hub,E=T?w.data?.id:e.queryParams.hubTopic,O=p(w.data&&L.presentationById(w.data.presentationId)),k=p(w.data&&ke.audiencesByPresentationId(w.data.presentationId)),A=p(w.data&&Le.nextTopicSpecialEvent(e.id,w.data.presentationId)),ee=p(l.data?.isAuthenticated&&De.libraries()),{availablePresentations:M,canAccessPresentation:te}=xe(),ie=p(L.path(e.id)),{dashboard:R,hasTopicDirectoryDashboard:oe,hasTopicCurriculumDashboard:se,isPreviewing:z,isTeacherOnly:V}=Yt(e.id,e.queryParams,e.targetType),H=we(),pe=de(),U=p(L.regionAlternatives(e.id)),_e=B.getPreferredRegionAlternative(U.data,l.data?.contentRegion);le(ce.getClassificationMetadata({content:{classification:w.data,dashboard:R.data},phraseContext:{phraseHandler:Xt,titlePhrase:`pageTitle`,descriptionPhrase:`pageDescription`},canonicalLink:B.getCanonicalLink({stripPresentationSlug:!0,customAppLink:me.getAppLink({...w.data,name:_e?.name||w.data?.name},e.queryParams,M),hrefTransformer:B.createRegionHrefTransformer(U.data,l.data?.contentRegion)}),allowIndexing:B.allowIndexing(),hrefLang:B.getContentHrefLang(U.data,()=>me.getAppLink(w.data,{},M))})),He(w,{notFound:Jt}),Ce({id:e.id,app:`topics`});let{commonVideoProps:ve}=Ue({locationContext:y.VideoThumbnail,mtv:e.queryParams.mtv,hubTopic:E}),be=et({location:tt.VideoItem,presentationSlug:e.presentationSlug}),W=Y.useMemo(()=>S.getActiveAudiencesFromParams(k.data,e.queryParams),[k.data,e.queryParams]),G=W?.map(e=>e.masterId)??[],K={presentationId:O.data?.id,presentationName:O.data?.name,currentClassificationId:w.data?.id,currentClassificationName:w.data?.name,followingCurrentClassification:!!w.data?.followers?.data?.length,activeAudienceNames:W?.length?W.map(e=>e.name):null,activeAudienceIds:G.length?G:null},{canFollowSubjects:Se,showFollowButtonSpinner:q,onToggleFollow:Fe,getFollowBannerActions:Ie}=Kt({classification:w.data,analyticsData:K}),Re=w.data?.status===Te.ComingSoon&&!z,ze=D.getDashboardTargetType(R.data),Be=ut(),Ve=fe();async function We(e,t,n){try{await Be(e,t,n)}catch{Ve.error(o.getPhrase(`shared.downloadResource`,`downloadResourcesError`))}}async function Ge(e){let a=await t(Me.submitFeedback({type:Ne.Footer,user:Pe.getUserInfo(l.data,g.data),tags:Pe.getTags(l.data,ae.Primary,r(i.StudentExperience),[`topics`,`in product feedback`])},{reaction:e.type,feedback:e.content,location:`Topic Footer`,presentationName:O.data.description,presentationId:O.data.id,dashboardName:R.data.name,dashboardId:R.data.id,classificationName:w.data.name,classificationId:w.data.id,currentPageUrl:n.GetCurrentUrl()}));return re.logUserAction({feedbackType:e.type,content:e.content,presentationId:O.data.id,classificationId:w.data.id,dashboardId:R.data.id},{actionType:b.Submit,location:y.ClassificationFooter,entity:v.Feedback,workflowPhase:_.Complete}),a}function Ke(){if(T||J)return[];let e=Ie();return d?[...e.map(e=>({...e,className:`${e.className} me-2`})),{label:u,href:m(P.Subject,w.data?.id,O.data?.id),openInNewTab:!0}]:e}let qe=ye(w.data,ze,{...e.queryParams,hubTopic:E},l.data,e.presentationSlug,M),Je=Qe({name:w.data?.name});function Xe(){if(te(O.data?.id))return()=>Je}function Ze(e,t,n,r){let{hasTwig:i,hasTigtag:a}=je.hasTwigOrTigtag(ee.data,l.data);return Oe.dashboardWidgetContent(e,t,n,O.data,{hideTigTag:!a,hideTwig:!i,cursor:r})}let J=R.data?.metadata?.channelId,nt=p(J&&Ee.partnerProfile(R.data?.metadata?.channelId));return!(c.data&&R.hasCompleted&&w.data&&O.data&&ie.data&&M&&k.data&&A.hasCompleted&&(!J||nt.hasCompleted))&&!T?(0,X.jsx)(Vt,{}):(0,X.jsx)(Ye.Provider,{value:be,children:(0,X.jsxs)(`div`,{className:`position-relative`,children:[!!(z&&R.data)&&(0,X.jsx)(rt,{status:R.data.status,type:`topic`}),(0,X.jsx)(Bt,{dashboard:R.data,classification:w.data,channel:nt.data,getWidgetContentRequest:Ze,getWidgetContentRequestWithCursor:Ze,getBreadcrumbs:Xe(),hasPermissions:r,hasLocalPermissions:a,presentation:O.data,curriculums:h,onToggleFollow:Fe,getBannerActions:Ke,audiences:e.queryParams.mtv?null:k.data,activeAudiences:W,analyticsData:K,imageCdnUrl:c.data.imageCdnUrl,imageUrls:lt,resourceThumbnailFallbackImageUrl:I.Fallbacks.RESOURCE_THUMBNAIL,emptyImageUrl:V?I.EmptyStates.Topics.TEACHER_ONLY:I.EmptyStates.Topics.TOPIC,isComingSoon:Re,showFollowButtonSpinner:q,comingSoonImageUrl:I.EmptyStates.Topics.COMING_SOON,appLinks:{...qe,signUp:ge.getSignUpAppLink,widgetWizard:()=>null,previewQuestions:e=>he.getPreviewQuestionsAppLink(e)},isPreviewing:z,canFollowSubjects:Se,onSubmitFeedback:r(i.CanSubmitFeedback)&&Ge,tableOfContentsId:e.queryParams.tocId,lazyLoad:!B.isBot(),moviesAndTv:e.queryParams.mtv,isTeacherOnly:V,specialEvent:A.data,isBot:B.isBot(),hasTopicDirectoryDashboard:oe,hasTopicCurriculumDashboard:se,tab:x.getActiveTopicTab(w.data,e.targetType),settings:s,isTertiaryCustomerWithoutExchange:H&&!pe?.hasProduct(ae.Exchange),commonVideoProps:ve,onDownloadAllClick:We})]})})}var Qt=o.encloseNamespace(`liveClassification.classificationView`);$t.defaultProps={queryParams:{}};function $t(e){let{commonVideoProps:t}=Ue({locationContext:y.VideoThumbnail}),n=et({location:tt.VideoItem,presentationSlug:e.presentationSlug}),r=Ae(),i=ut(),a=fe();async function s(e,t,n){try{await i(e,t,n)}catch{a.error(o.getPhrase(`shared.downloadResource`,`downloadResourcesError`))}}let{openInCurationStudioLabel:c,isUserCurator:l,getOpenInCurationStudioLink:u}=$e(`clickview-live`),d=p(ne.config()),f=p(F.currentUser()),m=p(L.classification(e.id,f.data?.id)),{dashboard:h,presentation:g,isPreviewing:_}=q({targetType:k.Classification,classificationId:e.id,queryParams:e.queryParams}),v=p(g&&ke.presentationAudiences(w.StreamableLearning,g.id)),b=p(L.path(e.id,w.StreamableLearning)),x=_e(m.data,e.queryParams,e.presentationSlug);le(ce.getClassificationMetadata({content:{classification:m.data,dashboard:h.data},phraseContext:{phraseHandler:Qt,titlePhrase:`pageTitle`,descriptionPhrase:`pageDescription`},canonicalLink:B.getCanonicalLink({stripPresentationSlug:!0,customAppLink:x.classification(m.data)}),allowIndexing:B.allowIndexing()})),He(m,{notFound:Jt});let C=Y.useMemo(()=>S.getActiveAudiencesFromParams(v.data,e.queryParams),[v.data,e.queryParams]),T=C?.map(e=>e.masterId)??[],E={presentationId:g?.id,presentationName:g?.name,currentClassificationId:m.data?.id,currentClassificationName:m.data?.name,followingCurrentClassification:!!m.data?.followers?.data?.length,activeAudienceNames:C?.length?C.map(e=>e.name):null,activeAudienceIds:T.length?T:null},{canFollowSubjects:D,showFollowButtonSpinner:O,onToggleFollow:A,getFollowBannerActions:j}=Kt({classification:m.data,analyticsData:E});function M(){let e=j();return l?[...e.map(e=>({...e,className:`${e.className} me-2`})),{label:c,href:u(P.Subject,m.data?.id,g?.id),openInNewTab:!0}]:e}function N(){return()=>ve({appLinks:x,classification:m.data,path:b.data,presentationSlug:e.presentationSlug})}return d.data&&h.hasCompleted&&m.data&&g&&b.data&&v.data?(0,X.jsx)(Ye.Provider,{value:n,children:(0,X.jsxs)(`div`,{className:`position-relative`,children:[!!(_&&h.data)&&(0,X.jsx)(rt,{status:h.data.status,type:`topic`}),(0,X.jsx)(Bt,{dashboard:h.data,classification:m.data,getWidgetContentRequest:Oe.dashboardWidgetContent,getBreadcrumbs:N(),hasPermissions:()=>!1,hasLocalPermissions:()=>!1,presentation:g,getBannerActions:M,onToggleFollow:A,showFollowButtonSpinner:O,audiences:v.data,activeAudiences:C,analyticsData:E,imageCdnUrl:d.data.imageCdnUrl,imageUrls:lt,resourceThumbnailFallbackImageUrl:I.Live.Fallbacks.RESOURCE_THUMBNAIL,emptyImageUrl:I.Live.EmptyStates.Topics.TOPIC,appLinks:x,isPreviewing:_,isViewCurrentPresentation:!0,canFollowSubjects:D,tableOfContentsId:e.queryParams.tocId,lazyLoad:!B.isBot(),isTeacherOnly:!1,contentType:ee.Livestream,hasTopicDirectoryDashboard:!1,hasTopicCurriculumDashboard:!1,isTertiaryCustomerWithoutExchange:!1,tab:`curated-topic`,curriculums:r,commonVideoProps:t,onDownloadAllClick:s})]})}):(0,X.jsx)(Vt,{})}var en=Fe({[w.Subject]:e=>(0,X.jsx)(Zt,{presentationSlug:e.presentationSlug,id:e.id,queryParams:e.queryParams,targetType:e.targetType},`${e.id}:${e.targetType}`),[w.StreamableLearning]:e=>e.targetType===k.Classification?(0,X.jsx)($t,{presentationSlug:e.presentationSlug,id:e.id,queryParams:e.queryParams},`${e.id}:${e.targetType}`):null});en.displayName=`BaseClassificationView`;export{en as BaseClassificationView};
|
|
2
|
+
//# sourceMappingURL=KjTtF4IH.chunk.js.map
|