import{J as Je,m as mt,P as P$1}from'./chunk-B5yZUW1q.js';import{J as Ji}from'./chunk-zeb8qUt7.js';import{B}from'./chunk-B5KYT34f.js';import'./chunk-BBkjsYTZ.js';import'./chunk-BpQDcJB_.js';import'./chunk-Cj0bUbMX.js';import'./chunk-CQ8DS5LS.js';import'./chunk-qdb8laCV.js';import{H as Ht,D as Dt,N as Nt}from'./chunk-9FZVzjyB.js';import'./chunk-lrWSmANS.js';import'./chunk-C6aRWhcU.js';import{d7 as ck,g,dm as Oi,aQ as Xe,a_ as Pk,aC as x,dd as ag,av as E,ao as D,dG as ze,a9 as Oe,br as lt,fB as Zn,b as Pa,s as sp,v as vV,d as lb,f as Pp,W as WB,a3 as H0}from'./main-C0Sl1OBd.js';import'./chunk-4_XD9sdW.js';import'./chunk-DnUd0X0t.js';import'./chunk-DZVj2nmI.js';var P=(()=>{class r{authService=g(Xe);userSubscription=g(B);hooks=g(Pk);videoService=g(x);scopedTokensService=g(ag);getVideosObservableFunction=this.getVideosObservable.bind(this);getSyndicationItemsFunction=this.getSyndicationItems.bind(this);defaultSort="-publishedAt";actions=[{routerLink:"/my-library/subscriptions",label:"Gestionar",iconName:"cog"}];disabled=false;feedToken;getVideosObservable(e,i){let t=E(D({},i.toVideosAPIObject()),{videoPagination:e,skipCount:true});return this.hooks.wrapObsFun(this.userSubscription.getUserSubscriptionVideos.bind(this.userSubscription),t,"common","filter:api.user-subscriptions-videos.videos.list.params","filter:api.user-subscriptions-videos.videos.list.result");}getSyndicationItems(){return this.loadFeedToken().then(()=>{let e=this.authService.getUser();return this.videoService.getVideoSubscriptionFeedUrls(e.account.id,this.feedToken);});}disableForReuse(){this.disabled=true;}enabledForReuse(){this.disabled=false;}loadFeedToken(){if(this.feedToken)return Promise.resolve(this.feedToken);let e=this.authService.userInformationLoaded.pipe(ze(),Oe(()=>this.scopedTokensService.getScopedTokens()),lt(i=>this.feedToken=i.feedToken));return Zn(e);}static ɵfac=function(i){return new(i||r)();};static ɵcmp=Pa({type:r,selectors:[["my-videos-user-subscriptions"]],decls:3,vars:5,consts:()=>{let e;return e="V\xEDdeos des de les vostres subscripcions",[e,[1,"visually-hidden"],["displayFilters","false","loadUserVideoPreferences","false","groupByDate","true","highlightLives","false",3,"getVideosObservableFunction","getSyndicationItemsFunction","defaultSort","disabled","headerActions"]];},template:function(i,t){i&1&&(sp(0,"h1",1),vV(1,0),lb(),Pp(2,"my-videos-list",2)),i&2&&(WB(2),H0("getVideosObservableFunction",t.getVideosObservableFunction)("getSyndicationItemsFunction",t.getSyndicationItemsFunction)("defaultSort",t.defaultSort)("disabled",t.disabled)("headerActions",t.actions));},dependencies:[Ji],encapsulation:2,changeDetection:1});}return r;})();var oe=[{path:"",providers:[P$1,B,Ht,Dt,Nt],children:[{path:"overview",component:Je,data:{meta:{title:"Descobrir v\xEDdeos"},reuse:{enabled:true,key:"videos-discover"}}},{path:"most-liked",redirectTo:"browse?scope=federated&sort=-likes"},{path:"trending",redirectTo:()=>"browse?scope=federated&sort=-"+g(Oi).getDefaultTrendingSort()},{path:"recently-added",redirectTo:"browse?scope=federated&sort=-publishedAt"},{path:"local",redirectTo:"browse?scope=local&sort=-publishedAt"},{path:"browse",component:mt,data:{reuse:{enabled:true,key:"videos-list"}}},{path:"subscriptions",canActivate:[ck],component:P,data:{meta:{title:"Subscripcions"},reuse:{enabled:true,key:"subscription-videos-list"}}}]}];/**i18n:c8855ca17fb20171aa9dd43d012e42547cb1f0cfd9c21d4dc05679bbbdf5ccb8*/export{oe as default};//# sourceMappingURL=chunk-DI0mLx-d.js.map