import{c as x,s as w}from"./chunk-C6uGsfWa.js";import{Do as kg,Eo as kb,Fo as l$,Gr as Va,Lc as zg,Wa as g,Za as gx,ec as th,it as FB,li as Xe,oo as ho,po as ir,rs as nt,vc as wp,xn as Ng,y as Be,ys as pt}from"./chunk-B_pj7Jpm.js";import"./chunk-CgIzqGPc.js";import"./chunk-B35GeA_N.js";import"./chunk-qQMrTuzm.js";import{t as H}from"./chunk-CagJEiiY.js";import"./chunk-fGL9Zb_U.js";import"./chunk-DFa38la6.js";import"./chunk-Ch-TBCUx.js";import"./chunk-CX0pAEF-.js";import"./chunk-BPHMC4rz.js";import"./chunk-COgN00_S.js";import"./chunk-DULXsDZq.js";import"./chunk-CEibY8iL.js";import"./chunk-DhqynJiI.js";import"./chunk-BkYXs1tH.js";import"./chunk-BrcGtY4C.js";import"./chunk-M2X1-U1Z.js";import"./chunk-BmH4cOwr.js";import"./chunk-CR0lnyBO.js";import"./chunk-1IezKpCQ.js";import"./chunk-CEewNwum.js";import"./chunk-D7eF6KoS2.js";import"./chunk-r0Xv-ufY2.js";import"./chunk-CQiHXmZG2.js";import"./chunk-CwzbLzxS2.js";import"./chunk-cztdWiEo2.js";import"./chunk-BHPWLTEh2.js";import"./chunk-DQ-dV2Zg2.js";import"./chunk-TcpfKQW12.js";import{c as ke,n as He,r as Ne}from"./chunk-DwNPdFQU2.js";import"./chunk-Dw_PgttJ2.js";import"./chunk-BD06qecY2.js";import"./chunk-vat4lSzg2.js";import{t as P}from"./chunk-DYngkL6R2.js";import"./chunk-BtxPKQBE.js";import"./chunk-B5b4xrpm.js";import"./chunk-Boe1xg5G2.js";import"./chunk-ffD22sk92.js";import{t as At}from"./chunk-C_4vxqZo2.js";import{n as _e,r as ve,t as M}from"./chunk-B6NE7Mb8.js";var r=class n{authService=g(nt);userSubscription=g(P);hooks=g(zg);videoService=g(H);scopedTokensService=g(Ng);getVideosObservableFunction=this.getVideosObservable.bind(this);getSyndicationItemsFunction=this.getSyndicationItems.bind(this);defaultSort=`-publishedAt`;actions=[{routerLink:`/my-library/subscriptions`,label:"Zarządzaj",iconName:`cog`}];disabled=!1;feedToken;getVideosObservable(e,i){let t=x(w({},i.toVideosAPIObject()),{videoPagination:e,skipCount:!0});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=!0}enabledForReuse(){this.disabled=!1}loadFeedToken(){if(this.feedToken)return Promise.resolve(this.feedToken);return ir(this.authService.userInformationLoaded.pipe(Xe(),Be(()=>this.scopedTokensService.getScopedTokens()),pt(i=>this.feedToken=i.feedToken)))}static ɵfac=function(i){return new(i||n)};static ɵcmp=Va({type:n,selectors:[[`my-videos-user-subscriptions`]],decls:3,vars:5,consts:()=>{let e;return e="Filmy z twoich subskrypcji",[e,[1,`visually-hidden`],[`displayFilters`,`false`,`loadUserVideoPreferences`,`false`,`groupByDate`,`true`,`highlightLives`,`false`,3,`getVideosObservableFunction`,`getSyndicationItemsFunction`,`defaultSort`,`disabled`,`headerActions`]]},template:function(i,t){i&1&&(wp(0,`h1`,1),l$(1,0),kb(),th(2,`my-videos-list`,2)),i&2&&(FB(2),gx(`getVideosObservableFunction`,t.getVideosObservableFunction)(`getSyndicationItemsFunction`,t.getSyndicationItemsFunction)(`defaultSort`,t.defaultSort)(`disabled`,t.disabled)(`headerActions`,t.actions))},dependencies:[At],encapsulation:2,changeDetection:1})};var re=[{path:``,providers:[M,P,ke,Ne,He],children:[{path:`overview`,component:ve,data:{meta:{title:"Odkrywaj filmy"},reuse:{enabled:!0,key:`videos-discover`}}},{path:`most-liked`,redirectTo:`browse?scope=federated&sort=-likes`},{path:`trending`,redirectTo:()=>`browse?scope=federated&sort=-`+g(ho).getDefaultTrendingSort()},{path:`recently-added`,redirectTo:`browse?scope=federated&sort=-publishedAt`},{path:`local`,redirectTo:`browse?scope=local&sort=-publishedAt`},{path:`browse`,component:_e,data:{reuse:{enabled:!0,key:`videos-list`}}},{path:`subscriptions`,canActivate:[kg],component:r,data:{meta:{title:"Subskrypcje"},reuse:{enabled:!0,key:`subscription-videos-list`}}}]}];export{re as default};
//# debugId=95ea41ff-8414-5419-a12e-dfad50c6cdef
//# sourceMappingURL=chunk-DY3JnHsg.js.map