1"use strict";(self.webpackChunkPeerTube=self.webpackChunkPeerTube||[]).push([[4155],{37787:(k,A,e)=>{e.d(A,{GK:()=>r,Gz:()=>h,JK:()=>v,Wu:()=>O,mk:()=>s});var t=e(70997),b=e(27258);const s={VALIDATORS:[t.kI.required,t.kI.minLength(1),t.kI.maxLength(120)],MESSAGES:{required:"Display name is required.",minlength:"Display name must be at least 1 character long.",maxlength:"Display name cannot be more than 120 characters long."}},O={VALIDATORS:[t.kI.required],MESSAGES:{required:"Privacy is required."}},h={VALIDATORS:[t.kI.minLength(3),t.kI.maxLength(1e3)],MESSAGES:{minlength:"Description must be at least 3 characters long.",maxlength:"Description cannot be more than 1000 characters long."}},v={VALIDATORS:[],MESSAGES:{required:"The channel is required when the playlist is public."}};function r(y,P){P.toString()===b.vf.PUBLIC.toString()?y.setValidators([t.kI.required]):y.setValidators(null),y.markAsDirty(),y.updateValueAndValidity()}},82477:(k,A,e)=>{e.d(A,{x:()=>h}),e(90740);var b=e(95498),s=e(16354),O=e(51197);let h=(()=>{var v;class r{}return(v=r).\u0275fac=function(P){return new(P||v)},v.\u0275mod=O.oAB({type:v}),v.\u0275inj=O.cJS({imports:[s.n,b.Y]}),r})()},90740:(k,A,e)=>{e.d(A,{W:()=>u});var t=e(51197),b=e(27258),s=e(83473),O=e(19868),h=e(89650),v=e(19952),r=e(64806),y=e(15311);function P(i,p){1&i&&t.GkF(0)}function n(i,p){if(1&i&&(t.TgZ(0,"a",3),t.YNc(1,P,1,0,"ng-container",4),t.qZA()),2&i){const a=t.oxw(),o=t.MAs(3);t.Q6J("ariaLabel",a.ariaLabel)("routerLink",a.getVideoRouterLink())("queryParams",a.queryParams),t.xp6(1),t.Q6J("ngTemplateOutlet",o)}}function L(i,p){1&i&&t.GkF(0)}function H(i,p){if(1&i&&(t.TgZ(0,"a",5),t.YNc(1,L,1,0,"ng-container",4),t.qZA()),2&i){const a=t.oxw(),o=t.MAs(3);t.Q6J("ariaLabel",a.ariaLabel)("href",a.videoHref,t.LSH)("target",a.videoTarget),t.xp6(1),t.Q6J("ngTemplateOutlet",o)}}function R(i,p){if(1&i){const a=t.EpF();t.ynx(0),t.TgZ(1,"button",17),t.NdJ("click",function(l){t.CHM(a);const d=t.oxw(3);return t.KtG(d.onWatchLaterClick(l))}),t._UZ(2,"my-global-icon",18),t.qZA(),t.BQk()}if(2&i){const a=t.oxw(3);t.xp6(1),t.Q6J("ngbTooltip",a.addToWatchLaterText),t.xp6(1),t.uIk("aria-label",a.addToWatchLaterText)}}function V(i,p){if(1&i){const a=t.EpF();t.ynx(0),t.TgZ(1,"button",17),t.NdJ("click",function(l){t.CHM(a);const d=t.oxw(3);return t.KtG(d.onWatchLaterClick(l))}),t._UZ(2,"my-global-icon",19),t.qZA(),t.BQk()}if(2&i){const a=t.oxw(3);t.xp6(1),t.Q6J("ngbTooltip",a.addedToWatchLaterText),t.xp6(1),t.uIk("aria-label",a.addedToWatchLaterText)}}function T(i,p){if(1&i&&(t.TgZ(0,"div",15),t.YNc(1,R,3,2,"ng-container",16),t.YNc(2,V,3,2,"ng-container",16),t.qZA()),2&i){const a=t.oxw(2);t.xp6(1),t.Q6J("ngIf",!0!==a.inWatchLaterPlaylist),t.xp6(1),t.Q6J("ngIf",!0===a.inWatchLaterPlaylist)}}function U(i,p){if(1&i&&(t.TgZ(0,"div",20),t._uU(1),t.qZA()),2&i){const a=t.oxw(2);t.xp6(1),t.Oqu(a.video.durationLabel)}}function I(i,p){1&i&&(t.ynx(0),t.SDv(1,22),t.BQk())}function D(i,p){1&i&&(t.ynx(0),t.SDv(1,23),t.BQk())}const E=function(i){return{"live-ended":i}};function $(i,p){if(1&i&&(t.TgZ(0,"div",21),t.YNc(1,I,2,0,"ng-container",16),t.YNc(2,D,2,0,"ng-container",16),t.qZA()),2&i){const a=t.oxw(2);t.Q6J("ngClass",t.VKq(3,E,a.isLiveEnded())),t.xp6(1),t.Q6J("ngIf",!a.isLiveEnded()),t.xp6(1),t.Q6J("ngIf",a.isLiveEnded())}}const F=function(i){return{"width.%":i}};function B(i,p){if(1&i&&(t.TgZ(0,"div",24),t._UZ(1,"div",25),t.qZA()),2&i){const a=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(1,F,a.getProgressPercent()))}}const W=function(i){return{"blur-filter":i}};function N(i,p){if(1&i&&(t._UZ(0,"img",6),t.YNc(1,T,3,2,"div",7),t.TgZ(2,"div",8),t.Hsn(3),t.qZA(),t.TgZ(4,"div",9),t.Hsn(5,1),t.qZA(),t.YNc(6,U,2,1,"div",10),t.YNc(7,$,3,5,"div",11),t.TgZ(8,"div",12),t._UZ(9,"div",13),t.qZA(),t.YNc(10,B,2,3,"div",14)),2&i){const a=t.oxw();t.Q6J("ngClass",t.VKq(7,W,a.nsfw)),t.uIk("aria-label",a.video.name)("src",a.getImageUrl(),t.LSH),t.xp6(1),t.Q6J("ngIf",a.displayWatchLaterPlaylist),t.xp6(5),t.Q6J("ngIf",!a.video.isLive),t.xp6(1),t.Q6J("ngIf",a.video.isLive),t.xp6(3),t.Q6J("ngIf",null==a.video.userHistory?null:a.video.userHistory.currentTime)}}const J=[[["label-warning"]],[["label-danger"]]],c=["label-warning","label-danger"];let u=(()=>{var i;class p{constructor(o){this.screenService=o,this.nsfw=!1,this.watchLaterClick=new t.vpe,this.addToWatchLaterText="Add to wat
1ch later",this.addedToWatchLaterText="Remove from watch later"}isLiveEnded(){if(this.video.state)return this.video.state.id===b.Ii.LIVE_ENDED}getImageUrl(){return this.video?this.screenService.isInMobileView()?this.video.previewUrl:this.video.thumbnailUrl:""}getProgressPercent(){return this.video.userHistory?this.video.userHistory.currentTime/this.video.duration*100:0}getVideoRouterLink(){return this.videoRouterLink?this.videoRouterLink:s.nk.buildWatchUrl(this.video)}onWatchLaterClick(o){return this.watchLaterClick.emit(this.inWatchLaterPlaylist),o.stopPropagation(),!1}}return(i=p).\u0275fac=function(o){return new(o||i)(t.Y36(O.H2))},i.\u0275cmp=t.Xpm({type:i,selectors:[["my-video-thumbnail"]],inputs:{video:"video",nsfw:"nsfw",videoRouterLink:"videoRouterLink",queryParams:"queryParams",videoHref:"videoHref",videoTarget:"videoTarget",displayWatchLaterPlaylist:"displayWatchLaterPlaylist",inWatchLaterPlaylist:"inWatchLaterPlaylist",ariaLabel:"ariaLabel"},outputs:{watchLaterClick:"watchLaterClick"},ngContentSelectors:c,decls:4,vars:2,consts:function(){let a,o;return a="LIVE",o="LIVE ENDED",[["class","video-thumbnail","tabindex","-1",3,"ariaLabel","routerLink","queryParams",4,"ngIf"],["class","video-thumbnail","tabindex","-1",3,"ariaLabel","href","target",4,"ngIf"],["aContent",""],["tabindex","-1",1,"video-thumbnail",3,"ariaLabel","routerLink","queryParams"],[4,"ngTemplateOutlet"],["tabindex","-1",1,"video-thumbnail",3,"ariaLabel","href","target"],["alt","",3,"ngClass"],["class","video-thumbnail-actions-overlay",4,"ngIf"],[1,"video-thumbnail-label-overlay","warning"],[1,"video-thumbnail-label-overlay","danger"],["class","video-thumbnail-duration-overlay",4,"ngIf"],["class","video-thumbnail-live-overlay",3,"ngClass",4,"ngIf"],[1,"play-overlay"],[1,"icon"],["class","progress-bar",4,"ngIf"],[1,"video-thumbnail-actions-overlay"],[4,"ngIf"],["placement","left","container","body",1,"video-thumbnail-watch-later-overlay","button-unstyle",3,"ngbTooltip","click"],["iconName","clock","role","button"],["iconName","tick","role","button"],[1,"video-thumbnail-duration-overlay"],[1,"video-thumbnail-live-overlay",3,"ngClass"],a,o,[1,"progress-bar"],[3,"ngStyle"]]},template:function(o,l){1&o&&(t.F$t(J),t.YNc(0,n,2,4,"a",0),t.YNc(1,H,2,4,"a",1),t.YNc(2,N,11,9,"ng-template",null,2,t.W1O)),2&o&&(t.Q6J("ngIf",!l.videoHref),t.xp6(1),t.Q6J("ngIf",l.videoHref))},dependencies:[h.mk,h.O5,h.tP,h.PC,v.rH,r._L,y.$],styles:[".video-thumbnail[_ngcontent-%COMP%]{display:flex;flex-direction:column;position:relative;border-radius:3px;width:100%;height:100%;overflow:hidden;background-color:#ececec;transition:filter .2s ease}.video-thumbnail[_ngcontent-%COMP%]:focus:not(.focus-visible){outline:none!important}.video-thumbnail[_ngcontent-%COMP%] .play-overlay[_ngcontent-%COMP%]{position:absolute;right:0;bottom:0;width:inherit;height:inherit;opacity:0;background-color:#0000004d}.video-thumbnail[_ngcontent-%COMP%] .play-overlay[_ngcontent-%COMP%], .video-thumbnail[_ngcontent-%COMP%] .play-overlay[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{transition:all .2s ease}.video-thumbnail[_ngcontent-%COMP%] .play-overlay[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:0;height:0;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) scale(.5);border-top:13px solid transparent;border-bottom:13px solid transparent;border-left:18px solid rgba(255,255,255,.95)}.video-thumbnail[_ngcontent-%COMP%]:hover{text-decoration:none!important}.video-thumbnail[_ngcontent-%COMP%]:hover .play-overlay[_ngcontent-%COMP%]{opacity:1}.video-thumbnail[_ngcontent-%COMP%]:hover .play-overlay[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{transform:translate(-50%,-50%) scale(1)}.video-thumbnail.focus-visible[_ngcontent-%COMP%]{box-shadow:0 0 0 .2rem var(--mainColorLightest);outline:none}.video-thumbnail[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:inherit;height:inherit}.video-thumbnail[_ngcontent-%COMP%] img.blur-filter[_ngcontent-%COMP%]{filter:blur(20px);transform:scale(1.03)}.progress-bar[_ngcontent-%COMP%]{height:3px;width:100%;position:absolute;bottom:0;background-color:#0003}
1.progress-bar[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{height:100%;background-color:var(--mainColor)}.video-thumbnail-watch-later-overlay[_ngcontent-%COMP%], .video-thumbnail-label-overlay[_ngcontent-%COMP%], .video-thumbnail-duration-overlay[_ngcontent-%COMP%], .video-thumbnail-live-overlay[_ngcontent-%COMP%]{display:inline-block;background-color:#000000b3;color:#fff;border-radius:3px;font-size:12px;font-weight:600;line-height:1.1;z-index:10}.video-thumbnail-label-overlay[_ngcontent-%COMP%]{position:absolute;padding:0 5px;left:5px;top:5px;font-weight:700}.video-thumbnail-label-overlay.warning[_ngcontent-%COMP%]{background-color:orange}.video-thumbnail-label-overlay.danger[_ngcontent-%COMP%]{background-color:red}.video-thumbnail-duration-overlay[_ngcontent-%COMP%], .video-thumbnail-live-overlay[_ngcontent-%COMP%]{position:absolute;padding:0 3px;right:5px;bottom:5px}.video-thumbnail-live-overlay[_ngcontent-%COMP%]{font-weight:600;color:#fff}.video-thumbnail-live-overlay[_ngcontent-%COMP%]:not(.live-ended){background-color:#e00808b3}.video-thumbnail-actions-overlay[_ngcontent-%COMP%]{position:absolute;display:flex;flex-direction:column;right:5px;top:5px;opacity:0}.video-thumbnail-actions-overlay[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:not(:first-child){margin-top:2px}.video-thumbnail-watch-later-overlay[_ngcontent-%COMP%]{padding:3px}.video-thumbnail-watch-later-overlay[_ngcontent-%COMP%] my-global-icon[_ngcontent-%COMP%]{width:22px;height:22px}.video-thumbnail-watch-later-overlay[_ngcontent-%COMP%] my-global-icon[_ngcontent-%COMP%] .feather, .video-thumbnail-watch-later-overlay[_ngcontent-%COMP%] my-global-icon[_ngcontent-%COMP%] .material, .video-thumbnail-watch-later-overlay[_ngcontent-%COMP%] my-global-icon[_ngcontent-%COMP%] .misc{color:#fff}"]}),p})()},64155:(k,A,e)=>{e.d(A,{L6:()=>h.L,Qq:()=>v.Q,xq:()=>r.x}),e(37262),e(96824),e(70101),e(21198);var h=e(35862),v=e(36366),r=e(53414)},53414:(k,A,e)=>{e.d(A,{x:()=>y});var t=e(84099),b=e(95498),s=e(16354),O=e(82477),h=e(66871),v=e(36366),r=e(51197);let y=(()=>{var P;class n{}return(P=n).\u0275fac=function(H){return new(H||P)},P.\u0275mod=r.oAB({type:P}),P.\u0275inj=r.cJS({providers:[v.Q],imports:[s.n,t.hA,O.x,b.Y,h.A]}),n})()},37262:(k,A,e)=>{e.d(A,{Z:()=>u});var t=e(75811),s=e(90961),O=e(92887),h=e(37574),v=e(84099),r=e(20961),y=e(27258),P=e(37787),n=e(51197),L=e(19868),H=e(36366),R=e(89650),V=e(70997),T=e(22198),U=e(17063),I=e(15311);function D(i,p){if(1&i){const a=n.EpF();n.ynx(0),n.TgZ(1,"my-peertube-checkbox",24),n.NdJ("click",function(l){const M=n.CHM(a).$implicit,x=n.MAs(3),Y=n.MAs(5),w=n.oxw(2).$implicit,z=n.oxw();return n.KtG(z.toggleOptionalPlaylist(l,w,M,x.timestamp,Y.timestamp))}),n.qZA(),n.TgZ(2,"my-timestamp-input",25,26),n.NdJ("ngModelChange",function(l){const M=n.CHM(a).$implicit;return n.KtG(M.startTimestamp=l)})("inputBlur",function(){const d=n.CHM(a).$implicit,M=n.oxw(2).$implicit,x=n.oxw();return n.KtG(x.onElementTimestampUpdate(M,d))}),n.qZA(),n.TgZ(4,"my-timestamp-input",25,27),n.NdJ("ngModelChange",function(l){const M=n.CHM(a).$implicit;return n.KtG(M.stopTimestamp=l)})("inputBlur",function(){const d=n.CHM(a).$implicit,M=n.oxw(2).$implicit,x=n.oxw();return n.KtG(x.onElementTimestampUpdate(M,d))}),n.qZA(),n.BQk()}if(2&i){const a=p.$implicit,o=n.oxw(2).$implicit,l=n.oxw();n.xp6(1),n.Q6J("inputName",l.getOptionalInputName(o,a))("ngModel",a.enabled),n.xp6(1),n.Q6J("maxTimestamp",l.video.duration)("ngModel",a.startTimestamp),n.xp6(2),n.Q6J("maxTimestamp",l.video.duration)("ngModel",a.stopTimestamp)}}function E(i,p){if(1&i&&(n.TgZ(0,"div",19)(1,"div",20),n.SDv(2,21),n.qZA(),n.TgZ(3,"div",20),n.SDv(4,22),n.qZA(),n.YNc(5,D,6,6,"ng-container",23),n.qZA()),2&i){const a=n.oxw().$implicit,o=n.oxw();n.xp6(5),n.Q6J("ngForOf",o.buildOptionalRowElements(a))}}const $=function(i){return{"has-optional-row":i}},F=function(i){return{invisible:i}};function B(i,p){if(1&i){const a=n.EpF();n.TgZ(0,"div",13)(1,"button",14),n.NdJ("click",function(l){const M=n.CHM(a).$implicit,x=n.oxw();return n.KtG(x.toggleMainPlaylist(l,M))}),n._UZ(2,"my-peertube-checkbox",15),n.TgZ(3,"label",16),n._uU(4),n.qZA(),n.TgZ(5,"button",17),n.NdJ("
1click",function(l){const M=n.CHM(a).$implicit,x=n.oxw();return l.stopPropagation(),n.KtG(x.toggleOptionalRow(M))}),n._UZ(6,"my-global-icon",10),n.qZA()(),n.YNc(7,E,6,1,"div",18),n.qZA()}if(2&i){const a=p.$implicit,o=n.oxw();n.Q6J("ngClass",n.VKq(8,$,a.optionalRowDisplayed)),n.xp6(2),n.Q6J("disabled",o.isPresentMultipleTimes(a)||a.optionalRowDisplayed)("inputName",o.getPrimaryInputName(a))("ngModel",o.isPrimaryCheckboxChecked(a)),n.xp6(1),n.Q6J("for",o.getPrimaryInputName(a)),n.xp6(1),n.hij(" ",a.displayName," "),n.xp6(1),n.Q6J("ngClass",n.VKq(10,F,!o.isPrimaryCheckboxChecked(a))),n.xp6(2),n.Q6J("ngIf",a.optionalRowDisplayed)}}function W(i,p){if(1&i&&(n.TgZ(0,"div",35),n._uU(1),n.qZA()),2&i){const a=n.oxw(2);n.xp6(1),n.hij(" ",a.formErrors.displayName," ")}}const N=function(i){return{"input-error":i}};function J(i,p){if(1&i){const a=n.EpF();n.TgZ(0,"form",28),n.NdJ("ngSubmit",function(){n.CHM(a);const l=n.oxw();return n.KtG(l.createPlaylist())}),n.TgZ(1,"div",29)(2,"label",30),n.SDv(3,31),n.qZA(),n._UZ(4,"input",32),n.YNc(5,W,2,1,"div",33),n.qZA(),n._UZ(6,"input",34),n.qZA()}if(2&i){const a=n.oxw();n.Q6J("formGroup",a.form),n.xp6(4),n.Q6J("ngClass",n.VKq(4,N,a.formErrors.displayName)),n.xp6(1),n.Q6J("ngIf",a.formErrors.displayName),n.xp6(1),n.Q6J("disabled",!a.form.valid)}}const c=t("peertube:playlists:VideoAddToPlaylistComponent");let u=(()=>{var i;class p extends v.OI{constructor(o,l,d,M,x){super(),this.formReactiveService=o,this.authService=l,this.notifier=d,this.videoPlaylistService=M,this.cd=x,this.lazyLoad=!1,this.isNewPlaylistBlockOpened=!1,this.videoPlaylistSearchChanged=new s.x,this.videoPlaylists=[],this.disabled=!1,this.playlistsData=[]}get user(){return this.authService.getUser()}ngOnInit(){this.buildForm({displayName:P.mk}),this.videoPlaylistService.listenToMyAccountPlaylistsChange().subscribe(o=>{this.playlistsData=o.data,this.videoPlaylistService.runVideoExistsInPlaylistCheck(this.video.id)}),this.videoPlaylistSearchChanged.pipe((0,O.b)(500)).subscribe(()=>this.load()),!1===this.lazyLoad&&this.load()}ngOnChanges(o){o.video&&this.reload()}ngOnDestroy(){this.unsubscribePlaylistChanges()}disableForReuse(){this.disabled=!0}enabledForReuse(){this.disabled=!1}reload(){c("Reloading component"),this.videoPlaylists=[],this.videoPlaylistSearch=void 0,this.load(),this.cd.markForCheck()}load(){c("Loading component"),this.listenToVideoPlaylistChange(),this.videoPlaylistService.listMyPlaylistWithCache(this.user,this.videoPlaylistSearch).subscribe(o=>{this.playlistsData=o.data,this.videoPlaylistService.runVideoExistsInPlaylistCheck(this.video.id)})}openChange(o){!1===o&&(this.isNewPlaylistBlockOpened=!1)}openCreateBlock(o){o.preventDefault(),this.isNewPlaylistBlockOpened=!0}toggleMainPlaylist(o,l){o.preventDefault(),this.isPresentMultipleTimes(l)||l.optionalRowDisplayed||(0===l.elements.length?this.addVideoInPlaylist(l,{enabled:!0,playlistElementId:void 0,startTimestamp:0,stopTimestamp:this.video.duration}):(this.removeVideoFromPlaylist(l,l.elements[0].playlistElementId),l.elements=[]),this.cd.markForCheck())}toggleOptionalPlaylist(o,l,d,M,x){o.preventDefault(),d.enabled?(this.removeVideoFromPlaylist(l,d.playlistElementId),d.enabled=!1,!1===this.isPrimaryCheckboxChecked(l)&&(l.optionalRowDisplayed=!1)):this.addVideoInPlaylist(l,{enabled:!0,playlistElementId:void 0,startTimestamp:M,stopTimestamp:x}),this.cd.markForCheck()}createPlaylist(){this.videoPlaylistService.createVideoPlaylist({displayName:this.form.value.displayName,privacy:y.vf.PRIVATE}).subscribe({next:()=>{this.isNewPlaylistBlockOpened=!1,this.cd.markForCheck()},error:d=>this.notifier.error(d.message)})}onVideoPlaylistSearchChanged(){this.videoPlaylistSearchChanged.next()}isPrimaryCheckboxChecked(o){return this.pendingAddId===o.id||0!==o.elements.filter(l=>l.enabled).length}toggleOptionalRow(o){o.optionalRowDisplayed=!o.optionalRowDisplayed,this.cd.markForCheck()}getPrimaryInputName(o){return"in-playlist-primary-"+o.id}getOptionalInputName(o,l){return"in-playlist-optional-"+o.id+(l?"-"+l.playlistElementId:"")}buildOptionalRowElements(o){const l=o.elements,d=0===l.length?void 0:l[l.length-1];return(!d||!0===d.enabled)&&l.push({enabled:!1,startTimestamp:0,stopTimestamp:this.video.duration}),l}isPresentMultipleTimes(o){return o.elements.filter(l=>!0===l.enabled).length>1}onElementTimestampUpdate(o,l){l.playlistElementId&&!1!==l.enabled&&this.videoPlaylistService.updateVideoOfPlaylist(o.id,l.playlistElementId,{startTimestamp:l.startTimestamp,stopTimestamp:l.stopTimestamp},this.video.id).subscribe({next:()=>{this.notifier.success("Timestamps updated")},error:M=>this.notifier.error(M.message),complete:()=>this.cd.markForCheck()})}isOptionalRowDisplayed(o){const l=o.elements.filter(d=>d.enabled);if(l.length>1)return!0;
1if(1===l.length){const d=l[0];if(d.startTimestamp&&0!==d.startTimestamp||d.stopTimestamp&&d.stopTimestamp!==this.video.duration)return!0}return!1}removeVideoFromPlaylist(o,l){this.videoPlaylistService.removeVideoFromPlaylist(o.id,l,this.video.id).subscribe({next:()=>{this.notifier.success("Video removed from " + o.displayName + "")},error:d=>this.notifier.error(d.message),complete:()=>this.cd.markForCheck()})}listenToVideoPlaylistChange(){this.unsubscribePlaylistChanges(),this.listenToPlaylistChangeSub=this.videoPlaylistService.listenToVideoPlaylistChange(this.video.id).pipe((0,h.h)(()=>!1===this.disabled)).subscribe(o=>this.rebuildPlaylists(o))}unsubscribePlaylistChanges(){this.listenToPlaylistChangeSub&&(this.listenToPlaylistChangeSub.unsubscribe(),this.listenToPlaylistChangeSub=void 0)}rebuildPlaylists(o){c("Got existing results for %d.",this.video.id,o);const l=this.videoPlaylists;this.videoPlaylists=[];for(const d of this.playlistsData){const M=o.filter(w=>w.playlistId===d.id),x={id:d.id,optionalRowDisplayed:!1,displayName:d.displayName,elements:M.map(w=>({enabled:!0,playlistElementId:w.playlistElementId,startTimestamp:w.startTimestamp||0,stopTimestamp:w.stopTimestamp||this.video.duration}))},Y=l.find(w=>w.id===d.id);x.optionalRowDisplayed=Y?Y.optionalRowDisplayed:this.isOptionalRowDisplayed(x),this.videoPlaylists.push(x)}c("Rebuilt playlist state for video %d.",this.video.id,this.videoPlaylists),this.cd.markForCheck()}addVideoInPlaylist(o,l){const d={videoId:this.video.id};l.startTimestamp&&(d.startTimestamp=l.startTimestamp),l.stopTimestamp&&l.stopTimestamp!==this.video.duration&&(d.stopTimestamp=l.stopTimestamp),this.pendingAddId=o.id,this.videoPlaylistService.addVideoInPlaylist(o.id,d).subscribe({next:M=>{const x=d.startTimestamp||d.stopTimestamp?"Video added in " + o.displayName + " at timestamps " + this.formatTimestamp(l) + "":"Video added in " + o.displayName + "";this.notifier.success(x),l&&(l.playlistElementId=M.videoPlaylistElement.id)},error:M=>{this.pendingAddId=void 0,this.cd.markForCheck(),this.notifier.error(M.message)},complete:()=>{this.pendingAddId=void 0,this.cd.markForCheck()}})}formatTimestamp(o){return`(${o.startTimestamp?(0,r.nH)(o.startTimestamp):""}-${o.stopTimestamp?(0,r.nH)(o.stopTimestamp):""})`}}return(i=p).\u0275fac=function(o){return new(o||i)(n.Y36(v.RL),n.Y36(L.e8),n.Y36(L.d4),n.Y36(H.Q),n.Y36(n.sBO))},i.\u0275cmp=n.Xpm({type:i,selectors:[["my-video-add-to-playlist"]],inputs:{video:"video",currentVideoTimestamp:"currentVideoTimestamp",lazyLoad:"lazyLoad"},features:[n.qOj,n.TTD],decls:14,vars:4,consts:function(){let a,o,l,d,M,x,Y;return a="Save to",o="Search playlists",l="Create a private playlist",d="Start at",M="Stop at",x="Display name",Y="Create",[[1,"root"],[1,"header"],[1,"first-row"],[1,"title"],a,[1,"input-container"],["type","text","placeholder",o,3,"ngModel","ngModelChange"],[1,"playlists"],["class","playlist dropdown-item",3,"ngClass",4,"ngFor","ngForOf"],[1,"new-playlist-button","dropdown-item",3,"hidden","click"],["iconName","add","aria-hidden","true"],l,["class","new-playlist-block dropdown-item",3,"formGroup","ngSubmit",4,"ngIf"],[1,"playlist","dropdown-item",3,"ngClass"],[1,"primary-row","button-unstyle",3,"click"],[3,"disabled","inputName","ngModel"],[1,"display-name",3,"for"],[1,"optional-row-icon","button-unstyle",3,"ngClass","click"],["class","optional-rows",4,"ngIf"],[1,"optional-rows"],[1,"header-label"],d,M,[4,"ngFor","ngForOf"],[3,"inputName","ngModel","click"],[3,"maxTimestamp","ngModel","ngModelChange","inputBlur"],["startAt",""],["stopAt",""],[1,"new-playlist-block","dropdown-item",3,"formGroup","ngSubmit"],[1,"form-group"],["for","displayName"],x,["type","text","id","displayName","formControlName","displayName",3,"ngClass"],["class","form-error","role","alert",4,"ngIf"],["type","submit","value",Y,3,"disabled"],["role","alert",1,"form-error"]]},template:function(o,l){1&o&&(n.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),n.SDv(4,4),n.qZA()()(),n.TgZ(5,"div",5)(6,"input",6),n.NdJ("ngModelChange",function(M){return l.videoPlaylistSearch=M})("ngModelChange",function(){return l.onVideoPlaylistSearchChanged()}),n.qZA()(),n.TgZ(7,"div",7),n.YNc(8,B,8,12,"div",8),n.qZA(),n.TgZ(9,"button",9),n.NdJ("
1click",function(M){return l.openCreateBlock(M)}),n._UZ(10,"my-global-icon",10),n.TgZ(11,"span"),n.SDv(12,11),n.qZA()(),n.YNc(13,J,7,6,"form",12),n.qZA()),2&o&&(n.xp6(6),n.Q6J("ngModel",l.videoPlaylistSearch),n.xp6(2),n.Q6J("ngForOf",l.videoPlaylists),n.xp6(1),n.Q6J("hidden",l.isNewPlaylistBlockOpened),n.xp6(4),n.Q6J("ngIf",l.isNewPlaylistBlockOpened))},dependencies:[R.mk,R.sg,R.O5,V._Y,V.Fj,V.JJ,V.JL,V.On,V.sg,V.u,T.P,U.A,I.$],styles:[".header[_ngcontent-%COMP%], .dropdown-item[_ngcontent-%COMP%], .input-container[_ngcontent-%COMP%]{padding:8px 24px}.dropdown-item[_ngcontent-%COMP%]:active{color:inherit}.header[_ngcontent-%COMP%]{min-width:240px;margin-bottom:10px;border-bottom:1px solid rgba(0,0,0,.1)}.header[_ngcontent-%COMP%] .first-row[_ngcontent-%COMP%]{display:flex;align-items:center}.header[_ngcontent-%COMP%] .first-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:18px;flex-grow:1}.playlists[_ngcontent-%COMP%]{max-height:180px;overflow-y:auto}.playlist[_ngcontent-%COMP%]{padding:0}.playlist[_ngcontent-%COMP%] > .primary-row[_ngcontent-%COMP%]{padding:8px 10px 8px 24px}.playlist[_ngcontent-%COMP%] > .optional-rows[_ngcontent-%COMP%]{padding-inline-start:calc(1.275rem + .3vw)}@media (min-width: 1200px){.playlist[_ngcontent-%COMP%] > .optional-rows[_ngcontent-%COMP%]{padding-inline-start:1.5rem}}.playlist.has-optional-row[_ngcontent-%COMP%]:hover{background-color:inherit}.primary-row[_ngcontent-%COMP%]{display:flex;width:100%}.primary-row[_ngcontent-%COMP%] my-peertube-checkbox[_ngcontent-%COMP%]{margin-inline-end:.625rem;align-self:center}.primary-row[_ngcontent-%COMP%] .display-name[_ngcontent-%COMP%]{display:flex;align-items:flex-end;flex-grow:1;margin:0;font-weight:400;cursor:pointer}.primary-row[_ngcontent-%COMP%] .optional-row-icon[_ngcontent-%COMP%]{margin-inline-start:.5rem;display:flex;align-items:center;font-size:14px;cursor:pointer}.primary-row[_ngcontent-%COMP%] .optional-row-icon[_ngcontent-%COMP%] my-global-icon[_ngcontent-%COMP%]{margin-inline-end:0;position:relative;top:1px;width:19px;height:19px}.primary-row[_ngcontent-%COMP%] .optional-row-icon[_ngcontent-%COMP%] my-global-icon[_ngcontent-%COMP%] .feather, .primary-row[_ngcontent-%COMP%] .optional-row-icon[_ngcontent-%COMP%] my-global-icon[_ngcontent-%COMP%] .material, .primary-row[_ngcontent-%COMP%] .optional-row-icon[_ngcontent-%COMP%] my-global-icon[_ngcontent-%COMP%] .misc{color:#333}.primary-row[_ngcontent-%COMP%] .optional-row-icon[_ngcontent-%COMP%]:hover{opacity:.8}.optional-rows[_ngcontent-%COMP%]{display:grid;grid-template-columns:35px 80px 80px;row-gap:3px;column-gap:10px;align-items:center}.optional-rows[_ngcontent-%COMP%] my-peertube-checkbox[_ngcontent-%COMP%]{margin-inline-start:auto}.optional-rows[_ngcontent-%COMP%] .header-label[_ngcontent-%COMP%]{font-size:13px;color:var(--greyForegroundColor);padding-left:2px}.optional-rows[_ngcontent-%COMP%] .header-label[_ngcontent-%COMP%]:nth-child(1){grid-column:2}.optional-rows[_ngcontent-%COMP%] .header-label[_ngcontent-%COMP%]:nth-child(2){grid-column:3}.new-playlist-button[_ngcontent-%COMP%], .new-playlist-block[_ngcontent-%COMP%]{padding-top:10px;border-top:1px solid rgba(0,0,0,.1)}.new-playlist-button[_ngcontent-%COMP%]{cursor:pointer}.new-playlist-button[_ngcontent-%COMP%] my-global-icon[_ngcontent-%COMP%]{margin-inline-end:.25rem;position:relative;left:-1px;top:-1px;width:21px;height:21px}.new-playlist-button[_ngcontent-%COMP%] my-global-icon[_ngcontent-%COMP%] .feather, .new-playlist-button[_ngcontent-%COMP%] my-global-icon[_ngcontent-%COMP%] .material, .new-playlist-button[_ngcontent-%COMP%] my-global-icon[_ngcontent-%COMP%] .misc{color:#333}input[type=text][_ngcontent-%COMP%]{line-height:23px;font-size:15px;padding:3px 15px;display:inline-block;width:200px;max-width:200px;color:var(--inputForegroundColor);background-color:var(--inputBackgroundColor);border:1px solid var(--inputBorderColor);border-radius:3px;display:block}input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--inputPlaceholderColor)}input[type=text][readonly][_ngcontent-%COMP%]{opacity:.7}@media screen and (max-width: 240px){input[type=text][_ngcontent-%COMP%]{width:100%}}input[type=submit][_ngcontent-%COMP%]{line-height:23px;padding:4px 13px;border:0;font-weight:600;border-radius:3px!important;text-align:center;cursor:pointer;font-size:15px}input[type=submit][_ngcontent-%COMP%] my-global-icon[_ngcontent-%COMP%] + *[_ngcontent-%COMP%]{margin-inline-end:.25rem;margin-inline-start:.25rem}input[type=submit][_ngcontent-%COMP%]:focus, input[type=submit].focus-visible[_ngcontent-%COMP%]{box-shadow:0 0 0 .2rem var(--mainColorLightest)}input[type=submit][_ngcontent-%COMP%], input[type=submit][_ngcontent-%COMP%]:active, input[type=submit][_ngcontent-%COMP%]:focus{color:#fff;background-color:var(--mainColor)}input[type=submit][_ngcontent-%COMP%]:hover{color:#fff;background-color:var(--mainHoverColor)}input[type=submit][disabled][_ngcontent-%COMP%], input[type=submit].disabled[_ngcontent-%COMP%]{cursor:default;color:#fff;background-color:var(--inputBorderColor)}input[type=submit][_ngcontent-%COMP%] my-global-icon[_ngcontent-%COMP%] .feather, input[type=submit][_ngcontent-%COMP%] my-global-icon[_ngcontent-%COMP%] .material, input[type=submit][_ngcontent-%COMP%] my-global-icon[_ngcontent-%COMP%] .misc{color:#fff}"],changeDetection:0}),p})()},96824:(k,A,e)=>{e.d(A,{K:()=>it});var t=e(51197),b=e(20961),s=e(27258),O=e(35862),h=e(19868),v=e(36366),r=e(83473),y=e(89650),P=e(70997),n=e(19952),L=e(64806),H=e(32377),R=e(17043),V=e(22198),T=e(17063),U=e(90740),I=e(15311),D=e(54188);const E=["moreDropdown"];function $(m,S){1&m&&t._UZ(0,"my-global-icon",11)}function F(m,S){if(1&m&&(t.ynx(0),t._uU(1),t.BQk()),2&m){const _=t.oxw();
1t.xp6(1),t.Oqu(_.position)}}function B(m,S){if(1&m&&t._UZ(0,"my-video-thumbnail",12),2&m){const _=t.oxw();t.Q6J("video",_.playlistElement.video)("nsfw",_.isVideoBlur(_.playlistElement.video))("videoRouterLink",_.buildRouterLink())("queryParams",_.buildRouterQuery())("ariaLabel",_.getVideoAriaLabel())}}function W(m,S){1&m&&t._UZ(0,"div",13)}function N(m,S){1&m&&(t.TgZ(0,"span",24),t.SDv(1,25),t.qZA())}function J(m,S){1&m&&(t.TgZ(0,"span",24),t.SDv(1,26),t.qZA())}function c(m,S){if(1&m&&(t.ynx(0),t._uU(1),t.BQk()),2&m){const _=t.oxw(3);t.xp6(1),t.Oqu(_.playlistElement.video.byAccount)}}function u(m,S){if(1&m&&(t.ynx(0),t._uU(1),t.BQk()),2&m){const _=t.oxw(3);t.xp6(1),t.Oqu(_.playlistElement.video.byVideoChannel)}}const i=function(m){return["/c",m]};function p(m,S){if(1&m&&(t.TgZ(0,"a",27),t.YNc(1,c,2,1,"ng-container",4),t.YNc(2,u,2,1,"ng-container",4),t.qZA()),2&m){const _=t.oxw(2);t.Q6J("routerLink",t.VKq(3,i,_.playlistElement.video.byVideoChannel)),t.xp6(1),t.Q6J("ngIf","account"===_.getVideoOwnerDisplayType(_.playlistElement)),t.xp6(1),t.Q6J("ngIf","videoChannel"===_.getVideoOwnerDisplayType(_.playlistElement))}}function a(m,S){if(1&m&&(t.TgZ(0,"span",28),t._uU(1),t.qZA()),2&m){const _=t.oxw(2);t.xp6(1),t.Oqu(_.playlistElement.video.byAccount)}}function o(m,S){if(1&m&&(t.ynx(0),t.TgZ(1,"div",14)(2,"a",15),t._uU(3),t.qZA(),t.YNc(4,N,2,0,"span",16),t.YNc(5,J,2,0,"span",16),t.qZA(),t.TgZ(6,"span",17),t._UZ(7,"my-date-toggle",18),t.TgZ(8,"span",19),t._uU(9," \u2022 "),t._UZ(10,"my-video-views-counter",20),t.qZA()(),t.YNc(11,p,3,5,"a",21),t.YNc(12,a,2,1,"span",22),t.TgZ(13,"span",23),t._uU(14),t.qZA(),t.BQk()),2&m){const _=t.oxw();
1t.xp6(2),t.Q6J("ariaLabel",_.getVideoAriaLabel())("routerLink",_.buildRouterLink())("queryParams",_.buildRouterQuery()),t.uIk("title",_.playlistElement.video.name),t.xp6(1),t.Oqu(_.playlistElement.video.name),t.xp6(1),t.Q6J("ngIf",_.isVideoPrivate()),t.xp6(1),t.Q6J("ngIf",_.isVideoPasswordProtected()),t.xp6(2),t.Q6J("date",_.playlistElement.video.publishedAt),t.xp6(1),t.Q6J("title",_.playlistElement.video.getExactNumberOfViews()),t.xp6(2),t.Q6J("video",_.playlistElement.video),t.xp6(1),t.Q6J("ngIf",_.accountLink),t.xp6(1),t.Q6J("ngIf",!_.accountLink),t.xp6(2),t.Oqu(_.formatTimestamp(_.playlistElement))}}function l(m,S){1&m&&(t.ynx(0),t.SDv(1,30),t.BQk())}function d(m,S){1&m&&(t.ynx(0),t.SDv(1,31),t.BQk())}function M(m,S){1&m&&(t.ynx(0),t.SDv(1,32),t.BQk())}function x(m,S){if(1&m&&(t.TgZ(0,"span",29),t.YNc(1,l,2,0,"ng-container",4),t.YNc(2,d,2,0,"ng-container",4),t.YNc(3,M,2,0,"ng-container",4),t.qZA()),2&m){const _=t.oxw();t.xp6(1),t.Q6J("ngIf",_.isUnavailable(_.playlistElement)),t.xp6(1),t.Q6J("ngIf",_.isPrivate(_.playlistElement)),t.xp6(1),t.Q6J("ngIf",_.isDeleted(_.playlistElement))}}const Y=function(m){return["/my-library","video-playlists",m]};function w(m,S){if(1&m&&t._UZ(0,"my-edit-button",33),2&m){const _=t.oxw();t.Q6J("ptRouterLink",t.VKq(1,Y,_.playlist.uuid))}}function z(m,S){if(1&m){const _=t.EpF();t.TgZ(0,"div",45)(1,"div")(2,"my-peertube-checkbox",46),t.NdJ("ngModelChange",function(g){t.CHM(_);const f=t.oxw(3);return t.KtG(f.timestampOptions.startTimestampEnabled=g)}),t.qZA(),t.TgZ(3,"my-timestamp-input",47),t.NdJ("ngModelChange",function(g){t.CHM(_);const f=t.oxw(3);return t.KtG(f.timestampOptions.startTimestamp=g)}),t.qZA()(),t.TgZ(4,"div")(5,"my-peertube-checkbox",48),t.NdJ("ngModelChange",function(g){t.CHM(_);const f=t.oxw(3);return t.KtG(f.timestampOptions.stopTimestampEnabled=g)}),t.qZA(),t.TgZ(6,"my-timestamp-input",47),t.NdJ("ngModelChange",function(g){t.CHM(_);const f=t.oxw(3);return t.KtG(f.timestampOptions.stopTimestamp=g)}),t.qZA()(),t.TgZ(7,"input",49),t.NdJ("click",function(){t.CHM(_);const g=t.oxw(3);return t.KtG(g.updateTimestamps(g.playlistElement))}),t.qZA()()}if(2&m){const _=t.oxw(3);t.xp6(2),t.Q6J("ngModel",_.timestampOptions.startTimestampEnabled),t.xp6(1),t.Q6J("timestamp",_.timestampOptions.startTimestamp)("maxTimestamp",_.playlistElement.video.duration)("disabled",!_.timestampOptions.startTimestampEnabled)("ngModel",_.timestampOptions.startTimestamp),t.xp6(2),t.Q6J("ngModel",_.timestampOptions.stopTimestampEnabled),t.xp6(1),t.Q6J("timestamp",_.timestampOptions.stopTimestamp)("maxTimestamp",_.playlistElement.video.duration)("disabled",!_.timestampOptions.stopTimestampEnabled)("ngModel",_.timestampOptions.stopTimestamp)}}function tt(m,S){if(1&m){const _=t.EpF();t.ynx(0),t.TgZ(1,"button",39),t.NdJ("click",function(g){t.CHM(_);const f=t.oxw(2);return t.KtG(f.toggleDisplayTimestampsOptions(g,f.playlistElement))}),t._UZ(2,"my-global-icon",42),t.ynx(3),t.SDv(4,43),t.BQk(),t.qZA(),t.YNc(5,z,8,10,"div",44),t.BQk()}if(2&m){const _=t.oxw(2);t.xp6(5),t.Q6J("ngIf",_.displayTimestampOptions)}}function nt(m,S){if(1&m){const _=t.EpF();t.TgZ(0,"div",34,35),t.NdJ("openChange",function(){t.CHM(_);const g=t.oxw();return t.KtG(g.onDropdownOpenChange())}),t.TgZ(2,"button",36),t.NdJ("click",function(g){return g.preventDefault()}),t._UZ(3,"my-global-icon",37),t.qZA(),t.TgZ(4,"div",38),t.YNc(5,tt,6,1,"ng-container",4),t.TgZ(6,"button",39),t.NdJ("click",function(){t.CHM(_);const g=t.oxw();return t.KtG(g.removeFromPlaylist(g.playlistElement))}),t._UZ(7,"my-global-icon",40),t.ynx(8),t.SDv(9,41),t.BQk(),t.qZA()()()}if(2&m){const _=t.oxw();
1t.xp6(5),t.Q6J("ngIf",_.playlistElement.video),t.xp6(4),t.pQV(null==_.playlist?null:_.playlist.displayName),t.QtT(9)}}const et=function(m){return{playing:m}};let it=(()=>{var m;class S{constructor(C,g,f,K,Q,G){this.authService=C,this.serverService=g,this.notifier=f,this.videoPlaylistService=K,this.videoService=Q,this.cdr=G,this.owned=!1,this.playing=!1,this.rowLink=!1,this.accountLink=!0,this.touchScreenEditButton=!1,this.elementRemoved=new t.vpe,this.displayTimestampOptions=!1,this.timestampOptions={}}ngOnInit(){this.serverConfig=this.serverService.getHTMLConfig()}getVideoAriaLabel(){return "Watch video " + this.playlistElement.video.name + ""}getVideoOwnerDisplayType(C){return this.videoService.buildDefaultOwnerDisplayType(C.video)}isVideoPrivate(){return this.playlistElement.video.privacy.id===s.wq.PRIVATE}isVideoPasswordProtected(){return this.playlistElement.video.privacy.id===s.wq.PASSWORD_PROTECTED}isUnavailable(C){return C.type===s.tj.UNAVAILABLE}isPrivate(C){return C.type===s.tj.PRIVATE}isDeleted(C){return C.type===s.tj.DELETED}buildRouterLink(){return this.playlist?O.L.buildWatchUrl(this.playlist):null}buildRouterQuery(){var C;return null!==(C=this.playlistElement)&&void 0!==C&&C.video?{playlistPosition:this.playlistElement.position,start:this.playlistElement.startTimestamp,stop:this.playlistElement.stopTimestamp,resume:!0}:{}}isVideoBlur(C){return C.isVideoNSFWForUser(this.authService.getUser(),this.serverConfig)}removeFromPlaylist(C){this.videoPlaylistService.removeVideoFromPlaylist(this.playlist.id,C.id,this.playlistElement.video?this.playlistElement.video.id:void 0).subscribe({next:()=>{this.notifier.success("Video removed from " + this.playlist.displayName + ""),this.elementRemoved.emit(C)},error:f=>this.notifier.error(f.message)}),this.moreDropdown.close()}updateTimestamps(C){const g={};g.startTimestamp=this.timestampOptions.startTimestampEnabled?this.timestampOptions.startTimestamp:null,g.stopTimestamp=this.timestampOptions.stopTimestampEnabled?this.timestampOptions.stopTimestamp:null,this.videoPlaylistService.updateVideoOfPlaylist(this.playlist.id,C.id,g,this.playlistElement.video.id).subscribe({next:()=>{this.notifier.success("Timestamps updated"),C.startTimestamp=g.startTimestamp,C.stopTimestamp=g.stopTimestamp,this.cdr.detectChanges()},error:f=>this.notifier.error(f.message)}),this.moreDropdown.close()}formatTimestamp(C){const g=C.startTimestamp,f=C.stopTimestamp,K=(0,b.nH)({seconds:g,fullFormat:!0,symbol:":"}),Q=(0,b.nH)({seconds:f,fullFormat:!0,symbol:":"});return null===g&&null===f?"":null!==g&&null===f?"Starts at "+K:null===g&&null!==f?"Stops at "+Q:"Starts at "+K+" and stops at "+Q}onDropdownOpenChange(){this.displayTimestampOptions=!1}toggleDisplayTimestampsOptions(C,g){C.preventDefault(),this.displayTimestampOptions=!this.displayTimestampOptions,!0===this.displayTimestampOptions&&(this.timestampOptions={startTimestampEnabled:!1,stopTimestampEnabled:!1,startTimestamp:0,stopTimestamp:g.video.duration},g.startTimestamp&&(this.timestampOptions.startTimestampEnabled=!0,this.timestampOptions.startTimestamp=g.startTimestamp),g.stopTimestamp&&(this.timestampOptions.stopTimestampEnabled=!0,this.timestampOptions.stopTimestamp=g.stopTimestamp)),this.cdr.markForCheck()}}return(m=S).\u0275fac=function(C){return new(C||m)(t.Y36(h.e8),t.Y36(h.NG),t.Y36(h.d4),t.Y36(v.Q),t.Y36(r.kI),t.Y36(t.sBO))},m.\u0275cmp=t.Xpm({type:m,selectors:[["my-video-playlist-element-miniature"]],viewQuery:function(C,g){if(1&C&&t.Gf(E,5),2&C){let f;t.iGM(f=t.CRH())&&(g.moreDropdown=f.first)}},inputs:{playlist:"playlist",playlistElement:"playlistElement",owned:"owned",playing:"playing",rowLink:"rowLink",accountLink:"accountLink",position:"position",touchScreenEditButton:"touchScreenEditButton"},outputs:{elementRemoved:"elementRemoved"},decls:12,vars:13,consts:function(){let _,C,g,f,K,Q,G,X,j,q;return _="Private",C="Password protected",g="Unavailable",f="Private",K="Deleted",Q="Delete from " + "\ufffd0\ufffd" + "",G="Edit starts/stops at",X="Start at",j="Stop at",q="Save",[[1,"video",3,"ngClass"],[3,"routerLink","queryParams"],[1,"position"],["iconName","play",4,"ngIf"],[4,"ngIf"],[3,"video","nsfw","videoRouterLink","queryParams","ariaLabel",4,"ngIf"],["class","fake-thumbnail",4,"ngIf"],[1,"video-info"],["class","video-info-name",4,"ngIf"],[3,"ptRouterLink",4,"ngIf"],["class","more dropdown-root","ngbDropdown","","placement","left auto","autoClose","outside","container","body",3,"openChange",4,"ngIf"],["iconName","play"],[3,"video","nsfw","videoRouterLink","queryParams","ariaLabel"],[1,"fake-thumbnail"],[1,"video-info-header"],["tabindex","-1",1,"video-info-name",3,"ariaLabel","routerLink","queryParams"],["class","pt-badge badge-yellow",4,"ngIf"],[1,"video-miniature-created-at-views"],[3,"date"],[1,"views",3,"title"],[3,"video"],["tabindex","-1","class","video-info-owner",3,"routerLink",4,"ngIf"],["tabindex","-1","class","video-info-owner",4,"ngIf"],["tabindex","-1",1,"video-info-timestamp"],[1,"pt-badge","badge-yellow"],_,C,["tabindex","-1",1,"video-info-owner",3,"routerLink"],["tabindex","-1",1,"video-info-owner"],[1,"video-info-name"],g,f,K,[3,"ptRouterLink"],["ngbDropdown","","placement","left auto","autoClose","outside","container","body",1,"more","dropdown-root",3,"openChange"],["moreDropdown","ngbDropdown"],["ngbDropdownToggle","",1,"border-0","p-0","more-button",3,"click"],["iconName","more-vertical"],["ngbDropdownMenu",""],["ngbDropdownItem","",3,"click"],["iconName","delete","aria-hidden","true"],Q,["iconName","edit","aria-hidden","true"],G,["class","timestamp-options",4,"ngIf"],[1,"timestamp-options"],["inputName","startAt","labelText",X,3,"
1ngModel","ngModelChange"],[3,"timestamp","maxTimestamp","disabled","ngModel","ngModelChange"],["inputName","stopAt","labelText",j,3,"ngModel","ngModelChange"],["type","submit","value",q,3,"click"]]},template:function(C,g){1&C&&(t.TgZ(0,"div",0)(1,"a",1)(2,"div",2),t.YNc(3,$,1,0,"my-global-icon",3),t.YNc(4,F,2,1,"ng-container",4),t.qZA(),t.YNc(5,B,1,5,"my-video-thumbnail",5),t.YNc(6,W,1,0,"div",6),t.TgZ(7,"div",7),t.YNc(8,o,15,13,"ng-container",4),t.YNc(9,x,4,3,"span",8),t.qZA()(),t.YNc(10,w,1,3,"my-edit-button",9),t.YNc(11,nt,10,2,"div",10),t.qZA()),2&C&&(t.Q6J("ngClass",t.VKq(11,et,g.playing)),t.xp6(1),t.Q6J("routerLink",g.buildRouterLink())("queryParams",g.buildRouterQuery()),t.xp6(2),t.Q6J("ngIf",g.playing),t.xp6(1),t.Q6J("ngIf",!g.playing),t.xp6(1),t.Q6J("ngIf",g.playlistElement.video),t.xp6(1),t.Q6J("ngIf",!g.playlistElement.video),t.xp6(2),t.Q6J("ngIf",g.playlistElement.video),t.xp6(1),t.Q6J("ngIf",!g.playlistElement.video),t.xp6(1),t.Q6J("ngIf",g.owned&&g.touchScreenEditButton),t.xp6(1),t.Q6J("ngIf",g.owned))},dependencies:[y.mk,y.O5,P.JJ,P.On,n.rH,L.jt,L.iD,L.Vi,L.TH,H.M,R.J,V.P,T.A,U.W,I.$,D.M],styles:["my-video-thumbnail[_ngcontent-%COMP%] .video-thumbnail{width:130px;height:72px}.fake-thumbnail[_ngcontent-%COMP%]{width:130px;height:72px;background-color:#ececec}my-video-thumbnail[_ngcontent-%COMP%], .fake-thumbnail[_ngcontent-%COMP%]{margin-inline-end:.625rem;display:flex}.video[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr auto;background-color:var(--mainBackgroundColor);padding:10px;border-bottom:1px solid rgba(0,0,0,.1)}.video.playing[_ngcontent-%COMP%]{background-color:#00000005}.video[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--mainForegroundColor)}.video[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover, .video[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:focus, .video[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:active{text-decoration:none!important}.video[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:focus:not(.focus-visible){outline:none!important}.video[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{display:flex;min-width:0;align-items:center;cursor:pointer}.video[_ngcontent-%COMP%] > a[_ngcontent-%COMP%] .position[_ngcontent-%COMP%]{margin-inline-end:.625rem;font-weight:600;color:var(--greyForegroundColor);min-width:25px}.video[_ngcontent-%COMP%] > a[_ngcontent-%COMP%] .position[_ngcontent-%COMP%] my-global-icon[_ngcontent-%COMP%]{width:17px;position:relative;left:-2px}.video[_ngcontent-%COMP%] > a[_ngcontent-%COMP%] .position[_ngcontent-%COMP%] my-global-icon[_ngcontent-%COMP%] .feather, .video[_ngcontent-%COMP%] > a[_ngcontent-%COMP%] .position[_ngcontent-%COMP%] my-global-icon[_ngcontent-%COMP%] .material, .video[_ngcontent-%COMP%] > a[_ngcontent-%COMP%] .position[_ngcontent-%COMP%] my-global-icon[_ngcontent-%COMP%] .misc{color:var(--greyForegroundColor)}.video[_ngcontent-%COMP%] .more[_ngcontent-%COMP%], .video[_ngcontent-%COMP%] my-edit-button[_ngcontent-%COMP%]{margin-inline-start:auto;justify-self:flex-end;cursor:pointer;min-width:24px}.video[_ngcontent-%COMP%] .more[_ngcontent-%COMP%]{display:flex;align-items:center}.video[_ngcontent-%COMP%] .more-button[_ngcontent-%COMP%]{opacity:0}.video[_ngcontent-%COMP%] .more-button[_ngcontent-%COMP%]:after{border:0}.video[_ngcontent-%COMP%] .more-button[_ngcontent-%COMP%] my-global-icon[_ngcontent-%COMP%] .feather, .video[_ngcontent-%COMP%] .more-button[_ngcontent-%COMP%] my-global-icon[_ngcontent-%COMP%] .material, .video[_ngcontent-%COMP%] .more-button[_ngcontent-%COMP%] my-global-icon[_ngcontent-%COMP%] .misc{color:var(--greyForegroundColor)}.video[_ngcontent-%COMP%]:hover, .video[_ngcontent-%COMP%]:focus{background-color:#0000000d}.video[_ngcontent-%COMP%]:hover .more-button[_ngcontent-%COMP%], .video[_ngcontent-%COMP%]:focus-within .more-button[_ngcontent-%COMP%], .video[_ngcontent-%COMP%] .show[_ngcontent-%COMP%] .more-button[_ngcontent-%COMP%]{opacity:1}@media not all and (hover: hover) and (pointer: fine){.video[_ngcontent-%COMP%] .more-button[_ngcontent-%COMP%]{opacity:1!important}}
1.video-info-name[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:18px;font-weight:600;display:inline-block}.video-info[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-self:flex-start;min-width:0}.video-info[_ngcontent-%COMP%] .video-info-header[_ngcontent-%COMP%]{display:flex;align-items:baseline}.video-info[_ngcontent-%COMP%] .video-info-header[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{width:auto}.video-info[_ngcontent-%COMP%] .video-info-header[_ngcontent-%COMP%] .pt-badge[_ngcontent-%COMP%]{margin:0 5px;white-space:nowrap}.video-info[_ngcontent-%COMP%] .video-info-owner[_ngcontent-%COMP%], .video-info[_ngcontent-%COMP%] .video-info-timestamp[_ngcontent-%COMP%]{color:var(--greyForegroundColor)}.video-info-owner[_ngcontent-%COMP%], .video-miniature-created-at-views[_ngcontent-%COMP%]{font-size:14px}.dropdown-menu[_ngcontent-%COMP%] .dropdown-item[_ngcontent-%COMP%]{padding:6px 15px;cursor:pointer}.dropdown-menu[_ngcontent-%COMP%] .dropdown-item[_ngcontent-%COMP%] my-global-icon[_ngcontent-%COMP%]{margin-inline-end:.625rem;width:22px;opacity:.7;position:relative;top:-2px}.dropdown-menu[_ngcontent-%COMP%] .timestamp-options[_ngcontent-%COMP%]{padding-inline-start:calc(1.34375rem + 1.125vw);padding-top:0;margin-top:5px;margin-bottom:15px}@media (min-width: 1200px){.dropdown-menu[_ngcontent-%COMP%] .timestamp-options[_ngcontent-%COMP%]{padding-inline-start:2.1875rem}}.dropdown-menu[_ngcontent-%COMP%] .timestamp-options[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{display:flex;align-items:center;margin-bottom:5px}.dropdown-menu[_ngcontent-%COMP%] .timestamp-options[_ngcontent-%COMP%] my-peertube-checkbox[_ngcontent-%COMP%]{margin-inline-end:.3125rem}.dropdown-menu[_ngcontent-%COMP%] .timestamp-options[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{line-height:23px;padding:4px 13px;border:0;font-weight:600;border-radius:3px!important;text-align:center;cursor:pointer;font-size:15px;margin-top:10px}.dropdown-menu[_ngcontent-%COMP%] .timestamp-options[_ngcontent-%COMP%] input[_ngcontent-%COMP%] my-global-icon[_ngcontent-%COMP%] + *[_ngcontent-%COMP%]{margin-inline-end:.25rem;margin-inline-start:.25rem}.dropdown-menu[_ngcontent-%COMP%] .timestamp-options[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus, .dropdown-menu[_ngcontent-%COMP%] .timestamp-options[_ngcontent-%COMP%] input.focus-visible[_ngcontent-%COMP%]{box-shadow:0 0 0 .2rem var(--mainColorLightest)}.dropdown-menu[_ngcontent-%COMP%] .timestamp-options[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .dropdown-menu[_ngcontent-%COMP%] .timestamp-options[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:active, .dropdown-menu[_ngcontent-%COMP%] .timestamp-options[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus{color:#fff;background-color:var(--mainColor)}.dropdown-menu[_ngcontent-%COMP%] .timestamp-options[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:hover{color:#fff;background-color:var(--mainHoverColor)}.dropdown-menu[_ngcontent-%COMP%] .timestamp-options[_ngcontent-%COMP%] input[disabled][_ngcontent-%COMP%], .dropdown-menu[_ngcontent-%COMP%] .timestamp-options[_ngcontent-%COMP%] input.disabled[_ngcontent-%COMP%]{cursor:default;color:#fff;background-color:var(--inputBorderColor)}.dropdown-menu[_ngcontent-%COMP%] .timestamp-options[_ngcontent-%COMP%] input[_ngcontent-%COMP%] my-global-icon[_ngcontent-%COMP%] .feather, .dropdown-menu[_ngcontent-%COMP%] .timestamp-options[_ngcontent-%COMP%] input[_ngcontent-%COMP%] my-global-icon[_ngcontent-%COMP%] .material, .dropdown-menu[_ngcontent-%COMP%] .timestamp-options[_ngcontent-%COMP%] input[_ngcontent-%COMP%] my-global-icon[_ngcontent-%COMP%] .misc{color:#fff}@media screen and (min-width: 800px){.expanded[_nghost-%COMP%] .video[_ngcontent-%COMP%] my-edit-button[_ngcontent-%COMP%], .expanded [_nghost-%COMP%] .video[_ngcontent-%COMP%] my-edit-button[_ngcontent-%COMP%]{display:none}.expanded[_nghost-%COMP%] .video[_ngcontent-%COMP%] my-edit-button[_ngcontent-%COMP%] + .more-button[_ngcontent-%COMP%], .expanded [_nghost-%COMP%] .video[_ngcontent-%COMP%] my-edit-button[_ngcontent-%COMP%] + .more-button[_ngcontent-%COMP%]{display:inline-flex}}@media screen and (max-width: 800px){.expanded[_nghost-%COMP%] .video[_ngcontent-%COMP%] my-edit-button[_ngcontent-%COMP%], .expanded [_nghost-%COMP%] .video[_ngcontent-%COMP%] my-edit-button[_ngcontent-%COMP%]{display:none}
1.expanded[_nghost-%COMP%] .video.playing[_ngcontent-%COMP%] my-edit-button[_ngcontent-%COMP%], .expanded [_nghost-%COMP%] .video.playing[_ngcontent-%COMP%] my-edit-button[_ngcontent-%COMP%]{display:inline-flex;height:-webkit-max-content;height:max-content;margin:auto}.expanded[_nghost-%COMP%] .video[_ngcontent-%COMP%] my-edit-button[_ngcontent-%COMP%] + .more-button[_ngcontent-%COMP%], .expanded [_nghost-%COMP%] .video[_ngcontent-%COMP%] my-edit-button[_ngcontent-%COMP%] + .more-button[_ngcontent-%COMP%]{display:none}}@media screen and (max-width: 500px){.expanded[_nghost-%COMP%] .video[_ngcontent-%COMP%] my-edit-button[_ngcontent-%COMP%] .action-button-edit, .expanded [_nghost-%COMP%] .video[_ngcontent-%COMP%] my-edit-button[_ngcontent-%COMP%] .action-button-edit{padding:0 13px}.expanded[_nghost-%COMP%] .video[_ngcontent-%COMP%] my-edit-button[_ngcontent-%COMP%] .action-button-edit .button-label, .expanded [_nghost-%COMP%] .video[_ngcontent-%COMP%] my-edit-button[_ngcontent-%COMP%] .action-button-edit .button-label{display:none}}@media screen and (min-width: 1040px){.main-col:not(.expanded)[_nghost-%COMP%] .video[_ngcontent-%COMP%] my-edit-button[_ngcontent-%COMP%], .main-col:not(.expanded) [_nghost-%COMP%] .video[_ngcontent-%COMP%] my-edit-button[_ngcontent-%COMP%]{display:none}.main-col:not(.expanded)[_nghost-%COMP%] .video[_ngcontent-%COMP%] my-edit-button[_ngcontent-%COMP%] + .more-button[_ngcontent-%COMP%], .main-col:not(.expanded) [_nghost-%COMP%] .video[_ngcontent-%COMP%] my-edit-button[_ngcontent-%COMP%] + .more-button[_ngcontent-%COMP%]{display:inline-flex}}@media screen and (max-width: 1040px){.main-col:not(.expanded)[_nghost-%COMP%] .video[_ngcontent-%COMP%] my-edit-button[_ngcontent-%COMP%], .main-col:not(.expanded) [_nghost-%COMP%] .video[_ngcontent-%COMP%] my-edit-button[_ngcontent-%COMP%]{display:none}.main-col:not(.expanded)[_nghost-%COMP%] .video.playing[_ngcontent-%COMP%] my-edit-button[_ngcontent-%COMP%], .main-col:not(.expanded) [_nghost-%COMP%] .video.playing[_ngcontent-%COMP%] my-edit-button[_ngcontent-%COMP%]{display:inline-flex;height:-webkit-max-content;height:max-content;margin:auto}.main-col:not(.expanded)[_nghost-%COMP%] .video[_ngcontent-%COMP%] my-edit-button[_ngcontent-%COMP%] + .more-button[_ngcontent-%COMP%], .main-col:not(.expanded) [_nghost-%COMP%] .video[_ngcontent-%COMP%] my-edit-button[_ngcontent-%COMP%] + .more-button[_ngcontent-%COMP%]{display:none}}@media screen and (max-width: 740px){.main-col:not(.expanded)[_nghost-%COMP%] .video[_ngcontent-%COMP%] my-edit-button[_ngcontent-%COMP%] .action-button-edit, .main-col:not(.expanded) [_nghost-%COMP%] .video[_ngcontent-%COMP%] my-edit-button[_ngcontent-%COMP%] .action-button-edit{padding:0 13px}.main-col:not(.expanded)[_nghost-%COMP%] .video[_ngcontent-%COMP%] my-edit-button[_ngcontent-%COMP%] .action-button-edit .button-label, .main-col:not(.expanded) [_nghost-%COMP%] .video[_ngcontent-%COMP%] my-edit-button[_ngcontent-%COMP%] .action-button-edit .button-label{display:none}}"],changeDetection:0}),S})()},70101:(k,A,e)=>{e.d(A,{W:()=>b});var t=e(83473);class b{constructor(O,h={}){this.id=O.id,this.position=O.position,this.startTimestamp=O.startTimestamp,this.stopTimestamp=O.stopTimestamp,this.type=O.type,O.video&&(this.video=new t.nk(O.video,h))}}},21198:(k,A,e)=>{e.d(A,{U:()=>V});var t=e(80151),b=e(35862),s=e(51197),O=e(19868),h=e(89650),v=e(19952),r=e(65720),y=e(98384);const P=function(T){return["/c",T]};function n(T,U){if(1&T&&(s.TgZ(0,"a",15),s.SDv(1,16),s.qZA()),2&T){const I=s.oxw();s.Q6J("routerLink",s.VKq(2,P,I.playlist.videoChannelBy)),s.xp6(1),s.pQV(I.playlist.videoChannelBy),s.QtT(1)}}function L(T,U){if(1&T&&(s.TgZ(0,"span",17),s._uU(1),s.qZA()),2&T){const I=s.oxw();s.xp6(1),s.Oqu(I.playlist.privacy.label)}}function H(T,U){if(1&T&&s._UZ(0,"div",18),2&T){const I=s.oxw();s.Q6J("innerHTML",I.playlistDescription,s.oJD)}}const R=function(T,U,I){return{"no-videos":T,"to-manage":U,"display-as-row":I}};let V=(()=>{var T;class U{constructor(D){this.markdownService=D,this.toManage=!1,this.displayChannel=!1,this.displayDescription=!1,this.displayPrivacy=!1,this.displayAsRow=!1,this.linkType="internal"}ngOnInit(){var D=this;return(0,t.Z)(function*(){D.buildPlaylistUrl(),D.displayDescription&&(D.playlistDescription=yield D.markdownService.textMarkdownToHTML({markdown:D.playlist.description}))})()}buildPlaylistUrl(){if(this.toManage)this.routerLink=["/my-library/video-playlists",this.playlist.uuid];else if(0!==this.playlist.videosLength){if("internal"!==this.linkType&&this.playlist.url)return"external"===this.linkType?(this.routerLink=null,this.playlistHref=this.playlist.url,void(this.playlistTarget="_blank")):void(this.routerLink=["/search/lazy-load-playlist",{url:this.playlist.url}]);this.routerLink=b.L.buildWatchUrl(this.playlist)}else this.routerLink=null}}return(T=U).\u0275fac=function(D){return new(D||T)(s.Y36(O.Zy))},T.\u0275cmp=s.Xpm({type:T,selectors:[["my-video-playlist-miniature"]],inputs:{playlist:"playlist",toManage:"toManage",displayChannel:"displayChannel",displayDescription:"displayDescription",displayPrivacy:"displayPrivacy",displayAsRow:"displayAsRow",linkType:"linkType"},decls:18,vars:26,consts:function(){let I,D,E;return I="{VAR_PLURAL, plural, =0 {No videos} =1 {1 video}
1 other {{INTERPOLATION} videos}}",I=s.Zx4(I,{VAR_PLURAL:"\ufffd0\ufffd",INTERPOLATION:"\ufffd1\ufffd"}),D="Updated " + "\ufffd0\ufffd" + "",E=" " + "\ufffd0\ufffd" + " ",[[1,"miniature",3,"ngClass"],["tabindex","-1",1,"miniature-thumbnail",3,"internalLink","href","target","inheritParentCSS","title"],["alt",""],[1,"miniature-playlist-info-overlay"],I,[1,"play-overlay"],[1,"icon"],[1,"miniature-info"],["className","ellipsis-multiline-2",1,"miniature-name",3,"internalLink","href","target","inheritParentCSS","title"],["class","by",3,"routerLink",4,"ngIf"],[1,"privacy-date"],["class","privacy",4,"ngIf"],[1,"updated-at"],D,["class","description",3,"innerHTML",4,"ngIf"],[1,"by",3,"routerLink"],E,[1,"privacy"],[1,"description",3,"innerHTML"]]},template:function(D,E){1&D&&(s.TgZ(0,"div",0)(1,"my-link",1),s._UZ(2,"img",2),s.TgZ(3,"div",3),s.ynx(4),s.SDv(5,4),s.BQk(),s.qZA(),s.TgZ(6,"div",5),s._UZ(7,"div",6),s.qZA()(),s.TgZ(8,"div",7)(9,"my-link",8),s._uU(10),s.qZA(),s.YNc(11,n,2,4,"a",9),s.TgZ(12,"div",10),s.YNc(13,L,2,1,"span",11),s.TgZ(14,"span",12),s.SDv(15,13),s.ALo(16,"myFromNow"),s.qZA()(),s.YNc(17,H,1,1,"div",14),s.qZA()()),2&D&&(s.Q6J("ngClass",s.kEZ(22,R,0===E.playlist.videosLength,E.toManage,E.displayAsRow)),s.xp6(1),s.Q6J("internalLink",E.routerLink)("href",E.playlistHref)("target",E.playlistTarget)("inheritParentCSS",!0)("title",E.playlist.description),s.xp6(1),s.uIk("aria-labelledby",E.playlist.displayName)("src",E.playlist.thumbnailUrl,s.LSH),s.xp6(3),s.pQV(E.playlist.videosLength)(E.playlist.videosLength),s.QtT(5),s.xp6(4),s.Q6J("internalLink",E.routerLink)("href",E.playlistHref)("target",E.playlistTarget)("inheritParentCSS",!0)("title",E.playlist.description),s.xp6(1),s.hij(" ",E.playlist.displayName," "),s.xp6(1),s.Q6J("ngIf",E.displayChannel&&E.playlist.videoChannelBy),s.xp6(2),s.Q6J("ngIf",E.displayPrivacy),s.xp6(3),s.pQV(s.lcZ(16,20,E.playlist.updatedAt)),s.QtT(15),s.xp6(1),s.Q6J("ngIf",E.displayDescription))},dependencies:[h.mk,h.O5,v.rH,r.N,y.d],styles:['.miniature[_ngcontent-%COMP%]{display:inline-block;width:100%}.miniature.no-videos[_ngcontent-%COMP%]:not(.to-manage) a[_ngcontent-%COMP%]{cursor:default!important}.miniature.to-manage[_ngcontent-%COMP%] .play-overlay[_ngcontent-%COMP%], .miniature.no-videos[_ngcontent-%COMP%] .play-overlay[_ngcontent-%COMP%]{display:none}.miniature-thumbnail[_ngcontent-%COMP%]{display:flex;flex-direction:column;position:relative;border-radius:3px;width:100%;height:100%;overflow:hidden;background-color:#ececec;transition:filter .2s ease}.miniature-thumbnail[_ngcontent-%COMP%]:focus:not(.focus-visible){outline:none!important}.miniature-thumbnail[_ngcontent-%COMP%] .play-overlay[_ngcontent-%COMP%]{position:absolute;right:0;bottom:0;width:inherit;height:inherit;opacity:0;background-color:#0000004d}.miniature-thumbnail[_ngcontent-%COMP%] .play-overlay[_ngcontent-%COMP%], .miniature-thumbnail[_ngcontent-%COMP%] .play-overlay[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{transition:all .2s ease}.miniature-thumbnail[_ngcontent-%COMP%] .play-overlay[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:0;height:0;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) scale(.5);border-top:13px solid transparent;border-bottom:13px solid transparent;border-left:18px solid rgba(255,255,255,.95)}.miniature-thumbnail[_ngcontent-%COMP%]:hover{text-decoration:none!important}.miniature-thumbnail[_ngcontent-%COMP%]:hover .play-overlay[_ngcontent-%COMP%]{opacity:1}.miniature-thumbnail[_ngcontent-%COMP%]:hover .play-overlay[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{transform:translate(-50%,-50%) scale(1)}.miniature-thumbnail.focus-visible[_ngcontent-%COMP%]{box-shadow:0 0 0 .2rem var(--mainColorLightest);outline:none}.miniature-thumbnail[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:inherit;height:inherit}.miniature-thumbnail[_ngcontent-%COMP%] img.blur-filter[_ngcontent-%COMP%]{filter:blur(20px);transform:scale(1.03)}.miniature-thumbnail[_ngcontent-%COMP%] .miniature-playlist-info-overlay[_ngcontent-%COMP%]{display:inline-block;background-color:#000000b3;color:#fff;position:absolute;right:0;bottom:0;height:100%;padding:0 10px;display:flex;align-items:center;font-size:14px;font-weight:600}
1.miniature-info[_ngcontent-%COMP%] .miniature-name[_ngcontent-%COMP%]{word-break:break-word;word-wrap:break-word;overflow-wrap:break-word;font-size:1.1em;transition:color .2s;font-weight:600;color:var(--mainForegroundColor)}.miniature-info[_ngcontent-%COMP%] .miniature-name[_ngcontent-%COMP%]:hover{text-decoration:none}.miniature-info[_ngcontent-%COMP%] .miniature-name.blur-filter[_ngcontent-%COMP%]{padding-inline-start:.25rem;filter:blur(3px)}.miniature-info[_ngcontent-%COMP%] .by[_ngcontent-%COMP%]{display:block;color:var(--greyForegroundColor)}.miniature-info[_ngcontent-%COMP%] .by[_ngcontent-%COMP%]:hover, .miniature-info[_ngcontent-%COMP%] .by[_ngcontent-%COMP%]:focus, .miniature-info[_ngcontent-%COMP%] .by[_ngcontent-%COMP%]:active{text-decoration:none!important}.miniature-info[_ngcontent-%COMP%] .by[_ngcontent-%COMP%]:focus:not(.focus-visible){outline:none!important}.miniature-info[_ngcontent-%COMP%] .privacy-date[_ngcontent-%COMP%]{margin-top:5px;font-size:14px}.miniature-info[_ngcontent-%COMP%] .privacy-date[_ngcontent-%COMP%] .privacy[_ngcontent-%COMP%]{font-weight:600}.miniature-info[_ngcontent-%COMP%] .privacy-date[_ngcontent-%COMP%] .privacy[_ngcontent-%COMP%]:after{content:"-";margin:0 3px}.miniature-info[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{word-break:break-word;word-wrap:break-word;overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;margin-top:10px;color:var(--greyForegroundColor)}.miniature[_ngcontent-%COMP%]:not(.display-as-row) .miniature-name[_ngcontent-%COMP%]{margin-top:10px;margin-bottom:5px}.miniature[_ngcontent-%COMP%]:not(.display-as-row) .miniature-thumbnail[_ngcontent-%COMP%]{position:relative;height:0;width:100%;padding-top:56.25%;margin-top:10px;margin-bottom:5px}.miniature[_ngcontent-%COMP%]:not(.display-as-row) .miniature-thumbnail[_ngcontent-%COMP%] a{position:absolute;width:100%;height:100%;top:0}.miniature.display-as-row[_ngcontent-%COMP%]{--rowThumbnailWidth: 280px;--rowThumbnailHeight: 153px;display:flex}.miniature.display-as-row[_ngcontent-%COMP%] .miniature-name[_ngcontent-%COMP%]{font-size:1.3em}.miniature.display-as-row[_ngcontent-%COMP%] .miniature-thumbnail[_ngcontent-%COMP%]{margin-inline-end:1rem;min-width:var(--rowThumbnailWidth);max-width:var(--rowThumbnailWidth);height:var(--rowThumbnailHeight)}@media screen and (max-width: 1040px){.main-col:not(.expanded)[_nghost-%COMP%] .miniature.display-as-row[_ngcontent-%COMP%], .main-col:not(.expanded) [_nghost-%COMP%] .miniature.display-as-row[_ngcontent-%COMP%]{--rowThumbnailWidth: 201px;--rowThumbnailHeight: 114px}}@media screen and (max-width: 800px){.main-col.expanded[_nghost-%COMP%] .miniature.display-as-row[_ngcontent-%COMP%], .main-col.expanded [_nghost-%COMP%] .miniature.display-as-row[_ngcontent-%COMP%]{--rowThumbnailWidth: 201px;--rowThumbnailHeight: 114px}}@media screen and (max-width: 740px){.main-col:not(.expanded)[_nghost-%COMP%] .miniature.display-as-row[_ngcontent-%COMP%], .main-col:not(.expanded) [_nghost-%COMP%] .miniature.display-as-row[_ngcontent-%COMP%]{--rowThumbnailWidth: 125px;--rowThumbnailHeight: 71px}}@media screen and (max-width: 500px){.main-col.expanded[_nghost-%COMP%] .miniature.display-as-row[_ngcontent-%COMP%], .main-col.expanded [_nghost-%COMP%] .miniature.display-as-row[_ngcontent-%COMP%]{--rowThumbnailWidth: 125px;--rowThumbnailHeight: 71px}}']}),U})()},35862:(k,A,e)=>{e.d(A,{L:()=>h});var t=e(5914),b=e(83473),s=e(20961),O=e(27258);class h{static buildWatchUrl(r){return(0,s.wp)({shortUUID:r.shortUUID||r.uuid})}constructor(r,y){const P=(0,t.Ir)();this.id=r.id,this.uuid=r.uuid,this.shortUUID=r.shortUUID,this.url=r.url,this.isLocal=r.isLocal,this.displayName=r.displayName,this.description=r.description,this.privacy=r.privacy,this.thumbnailPath=r.thumbnailPath,this.thumbnailUrl=this.thumbnailPath?r.thumbnailUrl||P+r.thumbnailPath:P+"/client/assets/images/default-playlist.jpg",this.embedPath=r.embedPath,this.embedUrl=r.embedUrl||(0,t.lf)()+r.embedPath,this.videosLength=r.videosLength,this.type=r.type,this.createdAt=new Date(r.createdAt),this.updatedAt=new Date(r.updatedAt),this.ownerAccount=r.ownerAccount,this.ownerBy=b.vt.CREATE_BY_STRING(r.ownerAccount.name,r.ownerAccount.host),r.videoChannel&&(this.videoChannel=r.videoChannel,this.videoChannelBy=b.vt.CREATE_BY_STRING(r.videoChannel.name,r.videoChannel.host)),this.privacy.label=(0,s.ol)(this.privacy.label,y),this.type.id===O.e0.WATCH_LATER&&(this.displayName=(0,s.ol)(this.displayName,y))}}},36366:(k,A,e)=>{e.d(A,{Q:()=>N});var B,t=e(75811),s=e(85439),O=e(90961),h=e(28575),v=e(83693),r=e(13045),y=e(75162),P=e(56997),n=e(7218),L=e(61324),H=e(37574),R=e(74048),V=e(5914),T=e(83473),U=e(87699),I=e(20553),D=e(70101),E=e(35862),$=e(51197),F=e(19868);const W=t("peertube:playlists:VideoPlaylistService");class N{constructor(c,u,i,p,a){this.authHttp=c,this.auth=u,this.serverService=i,this.restExtractor=p,this.restService=a,this.videoExists
1InPlaylistNotifier=new s.t(1),this.videoExistsInPlaylistCacheSubject=new O.x,this.videoExistsObservableCache={},this.videoExistsCache={},this.myAccountPlaylistCache=void 0,this.myAccountPlaylistCacheSubject=new O.x,this.videoExistsInPlaylistObservable=(0,h.T)((0,V.f8)({time:500,bulkGet:o=>this.auth.isLoggedIn()?this.doVideosExistInPlaylist(o):(0,v.of)({}),notifierObservable:this.videoExistsInPlaylistNotifier}).pipe((0,r.U)(({response:o})=>o)),this.videoExistsInPlaylistCacheSubject)}listChannelPlaylists(c,u){const i=T.B1.BASE_VIDEO_CHANNEL_URL+c.nameWithHost+"/video-playlists",p=this.restService.componentToRestPagination(u);let a=new R.LE;return a=this.restService.addRestGetParams(a,p),this.authHttp.get(i,{params:a}).pipe((0,y.w)(o=>this.extractPlaylists(o)),(0,P.K)(o=>this.restExtractor.handleError(o)))}listMyPlaylistWithCache(c,u){if(!u){if(this.myAccountPlaylistCacheRunning)return this.myAccountPlaylistCacheRunning;if(this.myAccountPlaylistCache)return(0,v.of)(this.myAccountPlaylistCache)}const i=this.listAccountPlaylists(c.account,void 0,"-updatedAt",u).pipe((0,n.b)(p=>{u||(this.myAccountPlaylistCacheRunning=void 0,this.myAccountPlaylistCache=p)}),(0,L.B)());return u||(this.myAccountPlaylistCacheRunning=i),i}listAccountPlaylists(c,u,i,p){const a=T.BR.BASE_ACCOUNT_URL+c.nameWithHost+"/video-playlists",o=u?this.restService.componentToRestPagination(u):void 0;let l=new R.LE;return l=this.restService.addRestGetParams(l,o,i),p&&(l=this.restService.addObjectParams(l,{search:p})),this.authHttp.get(a,{params:l}).pipe((0,y.w)(d=>this.extractPlaylists(d)),(0,P.K)(d=>this.restExtractor.handleError(d)))}getVideoPlaylist(c){return this.authHttp.get(N.BASE_VIDEO_PLAYLIST_URL+c).pipe((0,y.w)(i=>this.extractPlaylist(i)),(0,P.K)(i=>this.restExtractor.handleError(i)))}createVideoPlaylist(c){const u=(0,V.D$)(c);return this.authHttp.post(N.BASE_VIDEO_PLAYLIST_URL,u).pipe((0,n.b)(i=>{this.myAccountPlaylistCache&&(this.myAccountPlaylistCache.total++,this.myAccountPlaylistCache.data.push({id:i.videoPlaylist.id,displayName:c.displayName}),this.myAccountPlaylistCacheSubject.next(this.myAccountPlaylistCache))}),(0,P.K)(i=>this.restExtractor.handleError(i)))}updateVideoPlaylist(c,u){const i=(0,V.D$)(u);return this.authHttp.put(N.BASE_VIDEO_PLAYLIST_URL+c.id,i).pipe((0,n.b)(()=>{this.myAccountPlaylistCache&&(this.myAccountPlaylistCache.data.find(a=>a.id===c.id).displayName=u.displayName,this.myAccountPlaylistCacheSubject.next(this.myAccountPlaylistCache))}),(0,P.K)(p=>this.restExtractor.handleError(p)))}removeVideoPlaylist(c){return this.authHttp.delete(N.BASE_VIDEO_PLAYLIST_URL+c.id).pipe((0,n.b)(()=>{this.myAccountPlaylistCache&&(this.myAccountPlaylistCache.total--,this.myAccountPlaylistCache.data=this.myAccountPlaylistCache.data.filter(u=>u.id!==c.id),this.myAccountPlaylistCacheSubject.next(this.myAccountPlaylistCache))}),(0,P.K)(u=>this.restExtractor.handleError(u)))}addVideoInPlaylist(c,u){return this.authHttp.post(N.BASE_VIDEO_PLAYLIST_URL+c+"/videos",u).pipe((0,n.b)(p=>{if(this.videoExistsCache[u.videoId].push({playlistId:c,playlistElementId:p.videoPlaylistElement.id,startTimestamp:u.startTimestamp,stopTimestamp:u.stopTimestamp}),this.runVideoExistsInPlaylistCheck(u.videoId),this.myAccountPlaylistCache){const o=this.myAccountPlaylistCache.data.find(d=>d.id===c);if(!o)return;const l=this.myAccountPlaylistCache.data.filter(d=>d!==o);this.myAccountPlaylistCache.data=[o,...l]}}),(0,P.K)(p=>this.restExtractor.handleError(p)))}updateVideoOfPlaylist(c,u,i,p){return this.authHttp.put(N.BASE_VIDEO_PLAYLIST_URL+c+"/videos/"+u,i).pipe((0,n.b)(()=>{const a=this.videoExistsCache[p];if(a){const o=a.find(l=>l.playlistElementId===u);o.startTimestamp=i.startTimestamp,o.stopTimestamp=i.stopTimestamp}this.runVideoExistsInPlaylistCheck(p)}),(0,P.K)(a=>this.restExtractor.handleError(a)))}removeVideoFromPlaylist(c,u,i){return this.authHttp.delete(N.BASE_VIDEO_PLAYLIST_URL+c+"/videos/"+u).pipe((0,n.b)(()=>{i&&(this.videoExistsCache[i]&&(this.videoExistsCache[i]=this.videoExistsCache[i].filter(p=>p.playlistElementId!==u)),this.runVideoExistsInPlaylistCheck(i))}),(0,P.K)(p=>this.restExtractor.handleError(p)))}reorderPlaylist(c,u,i){return this.authHttp.post(N.BASE_VIDEO_PLAYLIST_URL+c+"/videos/reorder",{startPosition:u,insertAfterPosition:i}).pipe((0,P.K)(a=>this.restExtractor.handleError(a)))}getPlaylistVideos(c){const u=N.BASE_VIDEO_PLAYLIST_URL+c.videoPlaylistId+"/videos",i=this.restService.componentToRestPagination(c.componentPagination);let p=new R.LE;return p=this.restService.addRestGetParams(p,i),this.authHttp.get(u,{params:p}).pipe((0,y.w)(a=>this.extractVideoPlaylistElements(a)),(0,P.K)(a=>this.restExtractor.handleError(a)))}listenToMyAccountPlaylistsChange(){return this.myAccountPlaylistCacheSubject.asObservable()}listenToVideoPlaylistChange(c){if(this.videoExistsObservableCache[c])return this.videoExistsObservableCache[c];
1const u=this.videoExistsInPlaylistObservable.pipe((0,r.U)(i=>i[c]),(0,H.h)(i=>!!i),(0,n.b)(i=>this.videoExistsCache[c]=i));return this.videoExistsObservableCache[c]=u,u}runVideoExistsInPlaylistCheck(c){return W("Running playlist check."),this.videoExistsCache[c]?(W("Found cache for %d.",c),this.videoExistsInPlaylistCacheSubject.next({[c]:this.videoExistsCache[c]})):(W("Fetching from network for %d.",c),this.videoExistsInPlaylistNotifier.next(c))}extractPlaylists(c){return this.serverService.getServerLocale().pipe((0,r.U)(u=>{const i=c.data,p=c.total,a=[];for(const o of i)a.push(new E.L(o,u));return{data:a,total:p}}))}extractPlaylist(c){return this.serverService.getServerLocale().pipe((0,r.U)(u=>new E.L(c,u)))}extractVideoPlaylistElements(c){return this.serverService.getServerLocale().pipe((0,r.U)(u=>{const i=c.data,p=c.total,a=[];for(const o of i)a.push(new D.W(o,u));return{total:p,data:a}}))}doVideosExistInPlaylist(c){const u=N.MY_VIDEO_PLAYLIST_URL+"videos-exist";let i=new R.LE;return i=this.restService.addObjectParams(i,{videoIds:c}),this.authHttp.get(u,{params:i,context:(new R.qT).set(U.L,!0)}).pipe((0,P.K)(p=>this.restExtractor.handleError(p)))}}(B=N).BASE_VIDEO_PLAYLIST_URL=I.N.apiUrl+"/api/v1/video-playlists/",B.MY_VIDEO_PLAYLIST_URL=I.N.apiUrl+"/api/v1/users/me/video-playlists/",B.\u0275fac=function(c){return new(c||B)($.LFG(R.eN),$.LFG(F.e8),$.LFG(F.NG),$.LFG(F.DI),$.LFG(F.vg))},B.\u0275prov=$.Yz7({token:B,factory:B.\u0275fac})},66871:(k,A,e)=>{e.d(A,{A:()=>s});var t=e(16354),b=e(51197);let s=(()=>{var O;class h{}return(O=h).\u0275fac=function(r){return new(r||O)},O.\u0275mod=b.oAB({type:O}),O.\u0275inj=b.cJS({imports:[t.n]}),h})()},54188:(k,A,e)=>{e.d(A,{M:()=>v});var t=e(51197),b=e(89650),s=e(38141);function O(r,y){if(1&r&&(t.ynx(0),t.SDv(1,2),t.ALo(2,"myNumberFormatter"),t.BQk()),2&r){const P=t.oxw();
1t.xp6(2),t.pQV(P.video.views)(t.lcZ(2,2,P.video.views)),t.QtT(1)}}function h(r,y){if(1&r&&(t.ynx(0),t.SDv(1,3),t.ALo(2,"myNumberFormatter"),t.BQk()),2&r){const P=t.oxw();t.xp6(2),t.pQV(P.video.viewers)(t.lcZ(2,2,P.video.viewers)),t.QtT(1)}}let v=(()=>{var r;class y{}return(r=y).\u0275fac=function(n){return new(n||r)},r.\u0275cmp=t.Xpm({type:r,selectors:[["my-video-views-counter"]],inputs:{video:"video"},decls:3,vars:3,consts:function(){let P,n,L,H;return P="{VAR_PLURAL, plural, =1 {1 view} other {{INTERPOLATION} views}}",P=t.Zx4(P,{VAR_PLURAL:"\ufffd0\ufffd",INTERPOLATION:"\ufffd1\ufffd"}),n=" " + P + " ",L="{VAR_PLURAL, plural, =1 {1 viewer} other {{INTERPOLATION} viewers}}",L=t.Zx4(L,{VAR_PLURAL:"\ufffd0\ufffd",INTERPOLATION:"\ufffd1\ufffd"}),H=" " + L + " ",[[3,"title"],[4,"ngIf"],n,H]},template:function(n,L){1&n&&(t.TgZ(0,"span",0),t.YNc(1,O,3,4,"ng-container",1),t.YNc(2,h,3,4,"ng-container",1),t.qZA()),2&n&&(t.Q6J("title",L.video.getExactNumberOfViews()),t.xp6(1),t.Q6J("ngIf",!L.video.isLive),t.xp6(1),t.Q6J("ngIf",L.video.isLive))},dependencies:[b.O5,s.m]}),y})()}}]); 2//# sourceMappingURL=4155.0973a383d0ab2add.js.map
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.