1import{a as ne,b as ut,c as ye,d as mt,e as U,f as Te,g as ie,h as ft,i as oe}from"./chunk-6CMPEXLY.js";import{a as pt}from"./chunk-YW3SQGDX.js";import{a as te}from"./chunk-6OQVWYOP.js";import{a as Ve}from"./chunk-FVJ7FX2W.js";import"./chunk-S4WRAL26.js";import{a as st}from"./chunk-HY4QHXNE.js";import"./chunk-OPRQNONW.js";import"./chunk-THGGAECT.js";import{a as dt}from"./chunk-KR2NBIV7.js";import"./chunk-BHOXL4LY.js";import"./chunk-QBE7TA47.js";import"./chunk-YMJUFDU5.js";import"./chunk-GRECWXSU.js";import"./chunk-AQEMCWZ4.js";import"./chunk-WD3ZVVJS.js";import"./chunk-XOTV7GJG.js";import"./chunk-DVYB3SDD.js";import{a as ct}from"./chunk-EYZ45VU5.js";import"./chunk-3SZSFBQZ.js";import"./chunk-WH7HCV7Y.js";import"./chunk-NKAZMGCL.js";import{a as ee}from"./chunk-Q3D5PUAM.js";import"./chunk-N57YLHBF.js";import"./chunk-Y7Q577DU.js";import"./chunk-CLSEWCAF.js";import"./chunk-LE3BFIWM.js";import"./chunk-3IJB6NNK.js";import"./chunk-PCNKN7TU.js";import"./chunk-7WRF56BE.js";import{a as gt}from"./chunk-DBBUMUIY.js";import{a as Le}from"./chunk-JS7J53QZ.js";import{a as _t}from"./chunk-JF6CNN2A.js";import"./chunk-2HNNT2VT.js";import"./chunk-PXFOMLNX.js";import"./chunk-GXA3YMKZ.js";import"./chunk-UIX23F7I.js";import"./chunk-J3MTDSU3.js";import{c as ge}from"./chunk-SGCHCWLM.js";import{a as pe}from"./chunk-76SWT53P.js";import"./chunk-KYFYXE3K.js";import"./chunk-XSS37KCJ.js";import"./chunk-BJVL6ZJ5.js";import"./chunk-MBQWFBKS.js";import"./chunk-WYO57RHC.js";import{a as Oe}from"./chunk-VI342OHG.js";import"./chunk-IYEWOREX.js";import"./chunk-5TE7477A.js";import{c as lt}from"./chunk-VQCVCUXF.js";import"./chunk-PR244PNT.js";import"./chunk-MS2CS6MN.js";import{a as ue}from"./chunk-KLZQNCJY.js";import{E as j,F as K,c as ce,g as q,o as Y,r as qe}from"./chunk-7JTNILXC.js";import{A as tt,C as nt,D as it,G as Me,w as Je,y as Ze,z as et}from"./chunk-CUOYDGDO.js";import{a as Z}from"./chunk-TTJW756Y.js";import{Ah as rt,Ba as Ge,Bb as Q,Cb as W,Da as c,Db as m,Dc as N,Eb as ve,Ec as V,Fb as he,Fc as X,Gd as $,Hb as S,Id as We,Jb as _,Kd as Ie,Ld as Ee,Na as R,Nf as je,Oh as k,Qh as at,R as le,Rb as se,Rf as Ke,Sb as _e,Tb as de,Tg as J,Ua as w,Wc as ze,Yb as B,Z as Fe,Zb as re,Zg as Ce,_b as Pe,_c as Qe,ae as fe,ba as s,cc as L,dc as y,ec as T,ga as u,gb as v,ha as g,hb as h,jh as D,mb as f,mc as Xe,nb as a,o as ae,ob as l,oe as Ye,pb as I,s as z,sh as be,tb as F,ub as G,vh as A,xc as Ne,zb as E,zh as ot}from"./chunk-NY4TI4KT.js";import{g as me,i as M,j as H}from"./chunk-IQVXR75E.js";var Vt=me(Ce());var Ct=me(Ce());var Lt=["torrentfileInput"];function yt(o,r){if(o&1){let n=E();a(0,"div",8),S("fileDropped",function(e){u(n);let i=_();return g(i.setTorrentFile(e));}),a(1,"div",9),I(2,"my-global-icon",10),a(3,"div",11)(4,"span"),m(5,1),l(),a(6,"input",12,0),S("change",function(){u(n);let e=_();return g(e.fileChange());}),l()(),I(8,"div",13),a(9,"div",14)(10,"label",15),m(11,2),l(),a(12,"my-help"),F(13),m(14,3),G(),l(),a(15,"input",16),T("ngModelChange",function(e){u(n);let i=_();return y(i.firstStepMagnetUri,e)||(i.firstStepMagnetUri=e),g(e);}),l()(),a(16,"div",17)(17,"label",18),m(18,4),l(),a(19,"my-select-channel",19),T("ngModelChange",function(e){u(n);let i=_();return y(i.firstStepChannelId,e)||(i.firstStepChannelId=e),g(e);}),l()(),a(20,"input",20),S("click",function(){u(n);let e=_();return g(e.importVideo());}),l()()();}if(o&2){let n=_();c(3),f("ngbTooltip","(extensions: .torrent)"),c(12),L("ngModel",n.firstStepMagnetUri),c(4),f("items",n.userChannels()),L("ngModel",n.firstStepChannelId),c(),f("disabled",!n.isMagnetUrlValid()||n.isImportingVideo);}}function Tt(o,r){if(o&1){let n=E();a(0,"my-video-manage-container",21),S("videoUpdated",function(){u(n);let e=_();return g(e.onVideoUpdated());}),a(1,"my-alert",22),m(2,5),l()();}}var Nt=(0,Ct.default)("peertube:video-publish"),St=(()=>{let r=class r{authService=s(D);loadingBar=s(Oe);notifier=s(J);videoService=s(ge);playerSettingsService=s(ee);videoImportService=s(Le);hooks=s(k);serverService=s(A);manageController=s(U);route=s($);videoEmbedPrivacyService=s(ne);userChannels=V.required();userQuota=V.required();highestPrivacy=V.required();firstStepDone=N();firstStepError=N();torrentfileInput=X("torrentfileInput");firstStep=!0;
1firstStepChannelId;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;let e=this.serverService.getHTMLConfig(),i=ie.createFromImport(e,{torrentfile:t,magnetUri:this.firstStepMagnetUri,channelId:this.firstStepChannelId,support:this.userChannels().find(d=>d.id===this.firstStepChannelId).support??"",user:this.authService.getUser()});this.manageController.setConfig({manageType:"import-torrent",serverConfig:this.serverService.getHTMLConfig()}),this.manageController.setVideoEdit(i),this.loadingBar.useRef("import-video").start(),this.videoImportService.importVideo(i.toVideoImportCreate(this.highestPrivacy())).pipe(le(({video:d})=>z([this.videoService.getVideo({videoId:d.uuid}),this.playerSettingsService.getVideoSettings({videoId:d.uuid,raw:!0}),this.videoEmbedPrivacyService.getPrivacy({videoId:d.uuid})]))).subscribe({next:P=>H(this,[P],function*([d,p,C]){yield i.loadFromAPI({video:d,playerSettings:p,embedPrivacy:C,loadPrivacy:!1}),this.loadingBar.useRef("import-video").complete(),Nt("Torrent/magnet import created"),this.manageController.silentRedirectOnManage(i.getVideoAttributes().shortUUID,this.route),this.firstStep=!1,this.isImportingVideo=!1,this.firstStepDone.emit(i.getVideoAttributes().name);}),error:d=>{if(this.isImportingVideo=!1,this.loadingBar.useRef("import-video").complete(),this.firstStepError.emit(),d.body?.code===fe.INCORRECT_FILES_IN_TORRENT){this.notifier.error("Torrents with only 1 file are supported.");return;}this.notifier.handleError(d);}});}};M(r,"\u0275fac",function(e){return new(e||r)();}),M(r,"\u0275cmp",R({type:r,selectors:[["my-video-import-torrent"]],viewQuery:function(e,i){e&1&&se(i.torrentfileInput,Lt,5),e&2&&_e();},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 i;i="Import";let d;d="Select the torrent to import";let p;p="Paste magnet URI";let C;C=" 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 P;P="Channel";let O;return O=" Congratulations, the video will be imported with BitTorrent! You can already add information about this video. ",[["torrentfileInput",""],d,p,C,P,O,["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",i,1,"peertube-button","primary-button",3,"click","disabled"],["canUpdate","true","canWatch","false","cancelLink","/my-library/videos",3,"videoUpdated"],["type","primary"]];},template:function(e,i){e&1&&v(0,yt,21,5,"div",6)(1,Tt,3,0,"my-video-manage-container",7),e&2&&h(i.firstStep?0:1);},dependencies:[Z,Me,ue,j,ce,q,Y,Te,te,K,pe,oe],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%]{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%] 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-color);font-size:var(--input-placeholder-font-size)}.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} 2/*# sourceMappingURL=common-publish-GHQ7UWQ5.css.map */`,`.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;
2transform: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} 3/*# sourceMappingURL=video-import-torrent.component-RXP7WHWW.css.map */`]}));let o=r;return o;})();var vt=me(Ce());function Dt(o,r){o&1&&(a(0,"div",13),Q(1,3),I(2,"a",17),W(),l());}function At(o,r){if(o&1){let n=E();a(0,"div",5)(1,"div",7),I(2,"my-global-icon",8),a(3,"div",9)(4,"label",10),m(5,0),l(),a(6,"my-help"),F(7),Q(8,1),I(9,"a",11),W(),G(),l(),a(10,"input",12),T("ngModelChange",function(e){u(n);let i=_();return y(i.targetUrl,e)||(i.targetUrl=e),g(e);}),l(),v(11,Dt,3,0,"div",13),l(),a(12,"div",9)(13,"label",14),m(14,2),l(),a(15,"my-select-channel",15),T("ngModelChange",function(e){u(n);let i=_();return y(i.firstStepChannelId,e)||(i.firstStepChannelId=e),g(e);}),l()(),a(16,"input",16),S("click",function(){u(n);let e=_();return g(e.importVideo());}),l()()();}if(o&2){let n=_();c(10),L("ngModel",n.targetUrl),c(),h(n.isChannelSyncEnabled()?11:-1),c(4),f("items",n.userChannels()),L("ngModel",n.firstStepChannelId),c(),f("disabled",!n.isTargetUrlValid()||n.isImportingVideo);}}function Ut(o,r){if(o&1){let n=E();a(0,"my-video-manage-container",18),S("videoUpdated",function(){u(n);let e=_();return g(e.onVideoUpdated());}),a(1,"my-alert",19),m(2,4),l()();}if(o&2){let n=_();c(2),ve(n.targetUrl),he(2);}}var xt=(0,vt.default)("peertube:video-publish"),ht=(()=>{let r=class r{authService=s(D);loadingBar=s(Oe);notifier=s(J);videoService=s(ge);videoImportService=s(Le);hooks=s(k);serverService=s(A);manageController=s(U);route=s($);chapterService=s(gt);captionService=s(_t);playerSettingsService=s(ee);videoEmbedPrivacyService=s(ne);userChannels=V.required();userQuota=V.required();highestPrivacy=V.required();firstStepDone=N();firstStepError=N();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=ie.createFromImport(t,{targetUrl:this.targetUrl,channelId:this.firstStepChannelId,support:this.userChannels().find(i=>i.id===this.firstStepChannelId).support??"",user:this.authService.getUser()});this.manageController.setConfig({manageType:"import-url",serverConfig:this.serverService.getHTMLConfig()}),this.manageController.setVideoEdit(e),this.loadingBar.useRef("import-video").start(),this.videoImportService.importVideo(e.toVideoImportCreate(this.highestPrivacy())).pipe(le(({video:i})=>z([this.captionService.listCaptions(i.uuid),this.chapterService.getChapters({videoId:i.uuid}),this.playerSettingsService.getVideoSettings({videoId:i.uuid,raw:!0}),this.videoService.getVideo({videoId:i.uuid}),this.videoEmbedPrivacyService.getPrivacy({videoId:i.uuid})]).pipe(ae(([{data:d},{chapters:p},C,P,O])=>({captions:d,chapters:p,playerSettings:C,video:P,embedPrivacy:O}))))).subscribe({next:O=>H(this,[O],function*({video:i,playerSettings:d,captions:p,chapters:C,embedPrivacy:P}){yield e.loadFromAPI({video:i,captions:p,playerSettings:d,chapters:C,embedPrivacy:P,loadPrivacy:!1}),this.loadingBar.useRef("import-video").complete(),xt("URL import created"),this.manageController.silentRedirectOnManage(e.getVideoAttributes().shortUUID,this.route),this.firstStep=!1,this.isImportingVideo=!1,this.firstStepDone.emit(e.getVideoAttributes().name);}),error:i=>{this.loadingBar.useRef("import-video").complete(),this.isImportingVideo=!1,this.firstStepError.emit(),this.notifier.handleError(i);}});}};M(r,"\u0275fac",function(e){return new(e||r)();}),M(r,"\u0275cmp",R({type:r,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 i;i=" You can import any URL "+"\uFFFD#9\uFFFD"+"supported by youtube-dl/yt-dlp"+"\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 d;d="Channel";let p;p=" You can also synchronize a remote channel in "+"\uFFFD#2\uFFFD"+"your library"+"\uFFFD/#2\uFFFD"+"";let C;return C=" Congratulations, the video behind "+"\uFFFD0\uFFFD"+" is being imported! You can already add information about this video. ",[e,i,d,p,C,[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"],[1,"form-group-description"],["for","first-step-channel"],["inputId","first-step-channel",3,"ngModelChange","items","ngModel"],["type","button","value",t,1,"peertube-button","primary-button",3,"click","disabled"],["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,i){e&1&&v(0,At,17,5,"div",5)(1,Ut,3,1,"my-video-manage-container",6),e&2&&h(i.firstStep?0:1);},dependencies:[Z,ue,j,ce,q,Y,Ee,te,K,pe,oe],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%]{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%] 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-color);font-size:var(--input-placeholder-font-size)}.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} 4/*# sourceMappingURL=common-publish-GHQ7UWQ5.css.map */`]}));let o=r;return o;})();var Pt=me(Ce());function Rt(o,r){if(o&1){let n=E();a(0,"div",4)(1,"div",6),I(2,"my-global-icon",7),a(3,"div",8)(4,"label",9),m(5,0),l(),a(6,"my-select-channel",10),T("ngModelChange",function(e){u(n);let i=_();
4return y(i.firstStepChannelId,e)||(i.firstStepChannelId=e),g(e);}),l()(),a(7,"div",11)(8,"div",12)(9,"input",13),T("ngModelChange",function(e){u(n);let i=_();return y(i.firstStepPermanentLive,e)||(i.firstStepPermanentLive=e),g(e);}),l(),a(10,"label",14),m(11,1),l(),a(12,"span",15),B(13),l()(),a(14,"div",12)(15,"input",16),T("ngModelChange",function(e){u(n);let i=_();return y(i.firstStepPermanentLive,e)||(i.firstStepPermanentLive=e),g(e);}),l(),a(16,"label",17),m(17,2),l(),a(18,"span",15),m(19,3),l()()(),a(20,"input",18),S("click",function(){u(n);let e=_();return g(e.goLive());}),l()()();}if(o&2){let n=_();c(6),f("items",n.userChannels()),L("ngModel",n.firstStepChannelId),c(3),L("ngModel",n.firstStepPermanentLive),f("value",!1),c(4),re(n.getNormalLiveDescription()),c(2),L("ngModel",n.firstStepPermanentLive),f("value",!0),c(4),ve(n.getPermanentLiveDescription()),he(19),c(),f("disabled",n.firstStepPermanentLive!==!0&&n.firstStepPermanentLive!==!1);}}function wt(o,r){if(o&1){let n=E();a(0,"my-video-manage-container",19),S("videoUpdated",function(){u(n);let e=_();return g(e.onVideoUpdated());}),l();}}var Bt=(0,Pt.default)("peertube:video-publish"),It=(()=>{let r=class r{notifier=s(J);authService=s(D);serverService=s(A);liveVideoService=s(Ve);hooks=s(k);manageController=s(U);route=s($);playerSettingsService=s(ee);videoEmbedPrivacyService=s(ne);userChannels=V.required();userQuota=V.required();highestPrivacy=V.required();firstStepDone=N();firstStepError=N();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=ie.createFromLive(t,{name:"Live",channelId:this.firstStepChannelId,support:this.userChannels().find(i=>i.id===this.firstStepChannelId).support??"",permanentLive:this.firstStepPermanentLive,latencyMode:Ye.DEFAULT,dvrWindow:t.live.dvr.maxWindow,saveReplay:this.isReplayAllowed()&&t.defaults.live.saveReplay,replaySettings:{privacy:this.highestPrivacy()},schedules:[],user:this.authService.getUser()});this.manageController.setConfig({manageType:"go-live",serverConfig:this.serverService.getHTMLConfig()}),this.manageController.setVideoEdit(e),this.liveVideoService.goLive(e.toLiveCreate(this.highestPrivacy())).pipe(le(({video:i})=>z([this.liveVideoService.getVideoLive(i.uuid),this.playerSettingsService.getVideoSettings({videoId:i.uuid,raw:!0}),this.videoEmbedPrivacyService.getPrivacy({videoId:i.uuid})]).pipe(ae(([d,p,C])=>({live:d,playerSettings:p,embedPrivacy:C,video:i}))))).subscribe({next:x=>H(this,[x],function*({video:{id:i,uuid:d,shortUUID:p},live:C,playerSettings:P,embedPrivacy:O}){e.loadAfterPublish({video:{id:i,uuid:d,shortUUID:p}}),yield e.loadFromAPI({live:C,playerSettings:P,embedPrivacy:O,loadPrivacy:!1}),Bt("Live published"),this.manageController.silentRedirectOnManage(p,this.route),this.firstStep=!1,this.isGoingLive=!1,this.firstStepDone.emit(e.getVideoAttributes().name);}),error:i=>{this.firstStepError.emit(),this.isGoingLive=!1;let d=i.body;d?.code===fe.MAX_INSTANCE_LIVES_LIMIT_REACHED?this.notifier.error("Cannot create live because this platform has too many created lives"):d?.code===fe.MAX_USER_LIVES_LIMIT_REACHED?this.notifier.error("Cannot create live because you created too many lives"):this.notifier.handleError(i);}});}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;}};M(r,"\u0275fac",function(e){return new(e||r)();}),M(r,"\u0275cmp",R({type:r,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 i;i="Normal live";let d;d="Permanent/recurring live";let p;return p=""+"\uFFFD0\uFFFD"+"",[e,i,d,p,[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,i){e&1&&v(0,Rt,21,9,"div",4)(1,wt,1,0,"my-video-manage-container",5),e&2&&h(i.firstStep?0:1);},dependencies:[Z,te,j,ce,qe,q,Y,K,oe],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%]{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%] 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-color);font-size:var(--input-placeholder-font-size)}.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} 5/*# sourceMappingURL=common-publish-GHQ7UWQ5.css.map */`,`.live-type[_ngcontent-%COMP%]{margin-top:15px} 6/*# sourceMappingURL=video-go-live.component-WMDHYGSU.css.map */`]}));let o=r;return o;})();var Mt=me(Ce());var $t=["videoFileInput"];function kt(o,r){if(o&1){let n=E();a(0,"div",15)(1,"label",16),m(2,3),l(),a(3,"div",17),Q(4,4),I(5,"br"),W(),l(),a(6,"my-image-input",18),T("ngModelChange",function(e){u(n);let i=_(2);return y(i.audioThumbnailFile,e)||(i.audioThumbnailFile=e),g(e);}),l()(),a(7,"div",19)(8,"my-button",20),S("click",function(){u(n);let e=_(2);return g(e.uploadAudio());}),l()();}if(o&2){let n=_(2);c(6),L("ngModel",n.audioThumbnailFile),c(2),f("label",n.getAudioUploadLabel());}}function Ht(o,r){if(o&1){let n=E();a(0,"div",7),S("fileDropped",function(e){u(n);let i=_();return g(i.onFileDropped(e));}),a(1,"div",8),I(2,"my-global-icon",9),a(3,"div",10)(4,"span"),m(5,1),l(),a(6,"input",11,0),S("change",function(e){u(n);let i=_();return g(i.onFileChange(e));}),l()(),a(8,"div",12)(9,"label",13),m(10,2),l(),a(11,"my-select-channel",14),T("ngModelChange",function(e){u(n);let i=_();
6return y(i.firstStepChannelId,e)||(i.firstStepChannelId=e),g(e);}),l()(),v(12,kt,9,2),l()();}if(o&2){let n=_();c(3),f("ngbTooltip","(extensions: "+n.getVideoExtensions()+")"),c(3),f("accept",n.getVideoExtensions()),c(5),f("items",n.userChannels()),L("ngModel",n.firstStepChannelId),c(),h(n.uploadingAudioFile?12:-1);}}function Ft(o,r){if(o&1){let n=E();a(0,"my-video-manage-container",21),S("videoUpdated",function(){u(n);let e=_();return g(e.onVideoUpdated());}),l();}if(o&2){let n=_();f("canUpdate",n.hasUploadedFile())("canWatch",n.hasUploadedFile())("cancelLink",n.getCancelLink());}}var Et=(0,Mt.default)("peertube:video-publish"),Ot=(()=>{let r=class r{notifier=s(J);authService=s(D);serverService=s(A);hooks=s(k);metaService=s(rt);route=s($);videoUploadService=s(ye);manageController=s(U);userChannels=V.required();userQuota=V.required();highestPrivacy=V.required();firstStepDone=N();firstStepError=N();videoFileInput=X("videoFileInput");uploadingAudioFile=!1;audioThumbnailFile;firstStep=!0;firstStepChannelId;hasFirstUpdated=!1;videoEdit;uploadEventsSubscription;ngOnInit(){this.uploadEventsSubscription=this.manageController.getUploadEventsObs().subscribe(t=>{if(this.updateTitle(),t.status==="cancelled"){Et("Upload cancelled",t),this.firstStepError.emit(),this.firstStep=!0,this.manageController.silentRedirectOnAbortUpload(this.route);return;}if(t.status==="complete"){let{id:e,uuid:i,shortUUID:d}=t.response.video;this.videoEdit.loadAfterPublish({video:{id:e,uuid:i,shortUUID:d}}),Et("Upload complete",t),this.manageController.silentRedirectOnManage(d,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.audioThumbnailFile=void 0;}uploadAudio(){this.uploadFile(this.getInputVideoFile(),this.audioThumbnailFile);}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 i=this.serverService.getHTMLConfig();this.videoEdit=ie.createFromUpload(i,{name:this.buildVideoFilename(t.name),channelId:this.firstStepChannelId,support:this.userChannels().find(d=>d.id===this.firstStepChannelId).support??"",user:this.authService.getUser()}),this.manageController.setConfig({manageType:"upload",serverConfig:this.serverService.getHTMLConfig()}),this.manageController.setVideoEdit(this.videoEdit),this.manageController.uploadNewVideo({privacy:this.highestPrivacy(),file:t,thumbnailfile:e}),this.manageController.silentRedirectOnUploading(this.route),this.firstStep=!1,this.firstStepDone.emit(this.videoEdit.getVideoAttributes().name),this.updateTitle();}buildVideoFilename(t){let e=t.replace(/\.[^/.]+$/,""),i=e.length<3?t:e,d=110;return i.length>d&&(i=je(i,{length:d,omission:""})),i;}};M(r,"\u0275fac",function(e){return new(e||r)();}),M(r,"\u0275cmp",R({type:r,selectors:[["my-video-upload"]],viewQuery:function(e,i){e&1&&se(i.videoFileInput,$t,5),e&2&&_e();},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 i;i="Select the file to upload";let d;d="Channel";let p;p="Edit";let C;C="Video background image";let P;return P=" Image that will be merged with your audio file. "+"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"+" The chosen image will be definitive and cannot be modified. ",[["videoFileInput",""],i,d,C,P,["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"],[1,"form-group","audio-thumbn
6ail"],["for","thumbnailfileUpload"],[1,"audio-image-info"],["inputLabel",p,"inputName","thumbnailfileUpload",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,i){e&1&&v(0,Ht,13,5,"div",5)(1,Ft,1,3,"my-video-manage-container",6),e&2&&h(i.firstStep?0:1);},dependencies:[Te,Z,Me,te,j,q,Y,st,lt,K,oe],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%]{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%] 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-color);font-size:var(--input-placeholder-font-size)}.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} 7/*# sourceMappingURL=common-publish-GHQ7UWQ5.css.map */`,`.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-thumbnail[_ngcontent-%COMP%]{margin:30px 0}.first-step-block[_ngcontent-%COMP%] .audio-thumbnail[_ngcontent-%COMP%] my-image-input[_ngcontent-%COMP%]{width:360px;height:200px} 8/*# sourceMappingURL=video-upload.component-5UNWOVOI.css.map */`]}));let o=r;return o;})();var Gt=["videoUpload"],Xt=["videoImportUrl"],zt=["videoImportTorrent"],Qt=["videoGoLive"],Wt=o=>({"hide-nav":o});function qt(o,r){o&1&&(a(0,"a",22),m(1,8),l());}function Yt(o,r){if(o&1&&(v(0,qt,2,0,"a",22),a(1,"a",23),m(2,7),l()),o&2){let n=_();h(n.isContactFormEnabled?0:-1);}}function jt(o,r){}function Kt(o,r){if(o&1&&(a(0,"my-alert",24)(1,"div"),B(2),l(),w(3,jt,0,0,"ng-template",27),l()),o&2){let n=_(2),t=de(1);c(2),re(n.uploadMessages==null?null:n.uploadMessages.autoBlock),c(),f("ngTemplateOutlet",t);}}function Jt(o,r){o&1&&(a(0,"my-alert",25)(1,"div"),Q(2,9),I(3,"strong"),W(),l(),a(4,"div"),Q(5,10),I(6,"a",28),W(),l()());}function Zt(o,r){o&1&&I(0,"my-channels-setup-message");}function en(o,r){if(o&1&&(a(0,"div"),B(1),l()),o&2){let n=_(3);c(),re(n.uploadMessages==null?null:n.uploadMessages.quotaLeft);}}function tn(o,r){if(o&1&&(a(0,"div"),B(1),l()),o&2){let n=_(3);c(),re(n.uploadMessages==null?null:n.uploadMessages.quotaLeftDaily);}}function nn(o,r){}function on(o,r){if(o&1&&(a(0,"my-alert",26),v(1,en,2,1,"div"),v(2,tn,2,1,"div"),w(3,nn,0,0,"ng-template",27),l()),o&2){let n=_(2),t=de(1);c(),h(n.hasNoQuotaLeft?1:-1),c(),h(n.hasNoQuotaLeftDaily?2:-1),c(),f("ngTemplateOutlet",t);}}function rn(o,r){if(o&1&&(v(0,Kt,4,2,"my-alert",24),v(1,Jt,7,0,"my-alert",25)(2,Zt,1,0,"my-channels-setup-message"),I(3,"my-user-quota"),v(4,on,4,3,"my-alert",26)),o&2){let n=_();h(n.user.isAutoBlocked(n.serverConfig)?0:-1),c(),h(n.isRootUser()?1:2),c(3),h(n.hasNoQuotaLeft||n.hasNoQuotaLeftDaily?4:-1);}}function an(o,r){}function ln(o,r){if(o&1&&(a(0,"div",21)(1,"my-alert",29)(2,"div"),B(3),l(),w(4,an,0,0,"ng-template",27),l(),a(5,"div",30),I(6,"img",31),l()()),o&2){let n=_(),t=de(1);c(3),re(n.uploadMessages==null?null:n.uploadMessages.noQuota),c(),f("ngTemplateOutlet",t);}}function sn(o,r){}function _n(o,r){if(o&1&&w(0,sn,0,0,"ng-template",27),o&2){_(2);let n=de(3);f("ngTemplateOutlet",n);}}function dn(o,r){if(o&1){let n=E();a(0,"my-video-upload",41,3),S("firstStepDone",function(e){u(n);let i=_(2);return g(i.onFirstStepDone("upload",e));})("firstStepError",function(){u(n);let e=_(2);return g(e.onError());}),l();}if(o&2){let n=_(2);f("userChannels",n.userChannels)("userQuota",n.userQuota)("highe
8stPrivacy",n.highestPrivacy);}}function cn(o,r){o&1&&(a(0,"a",34)(1,"span"),m(2,12),l()());}function pn(o,r){if(o&1&&(a(0,"div",37)(1,"span"),m(2,13),l(),a(3,"div",42),m(4,14),l(),a(5,"my-help",43),B(6),l()()),o&2){let n=_(2);c(6),Pe(" Import with URL is not available on ",n.instanceName,". ");}}function un(o,r){if(o&1){let n=E();a(0,"my-video-import-url",41,4),S("firstStepDone",function(e){u(n);let i=_(2);return g(i.onFirstStepDone("import-url",e));})("firstStepError",function(){u(n);let e=_(2);return g(e.onError());}),l();}if(o&2){let n=_(2);f("userChannels",n.userChannels)("userQuota",n.userQuota)("highestPrivacy",n.highestPrivacy);}}function gn(o,r){o&1&&(a(0,"a",34)(1,"span"),m(2,15),l()());}function mn(o,r){if(o&1&&(a(0,"div",37)(1,"span"),m(2,16),l(),a(3,"div",42),m(4,17),l(),a(5,"my-help",44),B(6),l()()),o&2){let n=_(2);c(6),Pe(" Import with torrent is not available on ",n.instanceName,". ");}}function fn(o,r){if(o&1){let n=E();a(0,"my-video-import-torrent",41,5),S("firstStepDone",function(e){u(n);let i=_(2);return g(i.onFirstStepDone("import-torrent",e));})("firstStepError",function(){u(n);let e=_(2);return g(e.onError());}),l();}if(o&2){let n=_(2);f("userChannels",n.userChannels)("userQuota",n.userQuota)("highestPrivacy",n.highestPrivacy);}}function Cn(o,r){o&1&&(a(0,"a",34)(1,"span"),m(2,18),l()());}function Sn(o,r){if(o&1&&(a(0,"div",37)(1,"span"),m(2,19),l(),a(3,"div",42),m(4,20),l(),a(5,"my-help",45),B(6),l()()),o&2){let n=_(2);c(6),Pe(" Live streaming is not available on ",n.instanceName,". ");}}function vn(o,r){if(o&1){let n=E();a(0,"my-video-go-live",41,6),S("firstStepDone",function(e){u(n);let i=_(2);return g(i.onFirstStepDone("go-live",e));})("firstStepError",function(){u(n);let e=_(2);return g(e.onError());}),l();}if(o&2){let n=_(2);f("userChannels",n.userChannels)("userQuota",n.userQuota)("highestPrivacy",n.highestPrivacy);}}function hn(o,r){if(o&1){let n=E();a(0,"div",21),v(1,_n,1,1,null,27),a(2,"div",32,2),S("activeIdChange",function(e){u(n);let i=_();return g(i.onNavChange(e));}),F(4,33),a(5,"a",34)(6,"span"),m(7,11),l()(),w(8,dn,2,3,"ng-template",35),G(),F(9,36),v(10,cn,3,0,"a",34)(11,pn,7,1,"div",37),w(12,un,2,3,"ng-template",35),G(),F(13,38),v(14,gn,3,0,"a",34)(15,mn,7,1,"div",37),w(16,fn,2,3,"ng-template",35),G(),F(17,39),v(18,Cn,3,0,"a",34)(19,Sn,7,1,"div",37),w(20,vn,2,3,"ng-template",35),G(),l(),I(21,"div",40),l();}if(o&2){let n=de(3),t=_();c(),h(t.isInSecondStep()?-1:1),c(),f("activeId",t.activeNav)("ngClass",Xe(7,Wt,t.isInSecondStep())),c(8),h(t.isVideoImportHttpEnabled()?10:11),c(4),h(t.isVideoImportTorrentEnabled()?14:15),c(4),h(t.isVideoLiveEnabled()?18:19),c(3),f("ngbNavOutlet",n);}}var bt=(()=>{let r=class r{auth=s(D);hooks=s(k);serverService=s(A);route=s($);router=s(Ie);manageController=s(U);videoService=s(ge);canDeactivateGuard=s(be);videoUpload=X("videoUpload");videoImportUrl=X("videoImportUrl");videoImportTorrent=X("videoImportTorrent");videoGoLive=X("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:i,privacies:d}=t;this.userChannels=e,this.userQuota=i,this.privacies=d,this.user=this.auth.getUser(),this.serverConfig=this.serverService.getHTMLConfig(),this.highestPrivacy=this.videoService.getMostPrivatePrivacy(d),this.route.snapshot.fragment&&this.onNavChange(this.route.snapshot.fragment),this.buildUploadMessages(),this.user.videoQuota!==-1&&i.videoQuotaUsed>this.user.videoQuota*.9&&(this.hasNoQuotaLeft=!0),this.user.videoQuotaDaily!==-1&&i.videoQuotaUsedDaily>this.user.videoQuotaDaily*.9&&(this.hasNoQuotaLeftDaily=!0),this.reset(),this.route.queryParams.subscribe(p=>{p.publishedId?this.publishedIdQuery=p.publishedId:p.uploading?this.uploadingQuery=p.uploading:(this.publishedIdQuery||this.uploadingQuery)&&this.tryToReset();});}tryToReset(){return H(this,null,function*(){let t=[this.videoUpload(),this.videoImportUrl(),this.videoImportTorrent(),this.videoGoLive
8()];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 H(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.",i="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.",d="Your video quota is insufficient. If you want to add more videos, an admin must increase your quota.",p={noQuota:t,autoBlock:e,quotaLeftDaily:i,quotaLeft:d};this.uploadMessages=yield this.hooks.wrapObject(p,"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:i}=this.canDeactivate();if(!i)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";}};M(r,"\u0275fac",function(e){return new(e||r)();}),M(r,"\u0275cmp",R({type:r,selectors:[["my-video-publish"]],viewQuery:function(e,i){e&1&&se(i.videoUpload,Gt,5)(i.videoImportUrl,Xt,5)(i.videoImportTorrent,zt,5)(i.videoGoLive,Qt,5),e&2&&_e(4);},hostBindings:function(e,i){e&1&&S("beforeunload",function(p){return i.onUnload(p);},Ge);},decls:6,vars:1,consts:()=>{let t;t="Read instance rules for help";let e;e="Contact us";let i;i="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 d;d="Instead, "+"\uFFFD#6\uFFFD"+"create a dedicated account"+"\uFFFD/#6\uFFFD"+" to upload your videos.";let p;p="Upload a file";let C;C="Import with URL";let P;P="Feature unavailable";let O;O="Import with URL";let x;x="UNAVAILABLE";let Ue;Ue="Import with torrent";let xe;xe="Feature unavailable";let Re;Re="Import with torrent";let we;we="UNAVAILABLE";let Be;Be="Go live";let $e;$e="Feature unavailable";let ke;ke="Go live";let He;return He="UNAVAILABLE",[["helpButtons",""],["infoMessages",""],["nav","ngbNav"],["videoUpload",""],["videoImportUrl",""],["videoImportTorrent",""],["videoGoLive",""],t,e,i,d,p,C,O,x,Ue,Re,we,Be,ke,He,[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"],["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",P,"container","body"],["helpTitle",xe,"container","body"],["helpTitle",$e,"container","body"]];},template:function(e,i){e&1&&(w(0,Yt,3,1,"ng-template",null,0,Ne)(2,rn,5,3,"ng-template",null,1,Ne),v(4,ln,7,2,"div",21)(5,hn,22,9,"div",21)),e&2&&(c(4),h(i.user.hasUploadDisabled()?4:5));},dependencies:[Ee,Qe,dt,ct,et,ze,Ze,nt,tt,Je,it,pe,It,St,ht,Ot,ue],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}
8[_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)} 9/*# sourceMappingURL=video-publish.component-J7G6U6FU.css.map */`]}));let o=r;return o;})();var Ae=(()=>{let r=class r{authService=s(D);serverService=s(A);userService=s(at);resolve(){return z([Ke(this.authService,{includeCollaborations:!0}),this.userService.getMyVideoQuotaUsed(),this.serverService.getVideoPrivacies()]).pipe(ae(([t,e,i])=>({videoChannels:t,userQuota:e,privacies:i})));}};M(r,"\u0275fac",function(e){return new(e||r)();}),M(r,"\u0275prov",Fe({token:r,factory:r.ɵfac}));let o=r;return o;})();var Pn=(0,Vt.default)("peertube:video-publish"),wo=[{path:"",component:bt,canActivate:[ot,()=>{let o=new URLSearchParams(window.location.search).get("publishedId"),r=s(Ie);if(o){let n=window.location.pathname.match(/^\/videos\/publish\/(.*)$/),t=n?`/${n[1]}`:"";return Pn("Redirecting to video manage page",{publishedId:o,match:n,suffixUrl:t}),new We(r.parseUrl(`/videos/manage/${o}${t}`));}return!0;}],canDeactivate:[be],providers:[Ae,U,ee,pt,Ve,ut,ye,mt,ne],resolve:{resolverData:Ae},children:ft}];export{wo as default};/**i18n:347eeb695970c32bc275618edc2e751c67145d9fc3012e70543c114a99b9e016*///# sourceMappingURL=chunk-Q6WGG7U3.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.