1import{a as St,b as Ae,c as bt,d as V,e as Ne,f as K,g as Et,h as J}from"./chunk-6RSAK24T.js";import{a as ht}from"./chunk-7LF5UWBE.js";import{a as j}from"./chunk-TTWAA7G7.js";import{a as Le}from"./chunk-CP7B4ZRS.js";import"./chunk-DIGB4B3B.js";import"./chunk-73EPZWC4.js";import{a as Pt}from"./chunk-U5CY2OHZ.js";import"./chunk-34UUFVRD.js";import"./chunk-K4N7EYO7.js";import{a as Ot}from"./chunk-Z4BGAK62.js";import"./chunk-GV3EIP2L.js";import"./chunk-PQXBPOUK.js";import"./chunk-X2FBURF4.js";import"./chunk-QUC6NTSG.js";import"./chunk-3LWJAFO5.js";import"./chunk-QG35CQN2.js";import{a as Mt}from"./chunk-J4TV2KDY.js";import"./chunk-LOKSV7BJ.js";import"./chunk-3EB6ROPE.js";import"./chunk-MAJ2MT4V.js";import"./chunk-3NI6D25S.js";import"./chunk-PX2V5LW4.js";import"./chunk-XNO4KBCG.js";import"./chunk-ADXUERWR.js";import{a as It}from"./chunk-XM66LESI.js";import{a as De}from"./chunk-NZGVU4SK.js";import"./chunk-QWEOPDUO.js";import{a as vt}from"./chunk-TQFSJ42M.js";import"./chunk-H5LMM5H6.js";import"./chunk-J4MCGFGL.js";import"./chunk-HPNPWRE6.js";import{c as _e}from"./chunk-MPST6DST.js";import"./chunk-VBSB25XC.js";import"./chunk-BCRRYDPZ.js";import"./chunk-QCPM66FJ.js";import"./chunk-HHA6TJUW.js";import{a as le}from"./chunk-BEGS45EY.js";import"./chunk-YWMORIFE.js";import"./chunk-2LRCFDBM.js";import"./chunk-YWKNUTTI.js";import{c as ft}from"./chunk-UOKNR47W.js";import"./chunk-6GITQCZG.js";import{a as ye}from"./chunk-VAQV5NIY.js";import"./chunk-4AYNN2OG.js";import"./chunk-EIKVP5P3.js";import{a as se}from"./chunk-AEOKVOTE.js";import"./chunk-L5VBVHBU.js";import{A as ct,B as dt,E as Ee,u as at,w as lt,x as st,y as _t}from"./chunk-RCSKD7UH.js";import{C as Q,D as W,c as ae,g as z,n as X,q as it}from"./chunk-5ZKSLKN2.js";import{a as Y}from"./chunk-P3G3RYGD.js";import{$ as _,Ab as C,Bb as s,Dh as Te,Ea as Ke,Ec as et,Fg as pt,Fh as D,Ga as c,Gc as re,Jg as ut,Jh as gt,Kh as mt,Lb as H,Lc as tt,Ma as $,Mb as oe,Md as Ce,Nb as ie,Ob as R,P as ne,Pb as Z,Qb as Se,Ra as U,Sc as nt,Ub as b,Vb as E,Wb as y,X as je,Xa as m,Yd as rt,Yh as w,_b as Je,_h as Ct,ac as Ze,db as u,dh as q,ga as d,ha as p,hh as fe,ib as M,m as te,mb as a,mc as $e,nb as l,ob as P,pb as A,q as Oe,qb as N,qd as k,ra as L,sa as S,sb as v,sd as ot,ub as F,ud as Ie,uh as Ve,vb as G,vd as be,wb as g,xb as Me,yb as he}from"./chunk-VGQB5O46.js";import{g as me,j as O,m as B}from"./chunk-4BD4KICC.js";var yt=me(fe());var Nt=["torrentfileInput"];function xt(i,t){if(i&1){let e=v();a(0,"div",8),C("fileDropped",function(n){d(e);let r=s();return p(r.setTorrentFile(n));}),a(1,"div",9),P(2,"my-global-icon",10),a(3,"div",11)(4,"span"),g(5,1),l(),a(6,"input",12,0),C("change",function(){d(e);let n=s();return p(n.fileChange());}),l()(),P(8,"div",13),a(9,"div",14)(10,"label",15),g(11,2),l(),a(12,"my-help"),A(13),g(14,3),N(),l(),a(15,"input",16),y("ngModelChange",function(n){d(e);let r=s();return E(r.firstStepMagnetUri,n)||(r.firstStepMagnetUri=n),p(n);}),l()(),a(16,"div",17)(17,"label",18),g(18,4),l(),a(19,"my-select-channel",19),y("ngModelChange",function(n){d(e);let r=s();return E(r.firstStepChannelId,n)||(r.firstStepChannelId=n),p(n);}),l()(),a(20,"input",20),C("click",function(){d(e);let n=s();return p(n.importVideo());}),l()()();}if(i&2){let e=s();c(3),u("ngbTooltip","(extensions: .torrent)"),c(12),b("ngModel",e.firstStepMagnetUri),c(4),u("items",e.userChannels()),b("ngModel",e.firstStepChannelId),c(),u("disabled",!e.isMagnetUrlValid()||e.isImportingVideo);}}function Ut(i,t){if(i&1){let e=v();a(0,"my-video-manage-container",21),C("videoUpdated",function(){d(e);let n=s();return p(n.onVideoUpdated());}),a(1,"my-alert",22),g(2,5),l()();}}var Rt=(0,yt.default)("peertube:video-publish"),ce=class ce{loadingBar=_(ye);notifier=_(q);videoService=_(_e);videoImportService=_(De);hooks=_(w);serverService=_(D);manageController=_(V);route=_(k);userChannels=S.required();userQuota=S.required();highestPrivacy=S.required();firstStepDone=L();firstStepError=L();torrentfileInput=$("torrentfileInput");firstStep=!0;firstStepChannelId;firstStepMagnetUri="";isImportingVideo=!1;ngOnInit(){this.firstStepChannelId=this.userChannels()[0].id;}ngAfterViewInit(){this.hooks.runAction("action:video-torrent-import.init","video-edit");}canDeactivate(){if(this.firstStep)return{canDeactivate:!0};let t="";return this.manageController.hasPendingChanges()&&(t="Your video is being imported. But there are unsaved changes: are you sure you want to leave this page?"),{canDeactivate:!t,text:t};}onVideoUpdated(){this.notifier.success("Changes saved.");}reset(){this.firstStep=!0,this.isImportingVideo=!1,this.firstStepMagnetUri="";}isMagnetUrlValid(){return!!this.firstStepMagnetUri;}fileChange(){let t=this.torrentfileInput().nativeElement.files[0];t&&this.importVideo(t);}setTorrentFile(t){this.torrentfileInput().nativeElement.files=t,this.fileChange();}importVideo(t){if(this.isImportingVideo)return;this.isImportingVideo=!0;
1let e=this.serverService.getHTMLConfig(),o=K.createFromImport(e,{torrentfile:t,magnetUri:this.firstStepMagnetUri,channelId:this.firstStepChannelId,support:this.userChannels().find(n=>n.id===this.firstStepChannelId).support??""});this.manageController.setConfig({manageType:"import-torrent",serverConfig:this.serverService.getHTMLConfig()}),this.manageController.setVideoEdit(o),this.loadingBar.useRef().start(),this.videoImportService.importVideo(o.toVideoImportCreate(this.highestPrivacy())).pipe(ne(({video:n})=>this.videoService.getVideo({videoId:n.uuid}))).subscribe({next:n=>B(this,null,function*(){yield o.loadFromAPI({video:n,loadPrivacy:!1}),this.loadingBar.useRef().complete(),Rt("Torrent/magnet import created"),this.manageController.silentRedirectOnManage(o.getVideoAttributes().shortUUID,this.route),this.firstStep=!1,this.isImportingVideo=!1,this.firstStepDone.emit(o.getVideoAttributes().name);}),error:n=>{this.loadingBar.useRef().complete(),this.firstStepError.emit();let r=n.message;n.body?.code===Ce.INCORRECT_FILES_IN_TORRENT&&(r="Torrents with only 1 file are supported."),this.notifier.error(r),this.isImportingVideo=!1;}});}};O(ce,"\u0275fac",function(e){return new(e||ce)();}),O(ce,"\u0275cmp",U({type:ce,selectors:[["my-video-import-torrent"]],viewQuery:function(e,o){e&1&&H(o.torrentfileInput,Nt,5),e&2&&oe();},inputs:{userChannels:[1,"userChannels"],userQuota:[1,"userQuota"],highestPrivacy:[1,"highestPrivacy"]},outputs:{firstStepDone:"firstStepDone",firstStepError:"firstStepError"},decls:2,vars:1,consts:()=>{let t;t="Select the torrent to import";let e;e="OR";let o;o="Import";let n;n="Select the torrent to import";let r;r="Paste magnet URI";let f;f=" You can import any torrent file that points to a media file. You should make sure you have diffusion rights over the content it points to, otherwise it could cause legal trouble to yourself and your instance. ";let I;I="Channel";let T;return T=" Congratulations, the video will be imported with BitTorrent! You can already add information about this video. ",[["torrentfileInput",""],n,r,f,I,T,["myDragDrop","",1,"upload-video-container"],["canUpdate","true","canWatch","false","cancelLink","/my-library/videos"],["myDragDrop","",1,"upload-video-container",3,"fileDropped"],[1,"first-step-block"],["iconName","upload","aria-hidden","true",1,"upload-icon"],[1,"button-file","primary-button","form-control",3,"ngbTooltip"],["aria-label",t,"type","file","name","torrentfile","id","torrentfile","accept",".torrent",3,"change"],["data-content",e,1,"torrent-or-magnet"],[1,"form-group","form-group-magnet-uri"],["for","magnetUri"],["type","text","id","magnetUri",1,"form-control",3,"ngModelChange","ngModel"],[1,"form-group"],["for","first-step-channel"],["inputId","first-step-channel",3,"ngModelChange","items","ngModel"],["type","button","value",o,1,"peertube-button","primary-button",3,"click","disabled"],["canUpdate","true","canWatch","false","cancelLink","/my-library/videos",3,"videoUpdated"],["type","primary"]];},template:function(e,o){e&1&&m(0,xt,21,5,"div",6)(1,Ut,3,0,"my-video-manage-container",7),e&2&&M(o.firstStep?0:1);},dependencies:[Y,Ee,se,Q,ae,z,X,Ne,j,W,le,J],styles:['.alert.alert-danger[_ngcontent-%COMP%]{text-align:center}.alert.alert-danger[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{font-weight:600}.first-step-block[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;--textarea-bg: var(--textarea-bg-in-modal);--input-bg: var(--input-bg-in-modal);--input-border-color: var(--input-bg-in-modal);--p-multiselect-background: var(--input-bg-in-modal);--p-select-background: var(--input-bg-in-modal)}.first-step-block[_ngcontent-%COMP%] .upload-icon[_ngcontent-%COMP%]{width:90px;margin-bottom:25px;color:var(--fg-300)}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%]{padding:0;margin:0;position:relative;height:min-content;width:275px}@media screen and (max-width: 305px){.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%]{width:100%}}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%]:after{top:50%;right:calc(0% + 15px);content:" ";height:0;width:0;position:absolute;pointer-events:none;border:5px solid rgba(0,0,0,0);border-top-color:var(--fg-300);margin-top:-2px;z-index:100}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{line-height:24px}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{color:inherit;background-color:transparent;border:1px solid var(--bg-secondary-500)!important}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:active, .first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select.active[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:focus, .first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:focus-visible{color:inherit;background-color:var(--bg-secondary-500);border-color:var(--bg-secondary-500)}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select.btn[_ngcontent-%COMP%]:active, .first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select.btn[_ngcontent-%COMP%]:focus-visible, .first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select.btn.show[_ngcontent-%COMP%]{color:inherit!important;background-color:var(--bg-secondary-500)!important;border-color:var(--bg-secondary-500)!important}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:hover{color:inherit;background-color:var(--bg-secondary-450)}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[disabled][_ngcontent-%COMP%]{pointer-events:none;opacity:.8}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:not(.icon-only) my-global-icon[_ngcontent-%COMP%]{color:var(--secondary-icon-color)}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) calc(var(--input-x-padding) + 23px) var(--input-y-padding) var(--input-x-padding);position:relative;border:var(--input-border-width) solid var(--input-border-color)!important;-webkit-appearance:none;appearance:none;text-overflow:ellipsis;color:var(--input-fg);background:var(--input-bg);border-radius:var(--input-border-radius)}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:focus, .first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100)}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[disabled][_ngcontent-%COMP%]{opacity:.5}.first-step-block[_ngcontent-%COMP%] my-select-channel[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%] my-select-options[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%] .peertube-radio-container[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%] .form-group-description[_ngcontent-%COMP%]{display:block;width:275px}@media screen and (max-width: 275px){.first-step-block[_ngcontent-%COMP%] my-select-channel[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%] my-select-options[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%] .peertube-radio-container[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%] .form-group-description[_ngcontent-%COMP%]{width:100%}}.first-step-block[_ngcontent-%COMP%] .form-group-description[_ngcontent-%COMP%]{white-space:nowrap}.first-step-block[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%]{display:block;font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:275px;max-width:275px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}.first-step-block[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder);font-size:14px}.first-step-block[_ngcontent-%COMP%] input[type=text][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}.first-step-block[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%]:focus, .first-step-block[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}.first-step-block[_ngcontent-%COMP%] input[type=text][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width: 315px){.first-step-block[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%]{width:100%}}.first-step-block[_ngcontent-%COMP%] .button-file[_ngcontent-%COMP%]{width:max-content}',".first-step-block[_ngcontent-%COMP%] .torrent-or-magnet[_ngcontent-%COMP%]{width:95%;border-top:.05rem solid var(--secondary-icon-color);height:.05rem;text-align:center;display:block;position:relative}.first-step-block[_ngcontent-%COMP%] .torrent-or-magnet[data-content][_ngcontent-%COMP%]{margin:.8rem 0}.first-step-block[_ngcontent-%COMP%] .torrent-or-magnet[data-content][_ngcontent-%COMP%]:after{background:var(--bg-secondary-400);color:var(--secondary-icon-color);content:attr(data-content);display:inline-block;font-size:.7rem;padding:0 .4rem;
1transform:translateY(-.65rem)}.first-step-block[_ngcontent-%COMP%] .torrent-or-magnet[data-content][_ngcontent-%COMP%]{margin:1.5rem 0}.first-step-block[_ngcontent-%COMP%] .form-group-magnet-uri[_ngcontent-%COMP%]{margin-bottom:40px}"]}));var xe=ce;var Vt=me(fe());function kt(i,t){i&1&&(a(0,"div",17),F(1,3),P(2,"a",18),G(),l());}function wt(i,t){if(i&1){let e=v();a(0,"div",5)(1,"div",7),P(2,"my-global-icon",8),a(3,"div",9)(4,"label",10),g(5,0),l(),a(6,"my-help"),A(7),F(8,1),P(9,"a",11),G(),N(),l(),a(10,"input",12),y("ngModelChange",function(n){d(e);let r=s();return E(r.targetUrl,n)||(r.targetUrl=n),p(n);}),l(),m(11,kt,3,0,"div",13),l(),a(12,"div",9)(13,"label",14),g(14,2),l(),a(15,"my-select-channel",15),y("ngModelChange",function(n){d(e);let r=s();return E(r.firstStepChannelId,n)||(r.firstStepChannelId=n),p(n);}),l()(),a(16,"input",16),C("click",function(){d(e);let n=s();return p(n.importVideo());}),l()()();}if(i&2){let e=s();c(10),b("ngModel",e.targetUrl),c(),u("ngIf",e.isChannelSyncEnabled()),c(4),u("items",e.userChannels()),b("ngModel",e.firstStepChannelId),c(),u("disabled",!e.isTargetUrlValid()||e.isImportingVideo);}}function Bt(i,t){if(i&1){let e=v();a(0,"my-video-manage-container",19),C("videoUpdated",function(){d(e);let n=s();return p(n.onVideoUpdated());}),a(1,"my-alert",20),g(2,4),l()();}if(i&2){let e=s();c(2),Me(e.targetUrl),he(2);}}var $t=(0,Vt.default)("peertube:video-publish"),de=class de{loadingBar=_(ye);notifier=_(q);videoService=_(_e);videoImportService=_(De);hooks=_(w);serverService=_(D);manageController=_(V);route=_(k);chapterService=_(It);captionService=_(vt);userChannels=S.required();userQuota=S.required();highestPrivacy=S.required();firstStepDone=L();firstStepError=L();targetUrl="";firstStep=!0;firstStepChannelId;isImportingVideo=!1;ngOnInit(){this.firstStepChannelId=this.userChannels()[0].id;}ngAfterViewInit(){this.hooks.runAction("action:video-url-import.init","video-edit");}canDeactivate(){if(this.firstStep)return{canDeactivate:!0};let t="";return this.manageController.hasPendingChanges()&&(t="Your video is being imported. But there are unsaved changes: are you sure you want to leave this page?"),{canDeactivate:!t,text:t};}onVideoUpdated(){this.notifier.success("Changes saved.");}reset(){this.firstStep=!0,this.isImportingVideo=!1;}isTargetUrlValid(){return this.targetUrl?.match(/https?:\/\//);}isChannelSyncEnabled(){return this.serverService.getHTMLConfig().import.videoChannelSynchronization.enabled;}importVideo(){if(this.isImportingVideo)return;this.isImportingVideo=!0;let t=this.serverService.getHTMLConfig(),e=K.createFromImport(t,{targetUrl:this.targetUrl,channelId:this.firstStepChannelId,support:this.userChannels().find(o=>o.id===this.firstStepChannelId).support??""});this.manageController.setConfig({manageType:"import-url",serverConfig:this.serverService.getHTMLConfig()}),this.manageController.setVideoEdit(e),this.loadingBar.useRef().start(),this.videoImportService.importVideo(e.toVideoImportCreate(this.highestPrivacy())).pipe(ne(o=>Oe([this.captionService.listCaptions(o.video.uuid),this.chapterService.getChapters({videoId:o.video.uuid}),this.videoService.getVideo({videoId:o.video.uuid})]).pipe(te(([{data:n},{chapters:r},f])=>({captions:n,chapters:r,video:f}))))).subscribe({next:f=>B(this,[f],function*({video:o,captions:n,chapters:r}){yield e.loadFromAPI({video:o,captions:n,chapters:r,loadPrivacy:!1}),this.loadingBar.useRef().complete(),$t("URL import created"),this.manageController.silentRedirectOnManage(e.getVideoAttributes().shortUUID,this.route),this.firstStep=!1,this.isImportingVideo=!1,this.firstStepDone.emit(e.getVideoAttributes().name);}),error:o=>{this.loadingBar.useRef().complete(),this.isImportingVideo=!1,this.firstStepError.emit(),this.notifier.error(o.message);}});}};O(de,"\u0275fac",function(e){return new(e||de)();}),O(de,"\u0275cmp",U({type:de,selectors:[["my-video-import-url"]],inputs:{userChannels:[1,"userChannels"],userQuota:[1,"userQuota"],highestPrivacy:[1,"highestPrivacy"]},outputs:{firstStepDone:"firstStepDone",firstStepError:"firstStepError"},decls:2,vars:1,consts:()=>{let t;t="Import";let e;e="URL";let o;o=" You can import any URL "+"\uFFFD#9\uFFFD"+"supported by youtube-dl"+"\uFFFD/#9\uFFFD"+" or URL that points to a media file. You should make sure you have diffusion rights over the content it points to, otherwise it could cause legal trouble to yourself and your instance. ";let n;n="Channel";let r;r=" You can also synchronize a remote channel in "+"\uFFFD#2\uFFFD"+"your library"+"\uFFFD/#2\uFFFD"+"";let f;return f=" Congratulations, the video behind "+"\uFFFD0\uFFFD"+" is being imported! You can already add information about this video. ",[e,o,n,r,f,[1,"upload-video-container"],["canUpdate","true","canWatch","false","cancelLink","/my-library/videos"],[1,"first-step-block"],["iconName","upload","aria-hidden","true",1,"upload-icon"],[1,"form-group"],["for","targetUrl"],["href","https://rg3.github.io/youtube-dl/supportedsites.html","target","_blank","rel","noopener noreferrer"],["type","text","id","targetUrl",1,"form-control",3,"ngModelChange","ngModel"],["class","form-group-description",4,"ngIf"],["for","first-step-channel"],["inputId","first-step-channel",3,"ngModelChange","items","ngModel"],["type","button","value",t,1,"peertube-button","primary-button",3,"click","disabled"],[1,"form-group-description"],["routerLink","/my-library/video-channel-syncs",1,"text-decoration-underline"],["canUpdate","true","canWatch","false","cancelLink","/my-library/videos",3,"videoUpdated"],["type","primary"]];},template:function(e,o){e&1&&m(0,wt,17,5,"div",5)(1,Bt,3,1,"my-video-manage-container",6),e&2&&M(o.firstStep?0:1);},dependencies:[re,Y,se,Q,ae,z,X,be,j,W,le,J],styles:['.alert.alert-danger[_ngcontent-%COMP%]{text-align:center}.alert.alert-danger[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{font-weight:600}.first-step-block[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;--textarea-bg: var(--textarea-bg-in-modal);--input-bg: var(--input-bg-in-modal);--input-border-color: var(--input-bg-in-modal);--p-multiselect-background: var(--input-bg-in-modal);--p-select-background: var(--input-bg-in-modal)}.first-step-block[_ngcontent-%COMP%] .upload-icon[_ngcontent-%COMP%]{width:90px;margin-bottom:25px;color:var(--fg-300)}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%]{padding:0;margin:0;position:relative;height:min-content;width:275px}@media screen and (max-width: 305px){.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%]{width:100%}}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%]:after{top:50%;right:calc(0% + 15px);content:" ";height:0;width:0;position:absolute;pointer-events:none;border:5px solid rgba(0,0,0,0);border-top-color:var(--fg-300);margin-top:-2px;z-index:100}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{line-height:24px}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{color:inherit;background-color:transparent;border:1px solid var(--bg-secondary-500)!important}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:active, .first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select.active[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:focus, .first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:focus-visible{color:inherit;background-color:var(--bg-secondary-500);border-color:var(--bg-secondary-500)}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select.btn[_ngcontent-%COMP%]:active, .first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select.btn[_ngcontent-%COMP%]:focus-visible, .first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select.btn.show[_ngcontent-%COMP%]{color:inherit!important;background-color:var(--bg-secondary-500)!important;border-color:var(--bg-secondary-500)!important}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:hover{color:inherit;background-color:var(--bg-secondary-450)}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[disabled][_ngcontent-%COMP%]{pointer-events:none;opacity:.8}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:not(.icon-only) my-global-icon[_ngcontent-%COMP%]{color:var(--secondary-icon-color)}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) calc(var(--input-x-padding) + 23px) var(--input-y-padding) var(--input-x-padding);position:relative;border:var(--input-border-width) solid var(--input-border-color)!important;-webkit-appearance:none;appearance:none;text-overflow:ellipsis;color:var(--input-fg);background:var(--input-bg);border-radius:var(--input-border-radius)}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:focus, .first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100)}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[disabled][_ngcontent-%COMP%]{opacity:.5}.first-step-block[_ngcontent-%COMP%] my-select-channel[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%] my-select-options[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%] .peertube-radio-container[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%] .form-group-description[_ngcontent-%COMP%]{display:block;width:275px}@media screen and (max-width: 275px){.first-step-block[_ngcontent-%COMP%] my-select-channel[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%] my-select-options[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%] .peertube-radio-container[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%] .form-group-description[_ngcontent-%COMP%]{width:100%}}.first-step-block[_ngcontent-%COMP%] .form-group-description[_ngcontent-%COMP%]{white-space:nowrap}.first-step-block[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%]{display:block;font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:275px;max-width:275px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}.first-step-block[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder);font-size:14px}.first-step-block[_ngcontent-%COMP%] input[type=text][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}.first-step-block[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%]:focus, .first-step-block[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}.first-step-block[_ngcontent-%COMP%] input[type=text][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width: 315px){.first-step-block[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%]{width:100%}}.first-step-block[_ngcontent-%COMP%] .button-file[_ngcontent-%COMP%]{width:max-content}']}));var Re=de;var Tt=me(fe());function Ht(i,t){if(i&1){let e=v();a(0,"div",4)(1,"div",6),P(2,"my-global-icon",7),a(3,"div",8)(4,"label",9),g(5,0),l(),a(6,"my-select-channel",10),y("ngModelChange",function(n){d(e);let r=s();
1return E(r.firstStepChannelId,n)||(r.firstStepChannelId=n),p(n);}),l()(),a(7,"div",11)(8,"div",12)(9,"input",13),y("ngModelChange",function(n){d(e);let r=s();return E(r.firstStepPermanentLive,n)||(r.firstStepPermanentLive=n),p(n);}),l(),a(10,"label",14),g(11,1),l(),a(12,"span",15),R(13),l()(),a(14,"div",12)(15,"input",16),y("ngModelChange",function(n){d(e);let r=s();return E(r.firstStepPermanentLive,n)||(r.firstStepPermanentLive=n),p(n);}),l(),a(16,"label",17),g(17,2),l(),a(18,"span",15),g(19,3),l()()(),a(20,"input",18),C("click",function(){d(e);let n=s();return p(n.goLive());}),l()()();}if(i&2){let e=s();c(6),u("items",e.userChannels()),b("ngModel",e.firstStepChannelId),c(3),b("ngModel",e.firstStepPermanentLive),u("value",!1),c(4),Z(e.getNormalLiveDescription()),c(2),b("ngModel",e.firstStepPermanentLive),u("value",!0),c(4),Me(e.getPermanentLiveDescription()),he(19),c(),u("disabled",e.firstStepPermanentLive!==!0&&e.firstStepPermanentLive!==!1);}}function Ft(i,t){if(i&1){let e=v();a(0,"my-video-manage-container",19),C("videoUpdated",function(){d(e);let n=s();return p(n.onVideoUpdated());}),l();}}var Gt=(0,Tt.default)("peertube:video-publish"),pe=class pe{notifier=_(q);serverService=_(D);liveVideoService=_(Le);hooks=_(w);manageController=_(V);route=_(k);userChannels=S.required();userQuota=S.required();highestPrivacy=S.required();firstStepDone=L();firstStepError=L();firstStep=!0;firstStepChannelId;firstStepPermanentLive;isGoingLive=!1;ngOnInit(){this.firstStepChannelId=this.userChannels()[0].id;}ngAfterViewInit(){this.hooks.runAction("action:go-live.init","video-edit");}canDeactivate(){if(this.firstStep)return{canDeactivate:!0};let t="";return this.manageController.hasPendingChanges()&&(t="Your live is waiting in your library. But there are unsaved changes: are you sure you want to leave this page?"),{canDeactivate:!t,text:t};}reset(){this.firstStep=!0,this.isGoingLive=!1;}goLive(){if(this.isGoingLive)return;this.isGoingLive=!0;let t=this.serverService.getHTMLConfig(),e=K.createFromLive(t,{name:"Live",channelId:this.firstStepChannelId,support:this.userChannels().find(o=>o.id===this.firstStepChannelId).support??"",permanentLive:this.firstStepPermanentLive,latencyMode:rt.DEFAULT,saveReplay:this.isReplayAllowed(),replaySettings:{privacy:this.highestPrivacy()},schedules:[]});this.manageController.setConfig({manageType:"go-live",serverConfig:this.serverService.getHTMLConfig()}),this.manageController.setVideoEdit(e),this.liveVideoService.goLive(e.toLiveCreate(this.highestPrivacy())).pipe(ne(({video:o})=>this.liveVideoService.getVideoLive(o.uuid).pipe(te(n=>({live:n,video:o}))))).subscribe({next:I=>B(this,[I],function*({video:{id:o,uuid:n,shortUUID:r},live:f}){e.loadAfterPublish({video:{id:o,uuid:n,shortUUID:r}}),yield e.loadFromAPI({live:f,loadPrivacy:!1}),Gt("Live published"),this.manageController.silentRedirectOnManage(r,this.route),this.firstStep=!1,this.isGoingLive=!1,this.firstStepDone.emit(e.getVideoAttributes().name);}),error:o=>{this.firstStepError.emit();let n=o.message,r=o.body;r?.code===Ce.MAX_INSTANCE_LIVES_LIMIT_REACHED?n="Cannot create live because this platform has too many created lives":r?.code===Ce.MAX_USER_LIVES_LIMIT_REACHED&&(n="Cannot create live because you created too many lives"),this.notifier.error(n),this.isGoingLive=!1;}});}onVideoUpdated(){this.notifier.success("Changes saved.");}getNormalLiveDescription(){return this.isReplayAllowed()?"Stream only once, replay will replace your live":"Stream only once";}getPermanentLiveDescription(){return this.isReplayAllowed()?"Stream multiple times, replays will be separate videos":"Stream multiple times using the same URL";}isReplayAllowed(){return this.serverService.getHTMLConfig().live.allowReplay;}};O(pe,"\u0275fac",function(e){return new(e||pe)();}),O(pe,"\u0275cmp",U({type:pe,selectors:[["my-video-go-live"]],inputs:{userChannels:[1,"userChannels"],userQuota:[1,"userQuota"],highestPrivacy:[1,"highestPrivacy"]},outputs:{firstStepDone:"firstStepDone",firstStepError:"firstStepError"},decls:2,vars:1,consts:()=>{let t;t="Go Live";let e;e="Channel";let o;o="Normal live";let n;n="Permanent/recurring live";let r;return r=""+"\uFFFD0\uFFFD"+"",[e,o,n,r,[1,"upload-video-container"],["canUpdate","true","canWatch","true","cancelLink","/my-library/videos"],[1,"first-step-block"],["iconName","upload","aria-hidden","true",1,"upload-icon"],[1,"form-group"],["for","first-step-channel"],["inputId","first-step-channel",3,"ngModelChange","items","ngModel"],[1,"form-group","live-type"],[1,"peertube-radio-container"],["type","radio","id","permanentLiveFalse",3,"ngModelChange","ngModel","value"],["for","permanentLiveFalse",1,"radio"],[1,"form-group-description"],["type","radio","id","permanentLiveTrue",3,"ngModelChange","ngModel","value"],["for","permanentLiveTrue",1,"radio"],["type","button","value",t,1,"peertube-button","primary-button",3,"click","disabled"],["canUpdate","true","canWatch","true","cancelLink","/my-library/videos",3,"videoUpdated"]];},template:function(e,o){e&1&&m(0,Ht,21,9,"div",4)(1,Ft,1,0,"my-video-manage-container",5),e&2&&M(o.firstStep?0:1);},dependencies:[Y,j,Q,ae,it,z,X,W,J],styles:['.alert.alert-danger[_ngcontent-%COMP%]{text-align:center}.alert.alert-danger[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{font-weight:600}.first-step-block[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;--textarea-bg: var(--textarea-bg-in-modal);--input-bg: var(--input-bg-in-modal);--input-border-color: var(--input-bg-in-modal);--p-multiselect-background: var(--input-bg-in-modal);--p-select-background: var(--input-bg-in-modal)}.first-step-block[_ngcontent-%COMP%] .upload-icon[_ngcontent-%COMP%]{width:90px;margin-bottom:25px;color:var(--fg-300)}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%]{padding:0;margin:0;position:relative;height:min-content;width:275px}@media screen and (max-width: 305px){.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%]{width:100%}}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%]:after{top:50%;right:calc(0% + 15px);content:" ";height:0;width:0;position:absolute;pointer-events:none;border:5px solid rgba(0,0,0,0);border-top-color:var(--fg-300);margin-top:-2px;z-index:100}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{line-height:24px}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{color:inherit;background-color:transparent;border:1px solid var(--bg-secondary-500)!important}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:active, .first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select.active[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:focus, .first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:focus-visible{color:inherit;background-color:var(--bg-secondary-500);border-color:var(--bg-secondary-500)}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select.btn[_ngcontent-%COMP%]:active, .first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select.btn[_ngcontent-%COMP%]:focus-visible, .first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select.btn.show[_ngcontent-%COMP%]{color:inherit!important;background-color:var(--bg-secondary-500)!important;border-color:var(--bg-secondary-500)!important}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:hover{color:inherit;background-color:var(--bg-secondary-450)}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[disabled][_ngcontent-%COMP%]{pointer-events:none;opacity:.8}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:not(.icon-only) my-global-icon[_ngcontent-%COMP%]{color:var(--secondary-icon-color)}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) calc(var(--input-x-padding) + 23px) var(--input-y-padding) var(--input-x-padding);position:relative;border:var(--input-border-width) solid var(--input-border-color)!important;-webkit-appearance:none;appearance:none;text-overflow:ellipsis;color:var(--input-fg);background:var(--input-bg);border-radius:var(--input-border-radius)}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:focus, .first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100)}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[disabled][_ngcontent-%COMP%]{opacity:.5}.first-step-block[_ngcontent-%COMP%] my-select-channel[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%] my-select-options[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%] .peertube-radio-container[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%] .form-group-description[_ngcontent-%COMP%]{display:block;width:275px}@media screen and (max-width: 275px){.first-step-block[_ngcontent-%COMP%] my-select-channel[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%] my-select-options[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%] .peertube-radio-container[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%] .form-group-description[_ngcontent-%COMP%]{width:100%}}.first-step-block[_ngcontent-%COMP%] .form-group-description[_ngcontent-%COMP%]{white-space:nowrap}.first-step-block[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%]{display:block;font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:275px;max-width:275px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}.first-step-block[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder);font-size:14px}.first-step-block[_ngcontent-%COMP%] input[type=text][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}.first-step-block[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%]:focus, .first-step-block[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}.first-step-block[_ngcontent-%COMP%] input[type=text][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width: 315px){.first-step-block[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%]{width:100%}}.first-step-block[_ngcontent-%COMP%] .button-file[_ngcontent-%COMP%]{width:max-content}',".live-type[_ngcontent-%COMP%]{margin-top:15px}"]}));var ke=pe;var Dt=me(fe());var zt=["videoFileInput"];function Xt(i,t){if(i&1){let e=v();A(0),a(1,"div",16)(2,"label",17),g(3,3),l(),a(4,"div",18),F(5,4),P(6,"br"),G(),l(),a(7,"my-preview-upload",19),y("ngModelChange",function(n){d(e);let r=s(2);return E(r.audioPreviewFile,n)||(r.audioPreviewFile=n),p(n);}),l()(),a(8,"div",20)(9,"my-button",21),C("click",function(){d(e);let n=s(2);return p(n.uploadAudio());}),l()(),N();}if(i&2){let e=s(2);c(7),b("ngModel",e.audioPreviewFile),c(2),u("label",e.getAudioUploadLabel());}}function Qt(i,t){if(i&1){let e=v();a(0,"div",7),C("fileDropped",function(n){d(e);let r=s();return p(r.onFileDropped(n));}),a(1,"div",8),P(2,"my-global-icon",9),a(3,"div",10)(4,"span"),g(5,1),l(),a(6,"input",11,0),C("change",function(n){d(e);let r=s();return p(r.onFileChange(n));}),l()(),a(8,"div",12)(9,"label",13),g(10,2),l(),a(11,"my-select-channel",14),y("ngModelChange",function(n){d(e);let r=s();
1return E(r.firstStepChannelId,n)||(r.firstStepChannelId=n),p(n);}),l()(),m(12,Xt,10,2,"ng-container",15),l()();}if(i&2){let e=s();c(3),u("ngbTooltip","(extensions: "+e.getVideoExtensions()+")"),c(3),u("accept",e.getVideoExtensions()),c(5),u("items",e.userChannels()),b("ngModel",e.firstStepChannelId),c(),u("ngIf",e.uploadingAudioFile);}}function Wt(i,t){if(i&1){let e=v();a(0,"my-video-manage-container",22),C("videoUpdated",function(){d(e);let n=s();return p(n.onVideoUpdated());}),l();}if(i&2){let e=s();u("canUpdate",e.hasUploadedFile())("canWatch",e.hasUploadedFile())("cancelLink",e.getCancelLink());}}var Lt=(0,Dt.default)("peertube:video-publish"),ue=class ue{notifier=_(q);serverService=_(D);hooks=_(w);metaService=_(mt);route=_(k);videoUploadService=_(Ae);manageController=_(V);userChannels=S.required();userQuota=S.required();highestPrivacy=S.required();firstStepDone=L();firstStepError=L();videoFileInput=$("videoFileInput");uploadingAudioFile=!1;audioPreviewFile;firstStep=!0;firstStepChannelId;hasFirstUpdated=!1;videoEdit;uploadEventsSubscription;ngOnInit(){this.uploadEventsSubscription=this.manageController.getUploadEventsObs().subscribe(t=>{if(this.updateTitle(),t.status==="cancelled"){Lt("Upload cancelled",t),this.firstStepError.emit(),this.firstStep=!0,this.manageController.silentRedirectOnAbortUpload(this.route);return;}if(t.status==="complete"){let{id:e,uuid:o,shortUUID:n}=t.response.video;this.videoEdit.loadAfterPublish({video:{id:e,uuid:o,shortUUID:n}}),Lt("Upload complete",t),this.manageController.silentRedirectOnManage(n,this.route);return;}}),this.firstStepChannelId=this.userChannels()[0].id;}ngAfterViewInit(){this.hooks.runAction("action:video-upload.init","video-edit");}ngOnDestroy(){this.uploadEventsSubscription?.unsubscribe(),this.manageController.cancelUploadIfNeeded();}canDeactivate(){if(this.firstStep)return{canDeactivate:!0};let t="";return this.hasUploadedFile()!==!0?t="Your video is not uploaded yet, are you sure you want to leave this page?":this.manageController.hasPendingChanges()&&(t="Your video was uploaded to your library. But there are unsaved changes: are you sure you want to leave this page?"),{canDeactivate:!t,text:t};}updateTitle(){this.hasUploadedFile()?this.metaService.setTitle("Publish"):this.uploadingAudioFile||!this.firstStep?this.metaService.setTitle(`${this.manageController.getUploadPercents()}% - Publish`):this.metaService.update(this.route.snapshot.data.meta);}getVideoExtensions(){return this.videoUploadService.getVideoExtensions().join(", ");}onFileDropped(t){let e=this.videoFileInput();e.nativeElement.files=t,this.onFileChange({target:e.nativeElement});}onFileChange(t){this.resetUploadState();let e=t.target.files[0];if(e&&this.manageController.checkUserQuota(e)){if(this.videoUploadService.isAudioFile(e.name)){this.uploadingAudioFile=!0;return;}this.firstStep=!1,this.uploadFile(e);}}resetUploadState(){this.firstStep=!0,this.videoEdit=void 0,this.uploadingAudioFile=!1,this.audioPreviewFile=void 0;}uploadAudio(){this.uploadFile(this.getInputVideoFile(),this.audioPreviewFile);}getAudioUploadLabel(){let t=this.getInputVideoFile();return t?"Upload "+t.name+"":"Upload";}onVideoUpdated(){this.notifier.success("Changes saved.");}hasUploadedFile(){return this.videoEdit?!!this.videoEdit.getVideoAttributes().id:!1;}getCancelLink(){return this.hasUploadedFile()?"/my-library/videos":"/videos/publish";}reset(){this.resetUploadState(),this.manageController.cancelUploadIfNeeded(),this.updateTitle();}getInputVideoFile(){return this.videoFileInput().nativeElement.files[0];}uploadFile(t,e){let o=this.serverService.getHTMLConfig();this.videoEdit=K.createFromUpload(o,{name:this.buildVideoFilename(t.name),channelId:this.firstStepChannelId,support:this.userChannels().find(n=>n.id===this.firstStepChannelId).support??""}),this.manageController.setConfig({manageType:"upload",serverConfig:this.serverService.getHTMLConfig()}),this.manageController.setVideoEdit(this.videoEdit),this.manageController.uploadNewVideo({privacy:this.highestPrivacy(),file:t,previewfile:e}),this.manageController.silentRedirectOnUploading(this.route),this.firstStep=!1,this.firstStepDone.emit(this.videoEdit.getVideoAttributes().name),this.updateTitle();}buildVideoFilename(t){let e=t.replace(/\.[^/.]+$/,""),o=e.length<3?t:e,n=110;return o.length>n&&(o=pt(o,{length:n,omission:""})),o;}};O(ue,"\u0275fac",function(e){return new(e||ue)();}),O(ue,"\u0275cmp",U({type:ue,selectors:[["my-video-upload"]],viewQuery:function(e,o){e&1&&H(o.videoFileInput,zt,5),e&2&&oe();},inputs:{userChannels:[1,"userChannels"],userQuota:[1,"userQuota"],highestPrivacy:[1,"highestPrivacy"]},outputs:{firstStepDone:"firstStepDone",firstStepError:"firstStepError"},decls:2,vars:1,consts:()=>{let t;t="File uploaded! Your video is now available in your private library.";let e;e="Select the file to upload";let o;o="Select the file to upload";let n;n="Channel";let r;r="Edit";let f;f="Video background image";let I;return I=" Image that will be merged with your audio file. "+"\uFFFD#6\uFFFD\uFFFD/#6\uFFFD"+" The chosen image will be definitive and cannot be modified. ",[["videoFileInput",""],o,n,f,I,["myDragDrop","",1,"upload-video-container"],["uploadedLabel",t,3,"canUpdate","canWatch","cancelLink"],["myDragDrop","",1,"upload-video-container",3,"fileDropped"],[1,"first-step-block"],["iconName","upload","aria-hidden","true",1,"upload-icon"],[1,"button-file","primary-button","form-control",3,"ngbTooltip"],["aria-label",e,"id","videofile","type","file",3,"change","accept"],[1,"form-group","form-group-channel"],["for","first-step-channel"],["inputId","first-step-channel",3,"ngModelChange","items","ngModel"],[4,"ngIf"],[1,"form-group","audio-preview"],["for","previewfileUpload"],[1,"audio-image-info"],["input
1Label",r,"inputName","previewfileUpload",3,"ngModelChange","ngModel"],[1,"form-group","upload-audio-button"],["theme","primary","icon","upload",3,"click","label"],["uploadedLabel",t,3,"videoUpdated","canUpdate","canWatch","cancelLink"]];},template:function(e,o){e&1&&m(0,Qt,13,5,"div",5)(1,Wt,1,3,"my-video-manage-container",6),e&2&&M(o.firstStep?0:1);},dependencies:[nt,re,Ne,Y,Ee,j,Q,z,X,Pt,ft,W,J],styles:['.alert.alert-danger[_ngcontent-%COMP%]{text-align:center}.alert.alert-danger[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{font-weight:600}.first-step-block[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;--textarea-bg: var(--textarea-bg-in-modal);--input-bg: var(--input-bg-in-modal);--input-border-color: var(--input-bg-in-modal);--p-multiselect-background: var(--input-bg-in-modal);--p-select-background: var(--input-bg-in-modal)}.first-step-block[_ngcontent-%COMP%] .upload-icon[_ngcontent-%COMP%]{width:90px;margin-bottom:25px;color:var(--fg-300)}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%]{padding:0;margin:0;position:relative;height:min-content;width:275px}@media screen and (max-width: 305px){.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%]{width:100%}}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%]:after{top:50%;right:calc(0% + 15px);content:" ";height:0;width:0;position:absolute;pointer-events:none;border:5px solid rgba(0,0,0,0);border-top-color:var(--fg-300);margin-top:-2px;z-index:100}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{line-height:24px}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{color:inherit;background-color:transparent;border:1px solid var(--bg-secondary-500)!important}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:active, .first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select.active[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:focus, .first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:focus-visible{color:inherit;background-color:var(--bg-secondary-500);border-color:var(--bg-secondary-500)}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select.btn[_ngcontent-%COMP%]:active, .first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select.btn[_ngcontent-%COMP%]:focus-visible, .first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select.btn.show[_ngcontent-%COMP%]{color:inherit!important;background-color:var(--bg-secondary-500)!important;border-color:var(--bg-secondary-500)!important}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:hover{color:inherit;background-color:var(--bg-secondary-450)}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[disabled][_ngcontent-%COMP%]{pointer-events:none;opacity:.8}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:not(.icon-only) my-global-icon[_ngcontent-%COMP%]{color:var(--secondary-icon-color)}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) calc(var(--input-x-padding) + 23px) var(--input-y-padding) var(--input-x-padding);position:relative;border:var(--input-border-width) solid var(--input-border-color)!important;-webkit-appearance:none;appearance:none;text-overflow:ellipsis;color:var(--input-fg);background:var(--input-bg);border-radius:var(--input-border-radius)}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:focus, .first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100)}.first-step-block[_ngcontent-%COMP%] .peertube-select-container[_ngcontent-%COMP%] select[disabled][_ngcontent-%COMP%]{opacity:.5}.first-step-block[_ngcontent-%COMP%] my-select-channel[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%] my-select-options[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%] .peertube-radio-container[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%] .form-group-description[_ngcontent-%COMP%]{display:block;width:275px}@media screen and (max-width: 275px){.first-step-block[_ngcontent-%COMP%] my-select-channel[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%] my-select-options[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%] .peertube-radio-container[_ngcontent-%COMP%], .first-step-block[_ngcontent-%COMP%] .form-group-description[_ngcontent-%COMP%]{width:100%}}.first-step-block[_ngcontent-%COMP%] .form-group-description[_ngcontent-%COMP%]{white-space:nowrap}.first-step-block[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%]{display:block;font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:275px;max-width:275px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}.first-step-block[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder);font-size:14px}.first-step-block[_ngcontent-%COMP%] input[type=text][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}.first-step-block[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%]:focus, .first-step-block[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}.first-step-block[_ngcontent-%COMP%] input[type=text][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width: 315px){.first-step-block[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%]{width:100%}}.first-step-block[_ngcontent-%COMP%] .button-file[_ngcontent-%COMP%]{width:max-content}',".first-step-block[_ngcontent-%COMP%] .form-group-channel[_ngcontent-%COMP%]{margin-bottom:20px;margin-top:35px}.first-step-block[_ngcontent-%COMP%] .audio-image-info[_ngcontent-%COMP%]{margin-bottom:10px}.first-step-block[_ngcontent-%COMP%] .audio-preview[_ngcontent-%COMP%]{margin:30px 0}.first-step-block[_ngcontent-%COMP%] .audio-preview[_ngcontent-%COMP%] my-preview-upload[_ngcontent-%COMP%]{width:360px;height:200px}"]}));var we=ue;var qt=["videoUpload"],Yt=["videoImportUrl"],jt=["videoImportTorrent"],Kt=["videoGoLive"],Jt=i=>({"hide-nav":i});function Zt(i,t){i&1&&(a(0,"a",22),g(1,8),l());}function en(i,t){if(i&1&&(m(0,Zt,2,0,"a",22),a(1,"a",23),g(2,7),l()),i&2){let e=s();M(e.isContactFormEnabled?0:-1);}}function tn(i,t){}function nn(i,t){if(i&1&&(a(0,"my-alert",24)(1,"div"),R(2),l(),m(3,tn,0,0,"ng-template",27),l()),i&2){let e=s(2),o=ie(1);c(2),Z(e.uploadMessages==null?null:e.uploadMessages.autoBlock),c(),u("ngTemplateOutlet",o);}}function on(i,t){i&1&&(a(0,"my-alert",25)(1,"div"),F(2,9),P(3,"strong"),G(),l(),a(4,"div"),F(5,10),P(6,"a",28),G(),l()());}function rn(i,t){i&1&&P(0,"my-channels-setup-message");}function an(i,t){if(i&1&&(a(0,"div"),R(1),l()),i&2){let e=s(3);c(),Z(e.uploadMessages==null?null:e.uploadMessages.quotaLeft);}}function ln(i,t){if(i&1&&(a(0,"div"),R(1),l()),i&2){let e=s(3);c(),Z(e.uploadMessages==null?null:e.uploadMessages.quotaLeftDaily);}}function sn(i,t){}function _n(i,t){if(i&1&&(a(0,"my-alert",26),m(1,an,2,1,"div",29)(2,ln,2,1,"div",29)(3,sn,0,0,"ng-template",27),l()),i&2){let e=s(2),o=ie(1);c(),u("ngIf",e.hasNoQuotaLeft),c(),u("ngIf",e.hasNoQuotaLeftDaily),c(),u("ngTemplateOutlet",o);}}function cn(i,t){if(i&1&&(m(0,nn,4,2,"my-alert",24)(1,on,7,0,"my-alert",25)(2,rn,1,0,"my-channels-setup-message"),P(3,"my-user-quota"),m(4,_n,4,3,"my-alert",26)),i&2){let e=s();M(e.user.isAutoBlocked(e.serverConfig)?0:-1),c(),M(e.isRootUser()?1:2),c(3),M(e.hasNoQuotaLeft||e.hasNoQuotaLeftDaily?4:-1);}}function dn(i,t){}function pn(i,t){if(i&1&&(a(0,"div",21)(1,"my-alert",30)(2,"div"),R(3),l(),m(4,dn,0,0,"ng-template",27),l(),a(5,"div",31),P(6,"img",32),l()()),i&2){let e=s(),o=ie(1);c(3),Z(e.uploadMessages==null?null:e.uploadMessages.noQuota),c(),u("ngTemplateOutlet",o);}}function un(i,t){}function gn(i,t){if(i&1&&m(0,un,0,0,"ng-template",27),i&2){s(2);let e=ie(3);u("ngTemplateOutlet",e);}}function mn(i,t){if(i&1){let e=v();a(0,"my-video-upload",42,3),C("firstStepDone",function(n){d(e);let r=s(2);return p(r.onFirstStepDone("upload",n));})("firstStepError",function(){d(e);let n=s(2);return p(n.onError());}),l();}if(i&2){let e=s(2);u("userChannels",e.userChannels)("userQuota",e.userQuota)("highe
1stPrivacy",e.highestPrivacy);}}function Cn(i,t){i&1&&(a(0,"a",35)(1,"span"),g(2,12),l()());}function fn(i,t){if(i&1&&(a(0,"div",38)(1,"span"),g(2,13),l(),a(3,"div",43),g(4,14),l(),a(5,"my-help",44),R(6),l()()),i&2){let e=s(2);c(6),Se(" Import with URL is not available on ",e.instanceName,". ");}}function Pn(i,t){if(i&1){let e=v();a(0,"my-video-import-url",42,4),C("firstStepDone",function(n){d(e);let r=s(2);return p(r.onFirstStepDone("import-url",n));})("firstStepError",function(){d(e);let n=s(2);return p(n.onError());}),l();}if(i&2){let e=s(2);u("userChannels",e.userChannels)("userQuota",e.userQuota)("highestPrivacy",e.highestPrivacy);}}function vn(i,t){i&1&&(a(0,"a",35)(1,"span"),g(2,15),l()());}function On(i,t){if(i&1&&(a(0,"div",38)(1,"span"),g(2,16),l(),a(3,"div",43),g(4,17),l(),a(5,"my-help",45),R(6),l()()),i&2){let e=s(2);c(6),Se(" Import with torrent is not available on ",e.instanceName,". ");}}function Mn(i,t){if(i&1){let e=v();a(0,"my-video-import-torrent",42,5),C("firstStepDone",function(n){d(e);let r=s(2);return p(r.onFirstStepDone("import-torrent",n));})("firstStepError",function(){d(e);let n=s(2);return p(n.onError());}),l();}if(i&2){let e=s(2);u("userChannels",e.userChannels)("userQuota",e.userQuota)("highestPrivacy",e.highestPrivacy);}}function hn(i,t){i&1&&(a(0,"a",35)(1,"span"),g(2,18),l()());}function Sn(i,t){if(i&1&&(a(0,"div",38)(1,"span"),g(2,19),l(),a(3,"div",43),g(4,20),l(),a(5,"my-help",46),R(6),l()()),i&2){let e=s(2);c(6),Se(" Live streaming is not available on ",e.instanceName,". ");}}function In(i,t){if(i&1){let e=v();a(0,"my-video-go-live",42,6),C("firstStepDone",function(n){d(e);let r=s(2);return p(r.onFirstStepDone("go-live",n));})("firstStepError",function(){d(e);let n=s(2);return p(n.onError());}),l();}if(i&2){let e=s(2);u("userChannels",e.userChannels)("userQuota",e.userQuota)("highestPrivacy",e.highestPrivacy);}}function bn(i,t){if(i&1){let e=v();a(0,"div",21),m(1,gn,1,1,null,27),a(2,"div",33,2),C("activeIdChange",function(n){d(e);let r=s();return p(r.onNavChange(n));}),A(4,34),a(5,"a",35)(6,"span"),g(7,11),l()(),m(8,mn,2,3,"ng-template",36),N(),A(9,37),m(10,Cn,3,0,"a",35)(11,fn,7,1,"div",38)(12,Pn,2,3,"ng-template",36),N(),A(13,39),m(14,vn,3,0,"a",35)(15,On,7,1,"div",38)(16,Mn,2,3,"ng-template",36),N(),A(17,40),m(18,hn,3,0,"a",35)(19,Sn,7,1,"div",38)(20,In,2,3,"ng-template",36),N(),l(),P(21,"div",41),l();}if(i&2){let e=ie(3),o=s();c(),M(o.isInSecondStep()?-1:1),c(),u("activeId",o.activeNav)("ngClass",Ze(7,Jt,o.isInSecondStep())),c(8),M(o.isVideoImportHttpEnabled()?10:11),c(4),M(o.isVideoImportTorrentEnabled()?14:15),c(4),M(o.isVideoLiveEnabled()?18:19),c(3),u("ngbNavOutlet",e);}}var ge=class ge{auth=_(Ve);hooks=_(w);serverService=_(D);route=_(k);router=_(Ie);manageController=_(V);videoService=_(_e);canDeactivateGuard=_(Te);videoUpload=$("videoUpload");videoImportUrl=$("videoImportUrl");videoImportTorrent=$("videoImportTorrent");videoGoLive=$("videoGoLive");user=null;secondStepType;videoName;activeNav;uploadMessages;hasNoQuotaLeft=!1;hasNoQuotaLeftDaily=!1;serverConfig;highestPrivacy;userChannels;userQuota;privacies;publishedIdQuery;uploadingQuery;get isContactFormEnabled(){return this.serverConfig.email.enabled&&this.serverConfig.contactForm.enabled;}get instanceName(){return this.serverConfig.instance.name;}ngOnInit(){let t=this.route.snapshot.data.resolverData,{videoChannels:e,userQuota:o,privacies:n}=t;this.userChannels=e,this.userQuota=o,this.privacies=n,this.user=this.auth.getUser(),this.serverConfig=this.serverService.getHTMLConfig(),this.highestPrivacy=this.videoService.getHighestAvailablePrivacy(n),this.route.snapshot.fragment&&this.onNavChange(this.route.snapshot.fragment),this.buildUploadMessages(),this.user.videoQuota!==-1&&o.videoQuotaUsed>this.user.videoQuota*.9&&(this.hasNoQuotaLeft=!0),this.user.videoQuotaDaily!==-1&&o.videoQuotaUsedDaily>this.user.videoQuotaDaily*.9&&(this.hasNoQuotaLeftDaily=!0),this.reset(),this.route.queryParams.subscribe(r=>{r.publishedId?this.publishedIdQuery=r.publishedId:r.uploading?this.uploadingQuery=r.uploading:(this.publishedIdQuery||this.uploadingQuery)&&this.tryToReset();});}tryToReset(){return B(this,null,function*(){let t=[this.videoUpload(),this.videoImportUrl(),this.videoImportTorrent(),this.videoGoLive
1()];for(let e of t)if(e){if(!(yield this.canDeactivateGuard.canDeactivate(e))){this.publishedIdQuery?this.manageController.silentRedirectOnManage(this.publishedIdQuery,this.route):this.uploadingQuery&&this.manageController.silentRedirectOnUploading(this.route);return;}e.reset();}this.reset();});}reset(){this.secondStepType=void 0,this.videoName=void 0,this.publishedIdQuery=void 0,this.uploadingQuery=void 0,this.manageController.setStore({userChannels:this.userChannels,userQuota:this.userQuota,privacies:this.privacies,videoEdit:void 0});}buildUploadMessages(){return B(this,null,function*(){let t="Sorry, the upload feature is disabled for your account. If you want to add videos, an admin must unlock your quota.",e="Uploaded videos are reviewed before publishing for your account. If you want to add videos without moderation review, an admin must turn off your videos auto-block.",o="Your daily video quota is insufficient. If you want to add more videos, you must wait for 24 hours or an admin must increase your daily quota.",n="Your video quota is insufficient. If you want to add more videos, an admin must increase your quota.",r={noQuota:t,autoBlock:e,quotaLeftDaily:o,quotaLeft:n};this.uploadMessages=yield this.hooks.wrapObject(r,"common","filter:upload.messages.create.result");});}onNavChange(t){this.activeNav=t,this.manageController.setConfig({manageType:t,serverConfig:this.serverConfig}),this.router.navigate([],{fragment:this.activeNav});}onFirstStepDone(t,e){this.secondStepType=t,this.videoName=e;}onError(){this.videoName=void 0,this.secondStepType=void 0;}onUnload(t){let{text:e,canDeactivate:o}=this.canDeactivate();if(!o)return t.returnValue=e,e;}canDeactivate(){return this.secondStepType==="upload"?this.videoUpload().canDeactivate():this.secondStepType==="import-url"?this.videoImportUrl().canDeactivate():this.secondStepType==="import-torrent"?this.videoImportTorrent().canDeactivate():this.secondStepType==="go-live"?this.videoGoLive().canDeactivate():{canDeactivate:!0};}isVideoImportHttpEnabled(){return this.serverConfig.import.videos.http.enabled;}isVideoImportTorrentEnabled(){return this.serverConfig.import.videos.torrent.enabled;}isVideoLiveEnabled(){return this.serverConfig.live.enabled;}isInSecondStep(){return!!this.secondStepType;}isRootUser(){return this.user.username==="root";}};O(ge,"\u0275fac",function(e){return new(e||ge)();}),O(ge,"\u0275cmp",U({type:ge,selectors:[["my-video-publish"]],viewQuery:function(e,o){e&1&&(H(o.videoUpload,qt,5),H(o.videoImportUrl,Yt,5),H(o.videoImportTorrent,jt,5),H(o.videoGoLive,Kt,5)),e&2&&oe(4);},hostBindings:function(e,o){e&1&&C("beforeunload",function(r){return o.onUnload(r);},!1,Ke);},features:[Je([V])],decls:6,vars:1,consts:()=>{let t;t="Read instance rules for help";let e;e="Contact us";let o;o="We recommend you to not use the "+"\uFFFD#3\uFFFD"+"root"+"\uFFFD/#3\uFFFD"+" user to publish your videos, since it's the super-admin account of your instance.";let n;n="Instead, "+"\uFFFD#6\uFFFD"+"create a dedicated account"+"\uFFFD/#6\uFFFD"+" to upload your videos.";let r;r="Upload a file";let f;f="Import with URL";let I;I="Feature unavailable";let T;T="Import with URL";let x;x="UNAVAILABLE";let Fe;Fe="Import with torrent";let Ge;Ge="Feature unavailable";let ze;ze="Import with torrent";let Xe;Xe="UNAVAILABLE";let Qe;Qe="Go live";let We;We="Feature unavailable";let qe;qe="Go live";let Ye;return Ye="UNAVAILABLE",[["helpButtons",""],["infoMessages",""],["nav","ngbNav"],["videoUpload",""],["videoImportUrl",""],["videoImportTorrent",""],["videoGoLive",""],t,e,o,n,r,f,T,x,Fe,ze,Xe,Qe,qe,Ye,[1,"margin-content"],["routerLink","/about/contact",1,"peertube-button-link","primary-button","mt-3","me-3"],["routerLink","/about/instance",1,"peertube-button-link","primary-button","mt-3"],["type","primary",1,"upload-message","auto-blocked"],["type","warning",1,"upload-message","root-user","root-user","root-user"],["type","warning",1,"upload-message","quota-left"],[3,"ngTemplateOutlet"],["routerLink","/admin/overview/users",1,"text-decoration-underline","alert-link"],[4,"ngIf"],["type","warning",1,"upload-message","upload-disabled"],[1,"upload-image"],["src","/client/assets/images/mascot/defeated.svg","alt","defeated mascot"],["ngbNav","",1,"nav-tabs","video-add-nav",3,"activeIdChange","activeId","ngClass"],["ngbNavItem","upload"],["ngbNavLink",""],["ngbNavContent",""],["ngbNavItem","import-url"],[1,"unavailable-nav-link"],["ngbNavItem","import-torrent"],["ngbNavItem","go-live"],[1,"nav-content",3,"ngbNavOutlet"],[3,"firstStepDone","firstStepError","userChannels","userQuota","highestPrivacy"],[1,"pt-badge","badge-secondary","ms-2","me-1"],["helpTitle",I,"container","body"],["helpTitle",Ge,"container","body"],["helpTitle",We,"container","body"]];},template:function(e,o){e&1&&m(0,en,3,1,"ng-template",null,0,$e)(2,cn,5,3,"ng-template",null,1,$e)(4,pn,7,2,"div",21)(5,bn,22,9,"div",21),e&2&&(c(4),M(o.user.hasUploadDisabled()?4:5));},dependencies:[re,be,tt,Ot,Mt,st,et,lt,ct,_t,at,dt,le,ke,xe,Re,we,se],styles:[".upload-message[_ngcontent-%COMP%]{display:block;width:100%;text-align:center;margin-bottom:0}.upload-message[_ngcontent-%COMP%]:last-child{margin-bottom:1rem}.upload-image[_ngcontent-%COMP%]{width:100%;text-align:center}.upload-image[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{margin-top:2rem;margin-bottom:75px;width:220px;height:auto}[_nghost-%COMP%] .video-add-nav{border-bottom:0 solid #fff;margin:20px 0 0!important}[_nghost-%COMP%] .video-add-nav.hide-nav{display:none!important}
1[_nghost-%COMP%] .video-add-nav a.nav-link, [_nghost-%COMP%] .video-add-nav .unavailable-nav-link{margin-bottom:0;min-height:40px!important;padding:0 30px!important;border:0 solid transparent}[_nghost-%COMP%] .video-add-nav a.nav-link, [_nghost-%COMP%] .video-add-nav a.nav-link:hover, [_nghost-%COMP%] .video-add-nav a.nav-link:focus, [_nghost-%COMP%] .video-add-nav a.nav-link:active, [_nghost-%COMP%] .video-add-nav .unavailable-nav-link, [_nghost-%COMP%] .video-add-nav .unavailable-nav-link:hover, [_nghost-%COMP%] .video-add-nav .unavailable-nav-link:focus, [_nghost-%COMP%] .video-add-nav .unavailable-nav-link:active{text-decoration:none}[_nghost-%COMP%] .video-add-nav a.nav-link:focus:not(:focus-visible), [_nghost-%COMP%] .video-add-nav .unavailable-nav-link:focus:not(:focus-visible){outline:none}[_nghost-%COMP%] .video-add-nav a.nav-link span, [_nghost-%COMP%] .video-add-nav .unavailable-nav-link span{border-bottom:2px solid transparent}[_nghost-%COMP%] .video-add-nav a.nav-link.active, [_nghost-%COMP%] .video-add-nav .unavailable-nav-link.active{border-color:#fff;border-bottom-color:transparent}[_nghost-%COMP%] .video-add-nav a.nav-link.active span, [_nghost-%COMP%] .video-add-nav .unavailable-nav-link.active span{border-bottom-color:var(--border-primary)}[_nghost-%COMP%] .video-add-nav a.nav-link:hover:not(.active), [_nghost-%COMP%] .video-add-nav .unavailable-nav-link:hover:not(.active){border-color:transparent}[_nghost-%COMP%] .video-add-nav{overflow-x:auto;flex-wrap:unset;white-space:nowrap}[_nghost-%COMP%] .video-add-nav a.nav-link.active{background-color:var(--bg-secondary-400)!important}[_nghost-%COMP%] .upload-video-container{border:0 solid #fff;border-top:transparent;background-color:var(--bg-secondary-400);border-bottom-left-radius:3px;border-bottom-right-radius:3px;width:100%;min-height:440px;padding-bottom:20px;display:flex;justify-content:center;padding-top:20px}[_nghost-%COMP%] .upload-video-container.dragover{border:3px dashed var(--primary)}"]}));var Be=ge;var ee=class ee{authService=_(Ve);serverService=_(D);userService=_(Ct);resolve(){return Oe([ut(this.authService),this.userService.getMyVideoQuotaUsed(),this.serverService.getVideoPrivacies()]).pipe(te(([t,e,o])=>({videoChannels:t,userQuota:e,privacies:o})));}};O(ee,"\u0275fac",function(e){return new(e||ee)();}),O(ee,"\u0275prov",je({token:ee,factory:ee.ɵfac}));var ve=ee;var At=me(fe());var En=(0,At.default)("peertube:video-publish"),sr=[{path:"",component:Be,canActivate:[gt,()=>{let i=new URLSearchParams(window.location.search).get("publishedId"),t=_(Ie);if(i){let e=window.location.pathname.match(/^\/videos\/publish\/(.*)$/),o=e?`/${e[1]}`:"";return En("Redirecting to video manage page",{publishedId:i,match:e,suffixUrl:o}),new ot(t.parseUrl(`/videos/manage/${i}${o}`));}return!0;}],canDeactivate:[Te],providers:[ve,V,ht,Le,St,Ae,bt],resolve:{resolverData:ve},children:Et}];export{sr as default};/**i18n:85d030b7fdd36d163c6d41dcef9178681a6baa573eb199e8b12fe27dbb057a98*/
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.