import{ao as e,aO as F,aU as t,L as i,aP as h,aq as r,am as B,W as H,E as R,p as f,r as w,f as C,e as S,dM as O,cu as M,ce as q,c4 as $,bc as Q,bN as z,aX as G,az as L,aj as W,bu as Y,fj as b,fp as X,c3 as J,c5 as K,gQ as Z}from"./app-k0jcl5PQ.js";import{B as ee}from"./PHV_KuUR.chunk.js";import{B as te}from"./CCtuxSlD.chunk.js";import{I as se}from"./DXJ2-V8v.chunk.js";import{V as ie,P as ae,a as oe}from"./DH1mz64H.chunk.js";import{h as re}from"./DIAJ896Y.chunk.js";import{u as ne}from"./CtFw3Moj.chunk.js";import{u as ce}from"./CnmbO5oy.chunk.js";import{u as me}from"./DDxzgH2W.chunk.js";import{u as pe}from"./DgW9Cwsn.chunk.js";import{u as ue}from"./4IZETxJX.chunk.js";import{u as le}from"./BIEH9YuF.chunk.js";import{u as de,V as ge}from"./BUtU6IOA.chunk.js";import"./BKsI6eJC.chunk.js";import"./DoGfHyrk.chunk.js";import"./CA48zo75.chunk.js";import"./BDviDDog.chunk.js";import"./wCY37Ze3.chunk.js";import"./CPXlV0fg.chunk.js";import"./BlKMjFEf.chunk.js";import"./CofWDDSQ.chunk.js";import"./DwvfEevL.chunk.js";import"./D9SGbB34.chunk.js";import"./BwBaQklX.chunk.js";import"./ByBCp1MC.chunk.js";import"./BhYYYlpK.chunk.js";import"./FGhEvk_q.chunk.js";import"./WCBjpMHJ.chunk.js";import"./DoFMWlew.chunk.js";import"./CMnqIsoM.chunk.js";import"./eerUhItV.chunk.js";import"./Cukd0Qmt.chunk.js";import"./B31bqZwo.chunk.js";import"./uoUaCILN.chunk.js";import"./f_twTV5Z.chunk.js";import"./BDeUEvb2.chunk.js";import"./Daim1zo7.chunk.js";import"./B3XH0kWB.chunk.js";import"./BRhv_AHY.chunk.js";import"./CIN5bTKK.chunk.js";import"./BAuuQuuB.chunk.js";import"./DAIetGMf.chunk.js";import"./TReHo2Ua.chunk.js";import"./Bj7bJt_4.chunk.js";import"./CGYNvpr2.chunk.js";import"./U4M4wGTR.chunk.js";import"./Bw9otuBi.chunk.js";import"./BvnABNse.chunk.js";import"./Bh7bFXwG.chunk.js";import"./DCdUbbLx.chunk.js";import"./t24_x3Gi.chunk.js";const he="_image_15h8f_1",fe={image:he},n="shared.favouritesEmptyState",I=i.encloseNamespace(n);function xe(){return e.jsx(F.Provider,{value:n,children:e.jsxs(t,{children:[e.jsx(t.Image,{src:h.EmptyStates.FAVOURITED_VIDEOS,altText:I("info"),className:fe.image}),e.jsx(t.Heading,{className:"h3",children:e.jsx(r,{phrase:"heading"})}),e.jsx(t.Info,{children:e.jsx(r,{phrase:"info"})}),e.jsx(t.Cta,{text:i.getPhrase(n,"cta"),appLink:{application:S.DASHBOARD,action:C.Dashboard.HOME,args:[null]}})]})})}function ve(){return e.jsx(F.Provider,{value:n,children:e.jsxs(t,{children:[e.jsx(t.Image,{src:h.EmptyStates.FAVOURITED_VIDEOS_PUBLIC,altText:I("publicInfo")}),e.jsx(t.Heading,{children:e.jsx(r,{phrase:"publicHeading"})}),e.jsx(t.Info,{children:e.jsx(r,{phrase:"publicInfo"})}),e.jsx(t.Cta,{text:i.getPhrase(n,"publicCta"),appLink:{application:S.SIGN_UP,action:C.SignUp.SIGN_UP},analyticsData:{},analyticsOptions:{actionType:w.Click,location:f.MyFavouritesLanding,entity:R.AppLink,workflowPhase:H.Start,descriptor:B.SignUp}})]})})}const je="shared.favourites";function Pe(){const c=de({location:ge.VideoItem,presentationSlug:null}),{setFavourite:l}=O(f.VideoThumbnail);return{...c,getVideoActions:a=>{const{canConsume:m}=M.getCanBeConsumed(a);return m?c.getVideoActions(a):[{label:i.getPhrase(je,"removeFromFavourites"),svg:q,button:!1,className:"btn btn-link text-danger",onClick:()=>l(a,!1)}]}}}const Ae="_banner_1b9hc_1",Ve={banner:Ae},o="shared.favourites";function Pt(){var A,V;const c=$(),l=Q(),{commonVideoProps:x}=me({locationContext:f.VideoThumbnail}),a=Pe();z({title:i.getPhrase(o,"pageTitle")});const{hasLocalPermissions:m,hasPermissions:E}=G(),d=L(W.currentUser()),y=L(Y.config()),v=s=>Z.getFavourites(d.data.id,s),j=s=>K(c)(v(s)),N=!m(b.ViewMyFavouritesLanding)&&d.hasCompleted,{items:p,hasMore:U,isFetching:P}=ce(N?v:!1,j,_);ue(p);const k=pe(),u=ne({name:i.getPhrase(o,"header")});function _(s,g){if(s===1)return re(g);l.error(i.getPhrase(o,"error"))}const{count:T,isLoading:D}=le((A=d.data)==null?void 0:A.id);return D?e.jsx(e.Fragment,{}):m(b.ViewMyFavouritesLanding)?e.jsx(ve,{}):e.jsx(ie.Provider,{value:a,children:e.jsxs("div",{className:"p-3",children:[e.jsx(ee,{heading:i.getPhrase(o,"header"),banner:{url:h.FAVOURITES_PLAYLIST.FAV_PLAYLIST_BANNER},bannerClassName:`${Ve.banner} bg-pink`,imageCdnUrl:(V=y.data)==null?void 0:V.imageCdnUrl,detailsComponent:()=>e.jsx("div",{className:"mb-n1 font-size-normal fw-normal mt-1",children:e.jsx(r,{namespace:o,phrase:"videos",options:{smartCount:T}})})}),(u==null?void 0:u.length)&&e.jsx("div",{className:"border-bottom pb-3",children:e.jsx(te,{breadcrumbs:u})}),p?p.length?e.jsxs("div",{className:"mt-2",children:[e.jsx(oe,{videos:p,getVideoAppLink:(s,g)=>J.getAppLink(s,g,null),hasPermissions:E,presentationAudiences:k.data,getPreviewQuestionsAppLink:s=>X.getPreviewQuestionsAppLink(s),commonVideoProps:x}),(U||P)&&e.jsx(se,{isFetching:P,fetchNext:j})]}):e.jsx(xe,{}):e.jsx(ae,{})]})})}export{Pt as FavouritesView};
//# sourceMappingURL=DbjJ7doL.chunk.js.map
