PageSourceSearch

https://exode.me/client/en-US/chunk-QLVOSTH7.js

js exode.me collected 2026-10-04 16:17:17 UTC 346,613 bytes, 5 lines download raw bytes

1import{a as y_}from"./chunk-VQG6FVZV.js";import{a as D_}from"./chunk-2VCO3ELQ.js";import{a as Wi,b as Hi,c as F_,d as b_,e as x_,f as k_,g as z_,h as Wr}from"./chunk-BS6YYGJU.js";import{a as Lt,b as U_,c as V_}from"./chunk-WQJRIKVQ.js";import{a as m_,b as c_}from"./chunk-7MQ4SBPO.js";import{a as u_,b as eo}from"./chunk-PJKYA6AI.js";import{a as g_}from"./chunk-AY7NRASF.js";import{b as p_}from"./chunk-MJ7YGT2J.js";import"./chunk-FGO7IWQW.js";import{a as vn}from"./chunk-SIUVO6VG.js";import{e as N_,g as f_}from"./chunk-O5IYCHZC.js";import{a as Hl,b as jl,c as Ql,d as Jl,e as ql,f as Kl,g as Gi,h as Li,i as Yl,j as Zl,k as e_,l as t_,m as n_,n as $i,o as o_,p as i_,q as r_,s as a_,t as xi,u as wi,v as we,w as jt,x as si}from"./chunk-THAUX7GZ.js";import{b as On,c as Ht}from"./chunk-KHC4A3RT.js";import{a as l_}from"./chunk-BH6MQPW4.js";import"./chunk-U7E76NBH.js";import"./chunk-LYSJ47UW.js";import"./chunk-ARBLAW36.js";import{a as O_,b as P_,c as v_,d as Qi,e as Ji}from"./chunk-P7YZPKB2.js";import{a as w_}from"./chunk-5GVXZ5ON.js";import{c as R_}from"./chunk-G3L6OW7K.js";import{a as no,c as He,d as Bi}from"./chunk-UFPPYVMH.js";import"./chunk-YEN262T4.js";import{a as T_}from"./chunk-4GM7L6JB.js";import{c as oo}from"./chunk-XG2UEYRK.js";import{a as qe}from"./chunk-LCNXNM6E.js";import"./chunk-O4DWGUCX.js";import{a as G_}from"./chunk-AWZKCMCZ.js";import{b as Rn,f as E_,g as Zn}from"./chunk-QMQZZIR5.js";import{a as Xi}from"./chunk-XGC7JZAU.js";import{a as ut}from"./chunk-MBPSVMMT.js";import{a as M_,b as A_,k as L_,l as $_}from"./chunk-N3ODB36S.js";import{a as I_}from"./chunk-TB5BTAZU.js";import{a as Pn}from"./chunk-L435IOLB.js";import"./chunk-AGD5WKED.js";import{a as h_}from"./chunk-XAUPS75L.js";import{a as qi}from"./chunk-X2SRRTG5.js";import"./chunk-C4KUKUZD.js";import{a as Yn}from"./chunk-S7TSA3HI.js";import"./chunk-J3EEEQXE.js";import{a as Qt}from"./chunk-62ATBB34.js";import{a as We}from"./chunk-PVOHGV2Y.js";import{a as Jt}from"./chunk-LQVRZI54.js";import{a as to}from"./chunk-PXSCR5MN.js";import{a as ji}from"./chunk-U2CJTFGW.js";import{a as Wl}from"./chunk-O2ZJMO7B.js";import{a as zi,b as S_}from"./chunk-WOBKXJK4.js";import"./chunk-BWH75TCH.js";import{a as C_}from"./chunk-SSETSBQT.js";import"./chunk-MTPQLCOP.js";import{a as Bl}from"./chunk-X3ZEAWQQ.js";import{a as Xl}from"./chunk-TWKGHEYL.js";import"./chunk-SGZLU3PA.js";import"./chunk-RBCASDJ4.js";import{a as Kn}from"./chunk-C726LWQF.js";import"./chunk-WMEOAIVO.js";import{a as yi,b as Di}from"./chunk-EO7FPGTW.js";import"./chunk-GDFO7X2G.js";import"./chunk-I6M5NA5Y.js";import{c as tn}from"./chunk-Q6I3NOHV.js";import{a as st}from"./chunk-KIVJRE4O.js";import{b as __,c as s_,d as Ui,h as Vi,i as d_,k as Jn,l as qn,m as ki}from"./chunk-L7C23KC7.js";import{h as It}from"./chunk-VDA4PBJF.js";import"./chunk-YLZ34D6D.js";import"./chunk-QXVUYXIG.js";import{b as Se}from"./chunk-OR7MKCZD.js";import{a as hi}from"./chunk-OTKVWBE5.js";import"./chunk-LLCRV73S.js";import"./chunk-KEEUBRDB.js";import"./chunk-GGNTEXQL.js";import{a as zl}from"./chunk-KLT2ZASF.js";import"./chunk-V3JZPFOE.js";import{c as bt}from"./chunk-PG4F5PSG.js";import"./chunk-CIVVPYF3.js";import{a as Qn,b as Je}from"./chunk-FZFWY5Y6.js";import{a as jn}from"./chunk-EGEBNI4V.js";import{A as Bt,B as fl,E as ae,F as Re,a as Cl,c as De,d as Ii,g as se,h as Ee,i as El,m as Nl,o as kt,p as Ne,q as Bn,t as Sl,u as vt,w as Ge,x as Pe,y as zt,z as Xt}from"./chunk-EBOVR5NW.js";import{G as Oi,u as Ti}from"./chunk-UME7L37K.js";import{a as Qe}from"./chunk-R76LZEZS.js";import{$g as $l,Ab as V,Ae as Tl,Af as Tt,B as Ve,Bb as k,C as pn,Ca as a,Cb as l,Cc as zn,Ce as Gn,D as gn,Db as L,Dc as ce,Df as Y,E as Ni,Eb as $,Ec as me,Fb as X,Fd as $e,Fh as ze,Gb as T,Gd as fn,Gh as Hn,H as il,Ib as s,Ic as gl,If as _i,Jb as sl,Jd as Mn,Jf as hl,Kb as Ur,Kd as Oe,Kh as vi,L as rl,Lc as Mi,Lh as Tn,Ma as O,Mh as Fi,Oa as _l,Og as yl,Oh as bi,Pd as Xn,Ph as Vl,Q as Be,Qb as Ae,Qg as Dl,Qh as kl,Rb as Te,Rg as K,S as Si,Sa as pt,Sb as ue,Sd as Ml,Se as Vr,Ta as U,Ub as dl,Vc as Ce,Vd as Dn,Wb as ml,X as al,Xb as C,Xg as rs,Y as Ot,Yb as f,Zb as b,Zc as Sn,Zd as _t,Zg as Gl,_b as Zt,_d as ct,_g as Ll,aa as p,af as Ol,bb as Cn,bc as Et,be as In,bf as Pl,cc as Nt,ce as ii,ch as xl,d as oi,dc as St,df as Rl,ed as Le,ef as vl,fa as D,fb as c,ga as G,gb as u,ge as q,gf as li,gg as Br,gh as Ft,hc as Vt,he as ft,hh as Mt,i as un,ib as Ie,ie as Wn,if as Fl,ih as Pi,j as Ei,jb as pe,jc as cl,jh as wl,kb as ge,kc as mt,kh as Ri,lb as d,lc as x,lh as Wt,mb as r,mc as ul,md as Pt,n as lt,nb as i,nh as xe,ob as m,oc as pl,oe as Il,pb as gt,pd as Rt,qa as ll,qb as Ct,qf as kr,qh as en,r as ol,ra as Ut,rb as yn,rf as bl,sb as E,sc as Q,sf as zr,tb as N,tc as ke,th as j,ub as wr,uc as _e,uh as Ul,vb as En,ve as Al,wb as Nn,wc as v,xe as ri,xf as Xr,ya as Yt,yb as H,ye as An,za as at,zb as fi,ze as ai,zf as Ai}from"./chunk-HVCWS4IF.js";import{a as fe,b as Xe,c as Ci,g as is,j as S,k as le}from"./chunk-KJ7W2O2B.js";function as(n,t){n&1&&(r(0,"my-alert",9),l(1,2),i());}function ls(n,t){if(n&1&&(r(0,"li"),C(1),i()),n&2){let e=t.$implicit;a(),f(e);}}function _s(n,t){if(n&1&&(r(0,"my-alert",10),E(1),l(2,3),N(),r(3,"ul",11),pe(4,ls,2,1,"li",null,Ie),i()()),n&2){let e=s();a(4),ge(e.grabAllErrors());}}function ss(n,t){if(n&1&&(r(0,"my-alert",10),C(1),i()),n&2){let e=s();a(),f(e.inconsistentOptions());}}var io=class io{formReactiveService=p(Se);server=p(j);headerService=p(kl);screenService=p(Hn);peertubeModal=p(Wl);title=ce.required();form=ce.required();formErrors=ce.required();validationMessages=ce.required();inconsistentOptions=ce();save=zn();displayFormErrors=!1;ngOnInit(){this.screenService.isInMobileView()&&this.headerService.setSearchHidden(!0);}
1ngOnDestroy(){this.headerService.setSearchHidden(!1);}isUpdateAllowed(){return this.server.getHTMLConfig().webadmin.configuration.edition.allowed===!0;}canUpdate(){return!this.isUpdateAllowed()||this.inconsistentOptions()?!1:this.form().dirty;}grabAllErrors(){return this.formReactiveService.grabAllErrors(this.formErrors());}openConfigWizard(){this.peertubeModal.openAdminConfigWizardSubject.next({showWelcome:!1});}onSave(t){if(this.displayFormErrors=!1,this.formReactiveService.forceCheck(this.form(),this.formErrors(),this.validationMessages()),this.form().valid){this.save.emit();return;}t.preventDefault(),this.displayFormErrors=!0;}};S(io,"\u0275fac",function(e){return new(e||io)();}),S(io,"\u0275cmp",O({type:io,selectors:[["my-admin-save-bar"]],inputs:{title:[1,"title"],form:[1,"form"],formErrors:[1,"formErrors"],validationMessages:[1,"validationMessages"],inconsistentOptions:[1,"inconsistentOptions"]},outputs:{save:"save"},decls:12,vars:4,consts:()=>{let t;t="Open config wizard";let e;e="Save";let o;o=" Updating platform configuration from the web interface is disabled by the system administrator. ";let _;return _="There are errors in the configuration:",[t,e,o,_,[1,"root"],[1,"root-bar"],[1,"buttons"],["theme","secondary",1,"pre-config",3,"click"],["form","admin-config-form","theme","primary","icon","circle-tick",1,"save-button",3,"click","disabled"],["type","primary",1,"d-block","mt-3"],["type","danger",1,"d-block","mt-3"],[1,"mb-0"]];},template:function(e,o){e&1&&(r(0,"div",4)(1,"div",5)(2,"h2"),C(3),i(),r(4,"div",6)(5,"my-button",7),T("click",function(){return o.openConfigWizard();}),l(6,0),i(),r(7,"my-button",8),T("click",function(g){return o.onSave(g);}),l(8,1),i()()(),c(9,as,2,0,"my-alert",9)(10,_s,6,0,"my-alert",10),c(11,ss,2,1,"my-alert",10),i()),e&2&&(a(3),f(o.title()),a(4),d("disabled",!o.canUpdate()),a(2),u(o.isUpdateAllowed()?o.displayFormErrors&&!o.form().valid?10:-1:9),a(2),u(o.inconsistentOptions()?11:-1));},dependencies:[Xn,bt,st],styles:[".root[_ngcontent-%COMP%]{position:sticky;top:var(--header-height);z-index:11;background-color:var(--bg);margin-bottom:calc(1.425rem + 2.1vw)}@media(min-width:1200px){.root[_ngcontent-%COMP%]{margin-bottom:3rem}}.root-bar[_ngcontent-%COMP%]{display:flex;gap:.5rem;width:100%;min-width:0;justify-content:center;border-radius:14px;background-color:var(--bg-secondary-350);padding:calc(1.275rem + .3vw)}@media(min-width:1200px){.root-bar[_ngcontent-%COMP%]{padding:1.5rem}}.buttons[_ngcontent-%COMP%]{margin-inline-start:auto}.pre-config[_ngcontent-%COMP%]{display:inline-block;margin-inline-end:.5rem}h2[_ngcontent-%COMP%]{flex-shrink:1;color:var(--fg-350);font-weight:700;margin-bottom:0;line-height:normal;margin-inline-start:auto;font-size:calc(1.275rem + .3vw)}@media(min-width:1200px){h2[_ngcontent-%COMP%]{font-size:1.5rem}}h2[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media screen and (max-width:800px){.root-bar[_ngcontent-%COMP%]{flex-direction:column;align-items:center;padding:.5rem}.buttons[_ngcontent-%COMP%], h2[_ngcontent-%COMP%]{margin-inline-start:0}}"]}));var Ke=io;var ds=n=>({"input-error":n});function ms(n,t){if(n&1&&(r(0,"div",21),C(1),i()),n&2){let e=s();a(),f(e.formErrors.services.twitter.username);}}var ro=class ro{route=p($e);formReactiveService=p(Se);adminConfigService=p(we);form;formErrors={};validationMessages={};customConfig;customConfigSub;ngOnInit(){this.customConfig=this.route.parent.snapshot.data.customConfig,this.buildForm(),this.customConfigSub=this.adminConfigService.getCustomConfigReloadedObs().subscribe(t=>{this.customConfig=t,this.form.patchValue(this.customConfig);});}ngOnDestroy(){this.customConfigSub&&this.customConfigSub.unsubscribe();}canDeactivate(){return{canDeactivate:!this.form.dirty};}buildForm(){let t={services:{twitter:{username:Ql}}},e=this.customConfig,{form:o,formErrors:_,validationMessages:g}=this.formReactiveService.buildForm(t,e);this.form=o,this.formErrors=_,this.validationMessages=g;}save(){this.adminConfigService.saveAndUpdateCurrent({currentConfig:this.customConfig,form:this.form,formConfig:this.form.value,success:"Advanced configuration updated."});}};S(ro,"\u0275fac",function(e){return new(e||ro)();}),S(ro,"\u0275cmp",O({type:ro,selectors:[["my-admin-config-advanced"]],decls:27,vars:8,consts:()=>{let t;t="Advanced configuration";let e;e="CACHE";let o;o=" Some files are not federated, and fetched when necessary. Define their caching policies. ";let _;_="TWITTER/X";let g;
1g=" Extra configuration required by Twitter/X. All other social media (Facebook, Mastodon, etc.) are supported out of the box. ";let M;M="Your Twitter/X username";let I;I="Indicates the Twitter/X account for the website or platform where the content was published.";let P;return P="This is just an extra information injected in PeerTube HTML that is required by Twitter/X. If you don't have a Twitter/X account, just leave the default value.",[e,o,_,g,M,I,P,["title",t,3,"save","form","formErrors","validationMessages"],["id","admin-config-form",3,"formGroup"],[1,"pt-two-cols"],[1,"title-col"],[1,"inner-form-description"],[1,"pt-two-cols","mt-4"],[1,"content-col"],["formGroupName","services"],["formGroupName","twitter"],[1,"form-group"],["for","servicesTwitterUsername"],[1,"form-group-description"],[1,"mb-0"],["type","text","id","servicesTwitterUsername","formControlName","username",1,"form-control",3,"ngClass"],["role","alert",1,"form-error"]];},template:function(e,o){e&1&&(r(0,"my-admin-save-bar",7),T("save",function(){return o.save();}),i(),r(1,"form",8)(2,"div",9)(3,"div",10)(4,"h2"),l(5,0),i(),r(6,"div",11),l(7,1),i()()(),r(8,"div",12)(9,"div",10)(10,"h2"),l(11,2),i(),r(12,"div",11),l(13,3),i()(),r(14,"div",13),E(15,14)(16,15),r(17,"div",16)(18,"label",17),l(19,4),i(),r(20,"div",18)(21,"p",19),l(22,5),i(),r(23,"p"),l(24,6),i()(),m(25,"input",20),c(26,ms,2,1,"div",21),i(),N()(),i()()()),e&2&&(d("form",o.form)("formErrors",o.formErrors)("validationMessages",o.validationMessages),a(),d("formGroup",o.form),a(24),d("ngClass",x(6,ds,o.formErrors.services.twitter.username)),a(),u(o.formErrors.services.twitter.username?26:-1));},dependencies:[Le,Ce,ae,Ne,De,se,Ee,Re,Pe,Ge,vt,Ke],styles:["form[_ngcontent-%COMP%]{padding-bottom:1.5rem}my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:500px}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:100%}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]     textarea{height:300px!important}input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:340px;max-width:340px;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}input[type=text][_ngcontent-%COMP%]::placeholder, input[type=number][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%], input[type=number][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible, input[type=number][_ngcontent-%COMP%]:focus, input[type=number][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%], input[type=number][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:380px){input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{width:100%}}.peertube-select-container[_ngcontent-%COMP%]{width:340px}@media screen and (max-width:370px){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){display:block;width:340px}@media screen and (max-width:370px){my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){width:100%}}my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{display:block;width:480px}@media screen and (max-width:510px){my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{width:100%}}.inner-form-description[_ngcontent-%COMP%]{font-size:14px;margin-bottom:1rem;color:var(--fg-300)}textarea[_ngcontent-%COMP%]{max-width:100%;display:block;font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:500px;max-width:500px;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}textarea[_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}textarea[readonly][_ngcontent-%COMP%]{color:var(--fg-300)}textarea[_ngcontent-%COMP%]:focus, textarea[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}textarea[disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:540px){textarea[_ngcontent-%COMP%]{width:100%}}textarea[_ngcontent-%COMP%]{color:var(--textarea-fg)!important;background-color:var(--textarea-bg)!important;height:150px;padding:var(--textarea-y-padding) var(--textarea-x-padding)}textarea.small[_ngcontent-%COMP%]{height:75px}.disabled-checkbox-extra[_ngcontent-%COMP%], .disabled-checkbox-extra[_ngcontent-%COMP%]     label{opacity:.5;pointer-events:none}my-actor-banner-edit[_ngcontent-%COMP%]{max-width:500px}h4[_ngcontent-%COMP%]{font-weight:700;margin-bottom:.5rem;font-size:1rem}"]}));var Ki=ro;function cs(n,t){if(n&1&&(r(0,"span",3),C(1),i()),n&2){let e=s(2);a(),f(e.inputSuffix());}}function us(n,t){if(n&1){let e=H();r(0,"input",2),St("ngModelChange",function(_){D(e);let g=s();return Nt(g.customValue,_)||(g.customValue=_),G(_);}),T("ngModelChange",function(){D(e);let _=s();return G(_.onModelChange());}),i(),c(1,cs,2,1,"span",3);}if(n&2){let e=s();Et("ngModel",e.customValue),d("type",e.inputType()),Cn("aria-labelledby",e.labelId()),a(),u(e.inputSuffix()?1:-1);}}var Ln=class Ln{inputId=ce.required();labelId=ce.required();items=ce([]);clearable=ce(!1);searchable=ce(!1);inputSuffix=ce(void 0);inputType=ce("text");customValue="";selectedId;disabled=!1;itemsWithCustom=[];ngOnChanges(){this.itemsWithCustom=this.getItems();}propagateChange=t=>{};writeValue(t){this.selectedId=t,this.isSelectedIdInItems()!==!0&&(this.selectedId="other",this.customValue=t);}
1registerOnChange(t){this.propagateChange=t;}registerOnTouched(){}onModelChange(){return this.selectedId==="other"?this.propagateChange(this.customValue):this.propagateChange(this.selectedId);}isSelectedIdInItems(){return!!this.items().find(t=>t.id===this.selectedId);}getItems(){let t={id:"other",label:"Custom value..."};return this.items().concat([t]);}isCustomValue(){return this.selectedId==="other";}setDisabledState(t){this.disabled=t;}};S(Ln,"\u0275fac",function(e){return new(e||Ln)();}),S(Ln,"\u0275cmp",O({type:Ln,selectors:[["my-select-custom-value"]],hostVars:2,hostBindings:function(e,o){e&2&&dl("has-custom-value",o.isCustomValue());},inputs:{inputId:[1,"inputId"],labelId:[1,"labelId"],items:[1,"items"],clearable:[1,"clearable"],searchable:[1,"searchable"],inputSuffix:[1,"inputSuffix"],inputType:[1,"inputType"]},features:[cl([{provide:Cl,useExisting:al(()=>Ln),multi:!0}]),ll],decls:3,vars:5,consts:[[1,"d-flex","align-items-center"],[1,"flex-grow-1",3,"ngModelChange","inputId","disabled","items","ngModel"],[1,"ms-2","form-control","pt-input-text",3,"ngModelChange","ngModel","type"],[1,"ms-1"]],template:function(e,o){e&1&&(r(0,"div",0)(1,"my-select-options",1),St("ngModelChange",function(g){return Nt(o.selectedId,g)||(o.selectedId=g),g;}),T("ngModelChange",function(){return o.onModelChange();}),i(),c(2,us,2,4),i()),e&2&&(a(),d("inputId",o.inputId())("disabled",o.disabled)("items",o.itemsWithCustom),Et("ngModel",o.selectedId),a(),u(o.isCustomValue()?2:-1));},dependencies:[It,ae,De,se,kt],encapsulation:2}));var At=Ln;function ps(n,t){if(n&1&&(En(0),l(1,1),Q(2,"bytes"),Nn()),n&2){let e=s(2);a(2),L(_e(2,1,e.computeQuotaWithTranscoding(),0)),$(1);}}function gs(n,t){if(n&1&&(gt(0,"div"),En(1),V(2,0),yn(3,"strong"),k(),Nn(),yn(4,"br"),c(5,ps,3,4,"ng-container"),Ct()),n&2){let e=s();a(5),u(e.isTranscodingInformationDisplayed()?5:-1);}}var ao=class ao{server=p(j);videoQuota=ce(void 0);serverConfig;ngOnInit(){this.serverConfig=this.server.getHTMLConfig();}isTranscodingInformationDisplayed(){return this.serverConfig.transcoding.enabledResolutions.length!==0;}computeQuotaWithTranscoding(){let t=this.serverConfig.transcoding,e=t.enabledResolutions,o=Il.H_4K,_=1;for(let g of e)_+=g/o;return t.hls.enabled&&(_*=2),Math.round(_*this.getQuotaAsNumber());}getQuotaAsNumber(){return parseInt(this.videoQuota()+"",10);}};S(ao,"\u0275fac",function(e){return new(e||ao)();}),S(ao,"\u0275cmp",O({type:ao,selectors:[["my-user-real-quota-info"]],inputs:{videoQuota:[1,"videoQuota"]},decls:1,vars:1,consts:()=>{let t;t=" The video quota only takes into account the size of "+"\uFFFD#3\uFFFD"+"uploaded"+"\uFFFD/#3\uFFFD"+" videos, not transcoded files or user export archives (which may contain video files). ";let e;return e=" Transcoding is enabled so real videos size can be at most ~ "+"\uFFFD0\uFFFD"+". ",[t,e];},template:function(e,o){e&1&&c(0,gs,6,1,"div"),e&2&&u(o.getQuotaAsNumber()>0?0:-1);},dependencies:[ut],encapsulation:2}));var Fn=ao;var lo=n=>({"input-error":n}),Cs=n=>({"disabled-checkbox-extra":n});function Es(n,t){if(n&1&&(r(0,"div",86),C(1),i()),n&2){let e=s();a(),f(e.formErrors.instance.defaultClientRoute);}}function Ns(n,t){n&1&&(r(0,"span"),l(1,75),i());}function Ss(n,t){n&1&&(r(0,"span"),l(1,76),i());}function fs(n,t){if(n&1&&(r(0,"div",86),C(1),i()),n&2){let e=s();a(),f(e.formErrors.client.browseVideos.defaultSort);}}function Ms(n,t){if(n&1&&(r(0,"div",86),C(1),i()),n&2){let e=s();a(),f(e.formErrors.client.browseVideos.defaultScope);}}function Is(n,t){if(n&1&&(r(0,"div",86),C(1),i()),n&2){let e=s();a(),f(e.formErrors.trending.videos.algorithms.default);}}function As(n,t){if(n&1&&(r(0,"div",86),C(1),i()),n&2){let e=s();a(),f(e.formErrors.broadcastMessage.level);}}function Ts(n,t){if(n&1&&(r(0,"div",86),C(1),i()),n&2){let e=s();a(),f(e.formErrors.broadcastMessage.message);}}function Os(n,t){if(n&1&&(r(0,"my-alert",124),C(1),i()),n&2){let e=s();a(),f(e.signupAlertMessage);}}function Ps(n,t){if(n&1&&(r(0,"div",86),C(1),i()),n&2){let e=s();a(),f(e.formErrors.signup.limit);}}function Rs(n,t){n&1&&(r(0,"small",133),l(1,77),i());}function vs(n,t){if(n&1&&(r(0,"div",86),C(1),i()),n&2){let e=s();a(),f(e.formErrors.signup.minimumAge);}}function Fs(n,t){if(n&1&&(r(0,"div",86),C(1),i()),n&2){let e=s();a(),f(e.formErrors.user.videoQuota);}}function bs(n,t){if(n&1&&(r(0,"div",86),C(1),i()),n&2){let e=s();a(),f(e.formErrors.user.videoQuotaDaily);}}function hs(n,t){if(n&1&&(r(0,"div",86),C(1),i()),n&2){let e=s();a(),f(e.formErrors.import.videos.concurrency);}}function ys(n,t){if(n&1&&(r(0,"div",86),C(1),i()),n&2){let e=s();a(),b(" ",e.formErrors.import.videoChannelSynchronization.maxPerUser," ");}}function Ds(n,t){if(n&1&&(r(0,"div",86),C(1),i()),n&2){let e=s();a(),f(e.formErrors.defaults.publish.privacy);}}function Gs(n,t){if(n&1&&(r(0,"div",86),C(1),i()),n&2){let e=s();a(),f(e.formErrors.defaults.publish.licence);}}function Ls(n,t){if(n&1&&(r(0,"div",86),C(1),i()),n&2){let e=s();a(),f(e.formErrors.defaults.publish.commentsPolicy);}}function $s(n,t){if(n&1&&(r(0,"div",86),C(1),i()),n&2){let e=s();a(),f(e.formErrors.defaults.publish.downloadPolicy);}}function xs(n,t){if(n&1&&(r(0,"div",86),C(1),i()),n&2){let e=s();a(),f(e.formErrors.videoChannels.maxPerUser);}}function ws(n,t){if(n&1&&(r(0,"div",86),C(1),i()),n&2){let e=s();a(),b(" ",e.formErrors.followings.instance.autoFollowIndex.indexUrl," ");}}function Us(n,t){if(n&1&&(r(0,"div",86),C(1),i()),n&2){let e=s();a(),f(e.formErrors.search.searchIndex.url);}}function Vs(n,t){if(n&1&&(r(0,"div",86),C(1),i()),n&2){let e=s();a(),f(e.formErrors.export.users.maxUserVideoQuota);}}function ks(n,t){if(n&1&&(r(0,"div",86),C(1),i()),n&2){let e=s();a(),f(e.formErrors.export.users.exportExpiration);}}var _o=class _o{server=p(j);route=p($e);formReactiveService=p(Se);adminConfigService=p(we);videoService=p(tn);form;formErrors={};validationMessages={};signupAlertMessage;defaultLandingPageOptions=[];exportExpirationOptions=[];exportMaxUserVideoQuotaOptions=[];privacyOptions=[];commentPoliciesOptions=[];downloadPoliciesOptions=[{id:"allowed",label:"Allowed"},{id:"disabled",label:"Disabled"}];licenceOptions=[];customConfig;customConfigSub;ngOnInit(){this.customConfig=this.route.parent.snapshot.data.customConfig;
1let t=this.route.snapshot.data;this.privacyOptions=this.videoService.explainedPrivacyLabels(t.privacies).videoPrivacies,this.licenceOptions=t.licences,this.commentPoliciesOptions=t.commentPolicies,this.buildLandingPageOptions(),this.exportExpirationOptions=[{id:1e3*3600*24,label:"1 day"},{id:1e3*3600*24*2,label:"2 days"},{id:1e3*3600*24*7,label:"7 days"},{id:1e3*3600*24*30,label:"30 days"}],this.exportMaxUserVideoQuotaOptions=this.getVideoQuotaOptions().filter(e=>e.id>=1),this.buildForm(),this.subscribeToSignupChanges(),this.subscribeToImportSyncChanges(),this.customConfigSub=this.adminConfigService.getCustomConfigReloadedObs().subscribe(e=>{this.customConfig=e,this.form.patchValue(this.buildFormValue(this.customConfig));});}ngOnDestroy(){this.customConfigSub&&this.customConfigSub.unsubscribe();}buildForm(){let t={instance:{defaultClientRoute:null},client:{browseVideos:{defaultSort:null,defaultScope:null},menu:{login:{redirectOnSingleExternalAuth:null}}},signup:{enabled:null,limit:Jl,requiresApproval:null,requiresEmailVerification:null,minimumAge:ql},import:{videos:{concurrency:$i,http:{enabled:null},torrent:{enabled:null}},videoChannelSynchronization:{enabled:null,maxPerUser:n_},users:{enabled:null}},export:{users:{enabled:null,maxUserVideoQuota:i_,exportExpiration:o_}},trending:{videos:{algorithms:{enabled:null,default:null}}},user:{history:{videos:{enabled:null}},videoQuota:Jn,videoQuotaDaily:qn},videoChannels:{maxPerUser:t_},videoTranscription:{enabled:null,remoteRunners:{enabled:null}},videoFile:{update:{enabled:null}},autoBlacklist:{videos:{ofUsers:{enabled:null}}},followers:{instance:{enabled:null,manualApproval:null},channels:{enabled:null}},followings:{instance:{autoFollowBack:{enabled:null},autoFollowIndex:{enabled:null,indexUrl:On}}},broadcastMessage:{enabled:null,level:null,dismissable:null,message:null},search:{remoteUri:{users:null,anonymous:null},searchIndex:{enabled:null,url:On,disableLocalSearch:null,isDefaultSearch:null}},storyboards:{enabled:null,remoteRunners:{enabled:null}},defaults:{publish:{downloadPolicy:null,commentsPolicy:null,privacy:null,licence:null},p2p:{webapp:{enabled:null},embed:{enabled:null}},player:{autoPlay:null}},videoComments:{acceptRemoteComments:null}},e=this.buildFormValue(this.customConfig),{form:o,formErrors:_,validationMessages:g}=this.formReactiveService.buildForm(t,e);this.form=o,this.formErrors=_,this.validationMessages=g;}buildFormValue(t){return _i(t,{defaults:{publish:{downloadPolicy:t.defaults.publish.downloadEnabled?"allowed":"disabled"}}});}canDeactivate(){return{canDeactivate:!this.form.dirty};}countExternalAuth(){return this.server.getHTMLConfig().plugin.registeredExternalAuths.length;}getVideoQuotaOptions(){return xi();}getVideoQuotaDailyOptions(){return wi();}doesTrendingVideosAlgorithmsEnabledInclude(t){let e=this.form.value.trending.videos.algorithms.enabled;return Array.isArray(e)?!!e.find(o=>o===t):!1;}getUserVideoQuota(){return this.form.value.user.videoQuota;}isExportUsersEnabled(){return this.form.value.export.users.enabled===!0;}getDisabledExportUsersClass(){return{"disabled-checkbox-extra":!this.isExportUsersEnabled()};}isSignupEnabled(){return this.form.value.signup.enabled===!0;}getDisabledSignupClass(){return{"disabled-checkbox-extra":!this.isSignupEnabled()};}isImportVideosHttpEnabled(){return this.form.value.import.videos.http.enabled===!0;}importSynchronizationChecked(){return this.isImportVideosHttpEnabled()&&this.form.value.import.videoChannelSynchronization.enabled;}hasUnlimitedSignup(){return this.form.value.signup.limit===-1;}isSearchIndexEnabled(){return this.form.value.search.searchIndex.enabled===!0;}getDisabledSearchIndexClass(){return{"disabled-checkbox-extra":!this.isSearchIndexEnabled()};}isTranscriptionEnabled(){return this.form.value.videoTranscription.enabled===!0;}getTranscriptionRunnerDisabledClass(){return{"disabled-checkbox-extra":!this.isTranscriptionEnabled()};}isStoryboardEnabled(){return this.form.value.storyboards.enabled===!0;}getStoryboardRunnerDisabledClass(){return{"disabled-checkbox-extra":!this.isStoryboardEnabled()};}isAutoFollowIndexEnabled(){return this.form.value.followings.instance.autoFollowIndex.enabled===!0;}buildLandingPageOptions(){let t=[];this.server.getHTMLConfig().homepage.enabled&&t.push({label:"Home",path:"/home"}),t=t.concat([{label:"Discover",path:"/videos/overview"},{label:"Browse all videos",path:"/videos/browse"},{label:"Browse local videos",path:"/videos/browse?scope=local"}]),this.defaultLandingPageOptions=t.map(e=>({id:e.path,label:e.label,description:e.path}));}subscribeToImportSyncChanges(){let t=this.form.controls,e=t.import.controls.videoChannelSynchronization.controls.enabled;t.import.controls.videos.controls.http.controls.enabled.valueChanges.subscribe(_=>{e.setValue(_&&e.value),_?e.enable():e.disable();});}subscribeToSignupChanges(){let t=this.form.controls.signup.controls.enabled;t.valueChanges.pipe(rl()).subscribe(([e,o])=>{e===!1&&o===!0&&(this.signupAlertMessage="You enabled signup: we automatically enabled the \"Block new videos automatically\" checkbox of the \"Videos\" section just below.",this.form.patchValue({autoBlacklist:{videos:{ofUsers:{enabled:!0}}}}));}),t.updateValueAndValidity();}save(){this.adminConfigService.saveAndUpdateCurrent({currentConfig:this.customConfig,form:this.form,formConfig:_i(this.form.value,{defaults:{publish:{downloadEnabled:this.form.value.defaults.publish.downloadPolicy==="allowed"}}}),success:"General configuration updated."});}};S(_o,"\u0275fac",function(e){return new(e||_o)();}),S(_o,"\u0275cmp",O({type:_o,selectors:[["my-admin-config-general"]],decls:404,vars:80,consts:()=>{let t;t="General configuration";let e;
1e="Redirect users on single external auth when users click on the login button in menu";let o;o="Enable broadcast message";let _;_="Allow users to dismiss the broadcast message ";let g;g="Enable Signup";let M;M="Signup requires approval by moderators";let I;I="Signup requires email verification";let P;P="bytes";let y;y="bytes";let F;F="Automatically enable video history for a new user";let h;h="Allow import with HTTP URL (e.g. YouTube)";let J;J="Allow import with a torrent file or a magnet URI";let w;w="Allow channel synchronization with channel of other platforms like YouTube";let Z;Z="Block new videos automatically";let oe;oe="Allow users to upload a new version of their video";let be;be="Enable video storyboards";let ve;ve="Enable remote runners to generate storyboards";let de;de="Enable video transcription";let he;he="Enable remote runners for transcription";let Fe;Fe="Accept comments made on remote platforms";let Me;Me="Remote actors can follow channels of your platform";let ye;ye="Remote actors can follow your platform";let te;te="Manually approve new followers that follow your platform";let Ue;Ue="Automatically follow back followers that follow your platform";let ie;ie="Automatically follow platforms of a public index";let je;je="Automatically play videos in the player";let re;re="Enable P2P streaming by default on your platform";let Ze;Ze="Enable P2P streaming by default for videos embedded on external websites";let et;et="Allow users to do remote URI/handle search";let tt;tt="Allow anonymous to do remote URI/handle search";let nt;nt="Enable global search";let ot;ot="Disable local search in search bar";let it;it="Search bar uses the global search index by default";let rt;rt="Allow your users to import a data archive";let R;R="Allow your users to export their data";let yt;yt="bytes";let Dt;Dt="BEHAVIOR";let Gt;Gt="Landing page";let ee;ee="BROWSE VIDEOS";let an;an="Default sort";let ln;ln="Default scope";let _n;_n="Default trending algorithm";let sn;sn="Hot videos";let dn;dn="Recent views";let wt;wt="Most liked videos";let mn;mn="Global views";let cn;cn="BROADCAST MESSAGE";let B;B=" Display a message on your platform ";let ei;ei="Broadcast message level";let ti;ti="info";let ni;ni="warning";let z;z="error";let ea;ea="Message";let ta;ta="NEW USERS";let na;na="\u26A0\uFE0F This functionality requires a lot of attention and extra moderation";let oa;oa="Signup limit";let ia;ia="When the total number of users in your platform reaches this limit, registrations are disabled. -1 = unlimited";let mi;mi="{VAR_PLURAL, plural, =1 {user} other {users}}",mi=X(mi,{VAR_PLURAL:"\uFFFD0\uFFFD"});let ra;ra="Minimum required age to create an account";let ci;ci="{VAR_PLURAL, plural, =1 {year old} other {years old}}",ci=X(ci,{VAR_PLURAL:"\uFFFD0\uFFFD"});let aa;aa="Default video quota for a new user";let la;la="Default daily upload limit for a new user";let _a;_a="VIDEO IMPORTS";let sa;sa="Import jobs concurrency";let da;da="allows to import multiple videos in parallel";let ma;ma="jobs in parallel";let ca;ca="\u26A0\uFE0F If enabled, we recommend to use "+"\uFFFD#157\uFFFD"+"a HTTP proxy"+"\uFFFD/#157\uFFFD"+" to prevent private URL access from your PeerTube server";let ua;ua="\u26A0\uFE0F We don't recommend to enable this feature if you don't trust your users";let pa;pa=" \u26D4 You need to allow import with HTTP URL to be able to activate this feature. ";let ga;ga="Max channel synchronization per user";let ui;ui="{VAR_PLURAL, plural, =1 {sync} other {syncs}}",ui=X(ui,{VAR_PLURAL:"\uFFFD0\uFFFD"});let Ca;Ca="VIDEOS";let Ea;Ea="Unless a user is marked as trusted, their videos will stay private until a moderator reviews them.";let Na;Na="Generate storyboards of local videos using ffmpeg so users can see the video preview in the player while scrubbing the video";let Sa;Sa="Use "+"\uFFFD#206\uFFFD"+"remote runners"+"\uFFFD/#206\uFFFD"+" to generate storyboards.";let fa;fa="Remote runners have to register on your instance first.";let Ma;Ma=""+"\uFFFD#215\uFFFD"+"Automatically create subtitles"+"\uFFFD/#215\uFFFD"+" for uploaded/imported VOD videos";let Ia;Ia="Use "+"\uFFFD#222\uFFFD"+"remote runners"+"\uFFFD/#222\uFFFD"+" to process transcription tasks.";let Aa;Aa="Remote runners have to register on your instance first.";let Ta;Ta="Default video privacy";let Oa;Oa="Default video licence";let Pa;Pa="Default comment policy";let Ra;Ra="Default download policy";let va;
1va="VIDEO CHANNELS";let Fa;Fa="Max video channels per user";let pi;pi="{VAR_PLURAL, plural, =1 {channel} other {channels}}",pi=X(pi,{VAR_PLURAL:"\uFFFD0\uFFFD"});let ba;ba="FEDERATION";let ha;ha=" Manage "+"\uFFFD#266\uFFFD"+"relations"+"\uFFFD/#266\uFFFD"+" with other platforms. ";let ya;ya="This setting is not retroactive: current comments from remote platforms will not be deleted";let Da;Da="This setting is not retroactive: current followers of channels of your platform will not be affected";let Ga;Ga="This setting is not retroactive: current followers of your platform will not be affected";let La;La="\u26A0\uFE0F This functionality requires a lot of attention and extra moderation";let $a;$a="\u26A0\uFE0F This functionality requires a lot of attention and extra moderation.";let xa;xa=" See "+"\uFFFD#305\uFFFD"+"the documentation"+"\uFFFD/#305\uFFFD"+" for more information about the expected URL ";let wa;wa="Index URL";let Ua;Ua="PLAYER";let Va;Va="SEARCH";let ka;ka="Allow "+"\uFFFD#338\uFFFD"+"your users"+"\uFFFD/#338\uFFFD"+" to look up remote videos/actors that may not be federated with your platform";let za;za="Allow "+"\uFFFD#344\uFFFD"+"anonymous users"+"\uFFFD/#344\uFFFD"+" to look up remote videos/actors that may not be federated with your platform";let Xa;Xa="\u26A0\uFE0F This functionality depends heavily on the moderation of platforms followed by the search index you select";let Ba;Ba="Search index URL";let gi;gi=" Use "+"\uFFFD#357\uFFFD"+"your own search index"+"[\uFFFD/#357\uFFFD|\uFFFD/#358\uFFFD]"+" or choose the official one, "+"\uFFFD#358\uFFFD"+"https://sepiasearch.org"+"[\uFFFD/#357\uFFFD|\uFFFD/#358\uFFFD]"+", that is not moderated. ",gi=X(gi);let Wa;Wa="Otherwise, the local search will be used by default";let Ha;Ha="USER IMPORT/EXPORT";let ja;ja="Video quota is checked on import so the user doesn't upload a too big archive file";let Qa;Qa="Video quota (daily quota is not taken into account) is also checked for each video when PeerTube is processing the import";let Ja;Ja="Users can export their PeerTube data in a .zip for backup or re-import. Only one export at a time is allowed per user";let qa;qa="Max user video quota allowed to generate the export";let Ka;Ka="If the user decides to include the video files in the archive";let Ya;Ya="User export expiration";let Za;Za="The archive file is deleted after this period";let el;el="\u26A0\uFE0F You don't have any external auth plugin enabled";let tl;tl="\u26A0\uFE0F You have multiple external auth plugins enabled";let nl;return nl="Signup won't be limited to a fixed number of users",[Dt,Gt,ee,an,ln,_n,sn,dn,wt,mn,cn,B,ei,ti,ni,z,ea,ta,na,oa,ia,mi,ra,ci,aa,la,_a,sa,da,ma,ca,ua,pa,ga,ui,Ca,Ea,Na,Sa,fa,Ma,Ia,Aa,Ta,Oa,Pa,Ra,va,Fa,pi,ba,ha,ya,Da,Ga,La,$a,xa,wa,Ua,Va,ka,za,Xa,Ba,gi,Wa,Ha,ja,Qa,Ja,qa,Ka,Ya,Za,el,tl,nl,["title",t,3,"save","form","formErrors","validationMessages"],["id","admin-config-form",3,"formGroup"],[1,"pt-two-cols"],[1,"title-col"],[1,"content-col"],["formGroupName","instance",1,"form-group"],["id","instanceDefaultClientRouteLabel","for","instanceDefaultClientRoute"],["labelId","instanceDefaultClientRouteLabel","inputId","instanceDefaultClientRoute","formControlName","defaultClientRoute","inputType","text",3,"items","clearable"],["role","alert",1,"form-error"],["formGroupName","client"],["formGroupName","menu"],["formGroupName","login"],[1,"form-group"],["inputName","clientMenuLoginRedirectOnSingleExternalAuth","formControlName","redirectOnSingleExternalAuth","labelText",e],["ngProjectAs","description",5,["description"]],[1,"pt-two-cols","mt-4"],["formGroupName","client",1,"form-group"],["formGroupName","browseVideos"],["for","browseVideosDefaultSort"],["inputId","browseVideosDefaultSort","formControlName","defaultSort"],["for","browseVideosDefaultScope"],["inputId","browseVideosDefaultScope","formControlName","defaultScope"],["formGroupName","trending",1,"form-group"],["formGroupName","videos"],["formGroupName","algorithms"],["for","trendingVideosAlgorithmsDefault"],[1,"peertube-select-container"],["id","trendingVideosAlgorithmsDefault","formControlName","default",1,"form-control"],["value","hot"],["value","most-viewed"],["value","most-liked"],["value","views"],[1,"inner-form-description"],["formGroupName","broadcastMessage"],["inputName","broadcastMessageEnabled","formControlName","enabled","labelText",o],["inputName","broadcastMessageDismissable","formControlName","dismissable","labelText",_],["for","broadcastMessageLevel"],["id","broadcastMessageLevel","formControlName","level",1,"form-control"],["value","info"],["value","warning"],["value","error"],["for","broadcastMessageMessage"],["helpType","markdownText"],["inputId","broadcastMessageMessage","formControlName","message","markdownType","to-unsafe-html",3,"formError"],["formGroupName","signup"],["inputName","signupEnabled","formControlName","enabled","labelText",g],["type","primary",1,"d-block","mt-2"],["ngProjectAs","extra",5,["extra"]],["inputName","signupRequiresApproval","formControlName","requiresApproval","labelText",M,3,"ngClass"],["
1inputName","signupRequiresEmailVerification","formControlName","requiresEmailVerification","labelText",I,3,"ngClass"],[3,"ngClass"],["for","signupLimit"],[1,"small","muted","ms-1"],[1,"number-with-unit"],["type","number","min","-1","id","signupLimit","formControlName","limit",1,"form-control",3,"ngClass"],[1,"muted","small"],[1,"mt-3",3,"ngClass"],["for","signupMinimumAge"],["type","number","min","1","id","signupMinimumAge","formControlName","minimumAge",1,"form-control",3,"ngClass"],["formGroupName","user"],["id","userVideoQuotaLabel","for","userVideoQuota"],["labelId","userVideoQuotaLabel","inputId","userVideoQuota","formControlName","videoQuota","inputSuffix",P,"inputType","number",3,"items","clearable"],[1,"mt-2","d-block","small","muted",3,"videoQuota"],["id","userVideoQuotaDaily","for","userVideoQuotaDaily"],["labelId","userVideoQuotaDailyLabel","inputId","userVideoQuotaDaily","formControlName","videoQuotaDaily","inputSuffix",y,"inputType","number",3,"items","clearable"],["formGroupName","history"],["inputName","videosHistoryEnabled","formControlName","enabled","labelText",F],["formGroupName","import"],["for","importConcurrency"],["type","number","id","importConcurrency","formControlName","concurrency"],["formGroupName","http",1,"form-group"],["inputName","importVideosHttpEnabled","formControlName","enabled","labelText",h],["href","https://docs.joinpeertube.org/maintain/configuration#security",1,"link-primary"],["formGroupName","torrent",1,"form-group"],["inputName","importVideosTorrentEnabled","formControlName","enabled","labelText",J],["formGroupName","videoChannelSynchronization"],["inputName","importSynchronizationEnabled","formControlName","enabled","labelText",w],[3,"hidden"],["for","videoChannelSynchronizationMaxPerUser"],["type","number","min","1","id","videoChannelSynchronizationMaxPerUser","formControlName","maxPerUser",1,"form-control",3,"ngClass"],["formGroupName","autoBlacklist"],["formGroupName","ofUsers"],["inputName","autoBlacklistVideosOfUsersEnabled","formControlName","enabled","labelText",Z],["formGroupName","videoFile"],["formGroupName","update"],["inputName","videoFileUpdateEnabled","formControlName","enabled","labelText",oe],["formGroupName","storyboards"],["inputName","storyboardsEnabled","formControlName","enabled","labelText",be],["formGroupName","remoteRunners",1,"form-group",3,"ngClass"],["inputName","storyboardsRemoteRunnersEnabled","formControlName","enabled","labelText",ve],["routerLink","/admin/settings/system/runners/runners-list"],["formGroupName","videoTranscription"],["inputName","videoTranscriptionEnabled","formControlName","enabled","labelText",de],["href","https://docs.joinpeertube.org/admin/configuration#automatic-transcription","target","_blank"],["inputName","videoTranscriptionRemoteRunnersEnabled","formControlName","enabled","labelText",he],["formGroupName","defaults"],["formGroupName","publish"],["for","defaultsPublishPrivacy"],["inputId","defaultsPublishPrivacy","formControlName","privacy",3,"items"],["for","defaultsPublishLicence"],["inputId","defaultsPublishLicence","formControlName","licence","clearable","true",3,"items"],["for","defaultsPublishCommentsPolicy"],["inputId","defaultsPublishCommentsPolicy","formControlName","commentsPolicy",3,"items"],["for","defaultsDownloadPolicy"],["inputId","defaultsDownloadPolicy","formControlName","downloadPolicy",3,"items"],["formGroupName","videoChannels",1,"form-group"],["for","videoChannelsMaxPerUser"],["type","number","min","1","id","videoChannelsMaxPerUser","formControlName","maxPerUser",1,"form-control",3,"ngClass"],["routerLink","/admin/settings/follows",1,"link-primary"],["formGroupName","videoComments"],["inputName","videoCommentsAcceptRemoteComments","formControlName","acceptRemoteComments","labelText",Fe],["formGroupName","followers"],["formGroupName","channels"],["inputName","followersChannelsEnabled","formControlName","enabled","labelText",Me],["formGroupName","instance"],["inputName","followersInstanceEnabled","formControlName","enabled","labelText",ye],["inputName","followersInstanceManualApproval","formControlName","manualApproval","labelText",te],["formGroupName","followings"],["formGroupName","autoF
1ollowBack"],["inputName","followingsInstanceAutoFollowBackEnabled","formControlName","enabled","labelText",Ue],["formGroupName","autoFollowIndex"],["inputName","followingsInstanceAutoFollowIndexEnabled","formControlName","enabled","labelText",ie],["href","https://docs.joinpeertube.org/admin/following-instances#automatically-follow-other-instances","rel","noopener noreferrer","target","_blank",1,"link-primary"],["for","followingsInstanceAutoFollowIndexUrl"],["type","text","id","followingsInstanceAutoFollowIndexUrl","formControlName","indexUrl",1,"form-control",3,"ngClass"],["formGroupName","player"],["inputName","defaultsPlayerAutoplay","formControlName","autoPlay","labelText",je],["formGroupName","p2p"],["formGroupName","webapp",1,"form-group"],["inputName","defaultsP2PWebappEnabled","formControlName","enabled","labelText",re],["formGroupName","embed",1,"form-group"],["inputName","defaultsP2PEmbedEnabled","formControlName","enabled","labelText",Ze],["formGroupName","search"],["formGroupName","remoteUri"],["inputName","searchRemoteUriUsers","formControlName","users","labelText",et],["inputName","searchRemoteUriAnonymous","formControlName","anonymous","labelText",tt],["formGroupName","searchIndex"],["
1inputName","searchIndexEnabled","formControlName","enabled","labelText",nt],["for","searchIndexUrl"],[1,"form-group-description"],["target","_blank","href","https://framagit.org/framasoft/peertube/search-index",1,"link-primary"],["target","_blank","href","https://sepiasearch.org",1,"link-primary"],["type","text","id","searchIndexUrl","formControlName","url",1,"form-control",3,"ngClass"],[1,"mt-3"],["inputName","searchIndexDisableLocalSearch","formControlName","disableLocalSearch","labelText",ot,3,"ngClass"],["inputName","searchIndexIsDefaultSearch","formControlName","isDefaultSearch","labelText",it,3,"ngClass"],["formGroupName","users"],["inputName","importUsersEnabled","formControlName","enabled","labelText",rt],["formGroupName","export"],["inputName","exportUsersEnabled","formControlName","enabled","labelText",R],[1,"form-group",3,"ngClass"],["id","exportUsersMaxUserVideoQuota","for","exportUsersMaxUserVideoQuota"],[1,"ms-2","small","muted"],["labelId","exportUsersMaxUserVideoQuota","inputId","exportUsersMaxUserVideoQuota","formControlName","maxUserVideoQuota","inputSuffix",yt,"inputType","number",3,"items","clearable"],["for","exportUsersExportExpiration"],["inputId","exportUsersExportExpiration","formControlName","exportExpiration",3,"items"],[1,"mt-1","small","muted"]];},template:function(e,o){e&1&&(r(0,"my-admin-save-bar",78),T("save",function(){return o.save();}),i(),r(1,"form",79)(2,"div",80)(3,"div",81)(4,"h2"),l(5,0),i()(),r(6,"div",82)(7,"div",83)(8,"label",84),l(9,1),i(),m(10,"my-select-custom-value",85),c(11,Es,2,1,"div",86),i(),E(12,87)(13,88)(14,89),r(15,"div",90)(16,"my-peertube-checkbox",91),E(17,92),c(18,Ns,2,0,"span")(19,Ss,2,0,"span"),N(),i()(),N()()(),i()(),r(20,"div",93)(21,"div",81)(22,"h2"),l(23,2),i()(),r(24,"div",82)(25,"div",94),E(26,95),r(27,"div",90)(28,"label",96),l(29,3),i(),m(30,"my-select-videos-sort",97),c(31,fs,2,1,"div",86),i(),r(32,"div",90)(33,"label",98),l(34,4),i(),m(35,"my-select-videos-scope",99),c(36,Ms,2,1,"div",86),i(),N(),i(),r(37,"div",100),E(38,101)(39,102),r(40,"label",103),l(41,5),i(),r(42,"div",104)(43,"select",105)(44,"option",106),l(45,6),i(),r(46,"option",107),l(47,7),i(),r(48,"option",108),l(49,8),i(),r(50,"option",109),l(51,9),i()()(),c(52,Is,2,1,"div",86),N()(),i()()(),r(53,"div",93)(54,"div",81)(55,"h2"),l(56,10),i(),r(57,"div",110),l(58,11),i()(),r(59,"div",82),E(60,111),r(61,"div",90),m(62,"my-peertube-checkbox",112),i(),r(63,"div",90),m(64,"my-peertube-checkbox",113),i(),r(65,"div",90)(66,"label",114),l(67,12),i(),r(68,"div",104)(69,"select",115)(70,"option",116),l(71,13),i(),r(72,"option",117),l(73,14),i(),r(74,"option",118),l(75,15),i()()(),c(76,As,2,1,"div",86),i(),r(77,"div",90)(78,"label",119),l(79,16),i(),m(80,"my-help",120)(81,"my-markdown-textarea",121),c(82,Ts,2,1,"div",86),i(),N(),i()(),r(83,"div",93)(84,"div",81)(85,"h2"),l(86,17),i()(),r(87,"div",82),E(88,122),r(89,"div",90)(90,"my-peertube-checkbox",123),E(91,92),r(92,"span"),l(93,18),i(),c(94,Os,2,1,"my-alert",124),N(),E(95,125),r(96,"div",90),m(97,"my-peertube-checkbox",126),i(),r(98,"div",90),m(99,"my-peertube-checkbox",127),i(),r(100,"div",128)(101,"label",129),l(102,19),i(),r(103,"span",130),l(104,20),i(),r(105,"div",131),m(106,"input",132),r(107,"span"),l(108,21),i()(),c(109,Ps,2,1,"div",86),c(110,Rs,2,0,"small",133),i(),r(111,"div",134)(112,"label",135),l(113,22),i(),r(114,"div",131),m(115,"input",136),r(116,"span"),l(117,23),i()(),c(118,vs,2,1,"div",86),i(),N(),i()(),N(),E(119,137),r(120,"div",90)(121,"label",138),l(122,24),i(),m(123,"my-select-custom-value",139)(124,"my-user-real-quota-info",140),c(125,Fs,2,1,"div",86),i(),r(126,"div",90)(127,"label",141),l(128,25),i(),m(129,"my-select-custom-value",142),c(130,bs,2,1,"div",86),i(),r(131,"div",90),E(132,143)(133,101),m(134,"my-peertube-checkbox",144),N()(),i(),N(),i()(),r(135,"div",93)(136,"div",81)(137,"h2"),l(138,26),i()(),r(139,"div",82),E(140,145)(141,101),r(142,"div",90)(143,"label",146),l(144,27),i(),r(145,"span",130),l(146,28),i(),r(147,"div",131),m(148,"input",147),r(149,"span"),l(150,29),i()(),c(151,hs,2,1,"div",86),i(),r(152,"div",148)(153,"my-peertube-checkbox",149),E(154,92),r(155,"span"),V(156,30),m(157,"a",150),k(),i(),N(),i()(),r(158,"div",151)(159,"my-peertube-checkbox",152),E(160,92),r(161,"span"),l(162,31),i(),N(),i()(),N(),E(163,153),r(164,"div",90)(165,"my-peertube-checkbox",154),E(166,92),r(167,"span",155),l(168,32),i(),N(),i()(),r(169,"div",90)(170,"label",156),l(171,33),i(),r(172,"div",131),m(173,"input",157),r(174,"span"),l(1
175,34),i()(),c(176,ys,2,1,"div",86),i(),N()(),i()(),r(177,"div",93)(178,"div",81)(179,"h2"),l(180,35),i()(),r(181,"div",82),E(182,158)(183,101)(184,159),r(185,"div",90)(186,"my-peertube-checkbox",160),E(187,92),r(188,"span"),l(189,36),i(),N(),i()(),N()()(),E(190,161)(191,162),r(192,"div",90),m(193,"my-peertube-checkbox",163),i(),N()(),E(194,164),r(195,"div",90)(196,"my-peertube-checkbox",165),E(197,92),r(198,"span"),l(199,37),i(),N(),E(200,125),r(201,"div",166)(202,"my-peertube-checkbox",167),E(203,92),r(204,"div"),V(205,38),m(206,"a",168),k(),i(),r(207,"div"),l(208,39),i(),N(),i()(),N(),i()(),N(),E(209,169),r(210,"div",90)(211,"my-peertube-checkbox",170),E(212,92),r(213,"span"),V(214,40),m(215,"a",171),k(),i(),N(),E(216,125),r(217,"div",166)(218,"my-peertube-checkbox",172),E(219,92),r(220,"div"),V(221,41),m(222,"a",168),k(),i(),r(223,"div"),l(224,42),i(),N(),i()(),N(),i()(),N(),E(225,173)(226,174),r(227,"div",90)(228,"label",175),l(229,43),i(),m(230,"my-select-options",176),c(231,Ds,2,1,"div",86),i(),r(232,"div",90)(233,"label",177),l(234,44),i(),m(235,"my-select-options",178),c(236,Gs,2,1,"div",86),i(),r(237,"div",90)(238,"label",179),l(239,45),i(),m(240,"my-select-options",180),c(241,Ls,2,1,"div",86),i(),r(242,"div",90)(243,"label",181),l(244,46),i(),m(245,"my-select-options",182),c(246,$s,2,1,"div",86),i(),N()(),i()(),r(247,"div",93)(248,"div",81)(249,"h2"),l(250,47),i()(),r(251,"div",82)(252,"div",183)(253,"label",184),l(254,48),i(),r(255,"div",131),m(256,"input",185),r(257,"span"),l(258,49),i()(),c(259,xs,2,1,"div",86),i()()(),r(260,"div",93)(261,"div",81)(262,"h2"),l(263,50),i(),r(264,"div",110),V(265,51),m(266,"a",186),k(),i()(),r(267,"div",82),E(268,187),r(269,"div",90)(270,"my-peertube-checkbox",188),E(271,92),r(272,"span"),l(273,52),i(),N(),i()(),N(),E(274,189)(275,190),r(276,"div",90)(277,"my-peertube-checkbox",191),E(278,92),r(279,"span"),l(280,53),i(),N(),i()(),N(),E(281,192),r(282,"div",90)(283,"my-peertube-checkbox",193),E(284,92),r(285,"span"),l(286,54),i(),N(),i()(),r(287,"div",90),m(288,"my-peertube-checkbox",194),i(),N()(),E(289,195)(290,192)(291,196),r(292,"div",90)(293,"my-peertube-checkbox",197),E(294,92),r(295,"span"),l(296,55),i(),N(),i()(),N(),E(297,198),r(298,"div",90)(299,"my-peertube-checkbox",199),E(300,92),r(301,"div"),l(302,56),i(),r(303,"span"),V(304,57),m(305,"a",200),k(),i(),N(),E(306,125),r(307,"div",128)(308,"label",201),l(309,58),i(),m(310,"input",202),c(311,ws,2,1,"div",86),i(),N(),i()(),N()()(),i()(),r(312,"div",93)(313,"div",81)(314,"h2"),l(315,59),i()(),r(316,"div",82),E(317,173)(318,203),r(319,"div",90),m(320,"my-peertube-checkbox",204),i(),N(),E(321,205),r(322,"div",206),m(323,"my-peertube-checkbox",207),i(),r(324,"div",208),m(325,"my-peertube-checkbox",209),i(),N()(),i()(),r(326,"div",93)(327,"div",81)(328,"h2"),l(329,60),i()(),r(330,"div",82),E(331,210)(332,211),r(333,"div",90)(334,"my-peertube-checkbox",212),E(335,92),r(336,"span"),V(337,61),m(338,"strong"),k(),i(),N(),i()(),r(339,"div",90)(340,"my-peertube-checkbox",213),E(341,92),r(342,"span"),V(343,62),m(344,"strong"),k(),i(),N(),i()(),N(),E(345,214),r(346,"div",90)(347,"my-peertube-checkbox",215),E(348,92),r(349,"div"),l(350,63),i(),N(),E(351,125),r(352,"div",128)(353,"label",216),l(354,64),i(),r(355,"div",217),V(356,65),m(357,"a",218)(358,"a",219),k(),i(),m(359,"input",220),c(360,Us,2,1,"div",86),i(),r(361,"div",221),m(362,"my-peertube-checkbox",222),i(),r(363,"div",221)(364,"my-peertube-checkbox",223),E(365,92),r(366,"span"),l(367,66),i(),N(),i()(),N(),i()(),N()(),i()(),r(368,"div",93)(369,"div",81)(370,"h2"),l(371,67),i()(),r(372,"div",82),E(373,145)(374,224),r(375,"div",90)(376,"my-peertube-checkbox",225),E(377,92),r(378,"div"),l(379,68),i(),r(380,"div"),l(381,69),i(),N(),i()(),N()(),E(382,226)(383,224),r(384,"div",90)(385,"my-peertube-checkbox",227),E(386,92),r(387,"span"),l(388,70),i(),N(),E(389,125),r(390,"div",228)(391,"label",229),l(392,71),i(),r(393,"span",230),l(394,72),i(),m(395,"my-select-custom-value",231),c(396,Vs,2,1,"div",86),i(),r(397,"div",228)(398,"label",232),l(399,73),i(),m(400,"my-select-options",233),r(401,"div",234),l(402,74),i(),c(403,ks,2,1,"div",86),i(),N(),i()(),N()(),i()()()),e&2&&(d("form",o.form)("formErrors",o.formErrors)("validationMessages",o.validationMessages),a(),d("formGroup",o.form),a(9),d("items",o.defaultLandingPageOptions)("clearable",!1),a(),u(o.formErrors.instance.defaultClientRoute?11:-1),a(7),u(o.countExternalAuth()===0?18:o.countExternalAuth()>1?19:-1),a(13),u(o.formErrors.client.browseVideos.defaultSort?31:-1),a(5),u(o.formErrors.client.browseVideos.defaultScope?36:-1),a(16),u(o.formErrors.trending.videos.algorithms.default?52:-1),a(24),u(o.formErrors.broadcastMessage.level?76:-1),a(5),d("formError",o.formErrors.broadcastMessage.message),a(),u(o.formErrors.broadcastMessage.message?82:-1),a(12),u(o.signupAlertMessage?94:-1),a(3),d("ngClass",o.getDisabledSignupClass()),a(2),d("ngClass",o.getDisabledSignupClass()),a(),d("ngClass",o.getDisabledSignupClass()),a(6),d("ngClass",x(66,lo,o.formErrors.signup.limit)),a(2),L(o.form.value.signup.limit),$(108),a(),u(o.formErrors.signup.limit?109:-1),a(),u(o.hasUnlimitedSignup()?110:-1),a(),d("ngClass",o.getDisabledSignupClass()),a(4),d("ngClass",x(68,lo,o.formErrors.signup.minimumAge)),a(2),L(o.form.value.signup.minimumAge),$(117),a(),u(o.formErrors.signup.minimumAge?118:-1),a(5),d("items",o.getVideoQuotaOptions())("clearable",!1),a(),d("videoQuota",o.getUserVideoQuota()),a(),u(o.formErrors.user.videoQuota?125:-1),a(4),d("items",o.getVideoQuotaDailyOptions())("clearable",!1),a(),u(o.formErrors.user.videoQuotaDaily?130:-1),a(21
1),u(o.formErrors.import.videos.concurrency?151:-1),a(16),d("hidden",o.isImportVideosHttpEnabled()),a(6),d("ngClass",x(70,lo,o.formErrors.import.videoChannelSynchronization.maxPerUser)),a(2),L(o.form.value.import.videoChannelSynchronization.maxPerUser),$(175),a(),u(o.formErrors.import.videoChannelSynchronization.maxPerUser?176:-1),a(25),d("ngClass",o.getStoryboardRunnerDisabledClass()),a(16),d("ngClass",o.getTranscriptionRunnerDisabledClass()),a(13),d("items",o.privacyOptions),a(),u(o.formErrors.defaults.publish.privacy?231:-1),a(4),d("items",o.licenceOptions),a(),u(o.formErrors.defaults.publish.licence?236:-1),a(4),d("items",o.commentPoliciesOptions),a(),u(o.formErrors.defaults.publish.commentsPolicy?241:-1),a(4),d("items",o.downloadPoliciesOptions),a(),u(o.formErrors.defaults.publish.downloadPolicy?246:-1),a(10),d("ngClass",x(72,lo,o.formErrors.videoChannels.maxPerUser)),a(2),L(o.form.value.videoChannels.maxPerUser),$(258),a(),u(o.formErrors.videoChannels.maxPerUser?259:-1),a(48),d("ngClass",x(74,Cs,!o.isAutoFollowIndexEnabled())),a(3),d("ngClass",x(76,lo,o.formErrors.followings.instance.autoFollowIndex.indexUrl)),a(),u(o.formErrors.followings.instance.autoFollowIndex.indexUrl?311:-1),a(41),d("ngClass",o.getDisabledSearchIndexClass()),a(7),d("ngClass",x(78,lo,o.formErrors.search.searchIndex.url)),a(),u(o.formErrors.search.searchIndex.url?360:-1),a(2),d("ngClass",o.getDisabledSearchIndexClass()),a(2),d("ngClass",o.getDisabledSearchIndexClass()),a(26),d("ngClass",o.getDisabledExportUsersClass()),a(5),d("items",o.exportMaxUserVideoQuotaOptions)("clearable",!1),a(),u(o.formErrors.export.users.maxUserVideoQuota?396:-1),a(),d("ngClass",o.getDisabledExportUsersClass()),a(3),d("items",o.exportExpirationOptions),a(3),u(o.formErrors.export.users.exportExpiration?403:-1));},dependencies:[Le,Ce,ae,Ne,Xt,Bt,De,Bn,zt,se,Ee,fl,Re,Pe,Ge,vt,Oe,At,Je,jn,Yn,Fn,It,st,Ke,c_,m_],styles:["form[_ngcontent-%COMP%]{padding-bottom:1.5rem}my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:500px}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:100%}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]     textarea{height:300px!important}input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:340px;max-width:340px;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}input[type=text][_ngcontent-%COMP%]::placeholder, input[type=number][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%], input[type=number][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible, input[type=number][_ngcontent-%COMP%]:focus, input[type=number][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%], input[type=number][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:380px){input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{width:100%}}.peertube-select-container[_ngcontent-%COMP%]{width:340px}@media screen and (max-width:370px){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){display:block;width:340px}@media screen and (max-width:370px){my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){width:100%}}my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{display:block;width:480px}@media screen and (max-width:510px){my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{width:100%}}.inner-form-description[_ngcontent-%COMP%]{font-size:14px;margin-bottom:1rem;color:var(--fg-300)}textarea[_ngcontent-%COMP%]{max-width:100%;display:block;font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:500px;max-width:500px;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}textarea[_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}textarea[readonly][_ngcontent-%COMP%]{color:var(--fg-300)}textarea[_ngcontent-%COMP%]:focus, textarea[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}textarea[disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:540px){textarea[_ngcontent-%COMP%]{width:100%}}textarea[_ngcontent-%COMP%]{color:var(--textarea-fg)!important;background-color:var(--textarea-bg)!important;height:150px;padding:var(--textarea-y-padding) var(--textarea-x-padding)}textarea.small[_ngcontent-%COMP%]{height:75px}.disabled-checkbox-extra[_ngcontent-%COMP%], .disabled-checkbox-extra[_ngcontent-%COMP%]     label{opacity:.5;pointer-events:none}my-actor-banner-edit[_ngcontent-%COMP%]{max-width:500px}h4[_ngcontent-%COMP%]{font-weight:700;margin-bottom:.5rem;font-size:1rem}"]}));var Yi=_o;function zs(n,t){n&1&&(yn(0,"br"),En(1),V(2,1),yn(3,"a",4),k(),Nn());}var so=class so{supportRelMe=ce(!1,{transform:Mi});};S(so,"\u0275fac",function(e){return new(e||so)();}),S(so,"\u0275cmp",O({type:so,selectors:[["my-custom-markup-help"]],inputs:{supportRelMe:[1,"supportRelMe"]},decls:5,vars:1,consts:()=>{let t;t=""+"\uFFFD#2\uFFFD"+"Markdown compatible"+"[\uFFFD/#2\uFFFD|\uFFFD/#3\uFFFD]"+" that also supports "+"\uFFFD#3\uFFFD"+"custom PeerTube HTML tags"+"[\uFFFD/#2\uFFFD|\uFFFD/#3\uFFFD]"+".\n",t=X(t);let e;return e=""+"\uFFFD#3\uFFFD"+"Mastodon verification link"+"\uFFFD/#3\uFFFD"+" is also supported. ",[t,e,["href","https://en.wikipedia.org/wiki/Markdown#Example","target","_blank","rel","noreferrer noopener",1,"text-decoration-underline"],["href","https://docs.joinpeertube.org/api/custom-client-markup","target","_blank","rel","noreferrer noopener",1,"text-decoration-underline"],["href","https://docs.joinmastodon.org/user/profile/#verification","target","_blank","rel","noopener noreferrer"]];},template:function(e,o){e&1&&(En(0),V(1,0),yn(2,"a",2)(3,"a",3),k(),Nn(),c(4,zs,4,0)),e&2&&(a(4),u(o.supportRelMe()?4:-1));},encapsulation:2}));var mo=so;function Xs(n,t){if(n&1&&(r(0,"div",10),C(1),i()),n&2){let e=s();a(),f(e.formErrors.homepageContent);}}var co=class co{formReactiveService=p(Se);notifier=p(K);route=p($e);customMarkup=p(eo);customPage=p(to);form;formErrors={};validationMessages={};ngOnInit(){this.buildForm();}canDeactivate(){return{canDeactivate:!this.form.dirty};}getCustomMarkdownRenderer(){return this.customMarkup.getCustomMarkdownRenderer();}save(){this.customPage.updateInstanceHomepage(this.form.value.homepageContent).subscribe({next:()=>{this.form.markAsPristine(),this.notifier.success("Homepage updated.");},error:t=>this.notifier.handleError(t)});}buildForm(){let t={homepageContent:null},{form:e,formErrors:o,validationMessages:_}=this.formReactiveService.buildForm(t,{homepageContent:this.route.
1snapshot.data.homepageContent});this.form=e,this.formErrors=o,this.validationMessages=_;}};S(co,"\u0275fac",function(e){return new(e||co)();}),S(co,"\u0275cmp",O({type:co,selectors:[["my-admin-config-homepage"]],decls:13,vars:8,consts:()=>{let t;t="Edit your homepage";let e;e="HOMEPAGE";let o;return o="Homepage content",[e,o,["title",t,3,"save","form","formErrors","validationMessages"],["id","admin-config-form",1,"homepage","pt-two-cols",3,"formGroup"],[1,"title-col"],[1,"content-col"],[1,"form-group"],["for","homepageContent"],[1,"form-group-description"],["inputId","homepageContent","formControlName","homepageContent","dir","ltr","monospace","true",3,"customMarkdownRenderer","debounceTime","formError"],["role","alert",1,"form-error"]];},template:function(e,o){e&1&&(r(0,"my-admin-save-bar",2),T("save",function(){return o.save();}),i(),r(1,"form",3)(2,"div",4)(3,"h2"),l(4,0),i()(),r(5,"div",5)(6,"div",6)(7,"label",7),l(8,1),i(),r(9,"div",8),m(10,"my-custom-markup-help"),i(),m(11,"my-markdown-textarea",9),c(12,Xs,2,1,"div",10),i()()()),e&2&&(d("form",o.form)("formErrors",o.formErrors)("validationMessages",o.validationMessages),a(),d("formGroup",o.form),a(10),d("customMarkdownRenderer",o.getCustomMarkdownRenderer())("debounceTime",500)("formError",o.formErrors.homepageContent),a(),u(o.formErrors.homepageContent?12:-1));},dependencies:[ae,Ne,se,Ee,Re,Pe,Ge,mo,Yn,Ke],styles:["form[_ngcontent-%COMP%]{padding-bottom:1.5rem}my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:500px}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:100%}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]     textarea{height:300px!important}input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:340px;max-width:340px;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}input[type=text][_ngcontent-%COMP%]::placeholder, input[type=number][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%], input[type=number][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible, input[type=number][_ngcontent-%COMP%]:focus, input[type=number][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%], input[type=number][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:380px){input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{width:100%}}.peertube-select-container[_ngcontent-%COMP%]{width:340px}@media screen and (max-width:370px){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){display:block;width:340px}@media screen and (max-width:370px){my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){width:100%}}my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{display:block;width:480px}@media screen and (max-width:510px){my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{width:100%}}.inner-form-description[_ngcontent-%COMP%]{font-size:14px;margin-bottom:1rem;color:var(--fg-300)}textarea[_ngcontent-%COMP%]{max-width:100%;display:block;font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:500px;max-width:500px;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}textarea[_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}textarea[readonly][_ngcontent-%COMP%]{color:var(--fg-300)}textarea[_ngcontent-%COMP%]:focus, textarea[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}textarea[disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:540px){textarea[_ngcontent-%COMP%]{width:100%}}textarea[_ngcontent-%COMP%]{color:var(--textarea-fg)!important;background-color:var(--textarea-bg)!important;height:150px;padding:var(--textarea-y-padding) var(--textarea-x-padding)}textarea.small[_ngcontent-%COMP%]{height:75px}.disabled-checkbox-extra[_ngcontent-%COMP%], .disabled-checkbox-extra[_ngcontent-%COMP%]     label{opacity:.5;pointer-events:none}my-actor-banner-edit[_ngcontent-%COMP%]{max-width:500px}h4[_ngcontent-%COMP%]{font-weight:700;margin-bottom:.5rem;font-size:1rem}"]}));var Zi=co;var bn=n=>
1({"input-error":n});function Bs(n,t){if(n&1&&(r(0,"div",50),C(1),i()),n&2){let e=s();a(),f(e.formErrors.admin.email);}}function Ws(n,t){if(n&1&&(r(0,"div",50),C(1),i()),n&2){let e=s();a(),f(e.formErrors.instance.name);}}function Hs(n,t){if(n&1&&(r(0,"div",50),C(1),i()),n&2){let e=s();a(),f(e.formErrors.instance.shortDescription);}}function js(n,t){if(n&1&&(r(0,"div",50),C(1),i()),n&2){let e=s();a(),f(e.formErrors.instance.serverCountry);}}function Qs(n,t){if(n&1&&(r(0,"div",50),C(1),i()),n&2){let e=s();a(),f(e.formErrors.instance.social.externalLink);}}function Js(n,t){if(n&1&&(r(0,"div",50),C(1),i()),n&2){let e=s();a(),f(e.formErrors.instance.social.mastodonLink);}}function qs(n,t){if(n&1&&(r(0,"div",50),C(1),i()),n&2){let e=s();a(),f(e.formErrors.instance.social.xLink);}}function Ks(n,t){if(n&1&&(r(0,"div",50),C(1),i()),n&2){let e=s();a(),f(e.formErrors.instance.social.blueskyLink);}}function Ys(n,t){n&1&&(E(0),l(1,40),N());}function Zs(n,t){n&1&&(E(0),V(1,41),m(2,"br"),k(),N());}function ed(n,t){if(n&1&&(r(0,"div",50),C(1),i()),n&2){let e=s();a(),f(e.formErrors.instance.defaultNSFWPolicy);}}var uo=class uo{customMarkup=p(eo);server=p(j);route=p($e);formReactiveService=p(Se);adminConfigService=p(we);form;formErrors={};validationMessages={};languageItems=[];categoryItems=[];instanceBannerUrl;instanceAvatars=[];nsfwItems=[{id:"do_not_list",label:"Hide"},{id:"warn",label:"Warn"},{id:"blur",label:"Blur"},{id:"display",label:"Display"}];defaultLanguageItems=[];customConfig;customConfigSub;get instanceName(){return this.server.getHTMLConfig().instance.name;}ngOnInit(){this.customConfig=this.route.parent.snapshot.data.customConfig;let t=this.route.snapshot.data;this.languageItems=t.languages.map(e=>({label:e.label,id:e.id})),this.categoryItems=t.categories.map(e=>({label:e.label,id:e.id})),this.defaultLanguageItems=Object.entries(vl).map(([e,o])=>({label:o,id:e})),this.buildForm(),this.customConfigSub=this.adminConfigService.getCustomConfigReloadedObs().subscribe(e=>{this.customConfig=e,this.form.patchValue(this.customConfig);});}ngOnDestroy(){this.customConfigSub&&this.customConfigSub.unsubscribe();}buildForm(){let t={admin:{email:Kl},contactForm:{enabled:null},instance:{name:Hl,shortDescription:jl,description:null,isNSFW:null,defaultNSFWPolicy:null,terms:null,codeOfConduct:null,creationReason:null,moderationInformation:null,administrator:null,maintenanceLifetime:null,businessModel:null,hardwareInformation:null,defaultLanguage:null,categories:null,languages:null,serverCountry:null,support:{text:null},social:{externalLink:On,mastodonLink:On,blueskyLink:On,xLink:On}}},e=_i(this.customConfig,{instance:{defaultLanguage:Fl(this.customConfig.instance.defaultLanguage)}}),{form:o,formErrors:_,validationMessages:g}=this.formReactiveService.buildForm(t,e);this.form=o,this.formErrors=_,this.validationMessages=g;}canDeactivate(){return{canDeactivate:!this.form.dirty};}getCustomMarkdownRenderer(){return this.customMarkup.getCustomMarkdownRenderer();}save(){this.adminConfigService.saveAndUpdateCurrent({currentConfig:this.customConfig,form:this.form,formConfig:this.form.value,success:"Information updated."});}};S(uo,"\u0275fac",function(e){return new(e||uo)();}),S(uo,"\u0275cmp",O({type:uo,selectors:[["my-admin-config-information"]],decls:177,vars:55,consts:()=>{let t;t="Platform information";let e;e="Enable contact form";let o;o="Add a new category";let _;_="Add a new language";let g;g="Policy on videos containing sensitive content";let M;M="ADMINISTRATORS";let I;I="Admin email";let P;P="PLATFORM";let y;y="Name";let F;F="Short description";let h;h="Description";let J;J="Default language";let w;w="Default language used for users, in emails for example.";let Z;Z="The web interface still uses the web browser preferred language if not overridden by user preference";let oe;oe="Main instance categories";let be;be="Main languages you/your moderators speak";let ve;ve="Server country";let de;de="PeerTube uses this setting to explain to your users which law they must follow in the \"About\" pages";let he;he="SOCIAL";let Fe;Fe=" Social links and support information displayed in the "+"\uFFFD#69\uFFFD"+"About"+"\uFFFD/#69\uFFFD"+" pages ";let Me;Me="Support text";let ye;ye="Explain to your users how to support your platform. If set, PeerTube will display a \"Support\" button in \"About\" instance pages";let te;te="External link";let Ue;Ue="Link to your main website";let ie;ie="Mastodon link";let je;je="X link";let re;re="Bluesky link";let Ze;Ze="MODERATION & SENSITIVE CONTENT";let et;et=" Manage "+"\uFFFD#107\uFFFD"+"users"+"\uFFFD/#107\uFFFD"+" to build a moderation team. ";let tt;tt="Terms";let nt;nt="Code of conduct";let ot;ot="Moderation information";let it;it="Who moderates the instance? What is the policy regarding sensitive content? Political videos? etc";let rt;rt="YOU AND YOUR PLATFORM";let R;R="Who is behind the instance?";let yt;yt="A single person? A non-profit? A company?";let Dt;Dt="Why did you create this instance?";let Gt;Gt="To share your personal videos? To open registrations and allow people to upload what they want?";let ee;ee="How long do you plan to maintain this instance?";let an;an="It's important to know for users who want to register on your instance";let ln;ln="How will you finance the PeerTube server?";let _n;_n="With your own funds? With user donations? Advertising?";let sn;sn="OTHER INFORMATION";let dn;dn="What server/hardware does the instance run on?";let wt;wt="i.e. 2vCore 2GB RAM, a direct the link to the server you rent, etc.";let mn;mn="This instance is dedicated to sensitive content";let cn;return cn=" Enabling it will allow other administrators to know that you are mainly federating sensitive content."+"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"+" Moreover, the \"sensitive content\" checkbox on video upload will be automatically checked by default. ",[M,I,P,y,F,h,J,w,Z,oe,be,ve,de,he,Fe,Me,ye,te,Ue,ie,je,re,Ze,et,tt,nt,ot,it,rt,R,yt,Dt,Gt,ee,an,ln,_n,sn,dn,wt,mn,cn,["t
1itle",t,3,"save","form","formErrors","validationMessages"],["id","admin-config-form",3,"formGroup"],[1,"pt-two-cols","mt-4"],[1,"title-col"],[1,"content-col"],["formGroupName","admin",1,"form-group"],["for","adminEmail"],["type","text","id","adminEmail","formControlName","email",1,"form-control",3,"ngClass"],["role","alert",1,"form-error"],["formGroupName","contactForm",1,"form-group"],["inputName","enableContactForm","formControlName","enabled","labelText",e],["formGroupName","instance"],[1,"pt-two-cols"],[1,"form-group"],["for","instanceName"],["type","text","id","instanceName","formControlName","name",1,"form-control",3,"ngClass"],["for","instanceShortDescription"],["id","instanceShortDescription","formControlName","shortDescription",1,"form-control","small",3,"ngClass"],["for","instanceDescription"],[1,"form-group-description"],["supportRelMe","true"],["inputId","instanceDescription","formControlName","description",3,"customMarkdownRenderer","debounceTime","formError"],["for","instanceDefaultLanguage"],["inputId","instanceDefaultLanguage","formControlName","defaultLanguage",3,"items"],["for","instanceCategories"],["inputId","instanceCategories","formControlName","categories","placeholder",o,3,"availableItems","selectableGroup"],["for","instanceLanguages"],["inputId","instanceLanguages","formControlName","languages","placeholder",_,3,"availableItems","selectableGroup"],["for","instanceServerCountry"],["type","text","id","instanceServerCountry","formControlName","serverCountry",1,"form-control",3,"ngClass"],[1,"inner-form-description"],["formGroupName","support",1,"form-group"],["for","instanceSupportText"],["helpType","markdownText"],["inputId","instanceSupportText","formControlName","text","markdownType","enhanced",3,"formError"],["formGroupName","social"],["for","instanceSocialExternalLink"],["type","text","id","instanceSocialExternalLink","formControlName","externalLink",1,"form-control",3,"ngClass"],["for","instanceSocialMastodonLink"],["type","text","id","instanceSocialMastodonLink","formControlName","mastodonLink",1,"form-control",3,"ngClass"],["for","instanceSocialXLink"],["type","text","id","instanceSocialXLink","formControlName","xLink",1,"form-control",3,"ngClass"],["for","instanceSocialBlueskyLink"],["type","text","id","instanceSocialBlueskyLink","formControlName","blueskyLink",1,"form-control",3,"ngClass"],["routerLink","/admin/overview/users",1,"link-primary"],["inputName","instanceIsNSFW","formControlName","isNSFW"],["ptTemplate","label"],["ptTemplate","help"],["inputId","instanceDefaultNSFWPolicy","isGroup","true","label",g,"formControlName","defaultNSFWPolicy",3,"items"],["for","instanceTerms"],["inputId","instanceTerms","formControlName","terms","markdownType","enhanced",3,"formError"],["for","instanceCodeOfConduct"],["inputId","instanceCodeOfConduct","formControlName","codeOfConduct","markdownType","enhanced",3,"formError"],["for","instanceModerationInformation"],["inputId","instanceModerationInformation","formControlName","moderationInformation","markdownType","enhanced",3,"formError"],["for","instanceAdministrator"],["inputId","instanceAdministrator","formControlName","administrator","markdownType","enhanced",3,"formError"],["for","instanceCreationReason"],["inputId","instanceCreationReason","formControlName","creationReason","markdownType","enhanced",3,"formError"],["for","instanceMaintenanceLifetime"],["inputId","instanceMaintenanceLifetime","formControlName","maintenanceLifetime","markdownType","enhanced",3,"formError"],["for","instanceBusinessModel"],["inputId","instanceBusinessModel","formControlName","businessModel","markdownType","enhanced",3,"formError"],["for","instanceHardwareInformation"],["inputId","instanceHardwareInformation","formControlName","hardwareInformation","markdownType","enhanced",3,"formError"]];},template:function(e,o){e&1&&(r(0,"my-admin-save-bar",42),T("save",function(){return o.save();}),i(),r(1,"form",43)(2,"div",44)(3,"div",45)(4,"h2"),l(5,0),i()(),r(6,"div",46)(7,"div",47)(8,"label",48),l(9,1),i(),m(10,"input",49),c(11,Bs,2,1,"div",50),i(),r(12,"div",51),m(13,"my-peertube-checkbox",52),i()()(),E(14,53),r(15,"div",54)(16,"div",45)(17,"h2"),l(18,2),i()(),r(19,"div",46)(20,"div",55)(21,"label",56),l(22,3),i(),m(23,"input",57),c(24,Ws,2,1,"div",50),i(),r(25,"div",55)(26,"label",58),l(27,4),i(),m(28,"textarea",59),c(29,Hs,2,1,"div",50),i(),r(30,"div",55)(31,"label",60),l(32,5),i(),r(33,"div",61),m(34,"my-custom-markup-help",62),i(),m(35,"my-markdown-textarea",63),i(),r(36,"div",55)(37,"label",64),l(38,6),i(),r(39,"div",61)(40,"div"),l(41,7),i(),r(42,"div"),l(43,8),i()(),r(44,"div"),m(45,"my-select-options",65),i()(),r(46,"div",55)(47,"label",66),l(48,9),i(),r(49,"div"),m(50,"my-select-checkbox",67),i()(),r(51,"div",55)(52,"label",68),l(53,10),i(),r(54,"div"),m(55,"my-select-checkbox",69),i()(),r(56,"div",55)(57,"label",70),l(58,11),i(),r(59,"div",61),l(60,12),i(),m(61,"input",71),c(62,js,2,1,"div",50),i()()(),r(63,"div",44)(64,"div",45)(65,"h2"),l(66,13),i(),r(67,"div",72),V(68,14),m(69,"em"),k(),i()(),r(70,"div",46)(71,"div",73)(72,"label",74),l(73,15),i(),m(74,"my-help",75),r(75,"div",61),l(76,16),i(),m(77,"my-markdown-textarea",76),i(),E(78,77),r(79,"div",55)(80,"label",78),l(81,17),i(),r(82,"div",61),l(83,18),i(),m(84,"input",79),c(85,Qs,2,1,"div",50),i(),r(86,"div",55)(87,"label",80),l(88,19),i(),m(89,"input",81),c(90,Js,2,1,"div",50),i(),r(91,"div",55)(92,"label",82),l(93,20),i(),m(94,"input",83),c(95,qs,2,1,"div",50),i(),r(96,"div",55)(97,"label",84),l(98,21),i(),m(99,"input",85),c(100,Ks,2,1,"div",50),i(),N(),i()(),r(101,"div",44)(102,"div",45)(103,"h2"),l(104,22),i(),r(105,"div",72),V(106,23),m(107,"a",86),k(),i()(),r(108,"div",46)(109,"div",55)(110,"my-peertube-checkbox",87),U(111,Ys,2,0,"ng-template",88)(112,Zs,3,0,"ng-template",89),i()(),r(113,"div",55),m(114,"my-select-radio",90),c(115,ed,2,1,"div",50),i(),r(116,"div",55)(117,"label",91),l(118,24),i(),m(119,"my-help",75)(120,"my-markdown-textarea",92),i(),r(121,"div",55)(122,"label",93),l(123,25),i(),m(124,"my-help",75)(125,"my-markdown-textarea",94),i(),r(126,"div",55)(127,"label",95),l(128,26),i(),m(129,"my-help",75),r(130,"div",61),l(131,27),i(),m(132,"my-markdown-textarea",96),i()()(),r(133,"div",44)(134,"div",45)(135,"h2"),l(136,28),i()(),r(137,"div",46)(138,"div",55)(139,"label",97),l(140,29),i(),m(141,"my-help",75),r(142,"div",61),l(143,30),i(),m(144,"my-markdown-textarea",98),i(),r(145,"div",55)(146,"label",99),l(147,31),i(),m(148,"my-help",75),r(149,"div",61),l(150,32),i(),m(151,"my-markdown-textarea",100),i(),r(152,"div",55)(153,"label",101),l(154,33),i(),m(155,"my-help",75),r(156,"div",61),l(157,34),i(),m(158,"my-markdown-textarea",102),i(),r(159,"div",55)(160,"label",103),l(161,35),i(),m(162,"my-help",75),r(163,"div",61),l(164,36),i(),m(165,"my-markdown-textarea",104),i()()(),r(166,"div",44)(167,"div",45)(168,"h2"),l(169,37),i()(),r(170,"div",46)(171,"div",55)(172,"label",105),l(173,38),i(),r(174,"div",61),l(175,39),i(),m(1
176,"my-markdown-textarea",106),i()()(),N(),i()),e&2&&(d("form",o.form)("formErrors",o.formErrors)("validationMessages",o.validationMessages),a(),d("formGroup",o.form),a(9),d("ngClass",x(39,bn,o.formErrors.admin.email)),a(),u(o.formErrors.admin.email?11:-1),a(12),d("ngClass",x(41,bn,o.formErrors.instance.name)),a(),u(o.formErrors.instance.name?24:-1),a(4),d("ngClass",x(43,bn,o.formErrors.instance.shortDescription)),a(),u(o.formErrors.instance.shortDescription?29:-1),a(6),d("customMarkdownRenderer",o.getCustomMarkdownRenderer())("debounceTime",500)("formError",o.formErrors.instance.description),a(10),d("items",o.defaultLanguageItems),a(5),d("availableItems",o.categoryItems)("selectableGroup",!1),a(5),d("availableItems",o.languageItems)("selectableGroup",!1),a(6),d("ngClass",x(45,bn,o.formErrors.instance.serverCountry)),a(),u(o.formErrors.instance.serverCountry?62:-1),a(15),d("formError",o.formErrors.instance.support.text),a(7),d("ngClass",x(47,bn,o.formErrors.instance.social.externalLink)),a(),u(o.formErrors.instance.social.externalLink?85:-1),a(4),d("ngClass",x(49,bn,o.formErrors.instance.social.mastodonLink)),a(),u(o.formErrors.instance.social.mastodonLink?90:-1),a(4),d("ngClass",x(51,bn,o.formErrors.instance.social.xLink)),a(),u(o.formErrors.instance.social.xLink?95:-1),a(4),d("ngClass",x(53,bn,o.formErrors.instance.social.blueskyLink)),a(),u(o.formErrors.instance.social.blueskyLink?100:-1),a(14),d("items",o.nsfwItems),a(),u(o.formErrors.instance.defaultNSFWPolicy?115:-1),a(5),d("formError",o.formErrors.instance.terms),a(5),d("formError",o.formErrors.instance.codeOfConduct),a(7),d("formError",o.formErrors.instance.moderationInformation),a(12),d("formError",o.formErrors.instance.administrator),a(7),d("formError",o.formErrors.instance.creationReason),a(7),d("formError",o.formErrors.instance.maintenanceLifetime),a(7),d("formError",o.formErrors.instance.businessModel),a(11),d("formError",o.formErrors.instance.hardwareInformation));},dependencies:[ae,Ne,De,se,Ee,Re,Pe,Ge,vt,Bl,Le,Ce,mo,Yn,Xl,Oe,Je,Qn,jn,Ke,It],styles:["form[_ngcontent-%COMP%]{padding-bottom:1.5rem}my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:500px}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:100%}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]     textarea{height:300px!important}input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:340px;max-width:340px;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}input[type=text][_ngcontent-%COMP%]::placeholder, input[type=number][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%], input[type=number][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible, input[type=number][_ngcontent-%COMP%]:focus, input[type=number][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%], input[type=number][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:380px){input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{width:100%}}.peertube-select-container[_ngcontent-%COMP%]{width:340px}@media screen and (max-width:370px){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){display:block;width:340px}@media screen and (max-width:370px){my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player
1-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){width:100%}}my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{display:block;width:480px}@media screen and (max-width:510px){my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{width:100%}}.inner-form-description[_ngcontent-%COMP%]{font-size:14px;margin-bottom:1rem;color:var(--fg-300)}textarea[_ngcontent-%COMP%]{max-width:100%;display:block;font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:500px;max-width:500px;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}textarea[_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}textarea[readonly][_ngcontent-%COMP%]{color:var(--fg-300)}textarea[_ngcontent-%COMP%]:focus, textarea[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}textarea[disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:540px){textarea[_ngcontent-%COMP%]{width:100%}}textarea[_ngcontent-%COMP%]{color:var(--textarea-fg)!important;background-color:var(--textarea-bg)!important;height:150px;padding:var(--textarea-y-padding) var(--textarea-x-padding)}textarea.small[_ngcontent-%COMP%]{height:75px}.disabled-checkbox-extra[_ngcontent-%COMP%], .disabled-checkbox-extra[_ngcontent-%COMP%]     label{opacity:.5;pointer-events:none}my-actor-banner-edit[_ngcontent-%COMP%]{max-width:500px}h4[_ngcontent-%COMP%]{font-weight:700;margin-bottom:.5rem;font-size:1rem}"]}));var er=uo;function td(n,t){n&1&&(E(0),l(1,27),N());}function nd(n,t){if(n&1&&(r(0,"div",50),C(1),i()),n&2){let e=s();a(),f(e.formErrors.live.dvr.maxWindow);}}function od(n,t){if(n&1&&(r(0,"div",50),C(1),i()),n&2){let e=s();a(),f(e.formErrors.live.maxInstanceLives);}}function id(n,t){if(n&1&&(r(0,"div",50),C(1),i()),n&2){let e=s();a(),f(e.formErrors.live.maxUserLives);}}function rd(n,t){if(n&1&&(r(0,"div",50),C(1),i()),n&2){let e=s();a(),f(e.formErrors.live.maxDuration);}}function ad(n,t){n&1&&(E(0),l(1,28),N());}function ld(n,t){if(n&1&&(r(0,"div",50),C(1),i()),n&2){let e=s();a(),f(e.formErrors.live.transcoding.fps.max);}}function _d(n,t){if(n&1&&m(0,"div",85),n&2){let e=s(2).$implicit;d("innerHTML",e.description,Yt);}}function sd(n,t){n&1&&U(0,_d,1,1,"ng-template",84);}function dd(n,t){if(n&1&&(r(0,"div",72)(1,"my-peertube-checkbox",83),c(2,sd,1,0,null,84),i()()),n&2){let e=t.$implicit,o=s();a(),d("labelText",Vt(e.label))("inputName",o.getResolutionKey(e.id))("formControlName",e.id),a(),u(e.description?2:-1);}}function md(n,t){if(n&1&&(E(0),l(1,29),N()),n&2){let e=s();a(),L(e.getTotalTranscodingThreads().value)(e.getTotalTranscodingThreads().unit),$(1);}}function cd(n,t){if(n&1&&(E(0),l(1,30),N()),n&2){let e=s();a(),L(e.getTotalTranscodingThreads().value)(e.getTotalTranscodingThreads().unit),$(1);}}function ud(n,t){if(n&1&&(r(0,"div",50),C(1),i()),n&2){let e=s();a(),f(e.formErrors.live.transcoding.threads);}}function pd(n,t){if(n&1&&(r(0,"div",50),C(1),i()),n&2){let e=s();a(),f(e.formErrors.live.transcoding.profile);}}var po=class po{configService=p(we);server=p(j);route=p($e);formReactiveService=p(Se);adminConfigService=p(we);form;formErrors={};validationMessages={};transcodingThreadOptions=[];transcodingProfiles=[];liveMaxDurationOptions=[];liveResolutions=[];customConfig;customConfigSub;ngOnInit(){this.customConfig=this.route.parent.snapshot.data.customConfig,this.transcodingThreadOptions=this.configService.transcodingThreadOptions,this.liveMaxDurationOptions=[{id:-1,label:"No limit"},{id:1e3*3600,label:"1 hour"},{id:1e3*3600*3,label:"3 hours"},{id:1e3*3600*5,label:"5 hours"},{id:1e3*3600*10,label:"10 hours"}],this.liveResolutions=this.adminConfigService.getTranscodingOptions("live"),this.transcodingProfiles=this.adminConfigService.buildTranscodingProfiles(this.server.getHTMLConfig().live.transcoding.availableProfiles),this.buildForm(),this.customConfigSub=this.adminConfigService.getCustomConfigReloadedObs().subscribe(t=>{this.customConfig=t,this.form.patchValue(this.buildFormValue(this.customConfig));});}
1ngOnDestroy(){this.customConfigSub&&this.customConfigSub.unsubscribe();}buildForm(){let t={live:{enabled:null,allowReplay:null,maxDuration:Yl,maxInstanceLives:Zl,maxUserLives:e_,latencySetting:{enabled:null},transcoding:{enabled:null,threads:Gi,profile:null,resolutions:this.adminConfigService.buildFormResolutions("live"),alwaysTranscodeOriginalResolution:null,remoteRunners:{enabled:null},fps:{max:Li}},dvr:{enabled:null,maxWindow:r_}},defaults:{live:{saveReplay:null}}},e=this.buildFormValue(this.customConfig),{form:o,formErrors:_,validationMessages:g}=this.formReactiveService.buildForm(t,e);this.form=o,this.formErrors=_,this.validationMessages=g;}canDeactivate(){return{canDeactivate:!this.form.dirty};}getResolutionKey(t){return"live.transcoding.resolutions."+t;}getLiveRTMPPort(){return this.server.getHTMLConfig().live.rtmp.port;}get defaultsLiveSaveReplayControl(){return this.form.controls.defaults.controls.live.controls.saveReplay;}isLiveEnabled(){return this.form.value.live.enabled===!0;}isDvrEnabled(){return this.form.value.live.dvr.enabled===!0;}isRemoteRunnerLiveEnabled(){return this.form.value.live.transcoding.remoteRunners.enabled===!0;}getDisabledLiveClass(){return{"disabled-checkbox-extra":!this.isLiveEnabled()};}getDisabledLiveDVRClass(){return{"disabled-checkbox-extra":!this.isLiveEnabled()||!this.isDvrEnabled()};}getDisabledLiveTranscodingClass(){return{"disabled-checkbox-extra":!this.isLiveEnabled()||!this.isLiveTranscodingEnabled()};}getDisabledLiveLocalTranscodingClass(){return{"disabled-checkbox-extra":!this.isLiveEnabled()||!this.isLiveTranscodingEnabled()||this.isRemoteRunnerLiveEnabled()};}isLiveTranscodingEnabled(){return this.form.value.live.transcoding.enabled===!0;}getTotalTranscodingThreads(){return this.adminConfigService.getTotalTranscodingThreads({transcoding:this.customConfig.transcoding,live:{transcoding:{enabled:this.form.value.live.transcoding.enabled,threads:this.form.value.live.transcoding.threads}}});}save(){let t=Xe(fe({},this.form.value),{live:Xe(fe({},this.form.value.live),{dvr:{maxWindow:this.form.value.live.dvr.enabled&&this.form.value.live.dvr.maxWindow?this.form.value.live.dvr.maxWindow*60:0}})});this.adminConfigService.saveAndUpdateCurrent({currentConfig:this.customConfig,form:this.form,formConfig:t,success:"Live configuration updated."});}checkTranscodingConsistentOptions(){return this.adminConfigService.checkTranscodingConsistentOptions({transcoding:this.customConfig.transcoding,live:{enabled:this.form.value.live.enabled,allowReplay:this.form.value.live.allowReplay}});}buildFormValue(t){return Xe(fe({},t),{live:Xe(fe({},t.live),{dvr:{enabled:t.live.dvr.maxWindow>0,maxWindow:Math.round(t.live.dvr.maxWindow/60)}})});}};S(po,"\u0275fac",function(e){return new(e||po)();}),S(po,"\u0275cmp",O({type:po,selectors:[["my-admin-config-live"]],decls:125,vars:36,consts:()=>{let t;t="Live configuration";let e;e="Allow your users to automatically publish a replay of their live";let o;o="Allow your users to enable DVR (pause/rewind live)";let _;_="Automatically publish a replay by default";let g;g="Allow your users to change live latency";let M;M="Also transcode original resolution";let I;I="Enable remote runners for lives";let P;P="LIVE";let y;y=" Enable users of your platform to stream a live. ";let F;F="\u26A0\uFE0F Enabling live streaming requires trust in your users and extra moderation work";let h;h="If enabled, your server needs to accept incoming TCP traffic on port "+"\uFFFD0\uFFFD"+"";let J;J="Allow video streamers to set the DVR window up to";let w;w="{VAR_PLURAL, plural, =1 {minute} other {minutes}}",w=X(w,{VAR_PLURAL:"\uFFFD0\uFFFD"});let Z;Z=" Default value for the \"automatically publish a replay when your live ends\" checkbox when creating a new live ";let oe;oe=" Small latency disables P2P and high latency can increase P2P ratio ";let be;be="Max simultaneous lives created on your platform";let ve;ve="(-1 for \"unlimited\")";let de;de="{VAR_PLURAL, plural, =1 {live} other {lives}}",de=X(de,{VAR_PLURAL:"\uFFFD0\uFFFD"});let he;he="Max simultaneous lives created per user";let Fe;
1Fe="(-1 for \"unlimited\")";let Me;Me="{VAR_PLURAL, plural, =1 {live} other {lives}}",Me=X(Me,{VAR_PLURAL:"\uFFFD0\uFFFD"});let ye;ye="Max live duration";let te;te="TRANSCODING";let Ue;Ue=" Same as VOD transcoding, transcoding live streams so that they are in a streamable form that any device can play. Requires a beefy CPU, and then some. ";let ie;ie="Output formats";let je;je="Max live FPS";let re;re="Cap transcoded live FPS. Max resolution stream still keeps the original FPS.";let Ze;Ze="Live resolutions to generate";let et;et=" Even if it's above your maximum enabled resolution ";let tt;tt="Use "+"\uFFFD#107\uFFFD"+"remote runners"+"\uFFFD/#107\uFFFD"+" to process live transcoding.";let nt;nt="Remote runners have to register on your instance first.";let ot;ot="Live transcoding threads";let it;it="Live transcoding profile";let rt;rt="new live transcoding profiles can be added by PeerTube plugins";let R;R="Allow live streaming";let yt;yt="Transcoding enabled for live streams";let Dt;Dt=" will claim at most "+"\uFFFD0\uFFFD"+" "+"\uFFFD1\uFFFD"+" with VOD transcoding ";let Gt;return Gt=" will claim at least "+"\uFFFD0\uFFFD"+" "+"\uFFFD1\uFFFD"+" with VOD transcoding ",[P,y,F,h,J,w,Z,oe,be,ve,de,he,Fe,Me,ye,te,Ue,ie,je,re,Ze,et,tt,nt,ot,it,rt,R,yt,Dt,Gt,["title",t,3,"save","form","formErrors","validationMessages","inconsistentOptions"],["id","admin-config-form",3,"formGroup"],[1,"pt-two-cols"],[1,"title-col"],[1,"inner-form-description"],[1,"content-col"],["formGroupName","live"],[1,"form-group"],["inputName","liveEnabled","formControlName","enabled"],["ptTemplate","label"],["ngProjectAs","description",5,["description"]],["ngProjectAs","extra",5,["extra"]],[1,"form-group",3,"ngClass"],["inputName","liveAllowReplay","formControlName","allowReplay","labelText",e],["formGroupName","dvr",1,"form-group",3,"ngClass"],["inputName","liveAllowDVR","formControlName","enabled","labelText",o],["for","liveDvrMaxWindow"],[1,"number-with-unit"],["type","number","id","liveDvrMaxWindow","formControlName","maxWindow"],["role","alert",1,"form-error"],["inputName","liveSaveReplay","labelText",_,3,"formControl"],["formGroupName","latencySetting",1,"form-group",3,"ngClass"],["inputName","liveLatencySettingEnabled","formControlName","enabled","labelText",g],["for","liveMaxInstanceLives"],[1,"ms-2","small","muted"],["type","number","id","liveMaxInstanceLives","formControlName","maxInstanceLives"],["for","liveMaxUserLives"],["type","number","id","liveMaxUserLives","formControlName","maxUserLives"],["for","liveMaxDuration"],["inputId","liveMaxDuration","formControlName","maxDuration",3,"items"],["formGroupName","transcoding"],["inputName","liveTranscodingEnabled","formControlName","enabled"],[1,"callout","callout-light","pt-2","mt-2","pb-0"],[1,"callout-title"],[3,"ngClass"],["formGroupName","fps",1,"form-group"],["for","liveTranscodingFPSMax"],["type","number","name","liveTranscodingFPSMax","formControlName","max"],[1,"ms-2","mt-3"],[1,"mt-3"],["formGroupName","resolutions"],[1,"form-group","mb-2"],["inputName","liveTranscodingAlwaysTranscodeOriginalResolution","formControlName","alwaysTranscodeOriginalResolution","labelText",M],["formGroupName","remoteRunners",1,"form-group","mt-4",3,"ngClass"],["inputName","liveTranscodingRemoteRunnersEnabled","formControlName","enabled","labelText",I],["routerLink","/admin/settings/system/runners/runners-list"],["id","liveTranscodingThreadsLabel","for","liveTranscodingThreads"],[1,"small","muted","ms-1"],["labelId","liveTranscodingThreadsLabel","inputId","liveTranscodingThreads","formControlName","threads",3,"items","clearable"],[1,"form-group","mt-4",3,"ngClass"],["for","liveTranscodingProfile"],["inputId","liveTranscodingProfile","formControlName","profile",3,"items"],[3,"inputName","formControlName","labelText"],["ptTemplate","help"],[3,"innerHTML"]];},template:function(e,o){e&1&&(r(0,"my-admin-save-bar",31),T("save",function(){return o.save();}),i(),r(1,"form",32)(2,"div",33)(3,"div",34)(4,"h2"),l(5,0),i(),r(6,"div",35),l(7,1),i()(),r(8,"div",36),E(9,37),r(10,"div",38)(11,"my-peertube-checkbox",39),U(12,td,2,0,"ng-template",40),E(13,41),r(14,"div"),l(15,2),i(),r(16,"div"),l(17,3),i(),N(),E(18,42),r(19,"div",43),m(20,"my-peertube-checkbox",44),i(),r(21,"div",45)(22,"my-peertube-checkbox",46),E(23,42),r(24,"div",43)(25,"label",47),l(26,4),i(),r(27,"div",48),m(28,"input",49),r(29,"span"),l(30,5),i()(),c(31,nd,2,1,"div",50),i(),N(),i()(),r(32,"div",43)(33,"my-peertube-checkbox",51),E(34,41),l(35,6),N(),i()(),r(36,"div",52)(37,"my-peertube-checkbox",53),E(38,41),l(39,7),N(),i()(),r(40,"div",43)(41,"label",54),l(42,8),i(),r(43,"span",55),l(44,9),i(),r(45,"div",48),m(46,"input",56),r(47,"span"),l(48,10),i()(),c(49,od,2,1,"div",50),i(),r(50,"div",43)(51,"label",57),l(52,11),i(),r(53,"span",55),l(54,12),i(),r(55,"div",48),m(56,"input",58),r(57,"span"),l(58,13),i()(),c(59,id,2,1,"div",50),i(),r(60,"div",43)(61,"label",59),l(62,14),i(),m(63,"my-select-options",60),c(64,rd,2,1,"div",50),i(),N(),i()(),N(),i()(),r(65,"div",33)(66,"div",34)(67,"h2"),l(68,15),i(),r(69,"div",35),l(70,16),i()(),r(71,"div",36),E(72,37)(73,61),r(74,"div",43)(75,"my-peertube-checkbox",62),U(76,ad,2,0,"ng-template",40),i()(),r(77,"div",63)(78,"h3",64),l(79,17),i(),r(80,"div",65)(81,"div",66)(82,"label",67),l(83,18),i(),r(84,"span",55),l(85,19),i(),r(86,"div",48),m(87,"input",68),r(88,"span"),C(89,"FPS"),i()(),c(90,ld,2,1,"div",50),i(),r(91,"div",69)(92,"h4"),l(93,20),i(),r(94,"div",70),E(95,71),pe(96,dd,3,5,"div",72,Ie),N(),r(98,"div",38)(99,"my-peertube-checkbox",73),E(100,41),l(101,21),N(),i()()()()()(),r(102,"div",74)(103,"my-peertube-checkbox",75),E(104,41),r(105,"div"),V(106,22),m(107,"a",76),k(),i(),r(108,"div"),l(109,23),i(),N(),i()(),r(110,"div",43)(111,"label",77),l(112,24),i(),r(113,"span",78),c(114,md,2,2,"ng-container"),c(115,cd,2,2,"ng-container"),i(),m(116,"my-select-custom-value",79),c(117,ud,2,1,"div",50),i(),r(118,"div",80)(119,"label",81),l(120,25),i(),r(121,"span",78),l(122,26),i(),m(123,"my-select-options",82),c(124,pd,2,1,"div",50),i(),N()(),i()()()),e&2&&(d("form",o.form)("formErrors",o.formErrors)("validationMessages",o.validationMessages)("inconsistentOptions",o.checkTranscodingConsistentOptions()),a(),d("formGroup",o.form),a(16),L(o.getLiveRTMPPort()),$(17),a(2),d("ngClass",o.getDisabledLiveClass()),a(2),d("ngClass",o.getDisabledLiveClass()),a(3),d("ngClass",o.getDisabledLiveDVRClass()),a(6),L(o.form.value.live.dvr.maxWindow),$(30),a(),u(o.formErrors.live.dvr.maxWindow?31:-1),a(),d("ngClass",o.getDisabledLiveClass()),a(),d("formControl",o.defaultsLiveSaveReplayControl),a(3),d("ngClass",o.getDisabledLiveClass()),a(4),d("ngClass",o.getDisabledLiveClass()),a(8),L(o.form.value.live.maxInstanceLives),$(48),a(),u(o.formErrors.live.maxInstanceLives?49:-1),a(),d("ngClass",o.getDisabledLiveClass()),a(8),L(o.form.value.live.maxUserLives),$(58),a(),u(o.formErrors.live.maxUserLives?59:-1),a(),d("ngClass",o.getDisabledLiveClass()),a(3),d("items",o.liveMaxDurationOptions),a(),u(o.formErrors.live.maxDuration?64:-1),a(10),d("ngClass",o.getDisabledLiveClass()),a(6),d("ngClass",o.getDisabledLiveTranscodingClass()),a(10),u(o.formErrors.live.transcoding.fps.max?90:-1),a(6),ge(o.liveResolutions),a(6),d("ngClass",o.getDisabledLiveTranscodingClass()),a(8),d("ngClass",o.getDisabledLiveLocalTranscodingClass()),a(4),u(o.getTotalTranscodingThreads().atMost?114:-1),a(),u(o.getTotalTranscodingThreads().atMost?-1:115),a(),d("items",o.transcodingThreadOptions)("clearable",!1),a(),u(o.formErrors.live.transcoding.threads?117:-1),a(),d("ngClass",o.getDisabledLiveLocalTranscodingClass()),a(5),d("items",o.transcodingProfiles),a(),u(o.formErrors.live.transcoding.profile?124:-1));},dependencies:[Le,Ce,ae,Ne,De,Bn,se,Ee,Re,Sl,Pe,Ge,vt,Je,Qn,It,Oe,At,Ke],styles:["form[_ngcontent-%COMP%]{padding-bottom:1.5rem}my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:500px}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:100%}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]     textarea{height:300px!important}input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:340px;max-width:340px;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}input[type=text][_ngcontent-%COMP%]::placeholder, input[type=number][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%], input[type=number][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible, input[type=number][_ngcontent-%COMP%]:focus, input[type=number][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%], input[type=number][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:380px){input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{width:100%}}.peertube-select-container[_ngcontent-%COMP%]{width:340px}@media screen and (max-width:370px){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player
1-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){display:block;width:340px}@media screen and (max-width:370px){my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){width:100%}}my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{display:block;width:480px}@media screen and (max-width:510px){my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{width:100%}}.inner-form-description[_ngcontent-%COMP%]{font-size:14px;margin-bottom:1rem;color:var(--fg-300)}textarea[_ngcontent-%COMP%]{max-width:100%;display:block;font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:500px;max-width:500px;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}textarea[_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}textarea[readonly][_ngcontent-%COMP%]{color:var(--fg-300)}textarea[_ngcontent-%COMP%]:focus, textarea[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}textarea[disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:540px){textarea[_ngcontent-%COMP%]{width:100%}}textarea[_ngcontent-%COMP%]{color:var(--textarea-fg)!important;background-color:var(--textarea-bg)!important;height:150px;padding:var(--textarea-y-padding) var(--textarea-x-padding)}textarea.small[_ngcontent-%COMP%]{height:75px}.disabled-checkbox-extra[_ngcontent-%COMP%], .disabled-checkbox-extra[_ngcontent-%COMP%]     label{opacity:.5;pointer-events:none}my-actor-banner-edit[_ngcontent-%COMP%]{max-width:500px}h4[_ngcontent-%COMP%]{font-weight:700;margin-bottom:.5rem;font-size:1rem}"]}));var tr=po;function gd(n,t){n&1&&(E(0),l(1,31),N());}function Cd(n,t){n&1&&(E(0),V(1,32),m(2,"strong")(3,"p"),r(4,"ul"),m(5,"li")(6,"li")(7,"li"),i(),k(),N());}function Ed(n,t){n&1&&(E(0),l(1,33),N(),m(2,"br"),E(3),l(4,34),N(),m(5,"br"),E(6),l(7,35),N());}function Nd(n,t){if(n&1&&(r(0,"div",74),C(1),i()),n&2){let e=s();a(),f(e.formErrors.transcoding.fps.max);}}function Sd(n,t){if(n&1&&m(0,"div",97),n&2){let e=s(2).$implicit;d("innerHTML",e.description,Yt);}}function fd(n,t){n&1&&U(0,Sd,1,1,"ng-template",64);}function Md(n,t){if(n&1&&(r(0,"div",78)(1,"my-peertube-checkbox",96),c(2,fd,1,0,null,64),i()()),n&2){let e=t.$implicit,o=s();a(),d("labelText",Vt(e.label))("inputName",o.getResolutionKey(e.id))("formControlName",e.id),a(),u(e.description?2:-1);}}function Id(n,t){if(n&1&&(E(0),l(1,36),N()),n&2){let e=s();a(),L(e.getTotalTranscodingThreads().value)(e.getTotalTranscodingThreads().unit),$(1);}}function Ad(n,t){if(n&1&&(E(0),l(1,37),N()),n&2){let e=s();a(),L(e.getTotalTranscodingThreads().value)(e.getTotalTranscodingThreads().unit),$(1);}}function Td(n,t){if(n&1&&(r(0,"div",74),C(1),i()),n&2){let e=s();a(),f(e.formErrors.transcoding.threads);}}function Od(n,t){if(n&1&&(r(0,"div",74),C(1),i()),n&2){let e=s();a(),f(e.formErrors.transcoding.concurrency);}}function Pd(n,t){if(n&1&&(r(0,"div",74),C(1),i()),n&2){let e=s();a(),f(e.formErrors.transcoding.profile);}}function Rd(n,t){n&1&&(E(0,55),r(1,"span"),l(2,38),i(),N());}var go=class go{configService=p(we);notifier=p(K);server=p(j);route=p($e);formReactiveService=p(Se);adminConfigService=p(we);form;formErrors={};validationMessages={};transcodingThreadOptions=[];transcodingProfiles=[];resolutions=[];additionalVideoExtensions="";customConfig;customConfigSub;ngOnInit(){let t=this.server.getHTMLConfig();this.customConfig=this.route.parent.snapshot.data.customConfig,this.transcodingThreadOptions=this.configService.transcodingThreadOptions,this.resolutions=this.adminConfigService.getTranscodingOptions("vod"),this.additionalVideoExtensions=t.video.file.extensions.join(" "),this.transcodingProfiles=this.adminConfigService.buildTranscodingProfiles(t.transcoding.availableProfiles),this.buildForm(),this.subscribeToTranscodingChanges(),this.customConfigSub=this.adminConfigService.getCustomConfigReloadedObs().subscribe(e=>{this.customConfig=e,this.form.patchValue(this.customConfig);});}
1ngOnDestroy(){this.customConfigSub&&this.customConfigSub.unsubscribe();}buildForm(){let t={transcoding:{enabled:null,allowAdditionalExtensions:null,allowAudioFiles:null,originalFile:{keep:null},webVideos:{enabled:null},hls:{enabled:null,splitAudioAndVideo:null},fps:{max:Li},resolutions:this.adminConfigService.buildFormResolutions("vod"),alwaysTranscodeOriginalResolution:null,alwaysTranscodePodcastOptimizedAudio:null,remoteRunners:{enabled:null},threads:Gi,profile:null,concurrency:$i},videoStudio:{enabled:null,remoteRunners:{enabled:null}}},e=this.customConfig,{form:o,formErrors:_,validationMessages:g}=this.formReactiveService.buildForm(t,e);this.form=o,this.formErrors=_,this.validationMessages=g;}canDeactivate(){return{canDeactivate:!this.form.dirty};}getResolutionKey(t){return"transcoding.resolutions."+t;}isRemoteRunnerVODEnabled(){return this.form.value.transcoding.remoteRunners.enabled===!0;}isTranscodingEnabled(){return this.form.value.transcoding.enabled===!0;}isHLSEnabled(){return this.form.value.transcoding.hls.enabled===!0;}isStudioEnabled(){return this.form.value.videoStudio.enabled===!0;}getTranscodingDisabledClass(){return{"disabled-checkbox-extra":!this.isTranscodingEnabled()};}getHLSDisabledClass(){return{"disabled-checkbox-extra":!this.isHLSEnabled()};}getLocalTranscodingDisabledClass(){return{"disabled-checkbox-extra":!this.isTranscodingEnabled()||this.isRemoteRunnerVODEnabled()};}getStudioRunnerDisabledClass(){return{"disabled-checkbox-extra":!this.isStudioEnabled()};}getTotalTranscodingThreads(){return this.adminConfigService.getTotalTranscodingThreads({live:this.customConfig.live,transcoding:{enabled:this.form.value.transcoding.enabled,threads:this.form.value.transcoding.threads}});}subscribeToTranscodingChanges(){let t=this.form.controls,e=t.transcoding.controls.enabled,o=t.videoStudio.controls.enabled,_=t.transcoding.controls.hls.controls.enabled,g=t.transcoding.controls.webVideos.controls.enabled;g.valueChanges.subscribe(M=>{M===!1&&_.value===!1&&(_.setValue(!0),this.notifier.info("Automatically enable HLS transcoding because at least 1 output format must be enabled when transcoding is enabled","",1e4));}),_.valueChanges.subscribe(M=>{M===!1&&g.value===!1&&(g.setValue(!0),this.notifier.info("Automatically enable Web Videos transcoding because at least 1 output format must be enabled when transcoding is enabled","",1e4));}),e.valueChanges.subscribe(M=>{M===!1&&o.setValue(!1);}),e.updateValueAndValidity(),g.updateValueAndValidity(),o.updateValueAndValidity(),_.updateValueAndValidity();}save(){this.adminConfigService.saveAndUpdateCurrent({currentConfig:this.customConfig,form:this.form,formConfig:this.form.value,success:"VOD configuration updated."});}checkTranscodingConsistentOptions(){return this.adminConfigService.checkTranscodingConsistentOptions({transcoding:{enabled:this.form.value.transcoding.enabled},live:this.customConfig.live});}};S(go,"\u0275fac",function(e){return new(e||go)();}),S(go,"\u0275cmp",O({type:go,selectors:[["my-admin-config-vod"]],decls:144,vars:31,consts:()=>{let t;t="VOD configuration";let e;e="Allow additional extensions";let o;o="Allow audio files upload";let _;_="Keep a version of the input file";let g;g="Web Videos enabled";let M;M="HLS with P2P support enabled";let I;I="Split audio and video streams";let P;P="Always generate an audio file optimized for podcast applications";let y;y="Also transcode original resolution";let F;F="Enable remote runners for VOD";let h;h="Enable video studio";let J;J="Enable remote runners for studio";let w;w="TRANSCODING";let Z;Z=" Process uploaded videos so that they are streamable on any device. Although this is costly in terms of resources, it is a critical part of PeerTube, so proceed with caution. ";let oe;oe=" Estimating a server's capacity to transcode and stream videos isn't easy and we can't tune PeerTube automatically. ";let be;be=" However, you may want to read "+"\uFFFD#15\uFFFD"+"our guidelines"+"\uFFFD/#15\uFFFD"+" before tweaking the following values. ";let ve;ve="Input";let de;de="Allows users to upload videos with additional extensions than .mp4, .ogv and .webm (for example: .avi, .mov, .mkv etc).";let he;he="Allows users to upload .mp3, .ogg, .wma, .flac, .aac, or .ac3 audio files.";let Fe;
1Fe="The file will be merged in a still image video with the preview file on upload.";let Me;Me="If enabled, the input file is not deleted after transcoding but moved in a dedicated folder or object storage";let ye;ye="Output";let te;te="If you also enable HLS output, video storage will be multiplied by 2";let Ue;Ue="If you also enable Web Videos output, video storage will be multiplied by 2";let ie;ie="If enabled, remote PeerTube instances < 6.3.0 won't be able to play these videos";let je;je="HLS audio files are not always played correctly by podcast applications";let re;re="This option ensures that an optimized audio file is generated for podcast applications, even if Web Videos output is disabled";let Ze;Ze="Max video FPS";let et;et="Cap transcoded video FPS. Max resolution file still keeps the original FPS.";let tt;tt="Resolutions to generate";let nt;nt="Even if it's above your maximum enabled resolution";let ot;ot="Use "+"\uFFFD#96\uFFFD"+"remote runners"+"\uFFFD/#96\uFFFD"+" to process VOD transcoding.";let it;it="Remote runners have to register on your instance first.";let rt;rt="Transcoding threads";let R;R="Transcoding jobs concurrency";let yt;yt="allows to transcode multiple files in parallel";let Dt;Dt="jobs in parallel";let Gt;Gt="Transcoding profile";let ee;ee="new transcoding profiles can be added by PeerTube plugins";let an;an="VIDEO STUDIO";let ln;ln=" Allows your users to edit their video (cut, add intro/outro, add a watermark etc) ";let _n;_n="Use "+"\uFFFD#141\uFFFD"+"remote runners"+"\uFFFD/#141\uFFFD"+" to process studio transcoding tasks.";let sn;sn="Remote runners have to register on your instance first.";let dn;dn="Transcoding enabled";let wt;wt=""+"\uFFFD#2\uFFFD"+"Requires ffmpeg >= 4.1"+"\uFFFD/#2\uFFFD"+""+"\uFFFD#3\uFFFD"+"Generate HLS playlists and fragmented MP4 files resulting in a better playback than with Web Videos:"+"\uFFFD/#3\uFFFD"+""+"\uFFFD#4\uFFFD"+""+"[\uFFFD#5\uFFFD|\uFFFD#6\uFFFD|\uFFFD#7\uFFFD]"+"Resolution change is smoother"+"[\uFFFD/#5\uFFFD|\uFFFD/#6\uFFFD|\uFFFD/#7\uFFFD]"+""+"[\uFFFD#5\uFFFD|\uFFFD#6\uFFFD|\uFFFD#7\uFFFD]"+"Faster playback especially with long videos"+"[\uFFFD/#5\uFFFD|\uFFFD/#6\uFFFD|\uFFFD/#7\uFFFD]"+""+"[\uFFFD#5\uFFFD|\uFFFD#6\uFFFD|\uFFFD#7\uFFFD]"+"More stable playback (less bugs/infinite loading)"+"[\uFFFD/#5\uFFFD|\uFFFD/#6\uFFFD|\uFFFD/#7\uFFFD]"+""+"\uFFFD/#4\uFFFD"+"",wt=X(wt);let mn;mn="Store the audio stream in a separate file from the video.";let cn;cn="This option adds the ability for the HLS player to propose the \"Audio only\" quality to users.";let B;B="It also saves disk space by not duplicating the audio stream in each resolution file";let ei;ei=" will claim at most "+"\uFFFD0\uFFFD"+" "+"\uFFFD1\uFFFD"+" with live transcoding ";let ti;ti=" will claim at least "+"\uFFFD0\uFFFD"+" "+"\uFFFD1\uFFFD"+" with live transcoding ";let ni;return ni="\u26A0\uFE0F You need to enable transcoding first to enable video studio",[w,Z,oe,be,ve,de,he,Fe,Me,ye,te,Ue,ie,je,re,Ze,et,tt,nt,ot,it,rt,R,yt,Dt,Gt,ee,an,ln,_n,sn,dn,wt,mn,cn,B,ei,ti,ni,["title",t,3,"save","form","formErrors","validationMessages","inconsistentOptions"],["id","admin-config-form",3,"formGroup"],[1,"pt-two-cols"],[1,"title-col"],[1,"inner-form-description"],[1,"content-col"],[1,"callout","callout-primary","mb-4"],["target","_blank","rel","noopener noreferrer","href","https://docs.joinpeertube.org/admin/configuration#vod-transcoding",1,"link-primary"],["formGroupName","transcoding"],["inputName","transcodingEnabled","formControlName","enabled",3,"recommended"],["ptTemplate","label"],["ngProjectAs","extra",5,["extra"]],[1,"callout","callout-light","pt-2","pb-0"],[1,"callout-title"],[1,"form-group",3,"ngClass"],["inputName","transcodingAllowAdditionalExtensions","formControlName","allowAdditionalExtensions","labelText",e],["ngProjectAs","description",5,["description"]],["inputName","transcodingAllowAudioFiles","formControlName","allowAudioFiles","labelText",o],["formGroupName","originalFile",1,"form-group",3,"ngClass"],["inputName","transcodingOriginalFileKeep","formControlName","keep","labelText",_],[1,"callout","callout-light","pt-2","mt-2","pb-0"],["formGroupName","webVideos"],["
1inputName","transcodingWebVideosEnabled","formControlName","enabled","labelText",g],["formGroupName","hls"],["inputName","transcodingHlsEnabled","formControlName","enabled","labelText",M,3,"recommended"],["ptTemplate","help"],[1,"mb-0",3,"ngClass"],["inputName","transcodingHlsSplitAudioAndVideo","formControlName","splitAudioAndVideo","labelText",I],[1,"form-group"],["inputName","transcodingAlwaysTranscodePodcastOptimizedAudio","formControlName","alwaysTranscodePodcastOptimizedAudio","labelText",P],["formGroupName","fps",1,"form-group",3,"ngClass"],["for","transcodingFPSMax"],[1,"ms-2","small","muted"],[1,"number-with-unit"],["type","number","name","transcodingFPSMax","formControlName","max"],["role","alert",1,"form-error"],[1,"mb-2","fw-bold"],[1,"ms-2","d-flex","flex-column"],["formGroupName","resolutions"],[1,"form-group","mb-2"],["inputName","transcodingAlwaysTranscodeOriginalResolution","formControlName","alwaysTranscodeOriginalResolution","labelText",y],["formGroupName","remoteRunners",1,"form-group","mt-4",3,"ngClass"],["inputName","transcodingRemoteRunnersEnabled","formControlName","enabled","labelText",F],["routerLink","/admin/settings/system/runners/runners-list"],[1,"form-group","mt-4",3,"ngClass"],["id","transcodingThreadsLabel","for","transcodingThreads"],[1,"small","muted","ms-1"],["labelId","transcodingThreadsLabel","inputId","transcodingThreads","formControlName","threads",3,"items","clearable"],["for","transcodingConcurrency"],["type","number","id","transcodingConcurrency","formControlName","concurrency"],["for","transcodingProfile"],["inputId","transcodingProfile","formControlName","profile",3,"items"],[1,"pt-two-cols","mt-2"],["formGroupName","videoStudio"],["inputName","videoStudioEnabled","formControlName","enabled","labelText",h],["formGroupName","remoteRunners",1,"form-group",3,"ngClass"],["inputName","videoStudioRemoteRunnersEnabled","formControlName","enabled","labelText",J],[3,"inputName","formControlName","labelText"],[3,"innerHTML"]];},template:function(e,o){e&1&&(r(0,"my-admin-save-bar",39),T("save",function(){return o.save();}),i(),r(1,"form",40)(2,"div",41)(3,"div",42)(4,"h2"),l(5,0),i(),r(6,"div",43),l(7,1),i()(),r(8,"div",44)(9,"div",45)(10,"span"),l(11,2),i(),m(12,"br"),r(13,"span"),V(14,3),m(15,"a",46),k(),i()(),E(16,47),r(17,"div")(18,"my-peertube-checkbox",48),U(19,gd,2,0,"ng-template",49),E(20,50),r(21,"div",51)(22,"h3",52),l(23,4),i(),r(24,"div",53)(25,"my-peertube-checkbox",54),E(26,55),r(27,"span"),l(28,5),i(),N(),i()(),r(29,"div",53)(30,"my-peertube-checkbox",56),E(31,55),r(32,"div"),l(33,6),i(),r(34,"div"),l(35,7),i(),N(),i()(),r(36,"div",57)(37,"my-peertube-checkbox",58),E(38,55),r(39,"div"),l(40,8),i(),N(),i()()(),r(41,"div",59)(42,"h3",52),l(43,9),i(),E(44,60),r(45,"div",53)(46,"my-peertube-checkbox",61),E(47,55)(48),r(49,"div"),l(50,10),i(),N()(),i()(),N(),E(51,62),r(52,"div",53)(53,"my-peertube-checkbox",63),E(54,55),r(55,"div"),l(56,11),i(),N(),U(57,Cd,8,0,"ng-template",64),E(58,50),r(59,"div",65)(60,"my-peertube-checkbox",66),E(61,55),l(62,12),N(),U(63,Ed,8,0,"ng-template",64),i()(),N(),i()(),N(),r(64,"div",67)(65,"my-peertube-checkbox",68),E(66,55),r(67,"div"),l(68,13),i(),r(69,"div"),l(70,14),i(),N(),i()(),r(71,"div",69)(72,"label",70),l(73,15),i(),r(74,"span",71),l(75,16),i(),r(76,"div",72),m(77,"input",73),r(78,"span"),C(79,"FPS"),i()(),c(80,Nd,2,1,"div",74),i(),r(81,"div",53)(82,"div",75),l(83,17),i(),r(84,"div",76),E(85,77),pe(86,Md,3,5,"div",78,Ie),N(),r(88,"my-peertube-checkbox",79),E(89,55),l(90,18),N(),i()()()(),N(),i()(),r(91,"div",80)(92,"my-peertube-checkbox",81),E(93,55),r(94,"div"),V(95,19),m(96,"a",82),k(),i(),r(97,"div"),l(98,20),i(),N(),i()(),r(99,"div",83)(100,"label",84),l(101,21),i(),r(102,"span",85),c(103,Id,2,2,"ng-container"),c(104,Ad,2,2,"ng-container"),i(),m(105,"my-select-custom-value",86),c(106,Td,2,1,"div",74),i(),r(107,"div",53)(108,"label",87),l(109,22),i(),r(110,"span",85),l(111,23),i(),r(112,"div",72),m(113,"input",88),r(114,"span"),l(115,24),i()(),c(116,Od,2,1,"div",74),i(),r(117,"div",53)(118,"label",89),l(119,25),i(),r(120,"span",85),l(121,26),i(),m(122,"my-select-options",90),c(123,Pd,2,1,"div",74),i(),N(),i()(),r(124,"div",91)(125,"div",42)(126,"h2"),l(127,27),i(),r(128,"div",43),l(129,28),i()(),r(130,"div",44),E(131,92),r(132,"div",53)(133,"my-peertube-checkbox",93),c(134,Rd,3,0,"ng-container",55),E(135,50),r(136,"div",94)(137,"my-peertube-checkbox",95),E(138,55),r(139,"div"),V(140,29),m(141,"a",82),k(),i(),r(142,"div"),l(143,30),i(),N(),i()(),N(),i()(),N(),i()()()),e&2&&(d("form",o.form)("formErrors",o.formErrors)("validationMessages",o.validationMessages)("inconsistentOptions",o.checkTranscodingConsistentOptions()),a(),d("formGroup",o.form),a(17),d("recommended",!0),a(6),d("ngClass",o.getTranscodingDisabledClass()),a(5),d("ngClass",o.getTranscodingDisabledClass()),a(7),d("ngClass",o.getTranscodingDisabledClass()),a(9),d("ngClass",o.getTranscodingDisabledClass()),a(7),d("ngClass",o.getTranscodingDisabledClass()),a(),d("recommended",!0),a(6),d("ngClass",o.getHLSDisabledClass()),a(12),d("ngClass",o.getTranscodingDisabledClass()),a(9),u(o.formErrors.transcoding.fps.max?80:-1),a(),d("ngClass",o.getTranscodingDisabledClass()),a(5),ge(o.resolutions),a(5),d("ngClass",o.getTranscodingDisabledClass()),a(8),d("ngClass",o.getLocalTranscodingDisabledClass()),a(4),u(o.getTotalTranscodingThreads().atMost?103:-1),a(),u(o.getTotalTranscodingThreads().atMost?-1:104),a(),d("items",o.transcodingThreadOptions)("clearable",!1),a(),u(o.formErrors.transcoding.threads?106:-1),a(),d("ngClass",o.getLocalTranscodingDisabledClass()),a(9),u(o.formErrors.transcoding.concurrency?116:-1),a(),d("ngClass",o.getLocalTranscodingDisabledClass()),a(5),d("items",o.transcodingProfiles),a(),u(o.formErrors.transcoding.profile?123:-1),a(9),d("ngClass",o.getTranscodingDisabledClass()),a(2),u(o.isTranscodingEnabled()?-1:134),a(2),d("ngClass",o.get
1StudioRunnerDisabledClass()));},dependencies:[Le,Ce,ae,Ne,De,Bn,se,Ee,Re,Pe,Ge,vt,Je,Qn,Oe,At,It,Ke],styles:["form[_ngcontent-%COMP%]{padding-bottom:1.5rem}my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:500px}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:100%}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]     textarea{height:300px!important}input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:340px;max-width:340px;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}input[type=text][_ngcontent-%COMP%]::placeholder, input[type=number][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%], input[type=number][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible, input[type=number][_ngcontent-%COMP%]:focus, input[type=number][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%], input[type=number][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:380px){input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{width:100%}}.peertube-select-container[_ngcontent-%COMP%]{width:340px}@media screen and (max-width:370px){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){display:block;width:340px}@media screen and (max-width:370px){my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){width:100%}}my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{display:block;width:480px}@media screen and (max-width:510px){my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{width:100%}}.inner-form-description[_ngcontent-%COMP%]{font-size:14px;margin-bottom:1rem;color:var(--fg-300)}textarea[_ngcontent-%COMP%]{max-width:100%;display:block;font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:500px;max-width:500px;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}textarea[_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}textarea[readonly][_ngcontent-%COMP%]{color:var(--fg-300)}textarea[_ngcontent-%COMP%]:focus, textarea[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}textarea[disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:540px){textarea[_ngcontent-%COMP%]{width:100%}}textarea[_ngcontent-%COMP%]{color:var(--textarea-fg)!important;background-color:var(--textarea-bg)!important;height:150px;padding:var(--textarea-y-padding) var(--textarea-x-padding)}textarea.small[_ngcontent-%COMP%]{height:75px}.disabled-checkbox-extra[_ngcontent-%COMP%], .disabled-checkbox-extra[_ngcontent-%COMP%]     label{opacity:.5;pointer-events:none}my-actor-banner-edit[_ngcontent-%COMP%]{max-width:500px}h4[_ngcontent-%COMP%]{font-weight:700;margin-bottom:.5rem;font-size:1rem}"]}));var nr=go;var Co=class Co{menuConfig;ngOnInit(){this.menuConfig={title:"Configuration",entries:[{type:"link",label:"Information",routerLink:"information"},{type:"link",label:"Logo",routerLink:"logo"},{type:"link",label:"General",routerLink:"general"},{type:"link",label:"Homepage",routerLink:"homepage"},{type:"link",label:"Customization",routerLink:"customization"},{type:"separator"},{type:"link",label:"VOD",routerLink:"vod"},{type:"link",label:"Live",routerLink:"live"},{type:"separator"},{type:"link",label:"Advanced",routerLink:"advanced"}]};}};S(Co,"\u0275fac",function(e){return new(e||Co)();}),S(Co,"\u0275cmp",O({type:Co,selectors:[["my-admin-config"]],decls:5,vars:1,consts:[[1,"root"],[3,"config"],[1,"flex-grow-1"]],template:function(e,o){e&1&&(r(0,"div",0)(1,"div"),m(2,"my-lateral-menu",1),i(),r(3,"div",2),m(4,"router-outlet"),i()()),e&2&&(a(2),d("config",o.menuConfig));},dependencies:[Xn,fn,M_],styles:[".root[_ngcontent-%COMP%]{display:flex}@media screen and (max-width:1000px){.root[_ngcontent-%COMP%]{margin-bottom:150px}}"]}));var or=Co;var X_=is(rs());var di=n=>({"input-error":n}),Fd=(n,t)=>t.name;function bd(n,t){n&1&&(r(0,"div"),l(1,17),i());}function hd(n,t){}function yd(n,t){n&1&&U(0,hd,0,0,"ng-template");}function Dd(n,t){if(n&1&&(r(0,"my-alert",44),U(1,yd,1,0,null,64),r(2,"div"),l(3,18),i(),r(4,"div"),V(5,19),m(6,"strong"),k(),i(),r(7,"div"),V(8,20),m(9,"strong"),k(),i()()),n&2){let e=s(),o=ue(32);a(),d("ngTemplateOutlet",o),a(5),L(e.getCurrentThemeLabel()),$(5),a(3),L(e.getDefaultThemeLabel()),$(8);}}function Gd(n,t){}function Ld(n,t){n&1&&U(0,Gd,0,0,"ng-template");}function $d(n,t){if(n&1&&(r(0,"my-alert",45),U(1,Ld,1,0,null,64),r(2,"div"),V(3,21),m(4,"strong"),k(),i()()),n&2){s();let e=ue(32);a(),d("ngTemplateOutlet",e);}}function xd(n,t){if(n&1){let e=H();r(0,"button",70),T("click",function(){D(e);let _=s().$implicit,g=s();return G(g.resetCustomizationField(_.name));}),l(1,22),i();}}function wd(n,t){if(n&1&&(r(0,"div",39),C(1),i()),n&2){let e=s().$implicit;a(),f(e.description);}}function Ud(n,t){if(n&1&&m(0,"my-peertube-color-picker",67),n&2){let e=s().$implicit,o=s();d("inputId",e.inputId)("formControlName",e.name)("formError",o.formErrors.theme.customization[e.name]);}}function Vd(n,t){if(n&1&&m(0,"my-select-custom-value",68),n&2){let e=s().$implicit;d("labelId",e.inputId)("inputId",e.inputId)("items",e.items)("formControlName",e.name)("clearable",!1);}}function kd(n,t){if(n&1&&m(0,"input",69),n&2){let e=s().$implicit,o=s();d("id",e.inputId)("name",e.inputId)("formControlName",e.name)("ngClass",x(4,di,o.formErrors.theme.customization[e.name]));}}function zd(n,t){if(n&1&&(r(0,"div",37)(1,"label",65),C(2),i(),c(3,xd,2,0,"button",66),c(4,wd,2,1,"div",39),c(5,Ud,1,3,"my-peertube-color-picker",67)(6,Vd,1,5,"my-select-custom-value",68)(7,kd,1,6,"input",69),i()),n&2){let e=t.$implicit,o=s();a(),d("for",e.inputId),a(),f(e.label),a(),u(o.hasDefaultCustomizationValue(e.name)?-1:3),a(),u(e.description?4:-1),a(),u(e.type==="color"?5:e.type==="radius"?6:7);}}function Xd(n,t){if(n&1&&(r(0,"div",52),C(1),i()),n&2){let e=s();a(),f(e.formErrors.email.subject.prefix);}}function Bd(n,t){if(n&1&&(r(0,"div",52),C(1),i()),n&2){let e=s();a(),f(e.formErrors.email.body.signature);}}function Wd(n,t){if(n&1&&(r(0,"div",52),C(1),i()),n&2){let e=s();a(),f(e.formErrors.instance.customizations.javascript);}}function Hd(n,t){if(n&1&&(r(0,"div",52),C(1),i()),n&2){let e=s();a(),f(e.formErrors.instance.customizations.css);}}var jd=(0,X_.default)("peertube:config"),Eo=class Eo{formReactiveService=p(Se);adminConfigService=p(we);serverService=p(j);themeService=p(Vl);route=p($e);form;formErrors={};validationMessages={};customizationFormFields=[];availableThemes;availablePlayerThemes=[];customizationResetFields=new Set();customConfig;customConfigSub;formFieldsObject={primaryColor:{label:"Primary color",type:"color"},onPrimaryColor:{label:"On primary color",type:"color"},foregroundColor:{label:"Foreground color",type:"color"}
1,backgroundColor:{label:"Background color",type:"color"},backgroundSecondaryColor:{label:"Secondary background color",description:"Used as a background for inputs, overlays...",type:"color"},menuForegroundColor:{label:"Menu foreground color",type:"color"},menuBackgroundColor:{label:"Menu background color",type:"color"},menuBorderRadius:{label:"Menu rounding",type:"radius",items:[{id:"0",label:"Not rounded"},{id:"6px",label:"Slightly rounded"},{id:"14px",label:"Moderately rounded (default)"},{id:"60px",label:"Rounded"}]},headerForegroundColor:{label:"Header foreground color",type:"color"},headerBackgroundColor:{label:"Header background color",type:"color"},inputBorderRadius:{label:"Input rounding",type:"radius",items:[{id:"0",label:"Not rounded"},{id:"4px",label:"Slightly rounded (default)"},{id:"10px",label:"Moderately rounded"},{id:"20px",label:"Rounded"}]}};ngOnInit(){this.customConfig=this.route.parent.snapshot.data.customConfig,this.availableThemes=[this.themeService.getDefaultThemeItem(),...this.themeService.buildAvailableThemes()],this.availablePlayerThemes=[{id:"galaxy",label:"Galaxy",description:"Original theme"},{id:"lucide",label:"Lucide",description:"A clean and modern theme"}],this.buildForm(),this.subscribeToCustomizationChanges(),this.customConfigSub=this.adminConfigService.getCustomConfigReloadedObs().subscribe(t=>{this.customConfig=t,this.form.patchValue(this.getDefaultFormValues(),{emitEvent:!1}),this.form.setErrors(this.form.errors);});}ngOnDestroy(){this.customConfigSub&&this.customConfigSub.unsubscribe(),this.themeService.updateColorPalette(fe({builtIn:this.serverService.getHTMLConfig().theme.builtIn},this.customConfig.theme));}canDeactivate(){return{canDeactivate:!this.form.dirty};}subscribeToCustomizationChanges(){let t;this.form.get("theme.customization").valueChanges.pipe(Ni(250)).subscribe(e=>{t&&(cancelAnimationFrame(t),t=null),t=requestAnimationFrame(()=>{this.themeService.updateColorPalette(Xe(fe({},this.customConfig.theme),{builtIn:this.serverService.getHTMLConfig().theme.builtIn,customization:this.buildNewCustomization(e)}));});});for(let[e,o]of Object.entries(this.form.get("theme.customization").controls))o.events.subscribe(_=>{_ instanceof El&&(jd(`Deleting "${e}" from reset fields`),this.customizationResetFields.delete(e));});}buildForm(){for(let[g,M]of Object.entries(this.formFieldsObject)){let I=g;this.customizationFormFields.push({label:M.label,type:M.type,inputId:`themeCustomization${Gl(I)}`,name:I,items:M.items}),this.customConfig.theme.customization[I]||this.customizationResetFields.add(I);}let t={client:{videos:{miniature:{preferAuthorDisplayName:null}}},email:{subject:{prefix:null},body:{signature:null}},instance:{customizations:{css:null,javascript:null}},theme:{default:null,customization:{primaryColor:Ht,onPrimaryColor:Ht,foregroundColor:Ht,backgroundColor:Ht,backgroundSecondaryColor:Ht,menuForegroundColor:Ht,menuBackgroundColor:Ht,menuBorderRadius:null,headerForegroundColor:Ht,headerBackgroundColor:Ht,inputBorderRadius:null}},defaults:{player:{theme:null}}},{form:e,formErrors:o,validationMessages:_}=this.formReactiveService.buildForm(t,this.getDefaultFormValues());this.form=e,this.formErrors=o,this.validationMessages=_;}getCurrentThemeName(){return this.themeService.getCurrentThemeName();}getCurrentThemeLabel(){return this.availableThemes.find(t=>t.id===this.themeService.getCurrentThemeName())?.label;}getDefaultThemeName(){return this.serverService.getHTMLConfig().theme.default;}getDefaultThemeLabel(){return this.availableThemes.find(t=>t.id===this.getDefaultThemeName())?.label;}isUsingDefaultTheme(){this.themeService.isUsingDefaultTheme({currentTheme:this.getCurrentThemeName(),config:this.serverService.getHTMLConfig().theme});}hasDefaultCustomizationValue(t){return this.customizationResetFields.has(t);}resetCustomizationField(t){this.customizationResetFields.add(t),this.themeService.updateColorPalette(Xe(fe({},this.customConfig.theme),{builtIn:this.serverService.getHTMLConfig().theme.builtIn,customization:this.buildNewCustomization(this.form.get("theme.customization").value)}));let e=this.formatCustomizationFieldForForm(t,this.themeService.getCSSConfigValue(t)),o=this.getCustomizationControl(t);o.patchValue(e,{emitEvent:!1}),o.markAsDirty(),o.setErrors(o.errors);}save(){let t=this.form.value;t.theme.customization=this.buildNewCustomization(t.theme.customization),this.adminConfigService.saveAndUpdateCurrent({currentConfig:this.customConfig,form:this.form,formConfig:this.form.value,success:"Platform customization updated."});}getCustomizationControl(t){return this.form.get("theme.customization").get(t);}getDefaultFormValues(){return Xe(fe({},this.customConfig),{theme:{default:this.customConfig.theme.default,customization:this.getDefaultCustomization()}});}getDefaultCustomization(){let t=this.customConfig.theme.customization;return Vr(this.formFieldsObject).reduce((e,o)=>(e[o]=t[o]?this.formatCustomizationFieldForForm(o,t[o]):this.formatCustomizationFieldForForm(o,this.themeService.getCSSConfigValue(o)),e),{});}formatCustomizationFieldForForm(t,e){return this.formFieldsObject[t].type==="color"?this.themeService.formatColorForForm(e):e;}buildNewCustomization(t){return Vr(this.customConfig.theme.customization).reduce((e,o)=>(e[o]=this.formatCustomizationFieldForTheme(o,t[o]),e),{});}formatCustomizationFieldForTheme(t,e){return this.customizationResetFields.has(t)?null:e;}};S(Eo,"\u0275fac",function(e){return new(e||Eo)();}),S(Eo,"\u0275cmp",O({type:Eo,selectors:[["my-admin-config-customization"]],decls:94,vars:28,consts:()=>{let t;t="Platform customization";let e;e="Prefer author display name in video miniature";let o;o="APPEARANCE";let _;_="Theme";let g;g="Player Theme";let M;M="Only used by the web player";let I;I="CUSTOMIZATION";let P;P=" Use "+"\uFFFD#29\uFFFD"+"plugins & themes"+"\uFFFD/#29\uFFFD"+" for more involved changes ";let y;y="EMAIL";let F;F="Subject prefix";let h;h="Support "+"\uFFFD#50\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#50\uFFFD"+" template variable";let J;J="Body signature";let w;w="Support "+"\uFFFD#58\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#58\uFFFD"+" template variable";let Z;Z="ADVANCED";let oe;oe=" Advanced modifications to your PeerTube platform if creating a plugin or a theme is overkill. ";let be;be="JavaScript";let ve;ve=""+"\uFFFD#77\uFFFD"+"Write JavaScript code directly. Example:"+"\uFFFD/#77\uFFFD"+""+"\uFFFD#78\uFFFD"+"console.log('my instance is amazing');"+"\uFFFD/#78\uFFFD"+"";let de;de=""+"[\uFFFD#87\uFFFD|\uFFFD#89\uFFFD]"+"Write CSS code directly. Example:"+"[\uFFFD/#87\uFFFD|\uFFFD/#89\uFFFD]"+""+"[\uFFFD#88\uFFFD|\uFFFD#91\uFFFD]"+"  #custom-css "+"[\uFFFD0\uFFFD|\uFFFD2\uFFFD]"+"\n  color: red;\n  "+"[\uFFFD1\uFFFD|\uFFFD3\uFFFD]"+"\n  "+"[\uFFFD/#88\uFFFD|\uFFFD/#91\uFFFD]"+""+"[\uFFFD#87\uFFFD|\uFFFD#89\uFFFD]"+"Prepend with "+"\uFFFD#90\uFFFD"+"#custom-css"+"\uFFFD/#90\uFFFD"+" to override styles. Example:"+"[\uFFFD/#87\uFFFD|\uFFFD/#89\uFFFD]"+""+"[\uFFFD#88\uFFFD|\uFFFD#91\uFFFD]"+"  #custom-css .logged-in-email "+"[\uFFFD0\uFFFD|\uFFFD2\uFFFD]"+"\n  color: red;\n  "+"[\uFFFD1\uFFFD|\uFFFD3\uFFFD]"+"\n  "+"[\uFFFD/#88\uFFFD|\uFFFD/#91\uFFFD]"+"",de=X(de);let he;he="UI customization only applies if the user is using the default platform theme.";let Fe;
1Fe="You can't preview the changes because you aren't using your platform's default theme.";let Me;Me="Current theme: "+"\uFFFD#6\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#6\uFFFD"+"";let ye;ye="Platform theme: "+"\uFFFD#9\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#9\uFFFD"+".";let te;te="You can preview your UI customization but "+"\uFFFD#4\uFFFD"+"don't forget to save your changes"+"\uFFFD/#4\uFFFD"+" once you are happy with the results.";let Ue;return Ue=" Reset ",[["alertIntro",""],o,_,g,M,I,P,y,F,h,J,w,Z,oe,be,ve,de,he,Fe,Me,ye,te,Ue,["title",t,3,"save","form","formErrors","validationMessages"],["id","admin-config-form",3,"formGroup"],[1,"pt-two-cols"],[1,"title-col"],[1,"content-col"],["formGroupName","theme",1,"form-group"],["for","themeDefault"],["formControlName","default","inputId","themeDefault",3,"items"],["formGroupName","client"],["formGroupName","videos"],["formGroupName","miniature",1,"form-group"],["inputName","clientVideosMiniaturePreferAuthorDisplayName","formControlName","preferAuthorDisplayName","labelText",e],["formGroupName","defaults"],["formGroupName","player"],[1,"form-group"],["for","defaultsPlayerTheme"],[1,"form-group-description"],["mode","instance","formControlName","theme","inputId","defaultsPlayerTheme"],[1,"pt-two-cols","mt-4"],[1,"inner-form-description"],["routerLink","/admin/settings/plugins",1,"link-primary"],["type","warning"],["type","info"],["formGroupName","customization"],["formGroupName","email"],["formGroupName","subject",1,"form-group"],["for","emailSubjectPrefix"],[1,"d-inline"],["type","text","id","emailSubjectPrefix","formControlName","prefix",1,"form-control",3,"ngClass"],["role","alert",1,"form-error"],["formGroupName","body",1,"form-group"],["for","emailBodySignature"],["type","text","id","emailBodySignature","formControlName","signature",1,"form-control",3,"ngClass"],["id","customizations",1,"anchor"],["formGroupName","instance"],["formGroupName","customizations"],["for","customizationJavascript"],[1,"mb-2"],["id","customizationJavascript","formControlName","javascript","dir","ltr",1,"form-control",3,"ngClass"],["for","customizationCSS"],["id","customizationCSS","formControlName","css","dir","ltr",1,"form-control",3,"ngClass"],[4,"ngTemplateOutlet"],[3,"for"],["type","button",1,"reset-button","reset-button-small"],[3,"inputId","formControlName","formError"],["inputType","text",3,"labelId","inputId","items","formControlName","clearable"],["type","text",1,"form-control",3,"id","name","formControlName","ngClass"],["type","button",1,"reset-button","reset-button-small",3,"click"]];},template:function(e,o){e&1&&(r(0,"my-admin-save-bar",23),T("save",function(){return o.save();}),i(),r(1,"form",24)(2,"div",25)(3,"div",26)(4,"h2"),l(5,1),i()(),r(6,"div",27)(7,"div",28)(8,"label",29),l(9,2),i(),m(10,"my-select-options",30),i(),E(11,31)(12,32),r(13,"div",33),m(14,"my-peertube-checkbox",34),i(),N()(),E(15,35)(16,36),r(17,"div",37)(18,"label",38),l(19,3),i(),r(20,"div",39),l(21,4),i(),m(22,"my-select-player-theme",40),i(),N()(),i()(),r(23,"div",41)(24,"div",26)(25,"h2"),l(26,5),i(),r(27,"div",42),V(28,6),m(29,"a",43),k(),i()(),r(30,"div",27),U(31,bd,2,0,"ng-template",null,0,v),c(33,Dd,10,3,"my-alert",44)(34,$d,5,1,"my-alert",45),r(35,"div",28),E(36,46),pe(37,zd,8,5,"div",37,Fd),N(),i()()(),r(39,"div",25)(40,"div",26)(41,"h2"),l(42,7),i()(),E(43,47),r(44,"div",27)(45,"div",48)(46,"label",49),l(47,8),i(),r(48,"div",39),V(49,9),m(50,"pre",50),k(),i(),m(51,"input",51),c(52,Xd,2,1,"div",52),i(),r(53,"div",53)(54,"label",54),l(55,10),i(),r(56,"div",39),V(57,11),m(58,"pre",50),k(),i(),m(59,"input",55),c(60,Bd,2,1,"div",52),i()(),N(),i(),r(61,"div",41)(62,"div",26),m(63,"div",56),r(64,"h2"),l(65,12),i(),r(66,"div",42),l(67,13),i()(),r(68,"div",27),E(69,57)(70,58),r(71,"div",37)(72,"label",59),l(73,14),i(),r(74,"my-help"),E(75),V(76,15),m(77,"p",60)(78,"pre"),k(),N(),i(),m(79,"textarea",61),c(80,Wd,2,1,"div",52),i(),r(81,"div",37)(82,"label",62),C(83,"CSS"),i(),r(84,"my-help"),E(85),V(86,16),m(87,"p",60)(88,"pre"),r(89,"p",60),m(90,"em"),i(),m(91,"pre"),k(),N(),i(),m(92,"textarea",63),c(93,Hd,2,1,"div",52),i(),N()(),i()()()),e&2&&(d("form",o.form)("formErrors",o.formErrors)("validationMessages",o.validationMessages),a(),d("formGroup",o.form),a(9),d("items",o.availableThemes),a(23),u(o.getCurrentThemeName()!==o.getDefaultThemeName()?33:34),a(4),ge(o.customizationFormFields),a(13),L("{{instanceName}}"),$(49),a(),d("ngClass",x(20,di,o.formErrors.email.subject.prefix)),a(),u(o.formErrors.email.subject.prefix?52:-1),a(6),L("{{instanceName}}"),$(57),a(),d("ngClass",x(22,di,o.formErrors.email.body.signature)),a(),u(o.formErrors.email.body.signature?60:-1),a(19),d("ngClass",x(24,di,o.formErrors.instance.customizations.javascript)),a(),u(o.formErrors.instance.customizations.javascript?80:-1),a(11),L("{")("}")("{")("}"),$(86),a(),d("ngClass",x(26,di,o.formErrors.instance.customizations.css)),a(),u(o.formErrors.instance.customizations.css?93:-1));},dependencies:[Le,Ce,Sn,ae,Ne,De,se,Ee,Xn,Oe,Re,Pe,Ge,vt,Ke,a_,st,It,jn,Je,At,A_],styles:["form[_ngcontent-%COMP%]{padding-bottom:1.5rem}my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:500px}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:100%}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]     textarea{height:300px!important}input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:340px;max-width:340px;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}input[type=text][_ngcontent-%COMP%]::placeholder, input[type=number][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%], input[type=number][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible, input[type=number][_ngcontent-%COMP%]:focus, input[type=number][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%], input[type=number][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:380px){input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{width:100%}}.peertube-select-container[_ngcontent-%COMP%]{width:340px}@media screen and (max-width:370px){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player
1-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){display:block;width:340px}@media screen and (max-width:370px){my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){width:100%}}my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{display:block;width:480px}@media screen and (max-width:510px){my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{width:100%}}.inner-form-description[_ngcontent-%COMP%]{font-size:14px;margin-bottom:1rem;color:var(--fg-300)}textarea[_ngcontent-%COMP%]{max-width:100%;display:block;font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:500px;max-width:500px;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}textarea[_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}textarea[readonly][_ngcontent-%COMP%]{color:var(--fg-300)}textarea[_ngcontent-%COMP%]:focus, textarea[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}textarea[disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:540px){textarea[_ngcontent-%COMP%]{width:100%}}textarea[_ngcontent-%COMP%]{color:var(--textarea-fg)!important;background-color:var(--textarea-bg)!important;height:150px;padding:var(--textarea-y-padding) var(--textarea-x-padding)}textarea.small[_ngcontent-%COMP%]{height:75px}.disabled-checkbox-extra[_ngcontent-%COMP%], .disabled-checkbox-extra[_ngcontent-%COMP%]     label{opacity:.5;pointer-events:none}my-actor-banner-edit[_ngcontent-%COMP%]{max-width:500px}h4[_ngcontent-%COMP%]{font-weight:700;margin-bottom:.5rem;font-size:1rem}"]}));var ir=Eo;var Qd=()=>({height:"32px",width:"32px"}),Jd=()=>({height:"48px",width:"auto"}),qd=()=>({height:"48px",width:"48px"}),No=class No{notifier=p(K);logoService=p(si);server=p(j);route=p($e);formReactiveService=p(Se);serverService=p(j);adminConfigService=p(we);form;formErrors={};validationMessages={};customConfig;customConfigSub;get instanceName(){return this.server.getHTMLConfig().instance.name;}get avatarFileConstraints(){return this.server.getHTMLConfig().avatar.file;}get logoFileConstraints(){return this.server.getHTMLConfig().logo.file;}ngOnInit(){this.customConfig=this.route.parent.snapshot.data.customConfig,this.buildForm(),this.customConfigSub=this.adminConfigService.getCustomConfigReloadedObs().subscribe(t=>{this.customConfig=t,this.form.patchValue({hideInstanceName:t.client.header.hideInstanceName});});}ngOnDestroy(){this.customConfigSub&&this.customConfigSub.unsubscribe();}buildForm(){let t={hideInstanceName:null,avatar:null,banner:null,favicon:null,"header-square":null,"header-wide":null,opengraph:null},e=fe({hideInstanceName:this.customConfig.client.header.hideInstanceName},this.route.snapshot.data.logos),{form:o,formErrors:_,validationMessages:g}=this.formReactiveService.buildForm(t,e);this.form=o,this.formErrors=_,this.validationMessages=g;}canDeactivate(){return{canDeactivate:!this.form.dirty};}save(){this.adminConfigService.updateCustomConfig({client:{header:{hideInstanceName:this.form.value.hideInstanceName}}}).pipe(Be(()=>this.serverService.resetConfig()),Si(t=>Object.assign(this.customConfig,t)),Be(()=>this.buildSaveAvatar()),Be(()=>this.saveBanner()),Be(()=>this.saveLogo("favicon")),Be(()=>this.saveLogo("header-square")),Be(()=>this.saveLogo("header-wide")),Be(()=>this.saveLogo("opengraph")),Be(()=>this.serverService.resetConfig()),Be(()=>this.logoService.getAllLogos())).subscribe({next:t=>{this.notifier.success("Logos updated"),this.form.patchValue(t),this.form.markAsPristine();},error:t=>this.notifier.handleError(t)});}buildSaveAvatar(){if(this.form.controls.avatar.pristine)return Ei(!0);let t=this.form.value.avatar;return t?this.logoService.updateAvatar(t):this.logoService.deleteAvatar();}saveBanner(){if(this.form.controls.banner.pristine)return Ei(!0);let t=this.form.value.banner;return t?this.logoService.updateBanner(t):this.logoService.deleteBanner();}saveLogo(t){let e=this.form.get(t);if(e.pristine)return Ei(!0);let o=e.value;return o?this.logoService.updateLogo(o,t):this.logoService.deleteLogo(t);}};S(No,"\u0275fac",function(e){return new(e||No)();}),S(No,"\u0275cmp",O({type:No,selectors:[["my-admin-config-logo"]],decls:84,vars:16,consts:()=>{let t;t="Upload logos";let e;e="Hide the name of your platform in the header on desktop (wide screens)";let o;o="LOGO";let _;_="Square icon";let g;g="Square icon is used in the mobile application and can be used on your custom homepage.";let M;M="It's also used as a fallback for the favicon, header icon and social media logo.";let I;I="Banner";let P;P="Banner is displayed in the about, login and registration pages and be used on your custom homepage.";let y;
1y=" It can also be displayed on external websites to promote your instance, such as "+"\uFFFD#25\uFFFD"+"JoinPeerTube.org"+"\uFFFD/#25\uFFFD"+". ";let F;F="Favicon";let h;h="Favicon is the icon displayed in web browser tab. ";let J;J="If not set, the "+"\uFFFD#36\uFFFD"+"Square icon"+"\uFFFD/#36\uFFFD"+" will be used.";let w;w="If the image is not in .svg format, it will be resized to 32x32 pixels and converted to .png format.";let Z;Z="Desktop header logo";let oe;oe="Logo displayed in the header on large screens such as desktop computers.";let be;be="If not set, the "+"\uFFFD#49\uFFFD"+"Square icon"+"\uFFFD/#49\uFFFD"+" will be used.";let ve;ve="If the image is not in .svg format, its height will be reduced to 48 pixels and the width will be calculated based on the original file ratio.";let de;de="Useful for example if your \"Desktop header logo\" already includes your platform name";let he;he="Mobile header logo";let Fe;Fe="Logo displayed in the header on small screens such as mobile devices. ";let Me;Me="If not set, the "+"\uFFFD#67\uFFFD"+"Square icon"+"\uFFFD/#67\uFFFD"+" will be used.";let ye;ye="If the image is not in .svg format, it will be resized to 48x48 pixels.";let te;te="Social media logo";let Ue;Ue="Default logo displayed on social media. ";let ie;ie="If not set, the "+"\uFFFD#80\uFFFD"+"Square icon"+"\uFFFD/#80\uFFFD"+" will be used.";let je;return je="If the image is not in .svg format, it will be resized to 1200x650 pixels.",[o,_,g,M,I,P,y,F,h,J,w,Z,oe,be,ve,de,he,Fe,Me,ye,te,Ue,ie,je,["title",t,3,"save","form","formErrors","validationMessages"],["id","admin-config-form",3,"formGroup"],[1,"pt-two-cols","mt-4"],[1,"title-col"],[1,"content-col"],[1,"form-group"],["for","avatarfile"],[1,"form-group-description"],[1,"mb-0"],["formControlName","avatar","inputName","avatar","displayDelete","true",1,"avatar-preview",3,"fileConstraints"],["for","bannerfile"],["target","_blank","href","https://joinpeertube.org/instances"],["formControlName","banner","inputName","banner","displayDelete","true",1,"banner-preview",3,"fileConstraints"],["for","favicon"],["formControlName","favicon","inputName","favicon","displayDelete","true","buttonsAside","true",1,"favicon-preview",3,"previewSize","fileConstraints"],["for","header-wide"],["formControlName","header-wide","inputName","header-wide","displayDelete","true","buttonsAside","true",1,"header-wide-preview",3,"previewSize","fileConstraints"],["inputName","hideInstanceName","formControlName","hideInstanceName","labelText",e],["ngProjectAs","description",5,["description"]],["for","header-square"],["formControlName","header-square","inputName","header-square","displayDelete","true","buttonsAside","true",1,"header-square-preview",3,"previewSize","fileConstraints"],["for","opengraph"],["formControlName","opengraph","inputName","opengraph","displayDelete","true",1,"opengraph-preview",3,"fileConstraints"]];},template:function(e,o){e&1&&(r(0,"my-admin-save-bar",24),T("save",function(){return o.save();}),i(),r(1,"form",25)(2,"div",26)(3,"div",27)(4,"h2"),l(5,0),i()(),r(6,"div",28)(7,"div",29)(8,"label",30),l(9,1),i(),r(10,"div",31)(11,"div",32)(12,"div"),l(13,2),i(),r(14,"div"),l(15,3),i()()(),m(16,"my-image-input",33),i(),r(17,"div",29)(18,"label",34),l(19,4),i(),r(20,"div",31)(21,"p",32),l(22,5),i(),r(23,"p"),V(24,6),m(25,"a",35),k(),i()(),m(26,"my-image-input",36),i(),r(27,"div",29)(28,"label",37),l(29,7),i(),r(30,"div",31)(31,"p",32),E(32),l(33,8),N(),E(34),V(35,9),m(36,"strong"),k(),N(),i(),r(37,"p"),l(38,10),i()(),m(39,"my-image-input",38),i(),r(40,"div",29)(41,"label",39),l(42,11),i(),r(43,"div",31)(44,"p",32),E(45),l(46,12),N(),E(47),V(48,13),m(49,"strong"),k(),N(),i(),r(50,"p"),l(51,14),i()(),m(52,"my-image-input",40),i(),r(53,"div",29)(54,"my-peertube-checkbox",41),E(55,42),r(56,"div"),l(57,15),i(),N(),i()(),r(58,"div",29)(59,"label",43),l(60,16),i(),r(61,"div",31)(62,"p",32),E(63),l(64,17),N(),E(65),V(66,18),m(67,"strong"),k(),N(),i(),r(68,"p"),l(69,19),i()(),m(70,"my-image-input",44),i(),r(71,"div",29)(72,"label",45),l(73,20),i(),r(74,"div",31)(75,"p",32),E(76),l(77,21),N(),E(78),V(79,22),m(80,"strong"),k(),N(),i(),r(81,"p"),l(82,23),i()(),m(83,"my-image-input",46),i()()()()),e&2&&(d("form",o.form)("formErrors",o.formErrors)("validationMessages",o.validationMessages),a(),d("formGroup",o.form),a(15),d("fileConstraints",o.avatarFileConstraints),a(10),d("fileConstraints",o.avatarFileConstraints),a(13),d("previewSize",mt(13,Qd))("fileConstraints",o.logoFileConstraints),a(13),d("previewSize",mt(14,Jd))("fileConstraints",o.logoFileConstraints),a(18),d("previewSize",mt(15,qd))("fileConstraints",o.logoFileConstraints),a(13),d("fileConstraints",o.logoFileConstraints));},dependencies:[ae,Ne,se,Ee,Re,Pe,Ge,Ke,l_,Je],styles:[".banner-preview[_ngcontent-%COMP%]{max-width:500px;aspect-ratio:6;width:100%;height:auto}.avatar-preview[_ngcontent-%COMP%], .header-square-preview[_ngcontent-%COMP%]{width:128px;height:128px}.header-wide-preview[_ngcontent-%COMP%]{width:auto;height:128px;max-width:500px}.opengraph-preview[_ngcontent-%COMP%]{max-width:500px;aspect-ratio:1.9047619048;width:100%;height:auto}","form[_ngcontent-%COMP%]{padding-bottom:1.5rem}my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:500px}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]{display:block;max-width:100%}.homepage[_ngcontent-%COMP%]   my-markdown-textarea[_ngcontent-%COMP%]     textarea{height:300px!important}input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:340px;max-width:340px;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}input[type=text][_ngcontent-%COMP%]::placeholder, input[type=number][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%], input[type=number][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible, input[type=number][_ngcontent-%COMP%]:focus, input[type=number][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%], input[type=number][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:380px){input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%]{width:100%}}.peertube-select-container[_ngcontent-%COMP%]{width:340px}@media screen and (max-width:370px){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player
1-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){display:block;width:340px}@media screen and (max-width:370px){my-select-videos-sort[_ngcontent-%COMP%], my-select-videos-scope[_ngcontent-%COMP%], my-select-checkbox[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%], my-select-player-theme[_ngcontent-%COMP%], my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){width:100%}}my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{display:block;width:480px}@media screen and (max-width:510px){my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{width:100%}}.inner-form-description[_ngcontent-%COMP%]{font-size:14px;margin-bottom:1rem;color:var(--fg-300)}textarea[_ngcontent-%COMP%]{max-width:100%;display:block;font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:500px;max-width:500px;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}textarea[_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}textarea[readonly][_ngcontent-%COMP%]{color:var(--fg-300)}textarea[_ngcontent-%COMP%]:focus, textarea[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}textarea[disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:540px){textarea[_ngcontent-%COMP%]{width:100%}}textarea[_ngcontent-%COMP%]{color:var(--textarea-fg)!important;background-color:var(--textarea-bg)!important;height:150px;padding:var(--textarea-y-padding) var(--textarea-x-padding)}textarea.small[_ngcontent-%COMP%]{height:75px}.disabled-checkbox-extra[_ngcontent-%COMP%], .disabled-checkbox-extra[_ngcontent-%COMP%]     label{opacity:.5;pointer-events:none}my-actor-banner-edit[_ngcontent-%COMP%]{max-width:500px}h4[_ngcontent-%COMP%]{font-weight:700;margin-bottom:.5rem;font-size:1rem}"]}));var rr=No;var Kd=(n,t)=>p(we).getCustomConfig(),Yd=(n,t)=>p(to).getInstanceHomepage().pipe(lt(({content:e})=>e)),Zd=(n,t)=>p(j).getVideoCategories(),em=(n,t)=>p(j).getVideoLanguages(),tm=(n,t)=>p(j).getVideoLicences(),nm=(n,t)=>p(j).getVideoPrivacies(),om=(n,t)=>p(j).getCommentPolicies(),im=(n,t)=>p(si).getAllLogos(),B_=[{path:"config",canActivate:[ze],data:{userRight:q.MANAGE_CONFIGURATION},resolve:{customConfig:Kd},providers:[si,I_],component:or,children:[{path:"edit-custom",redirectTo:"information",pathMatch:"full"},{path:"",redirectTo:"information",pathMatch:"full"},{path:"homepage",component:Zi,canDeactivate:[en],resolve:{homepageContent:Yd},data:{meta:{title:"Edit your platform homepage"}}},{path:"customization",component:ir,canDeactivate:[en],data:{meta:{title:"Platform customization"}}},{path:"information",component:er,canDeactivate:[en],resolve:{categories:Zd,languages:em},data:{meta:{title:"Platform information"}}},{path:"logo",component:rr,canDeactivate:[en],resolve:{logos:im},data:{meta:{title:"Platform logos"}}},{path:"general",component:Yi,canDeactivate:[en],resolve:{privacies:nm,licences:tm,commentPolicies:om},data:{meta:{title:"General configuration"}}},{path:"vod",component:nr,canDeactivate:[en],data:{meta:{title:"VOD configuration"}}},{path:"live",component:tr,canDeactivate:[en],data:{meta:{title:"Live configuration"}}},{path:"advanced",component:Ki,canDeactivate:[en],data:{meta:{title:"Advanced configuration"}}}]}];var So=class So{};S(So,"\u0275fac",function(e){return new(e||So)();}),S(So,"\u0275cmp",O({type:So,selectors:[["my-abuse-list"]],decls:1,vars:0,consts:[["viewType","admin"]],template:function(e,o){e&1&&m(0,"my-abuse-list-table",0);},dependencies:[O_],encapsulation:2}));var ar=So;var fo=class fo{mode=1;};S(fo,"\u0275fac",function(e){return new(e||fo)();}),S(fo,"\u0275cmp",O({type:fo,selectors:[["my-instance-account-blocklist"]],decls:1,vars:1,consts:[["key","InstanceAccountBlocklistComponent",3,"mode"]],template:function(e,o){e&1&&m(0,"my-generic-account-blocklist",0),e&2&&d("mode",o.mode);},dependencies:[P_],encapsulation:2}));var lr=fo;var Mo=class Mo{mode=1;};S(Mo,"\u0275fac",function(e){return new(e||Mo)();}),S(Mo,"\u0275cmp",O({type:Mo,selectors:[["my-instance-server-blocklist"]],decls:1,vars:1,consts:[["key","InstanceServerBlocklistComponent",3,"mode"]],template:function(e,o){e&1&&m(0,"my-generic-server-blocklist",0),e&2&&d("mode",o.mode);},dependencies:[v_],encapsulation:2}));var _r=Mo;var am=["table"];function lm(n,t){if(n&1&&(E(0),l(1,6),Q(2,"myNumberFormatter"),N()),n&2){let e=t.$implicit;a(2),L(e)(ke(2,2,e)),$(1);}}function _m(n,t){n&1&&(r(0,"span",14),l(1,7),i());}function sm(n,t){n&1&&(r(0,"span",17),l(1,8),i());}function dm(n,t){if(n&1&&(r(0,"td")(1,"my-video-cell",13)(2,"div"),c(3,_m,2,0,"span",14),i()()(),r(4,"td"),m(5,"my-privacy-badge",15),i(),r(6,"td"),m(7,"my-video-nsfw-badge",16),i(),r(8,"td"),c(9,sm,2,0,"span",17),i(),r(10,"td"),C(11),Q(12,"ptDate"),i()),n&2){let e=t.$implicit,o=s();a(),d("video",e.video)("accountBlockBadges",e.video.account?o.accountBlocklist.get(e.video.account.id):void 0),a(2),u(e.type===2?3:-1),a(2),d("video",e.video),a(2),d("video",e.video),a(2),u(e.unfederated?9:-1),a(2),b(" ",_e(12,7,e.createdAt,"short")," ");}}function mm(n,t){if(n&1&&m(0,"my-action-dropdown",18),n&2){let e=t.$implicit,o=s();d("actions",o.videoBlocklistActions)("entry",e);}}function cm(n,t){if(n&1&&(r(0,"span",22),l(1,9),i(),m(2,"span",23)),n&2){let e=s(2).$implicit;a(2),d("innerHTML",e.reasonHtml,Yt);}}function um(n,t){if(n&1&&(r(0,"div",19)(1,"div",20),c(2,cm,3,1),i(),r(3,"div",21),m(4,"my-embed",15),i()()),n&2){let e=s().$implicit;a(2),u(e.reasonHtml?2:-1),a(2),d("video",e.video);}}function pm(n,t){if(n&1&&c(0,um,5,2,"div",19),n&2){let e=t.$implicit;u(e?0:-1);}}function gm(n,t){n&1&&(E(0),l(1,10),N());}function Cm(n,t){n&1&&(E(0),l(1,11),N());}function Em(n,t){if(n&1&&c(0,gm,2,0,"ng-container")(1,Cm,2,0,"ng-container"),n&2){let e=t.search,o=t.hasFilters;u(e||o?0:1);}}var Io=class Io{notifier=p(K);serverService=p(j);confirmService=p(xe);videoBlocklistService=p(Zn);blocklistService=p(Rn);markdownRenderer=p(vi);videoService=p(tn);table=me("table");blocklistTypeFilter;videoBlocklistActions=[];bulkActions=[];inputFilters=[{type:"options",key:"type",title:"Block type",options:[{value:"all",label:"All"},{value:Wn.AUTO_BEFORE_PUBLISHED,label:"Automatic blocks"},{value:Wn.MANUAL,label:"Manual blocks"}]}];columns=[{id:"name",label:"Video",sortable:!0},{id:"privacy",label:"Privacy",sortable:!1},{id:"sensitive",label:"Sensitive",sortable:!1},{id:"unfederated",label:"Unfederated",sortable:!1},{id:"createdAt",label:"Date",sortable:!0}];accountBlocklist=new Map();dataLoader;constructor(){this.dataLoader=this._dataLoader.bind(this);let{simpleActions:t,bulkActions:e}=no([[{label:()=>"Internal actions",isHeader:!0,isDisplayed:o=>o.type===Wn.AUTO_BEFORE_PUBLISHED,enableBulk:!0},{label:()=>"Switch to manual block",handler:o=>this.switchVideosBlockToManual(o),isDisplayed:o=>o.type===Wn.AUTO_BEFORE_PUBLISHED,enableBulk:!0}],[{label:()=>"Actions for videos",isHeader:!0,enableBulk:!0},{label:()=>"Unblock",handler:o=>this.unblockVideos(o),enableBulk:!0},{label:o=>Y("{count, plural, =1 {Delete video} other {Delete videos}}",{count:o.length}),handler:o=>this.deleteVideos(o),isDisplayed:o=>o.video?.isLocal===!0,enableBulk:!0}]]);this.videoBlocklistActions=t,this.bulkActions=e;}ngOnInit(){this.serverService.getHTMLConfig().autoBlacklist.videos.ofUsers.enabled&&(this.blocklistTypeFilter=Wn.MANUAL);}toHtml(t){return this.markdownRenderer.textMarkdownToHTML({markdown:t});}unblockVideo(t){return le(this,null,function*(){let e="Do you really want to unblock this video? It will be available again in the videos list.";(yield this.confirmService.confirm(e,"Unblock"))!==!1&&this.videoBlocklistService.unblockVideos([t.video.id]).subscribe({next:()=>{this.notifier.success("Video "+t.video.name+" unblocked."),this.table().loadD
1ata();},error:_=>this.notifier.handleError(_)});});}unblockVideos(t){return le(this,null,function*(){let e=Y("Do you really want to unblock {count, plural, =1 {this video?} other {these {count} videos?}}",{count:t.length});(yield this.confirmService.confirm(e,"Unblock"))!==!1&&this.videoBlocklistService.unblockVideos(t.map(_=>_.video.id)).subscribe({next:()=>{this.notifier.success(Y("{count, plural, =1 {Video unblocked.} other {{count} videos unblocked.}}",{count:t.length})),this.table().loadData();},error:_=>this.notifier.handleError(_)});});}switchVideosBlockToManual(t){return le(this,null,function*(){if((yield this.confirmService.confirm(Y("Switch {count, plural, =1 {this auto block to manual?} other {{count} auto blocks to manual?}}",{count:t.length}),"Switch"))===!1)return;let o=t.map(_=>_.video.id);this.videoBlocklistService.unblockVideos(o).pipe(Be(()=>this.videoBlocklistService.blockVideos(o.map(_=>({videoId:_,unfederate:!0}))))).subscribe({next:()=>{this.notifier.success(Y("{count, plural, =1 {Video switched to manual block.} other {{count} videos switched to manual block.}}",{count:t.length})),this.table().loadData();},error:_=>this.notifier.handleError(_)});});}deleteVideos(t){return le(this,null,function*(){(yield this.confirmService.confirm(Y("Do you really want to delete {count, plural, =1 {this video?} other {{count} videos?}}",{count:t.length}),"Delete"))!==!1&&this.videoService.removeVideo(t.map(o=>o.video.id)).subscribe({next:()=>{this.notifier.success(Y("{count, plural, =1 {Video deleted.} other {{count} videos deleted.}}",{count:t.length})),this.table().loadData();},error:o=>this.notifier.handleError(o)});});}getVideoEmbed(t){return $l({embedUrl:Pl({url:Ol(t.video,Tt.originServerUrl),title:!1,warningTitle:!1}),aspectRatio:t.video.aspectRatio,embedTitle:t.video.name});}onDataLoaded(){this.loadBlockStatus();}loadBlockStatus(){let t=this.table().data.map(_=>_.video),e=this.getUniqueAccounts(t),o=this.getUniqueHosts(e);this.blocklistService.getStatus({accounts:e.map(_=>_.name+"@"+_.host),hosts:o}).subscribe(_=>{this.accountBlocklist=new Map();for(let g of e){let M=g.name+"@"+g.host;this.accountBlocklist.set(g.id,{mutedByInstance:_.accounts[M]?.blockedByServer??!1,mutedServerByInstance:_.hosts[g.host]?.blockedByServer??!1});}});}getUniqueAccounts(t){let e=new Set();return t.map(o=>!o.account||e.has(o.account.id)?null:(e.add(o.account.id),o.account)).filter(o=>!!o);}getUniqueHosts(t){return Array.from(new Set(t.map(e=>e.host)));}_dataLoader(t){return this.videoBlocklistService.listBlocks(t).pipe(Be(e=>le(this,null,function*(){for(let o of e.data)o.reasonHtml=yield this.toHtml(o.reason);return e;})));}};S(Io,"\u0275fac",function(e){return new(e||Io)();}),S(Io,"\u0275cmp",O({type:Io,selectors:[["my-video-block-list"]],viewQuery:function(e,o){e&1&&Ae(o.table,am,5),e&2&&Te();},decls:12,vars:4,consts:()=>{let t;t="videos per page";let e;e="{VAR_PLURAL, plural, =0 {No video} =1 {1 video} other {{INTERPOLATION} videos}}",e=X(e,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let o;o="The video was blocked due to automatic blocking of new videos";let _;_="Auto block";let g;g="Unfederated";let M;M="Actions";let I;I="Block reason:";let P;P="No blocked video found matching current filters.";let y;return y="No blocked video found.",[["table",""],["totalTitle",""],["tableCells",""],["actionCell",""],["expandedRow",""],["noResults",""],e,_,g,I,P,y,["key","VideoBlockListComponent","paginatorText",t,"columnConfig","false","searchInput","true",3,"dataLoaded","defaultColumns","dataLoader","inputFilters","bulkActions"],["accountBlockBadgesPlatformOnly","true","size","small",3,"video","accountBlockBadges"],["title",o,1,"pt-badge","badge-info","badge-small"],[3,"video"],["theme","red",3,"video"],[1,"pt-badge","badge-blue"],["placement","bottom-right auto","container","body","label",M,3,"actions","entry"],[1,"d-flex","moderation-expanded"],[1,"left"],[1,"right"],[1,"moderation-expanded-label"],[1,"moderation-expanded-text",3,"innerHTML"]];},template:function(e,o){e&1&&(r(0,"my-table",12,0),T("dataLoaded",function(){return o.onDataLoaded();}),U(2,lm,3,4,"ng-template",null,1,v)(4,dm,13,10,"ng-template",null,2,v)(6,mm,1,2,"ng-template",null,3,v)(8,pm,1,1,"ng-template",null,4,v)(10,Em,2,1,"ng-template",null,5,v),i()),e&2&&d("defaultColumns",o.columns)("dataLoader",o.dataLoader)("inputFilters",o.inputFilters)("bulkActions",o.bulkActions);},dependencies:[Qt,Bi,Xi,Hi,He,Wi,qe,We],styles:[".moderation-expanded[_ngcontent-%COMP%]{font-size:90%;display:flex;flex-wrap:wrap;justify-content:space-between}.moderation-expanded[_ngcontent-%COMP%]   .moderation-expanded-label[_ngcontent-%COMP%]{font-weight:600;display:inline-block;vertical-align:top;text-align:end;min-width:100px;margin-inline-end:.3125rem}.moderation-expanded[_ngcontent-%COMP%]   .moderation-expanded-text[_ngcontent-%COMP%]{display:inline-flex;word-wrap:break-word}.moderation-expanded[_ngcontent-%COMP%]   .moderation-expanded-text[_ngcontent-%COMP%]     p:last-child{margin-bottom:0!important}.moderation-expanded[_ngcontent-%COMP%]   .right[_ngcontent-%COMP%]{width:50%;max-width:500px}@media screen and (max-width:1000px){.moderation-expanded[_ngcontent-%COMP%]   .right[_ngcontent-%COMP%]{width:100%}}.table-comment-link[_ngcontent-%COMP%], .table-account-link[_ngcontent-%COMP%]{text-decoration:none;color:var(--fg)}.table-comment-link[_ngcontent-%COMP%]:focus:not(:focus-visible), .table-account-link[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none!important}.table-comment-link[_ngcontent-%COMP%]     p:last-child, .table-account-link[_ngcontent-%COMP%]     p:last-child{margin:0}my-abuse-details[_ngcontent-%COMP%]{width:100%}@media screen and (max-width:1000px){.abuse-messages[_ngcontent-%COMP%]{justify-content:flex-start!important}}"]}));var sr=Io;var ht=class ht{authHttp=p(Rt);restExtractor=p(Ft);restService=p(Wt);listRegistrations(t){let{pagination:e,sort:o,search:_,stateOneOf:g}=t,M=ht.BASE_REGISTRATION_URL,I=new Pt();return I=this.restService.addRestGetParams(I,e,o),_&&(I=I.append("search",_)),I=this.restService.addObjectParam
1s(I,{stateOneOf:g}),this.authHttp.get(M,{params:I}).pipe(Ve(P=>this.restExtractor.handleError(P)));}acceptRegistration(t){let{registration:e,moderationResponse:o,preventEmailDelivery:_}=t,g=ht.BASE_REGISTRATION_URL+"/"+e.id+"/accept",M={moderationResponse:o,preventEmailDelivery:_};return this.authHttp.post(g,M).pipe(Ve(I=>this.restExtractor.handleError(I)));}rejectRegistration(t){let{registration:e,moderationResponse:o,preventEmailDelivery:_}=t,g=ht.BASE_REGISTRATION_URL+"/"+e.id+"/reject",M={moderationResponse:o,preventEmailDelivery:_};return this.authHttp.post(g,M).pipe(Ve(I=>this.restExtractor.handleError(I)));}removeRegistrations(t){let e=Gn(t);return un(e).pipe(gn(o=>this.authHttp.delete(ht.BASE_REGISTRATION_URL+"/"+o.id)),pn(),Ve(o=>this.restExtractor.handleError(o)));}};S(ht,"BASE_REGISTRATION_URL",Tt.apiUrl+"/api/v1/users/registrations"),S(ht,"\u0275fac",function(e){return new(e||ht)();}),S(ht,"\u0275prov",Ot({token:ht,factory:ht.ɵfac}));var hn=ht;var W_={VALIDATORS:[Ii.required,Ii.minLength(2),Ii.maxLength(3e3)],MESSAGES:{required:"Moderation response is required.",minlength:"Moderation response must be at least 2 characters long.",maxlength:"Moderation response cannot be more than 3000 characters long."}};var Nm=["modal"],Sm=n=>({"input-error":n});function fm(n,t){n&1&&(r(0,"my-alert",10),l(1,2),i());}function Mm(n,t){n&1&&(r(0,"my-alert",10),l(1,3),i());}function Im(n,t){if(n&1&&c(0,fm,2,0,"my-alert",10)(1,Mm,2,0,"my-alert",10),n&2){let e=s();u(e.hasMultipleRegistrations()?0:1);}}function Am(n,t){if(n&1&&(V(0,5,1),m(1,"strong")(2,"em"),k()),n&2){let e=s(3);a(2),L(e.registrations.length),$(0);}}function Tm(n,t){if(n&1&&(V(0,5,2),m(1,"strong")(2,"em"),k()),n&2){let e=s(3);a(2),L(e.registration.username),$(0);}}function Om(n,t){n&1&&wr(0);}function Pm(n,t){if(n&1&&U(0,Om,1,0,"ng-container",26),n&2){s(4);let e=ue(1);d("ngTemplateOutlet",e);}}function Rm(n,t){n&1&&l(0,6,1);}function vm(n,t){if(n&1&&(V(0,6,2),m(1,"em"),k()),n&2){let e=s(5);a(),L(e.registration.email),$(0);}}function Fm(n,t){if(n&1&&(r(0,"p"),V(1,6),c(2,Rm,1,0)(3,vm,2,1),k(),i()),n&2){let e=s(4);a(2),u(e.hasMultipleRegistrations()?2:3);}}function bm(n,t){if(n&1&&c(0,Pm,1,1,"ng-container")(1,Fm,4,1,"p"),n&2){let e=s(3);u(e.hasUnverifiedEmails()?0:1);}}function hm(n,t){n&1&&(r(0,"my-alert",10),l(1,7),i());}function ym(n,t){if(n&1&&(r(0,"p"),V(1,5),c(2,Am,3,1)(3,Tm,3,1),k(),i(),c(4,bm,2,1)(5,hm,2,0,"my-alert",10)),n&2){let e=s(2);a(2),u(e.hasMultipleRegistrations()?2:3),a(2),u(e.isEmailEnabled()?4:5);}}function Dm(n,t){n&1&&wr(0);}function Gm(n,t){if(n&1&&U(0,Dm,1,0,"ng-container",26),n&2){s(4);let e=ue(1);d("ngTemplateOutlet",e);}}function Lm(n,t){n&1&&(V(0,8,1),m(1,"strong"),k());}function $m(n,t){if(n&1&&(V(0,8,2),m(1,"em")(2,"strong"),k()),n&2){let e=s(5);a(2),L(e.registration.email),$(0);}}function xm(n,t){if(n&1&&(r(0,"p"),V(1,8),c(2,Lm,2,0)(3,$m,3,1),k(),i()),n&2){let e=s(4);a(2),u(e.hasMultipleRegistrations()?2:3);}}function wm(n,t){if(n&1&&c(0,Gm,1,1,"ng-container")(1,xm,4,1,"p"),n&2){let e=s(3);u(e.hasUnverifiedEmails()?0:1);}}function Um(n,t){n&1&&(r(0,"my-alert",10),l(1,9),i());}function Vm(n,t){if(n&1&&c(0,wm,2,1)(1,Um,2,0,"my-alert",10),n&2){let e=s(2);u(e.isEmailEnabled()?0:1);}}function km(n,t){if(n&1&&(r(0,"div",21),C(1),i()),n&2){let e=s(2);a(),b(" ",e.formErrors.moderationResponse," ");}}function zm(n,t){if(n&1){let e=H();r(0,"div",11)(1,"h4",12),C(2),i(),r(3,"button",13),T("click",function(){D(e);let _=s();return G(_.hide());}),m(4,"my-global-icon",14),i()(),r(5,"form",15),T("ngSubmit",function(){D(e);let _=s();return G(_.processRegistration());}),r(6,"div",16)(7,"div",17),c(8,ym,6,2)(9,Vm,2,1),i(),r(10,"div",18)(11,"label",19),l(12,4),i(),m(13,"textarea",20),c(14,km,2,1,"div",21),i(),r(15,"div",18),m(16,"my-peertube-checkbox",22),i()(),r(17,"div",23)(18,"input",24),T("click",function(){D(e);let _=s();return G(_.hide());})("key.enter",function(){D(e);let _=s();return G(_.hide());}),i(),m(19,"input",25),i()();}if(n&2){let e=s();a(2),b(" ",e.getModalTitle()," "),a(3),d("formGroup",e.form),a(3),u(e.isAccept()?8:e.isReject()?9:-1),a(5),d("ngClass",x(7,Sm,e.formErrors.moderationResponse)),a(),u(e.formErrors.moderationResponse?14:-1),a(5),d("value",e.getSubmitValue())("disabled",!e.form.valid);}}var $n=class $n extends Jt{formReactiveService=p(Se);server=p(j);
1modalService=p(Ti);notifier=p(K);registrationService=p(hn);modal=me("modal");registrationProcessed=zn();registrations=[];openedModal;processMode;ngOnInit(){this.buildForm({moderationResponse:W_,preventEmailDelivery:null});}isAccept(){return this.processMode==="accept";}isReject(){return this.processMode==="reject";}openModal(t,e){this.processMode=e,this.registrations=Gn(t),this.shouldDisableEmailDelivery()?(this.form.get("preventEmailDelivery").disable(),this.form.patchValue({preventEmailDelivery:!0})):(this.form.get("preventEmailDelivery").enable(),this.form.patchValue({preventEmailDelivery:!1})),this.openedModal=this.modalService.open(this.modal(),{centered:!0});}hide(){this.form.reset(),this.registrations=[],this.openedModal.close();}getSubmitValue(){let t=this.registrations.length,e=this.isAccept()?"{count, plural, =1 {Accept registration} other {Accept registrations}}":"{count, plural, =1 {Reject registration} other {Reject registrations}}";return Y(e,{count:t});}getModalTitle(){let t=this.registrations.length,e=this.isAccept()?"{count, plural, =1 {Accept registration} other {Accept {count} registrations}}":"{count, plural, =1 {Reject registration} other {Reject {count} registrations}}";return Y(e,{count:t});}hasMultipleRegistrations(){return this.registrations.length>1;}get registration(){return this.registrations[0];}processRegistration(){return this.isAccept()?this.acceptRegistration():this.rejectRegistration();}isEmailEnabled(){return this.server.getHTMLConfig().email.enabled;}hasUnverifiedEmails(){return this.registrations.some(t=>t.emailVerified!==!0);}shouldDisableEmailDelivery(){return!this.isEmailEnabled()||this.hasUnverifiedEmails();}acceptRegistration(){let t=this.form.value.moderationResponse,e=this.form.value.preventEmailDelivery;un(this.registrations).pipe(gn(o=>this.registrationService.acceptRegistration({registration:o,moderationResponse:t,preventEmailDelivery:e})),pn()).subscribe({next:()=>{let o=this.registrations.length,_=Y("{count, plural, =1 {{username} account created} other {{count} accounts created}}",{count:o,username:this.registration?.username});this.notifier.success(_),this.registrationProcessed.emit(),this.hide();},error:o=>this.notifier.handleError(o)});}rejectRegistration(){let t=this.form.value.moderationResponse,e=this.form.value.preventEmailDelivery;un(this.registrations).pipe(gn(o=>this.registrationService.rejectRegistration({registration:o,moderationResponse:t,preventEmailDelivery:e})),pn()).subscribe({next:()=>{let o=this.registrations.length,_=Y("{count, plural, =1 {{username} registration rejected} other {{count} registrations rejected}}",{count:o,username:this.registration?.username});this.notifier.success(_),this.registrationProcessed.emit(),this.hide();},error:o=>this.notifier.handleError(o)});}};S($n,"\u0275fac",(()=>{let t;return function(o){return(t||(t=Ut($n)))(o||$n);};})()),S($n,"\u0275cmp",O({type:$n,selectors:[["my-process-registration-modal"]],viewQuery:function(e,o){e&1&&Ae(o.modal,Nm,5),e&2&&Te();},outputs:{registrationProcessed:"registrationProcessed"},features:[pt],decls:4,vars:0,consts:()=>{let t;t=" At least one registration email has not been verified. Email delivery has been disabled by default. ";let e;e=" The registration email has not been verified. Email delivery has been disabled by default. ";let o;o="Close this modal";let _;_="Prevent email from being sent to the user";let g;g="Cancel";let M;M="Send a message to the user";let I;I=""+"\uFFFD*2:1\uFFFD"+""+"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"+"Accepting"+"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"+"\xA0"+"[\uFFFD#2:1\uFFFD|\uFFFD#2:2\uFFFD]"+""+"\uFFFD0:1\uFFFD"+""+"[\uFFFD/#2:1\uFFFD|\uFFFD/#2:2\uFFFD]"+" registrations will create the accounts and channels. "+"\uFFFD/*2:1\uFFFD"+""+"\uFFFD*3:2\uFFFD"+""+"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"+"Accepting"+"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"+"\xA0"+"[\uFFFD#2:1\uFFFD|\uFFFD#2:2\uFFFD]"+""+"\uFFFD0:2\uFFFD"+""+"[\uFFFD/#2:1\uFFFD|\uFFFD/#2:2\uFFFD]"+" registration will create the account and channel. "+"\uFFFD/*3:2\uFFFD"+"",I=X(I);let P;P=""+"\uFFFD*2:1\uFFFD"+" An email will be sent to each user explaining its account has been created with the moderation response you'll write below. "+"\uFFFD/*2:1\uFFFD"+""+"\uFFFD*3:2\uFFFD"+" An email will be sent to "+"\uFFFD#1:2\uFFFD"+""+"\uFFFD0:2\uFFFD"+""+"\uFFFD/#1:2\uFFFD"+" explaining its account has been created with the moderation response you'll write below. "+"\uFFFD/*3:2\uFFFD"+"";let y;y=" Emails are not enabled on this instance so PeerTube won't be able to send an email explaining accounts have been created. ";let F;F=""+"\uFFFD*2:1\uFFFD"+" An email will be sent to each user explaining its registration request has been "+"[\uFFFD#1:1\uFFFD|\uFFFD#2:2\uFFFD]"+"rejected"+"[\uFFFD/#1:1\uFFFD|\uFFFD/#2:2\uFFFD]"+" with the moderation response you'll write below. "+"\uFFFD/*2:1\uFFFD"+""+"\uFFFD*3:2\uFFFD"+" An email will be sent to "+"\uFFFD#1:2\uFFFD"+""+"\uFFFD0:2\uFFFD"+""+"\uFFFD/#1:2\uFFFD"+" explaining its registration request has been "+"[\uFFFD#1:1\uFFFD|\uFFFD#2:2\uFFFD]"+"rejected"+"[\uFFFD/#1:1\uFFFD|\uFFFD/#2:2\uFFFD]"+" with the moderation response you'll write below. "+"\uFFFD/*3:2\uFFFD"+"",F=X(F);let h;return h=" Emails are not enabled on this instance so PeerTube won't be able to send an email explaining registration requests have been rejected. ",[["unverifiedEmailsMessage",""],["modal",""],t,e,M,I,P,y,F,h,["type","warning"],[1,"modal-header"],[1,"modal-title"],["title",o,1,"border-0","p-0",3,"click"],["iconName","cross"],["novalidate","",3,"ngSubmit","formGroup"],[1,"modal-body","mb-3"],[1,"description"],[1,"form-group"],["for","moderationResponse"],["formControlName","moderationResponse","ngbAutofocus","","name","moderationResponse","id","moderationResponse",1,"form-control",3,"ngClass"],["role","alert",1,"form-error"],["inputName","preventEmailDelivery","formControlName","preventEmailDelivery","labelText",_],[1,"modal-footer","inputs"],["type","button","role","button","value",g,1,"peertube-button","secondary-button",3,"click","key.enter"],["type","submit",1,"peertube-button","primary-button",3,"value","disabled"],[4,"ngTemplateOutlet"]];},template:function(e,o){e&1&&U(0,Im,2,1,"ng-template",null,0,v)(2,zm,20,9,"ng-template",null,1,v);},dependencies:[Le,Ce,Sn,Qe,ae,Ne,De,se,Ee,Re,Pe,Ge,Je,st],encapsulation:2}));var dr=$n;function Xm(n,t){if(n&1&&C(0),n&2){let e=s(2);b(" \u2713 ",e.entry().email," ");}}function Bm(n,t){if(n&1&&(gt(0,"em"),C(1),Ct()),n&2){let e=s(3);a(),b("? ",e.entry().email);}}function Wm(n,t){if(n&1&&c(0,Bm,2,1,"em"),n&2){let e=s(2);u(e.entry().emailVerified?-1:0);}}function Hm(n,t){if(n&1&&c(0,Xm,1,1)(1,Wm,1,1),n&2){let e=s();u(e.entry().emailVerified===!0?0:1);}}function jm(n,t){if(n&1&&C(0),n&2){let e=s();b(" ",e.entry().email," ");}}var Ao=class Ao{entry=ce(void 0);
1showEmailVerifyInformation=ce(void 0,{transform:Mi});getTitle(){return this.entry().emailVerified?"User email has been verified":"User email hasn't been verified";}};S(Ao,"\u0275fac",function(e){return new(e||Ao)();}),S(Ao,"\u0275cmp",O({type:Ao,selectors:[["my-user-email-info"]],inputs:{entry:[1,"entry"],showEmailVerifyInformation:[1,"showEmailVerifyInformation"]},decls:4,vars:3,consts:[[3,"href","title"]],template:function(e,o){e&1&&(En(0),gt(1,"a",0),c(2,Hm,2,1)(3,jm,1,1),Ct(),Nn()),e&2&&(a(),fi("href","mailto:"+o.entry().email,at)("title",o.getTitle()),a(),u(o.showEmailVerifyInformation()?2:3));},styles:["a[_ngcontent-%COMP%]{color:var(--fg)}a[_ngcontent-%COMP%]:hover{text-decoration:underline}"]}));var To=Ao;var Qm=["processRegistrationModal"],Jm=["table"],H_=n=>({state:n});function qm(n,t){if(n&1&&(E(0),l(1,7),Q(2,"myNumberFormatter"),N()),n&2){let e=t.$implicit;a(2),L(e)(ke(2,2,e)),$(1);}}function Km(n,t){if(n&1&&(r(0,"td")(1,"div",16)(2,"div")(3,"span"),C(4),i(),r(5,"span",17),C(6),i()()()()),n&2){let e=s().$implicit;a(4),f(e.username),a(2),f(e.accountDisplayName);}}function Ym(n,t){if(n&1&&(r(0,"td"),m(1,"my-user-email-info",18),i()),n&2){let e=s().$implicit,o=s();a(),d("entry",e)("showEmailVerifyInformation",o.requiresEmailVerification);}}function Zm(n,t){if(n&1&&(r(0,"td")(1,"div",16)(2,"div")(3,"span"),C(4),i(),r(5,"span",17),C(6),i()()()()),n&2){let e=s().$implicit;a(4),f(e.channelHandle),a(2),f(e.channelDisplayName);}}function ec(n,t){if(n&1&&(r(0,"td",14),C(1),i()),n&2){let e=s().$implicit;d("ngbTooltip",e.registrationReason),a(),b(" ",e.registrationReason," ");}}function tc(n,t){if(n&1&&(r(0,"a",19),m(1,"my-global-icon",21),i()),n&2){let e=s(2).$implicit,o=s();d("queryParams",x(2,H_,e.state.id))("title",o.getStateFilterTitle(e.state.label));}}function nc(n,t){if(n&1&&(r(0,"a",20),m(1,"my-global-icon",22),i()),n&2){let e=s(2).$implicit,o=s();d("queryParams",x(2,H_,e.state.id))("title",o.getStateFilterTitle(e.state.label));}}function oc(n,t){if(n&1&&(r(0,"td",15),c(1,tc,2,4,"a",19)(2,nc,2,4,"a",20),i()),n&2){let e=s().$implicit,o=s();a(),u(o.isRegistrationAccepted(e)?1:o.isRegistrationRejected(e)?2:-1);}}function ic(n,t){if(n&1&&(r(0,"td",14),C(1),i()),n&2){let e=s().$implicit;d("ngbTooltip",e.moderationResponse),a(),b(" ",e.moderationResponse," ");}}function rc(n,t){if(n&1&&(r(0,"td"),C(1),Q(2,"ptDate"),i()),n&2){let e=s().$implicit;a(),f(_e(2,1,e.createdAt,"short"));}}function ac(n,t){if(n&1&&(c(0,Km,7,2,"td"),c(1,Ym,2,2,"td"),c(2,Zm,7,2,"td"),c(3,ec,2,2,"td",14),c(4,oc,3,1,"td",15),c(5,ic,2,2,"td",14),c(6,rc,3,4,"td")),n&2){s();let e=ue(1);u(e.isColumnDisplayed("account")?0:-1),a(),u(e.isColumnDisplayed("email")?1:-1),a(),u(e.isColumnDisplayed("channel")?2:-1),a(),u(e.isColumnDisplayed("registrationReason")?3:-1),a(),u(e.isColumnDisplayed("state")?4:-1),a(),u(e.isColumnDisplayed("moderationResponse")?5:-1),a(),u(e.isColumnDisplayed("createdAt")?6:-1);}}function lc(n,t){if(n&1&&m(0,"my-action-dropdown",23),n&2){let e=t.$implicit,o=s();d("actions",o.registrationActions)("entry",e);}}function _c(n,t){if(n&1&&(r(0,"div")(1,"span",27),l(2,9),i(),m(3,"span",28),i()),n&2){let e=s().$implicit;a(3),d("innerHTML",e.moderationResponseHTML,Yt);}}function sc(n,t){if(n&1&&(r(0,"div",24)(1,"div",25)(2,"div",26)(3,"span",27),l(4,8),i(),m(5,"span",28),i(),c(6,_c,4,1,"div"),i()()),n&2){let e=t.$implicit;a(5),d("innerHTML",e.registrationReasonHTML,Yt),a(),u(e.moderationResponse?6:-1);}}function dc(n,t){n&1&&(E(0),l(1,10),N());}function mc(n,t){n&1&&(E(0),l(1,11),N());}function cc(n,t){if(n&1&&c(0,dc,2,0,"ng-container")(1,mc,2,0,"ng-container"),n&2){let e=t.search,o=t.hasFilters;u(e||o?0:1);}}var Oo=class Oo{server=p(j);notifier=p(K);markdownRenderer=p(vi);confirmService=p(xe);adminRegistrationService=p(hn);processRegistrationModal=me("processRegistrationModal");table=me("table");registrationActions=[];bulkActions=[];requiresEmailVerification;columns=[{id:"account",label:"Account",sortable:!1},{id:"email",label:"Email",sortable:!1},{id:"channel",label:"Channel",sortable:!1},{id:"registrationReason",label:"Registration reason",sortable:!1},{id:"state",label:"State",sortable:!0},{id:"moderationResponse",label:"Moderation response",sortable:!1},{id:"createdAt",label:"Requested on",sortable:!0}];dataLoader;inputFilters=[{type:"options",key:"state",title:"Registration state",options:[{value:"all",label:"All registrations"}
1,{value:In.ACCEPTED,label:"Accepted registrations"},{value:In.REJECTED,label:"Rejected registrations"},{value:In.PENDING,label:"Pending registrations"}]}];constructor(){this.dataLoader=this._dataLoader.bind(this);let{simpleActions:t,bulkActions:e}=no([[{label:()=>"Accept",handler:o=>this.openRegistrationRequestProcessModal(o,"accept"),isDisplayed:o=>o.state.id===In.PENDING,enableBulk:!0},{label:()=>"Reject",handler:o=>this.openRegistrationRequestProcessModal(o,"reject"),isDisplayed:o=>o.state.id===In.PENDING,enableBulk:!0}],[{label:()=>"Remove",description:"Remove the request from the list. User can register again.",handler:o=>this.removeRegistrations(o),enableBulk:!0}]]);this.registrationActions=t,this.bulkActions=e;}ngOnInit(){this.server.getConfig().subscribe(t=>{this.requiresEmailVerification=t.signup.requiresEmailVerification;});}isRegistrationAccepted(t){return t.state.id===In.ACCEPTED;}isRegistrationRejected(t){return t.state.id===In.REJECTED;}onRegistrationProcessed(){this.table().loadData();}getStateFilterTitle(t){return"Filter by state: "+t+"";}_dataLoader(t){let g=t,{state:e}=g,o=Ci(g,["state"]),_;return e&&(_=[e]),this.adminRegistrationService.listRegistrations(Xe(fe({},o),{stateOneOf:_})).pipe(Be(M=>le(this,null,function*(){for(let I of M.data)I.registrationReasonHTML=yield this.toHtml(I.registrationReason),I.moderationResponseHTML=yield this.toHtml(I.moderationResponse);return M;})));}openRegistrationRequestProcessModal(t,e){this.processRegistrationModal().openModal(t,e);}removeRegistrations(t){return le(this,null,function*(){let e={count:t.length,username:t[0].username},o=Y("Do you really want to delete {count, plural, =1 {{username} registration request?} other {{count} registration requests?}}",e);(yield this.confirmService.confirm(o,"Delete"))!==!1&&this.adminRegistrationService.removeRegistrations(t).subscribe({next:()=>{let g=Y("Removed {count, plural, =1 {{username} registration request} other {{count} registration requests}}",e);this.notifier.success(g),this.table().loadData();},error:g=>this.notifier.handleError(g)});});}toHtml(t){return this.markdownRenderer.textMarkdownToHTML({markdown:t});}};S(Oo,"\u0275fac",function(e){return new(e||Oo)();}),S(Oo,"\u0275cmp",O({type:Oo,selectors:[["my-registration-list"]],viewQuery:function(e,o){e&1&&Ae(o.processRegistrationModal,Qm,5)(o.table,Jm,5),e&2&&Te(2);},decls:14,vars:4,consts:()=>{let t;t="registrations per page";let e;e="{VAR_PLURAL, plural, =0 {No registration} =1 {1 registration} other {{INTERPOLATION} registrations}}",e=X(e,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let o;o="Actions";let _;_="Registration reason:";let g;g="Moderation response:";let M;M="No registrations found matching current filters.";let I;return I="No registrations found.",[["table",""],["totalTitle",""],["tableCells",""],["actionCell",""],["expandedRow",""],["noResults",""],["processRegistrationModal",""],e,_,g,M,I,["key","RegistrationListComponent","paginatorText",t,"columnConfig","true","searchInput","true",3,"defaultColumns","dataLoader","bulkActions","inputFilters"],[3,"registrationProcessed"],["container","body","placement","left auto",1,"max-width-300px","ellipsis",3,"ngbTooltip"],[1,"abuse-states"],[1,"chip","two-lines"],[1,"muted"],[3,"entry","showEmailVerifyInformation"],["routerLink",".",1,"pt-badge","badge-success",3,"queryParams","title"],["routerLink",".",1,"pt-badge","badge-danger",3,"queryParams","title"],["iconName","tick"],["iconName","cross"],["placement","bottom-right top-right left auto","container","body","label",o,3,"actions","entry"],[1,"moderation-expanded"],[1,"left"],[1,"d-flex"],[1,"moderation-expanded-label"],[1,"moderation-expanded-text",3,"innerHTML"]];},template:function(e,o){e&1&&(r(0,"my-table",12,0),U(2,qm,3,4,"ng-template",null,1,v)(4,ac,7,7,"ng-template",null,2,v)(6,lc,1,2,"ng-template",null,3,v)(8,sc,7,2,"ng-template",null,4,v)(10,cc,2,1,"ng-template",null,5,v),i(),r(12,"my-process-registration-modal",13,6),T("registrationProcessed",function(){return o.onRegistrationProcessed();}),i()),e&2&&d("defaultColumns",o.columns)("dataLoader",o.dataLoader)("bulkActions",o.bulkActions)("inputFilters",o.inputFilters);},dependencies:[Oe,Qe,Qt,Oi,To,dr,He,qe,We],styles:[".moderation-expanded[_ngcontent-%COMP%]{font-size:90%;display:flex;flex-wrap:wrap;justify-content:space-between}.moderation-expanded[_ngcontent-%COMP%]   .moderation-expanded-label[_ngcontent-%COMP%]{font-weight:600;display:inline-block;vertical-align:top;text-align:end;min-width:100px;margin-inline-end:.3125rem}.moderation-expanded[_ngcontent-%COMP%]   .moderation-expanded-text[_ngcontent-%COMP%]{display:inline-flex;word-wrap:break-word}.moderation-expanded[_ngcontent-%COMP%]   .moderation-expanded-text[_ngcontent-%COMP%]     p:last-child{margin-bottom:0!important}.moderation-expanded[_ngcontent-%COMP%]   .right[_ngcontent-%COMP%]{width:50%;max-width:500px}@media screen and (max-width:1000px){.moderation-expanded[_ngcontent-%COMP%]   .right[_ngcontent-%COMP%]{width:100%}}.table-comment-link[_ngcontent-%COMP%], .table-account-link[_ngcontent-%COMP%]{text-decoration:none;color:var(--fg)}.table-comment-link[_ngcontent-%COMP%]:focus:not(:focus-visible), .table-account-link[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none!important}.table-comment-link[_ngcontent-%COMP%]     p:last-child, .table-account-link[_ngcontent-%COMP%]     p:last-child{margin:0}my-abuse-details[_ngcontent-%COMP%]{width:100%}@media screen and (max-width:1000px){.abuse-messages[_ngcontent-%COMP%]{justify-content:flex-start!important}}","my-global-icon[_ngcontent-%COMP%]{width:24px;height:24px}"]}));var mr=Oo;var Po=class Po{};S(Po,"\u0275fac",function(e){return new(e||Po)();}),S(Po,"\u0275cmp",O({type:Po,selectors:[["ng-component"]],decls:5,vars:0,consts:()=>{let t;t="Video name/description and comments that contain any of the watched words are automatically tagged with the name of the list.";let e;return e="These automatic tags can be used to filter comments and videos.",[t,e,[1,"d-block"],[1,"d-block","mb-3"],["mode","admin"]];},template:function(e,o){e&1&&(r(0,"em",2),l(1,0),i(),r(2,"em",3),l(3,1),i(),m(4,"my-watched-words-list-admin-owner",4));},dependencies:[b_],encapsulation:2}));var cr=Po;var Hr=[{path:"moderation",children:[{path:"",redirectTo:"abuses/list",pathMatch:"full"},{path:"video-abuses",redirectTo:"abuses/list",pathMatch:"full"},{path:"video-abuses/list",redirectTo:"abuses/list",pathMatch:"full"},{path:"abuses/list",component:ar,canActivate:[ze],data:{userRight:q.MANAGE_ABUSES,meta:{title:"Reports"}}},{path:"video-blacklist",redirectTo:"video-blocks/list",pathMatch:"full"},{path:"video-auto-blacklist",redirectTo:"video-blocks/list",pathMatch:"full"},{path:"video-auto-blacklist/list",redirectTo:"video-blocks/list",pathMatch:"full"},{path:"video-blacklist",redirectTo:"video-blocks/list",pathMatch:"full"},{path:"video-blocks/list",component:sr,canActivate:[ze],data:{userRight:q.MANAGE_VIDEO_BLACKLIST,meta:{title:"Blocked videos"}}},{path:"registrations/list",component:mr,canActivate:[ze],data:{userRight:q.MANAGE_REGISTRATIONS,meta:{title:"User registrations"}}},{path:"video-comments",redirectTo:"video-comments/list",pathMatch:"full"},{path:"video-comments/list",redirectTo:"/admin/overview/comments/list",pathMatch:"full"}
1,{path:"blocklist/accounts",component:lr,canActivate:[ze],data:{userRight:q.MANAGE_ACCOUNTS_BLOCKLIST,meta:{title:"Muted accounts"}}},{path:"blocklist/servers",component:_r,canActivate:[ze],data:{userRight:q.MANAGE_SERVERS_BLOCKLIST,meta:{title:"Muted platforms"}}},{path:"watched-words/list",component:cr,canActivate:[ze],data:{userRight:q.MANAGE_INSTANCE_WATCHED_WORDS,meta:{title:"Watched words"}}}]}];var uc=[[["badges"]],[["buttons"]]],pc=["badges","buttons"],Ro=class Ro{pluginApiService=p(jt);plugin=ce(void 0);version=ce(void 0);pluginType=ce(void 0);getPluginOrThemeHref(t){return this.pluginApiService.getPluginOrThemeHref(this.pluginType(),t);}};S(Ro,"\u0275fac",function(e){return new(e||Ro)();}),S(Ro,"\u0275cmp",O({type:Ro,selectors:[["my-plugin-card"]],inputs:{plugin:[1,"plugin"],version:[1,"version"],pluginType:[1,"pluginType"]},ngContentSelectors:pc,decls:17,vars:5,consts:()=>{let t;t="Homepage (new window)";let e;return e="NPM page (new window)",[[1,"card","plugin"],[1,"card-body"],[1,"first-row"],[1,"plugin-name"],[1,"plugin-version"],["target","_blank","rel","noopener noreferrer","title",t,1,"plugin-icon",3,"href"],["iconName","home"],["target","_blank","rel","noopener noreferrer","title",e,1,"plugin-icon",3,"href"],["iconName","registry"],[1,"buttons"],[1,"second-row"],["dir","auto",1,"description"]];},template:function(e,o){e&1&&(sl(uc),r(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),C(4),i(),r(5,"span",4),C(6),i(),r(7,"a",5),m(8,"my-global-icon",6),i(),r(9,"a",7),m(10,"my-global-icon",8),i(),Ur(11),r(12,"div",9),Ur(13,1),i()(),r(14,"div",10)(15,"div",11),C(16),i()()()()),e&2&&(a(4),f(o.plugin().name),a(2),f(o.version()),a(),d("href",o.plugin().homepage,at),a(2),d("href",o.getPluginOrThemeHref(o.plugin().name),at),a(7),f(o.plugin().description));},dependencies:[Qe],styles:[".plugin[_ngcontent-%COMP%]{margin:15px 0;background-color:var(--bg-secondary-400)}.first-row[_ngcontent-%COMP%]{display:flex;align-items:center;margin-bottom:10px}.first-row[_ngcontent-%COMP%]   .plugin-name[_ngcontent-%COMP%]{font-weight:600;margin-inline-end:.625rem}.first-row[_ngcontent-%COMP%]   .plugin-version[_ngcontent-%COMP%]{opacity:.7}.first-row[_ngcontent-%COMP%]   .plugin-icon[_ngcontent-%COMP%]{margin-inline-start:.625rem}.first-row[_ngcontent-%COMP%]   .plugin-icon[_ngcontent-%COMP%]   my-global-icon[_ngcontent-%COMP%]{color:var(--fg-400)}.first-row[_ngcontent-%COMP%]   .plugin-icon[_ngcontent-%COMP%]   my-global-icon[iconName=npm][_ngcontent-%COMP%]     svg path{fill:var(--fg-400)}.first-row[_ngcontent-%COMP%]   .buttons[_ngcontent-%COMP%]{width:max-content;margin-inline-start:auto}.second-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr auto;align-items:center;justify-content:space-between}.second-row[_ngcontent-%COMP%]   .description[_ngcontent-%COMP%]{opacity:.8}@media screen and (max-width:800px){.first-row[_ngcontent-%COMP%]{flex-wrap:wrap}.first-row[_ngcontent-%COMP%]   .buttons[_ngcontent-%COMP%]{flex-basis:100%;margin-top:10px}}"]}));var vo=Ro;function gc(n,t){if(n&1&&(r(0,"div",0),C(1),i()),n&2){let e=s();a(),b(" ",e.getNoResultMessage()," ");}}function Cc(n,t){if(n&1&&m(0,"my-button",4),n&2){let e=s().$implicit,o=s();d("ptRouterLink",o.getShowRouterLink(e))("responsiveLabel",!0);}}function Ec(n,t){if(n&1){let e=H();r(0,"my-button",7),T("click",function(){D(e);let _=s().$implicit,g=s();return G(g.update(_));}),i();}if(n&2){let e=s().$implicit,o=s();d("loading",o.isUpdating(e))("label",o.getUpdateLabel(e))("responsiveLabel",!0),Cn("disabled",o.isUpdating(e)||o.isUninstalling(e));}}function Nc(n,t){if(n&1){let e=H();r(0,"my-plugin-card",2)(1,"div",3),c(2,Cc,1,2,"my-button",4),c(3,Ec,1,4,"my-button",5),r(4,"my-delete-button",6),T("click",function(){let _=D(e).$implicit,g=s();return G(g.uninstall(_));}),i()()();}if(n&2){let e=t.$implicit,o=s();d("plugin",e)("version",e.version)("pluginType",o.pluginType),a(2),u(o.isTheme(e)?-1:2),a(),u(o.isUpdateAvailable(e)?3:-1),a(),d("responsiveLabel",!0)("disabled",o.isUpdating(e)||o.isUninstalling(e));}}var Fo=class Fo{pluginService=p(Tn);pluginApiService=p(jt);notifier=p(K);confirmService=p(xe);router=p(Mn);route=p($e);pluginType;pagination={currentPage:1,itemsPerPage:10,totalItems:null};sort="name";plugins=[];updating={};uninstalling={};
1onDataSubject=new oi();ngOnInit(){if(!this.route.snapshot.queryParams.pluginType){let t={pluginType:_t.PLUGIN};this.router.navigate([],{queryParams:t,replaceUrl:!0});}this.route.queryParams.subscribe(t=>{t.pluginType&&(this.pluginType=parseInt(t.pluginType,10),this.reloadPlugins());});}reloadPlugins(){this.plugins=[],Ri(this.pagination),this.loadMorePlugins();}loadMorePlugins(){this.pluginApiService.getPlugins(this.pluginType,this.pagination,this.sort).subscribe({next:t=>{this.plugins=this.plugins.concat(t.data),this.pagination.totalItems=t.total,this.onDataSubject.next(t.data);},error:t=>this.notifier.handleError(t)});}onNearOfBottom(){Pi(this.pagination)&&(this.pagination.currentPage+=1,this.loadMorePlugins());}getNoResultMessage(){return this.pluginType===_t.PLUGIN?"You don't have plugins installed yet.":"You don't have themes installed yet.";}isUpdateAvailable(t){return t.latestVersion&&Rl(t.latestVersion,t.version)>0;}getUpdateLabel(t){return"Update to "+t.latestVersion+"";}isUpdating(t){return!!this.updating[this.getPluginKey(t)];}isUninstalling(t){return!!this.uninstalling[this.getPluginKey(t)];}isTheme(t){return t.type===_t.THEME;}uninstall(t){return le(this,null,function*(){let e=this.getPluginKey(t);this.uninstalling[e]||(yield this.confirmService.confirm("Do you really want to uninstall "+t.name+"?","Uninstall"))===!1||(this.uninstalling[e]=!0,this.pluginApiService.uninstall(t.name,t.type).subscribe({next:()=>{this.notifier.success(""+t.name+" uninstalled."),this.plugins=this.plugins.filter(_=>_.name!==t.name),wl(this.pagination),this.uninstalling[e]=!1;},error:_=>{this.notifier.handleError(_),this.uninstalling[e]=!1;}}));});}update(t){return le(this,null,function*(){let e=this.getPluginKey(t);this.updating[e]||this.isMajorUpgrade(t)&&(yield this.confirmService.confirm("This is a major plugin upgrade. Please go on the plugin homepage to check potential release notes.","Upgrade",{confirmButtonText:"Proceed upgrade"}))===!1||(this.updating[e]=!0,this.pluginApiService.update(t.name,t.type).pipe().subscribe({next:o=>{this.updating[e]=!1,this.notifier.success(""+t.name+" updated."),Object.assign(t,o);},error:o=>{this.notifier.handleError(o),this.updating[e]=!1;}}));});}getShowRouterLink(t){return["/admin","settings","plugins","show",this.pluginService.nameToNpmName(t.name,t.type)];}getPluginOrThemeHref(t){return this.pluginApiService.getPluginOrThemeHref(this.pluginType,t);}getPluginKey(t){return t.name+t.type;}isMajorUpgrade(t){if(!t.latestVersion)return!1;let e=parseInt(t.latestVersion.split(".")[0]),o=parseInt(t.version.split(".")[0]);return e>o;}};S(Fo,"\u0275fac",function(e){return new(e||Fo)();}),S(Fo,"\u0275cmp",O({type:Fo,selectors:[["my-plugin-list-installed"]],decls:4,vars:2,consts:()=>{let t;t="Settings";let e;return e="Uninstall",[[1,"no-results"],["myInfiniteScroller","",1,"plugins",3,"nearOfBottom","dataObservable"],[3,"plugin","version","pluginType"],["ngProjectAs","buttons",5,["buttons"]],["label",t,"icon","config",3,"ptRouterLink","responsiveLabel"],["icon","refresh",1,"update-button",3,"loading","label","responsiveLabel"],["label",e,3,"click","responsiveLabel","disabled"],["icon","refresh",1,"update-button",3,"click","loading","label","responsiveLabel"]];},template:function(e,o){e&1&&(c(0,gc,2,1,"div",0),r(1,"div",1),T("nearOfBottom",function(){return o.onNearOfBottom();}),pe(2,Nc,5,7,"my-plugin-card",2,Ie),i()),e&2&&(u(o.pagination.totalItems===0?0:-1),a(),d("dataObservable",o.onDataSubject.asObservable()),a(),ge(o.plugins));},dependencies:[hi,vo,bt,Pn],styles:[".update-button[disabled=true][_ngcontent-%COMP%]     .action-button{cursor:default!important}my-edit-button[_ngcontent-%COMP%], my-button[_ngcontent-%COMP%]{margin-inline-end:.625rem}"]}));var ur=Fo;function Sc(n,t){n&1&&(r(0,"my-alert",8),l(1,0),i());}function fc(n,t){n&1&&(E(0),l(1,1),N());}function Mc(n,t){n&1&&(E(0),l(1,2),N());}function Ic(n,t){if(n&1&&(r(0,"div"),m(1,"my-global-icon",15),c(2,fc,2,0,"ng-container")(3,Mc,2,0,"ng-container"),i()),n&2){let e=s();a(2),u(e.isThemeSearch()?2:3);}}function Ac(n,t){if(n&1&&(r(0,"div"),m(1,"my-global-icon",16),E(2),l(3,3),N(),i()),n&2){let e=s();a(3),L(e.pagination.totalItems)(e.pagination.totalItems)(e.search),$(3);}}function Tc(n,t){n&1&&(r(0,"div",12),l(1,4),i());}function Oc(n,t){n&1&&(r(0,"span",18),l(1,5),i());}function Pc(n,t){n&1&&(r(0,"span",19),l(1,6),i());}function Rc(n,t){n&1&&(r(0,"span",20),l(1,7),i());}function vc(n,t){if(n&1&&m(0,"my-edit-button",22),n&2){let e=s().$implicit,o=s();
1d("ptRouterLink",o.getShowRouterLink(e))("responsiveLabel",!0);}}function Fc(n,t){if(n&1){let e=H();r(0,"my-button",24),T("click",function(){D(e);let _=s().$implicit,g=s();return G(g.install(_));}),i();}if(n&2){let e=s().$implicit,o=s();d("loading",o.isInstalling(e))("responsiveLabel",!0),Cn("disabled",o.isInstalling(e));}}function bc(n,t){if(n&1&&(r(0,"my-plugin-card",14)(1,"div",17),c(2,Oc,2,0,"span",18),c(3,Pc,2,0,"span",19),c(4,Rc,2,0,"span",20),i(),r(5,"div",21),c(6,vc,1,2,"my-edit-button",22),c(7,Fc,1,3,"my-button",23),i()()),n&2){let e=t.$implicit,o=s();d("plugin",e)("version",e.latestVersion)("pluginType",o.pluginType),a(2),u(e.installed?2:-1),a(),u(e.official?3:-1),a(),u(e.recommended?4:-1),a(2),u(e.installed===!0&&!o.isThemeSearch()?6:-1),a(),u(e.installed===!1?7:-1);}}var bo=class bo{pluginService=p(Tn);pluginApiService=p(jt);notifier=p(K);confirmService=p(xe);router=p(Mn);route=p($e);pluginType;pagination={currentPage:1,itemsPerPage:10,totalItems:null};sort="-trending";search="";isSearching=!1;plugins=[];installing={};pluginInstalled=!1;
1onDataSubject=new oi();searchSubject=new oi();ngOnInit(){if(!this.route.snapshot.queryParams.pluginType){let t={pluginType:_t.PLUGIN};this.router.navigate([],{queryParams:t});}this.route.queryParams.subscribe(t=>{t.pluginType&&(this.pluginType=parseInt(t.pluginType,10),this.search=t.search||"",this.reloadPlugins());}),this.searchSubject.asObservable().pipe(Ni(400),il()).subscribe(t=>this.router.navigate([],{queryParams:{search:t},queryParamsHandling:"merge"}));}onSearchChange(t){let e=t.target;this.searchSubject.next(e.value);}reloadPlugins(){Ri(this.pagination),this.plugins=[],this.loadMorePlugins();}loadMorePlugins(){this.isSearching=!0,this.pluginApiService.searchAvailablePlugins(this.pluginType,this.pagination,this.sort,this.search).subscribe({next:t=>{this.isSearching=!1,this.plugins=this.plugins.concat(t.data),this.pagination.totalItems=t.total,this.onDataSubject.next(t.data);},error:t=>{Ai.error(t);let e="The plugin index is not available. Please retry later.";this.notifier.error(e);}});}onNearOfBottom(){Pi(this.pagination)&&(this.pagination.currentPage+=1,this.loadMorePlugins());}isInstalling(t){return!!this.installing[t.npmName];}getShowRouterLink(t){return["/admin","settings","plugins","show",this.pluginService.nameToNpmName(t.name,this.pluginType)];}isThemeSearch(){return this.pluginType===_t.THEME;}install(t){return le(this,null,function*(){this.installing[t.npmName]||(yield this.confirmService.confirm("Please only install plugins or themes you trust, since they can execute any code on your platform.","Install "+t.name+"?"))===!1||(this.installing[t.npmName]=!0,this.pluginApiService.install(t.npmName).subscribe({next:()=>{this.installing[t.npmName]=!1,this.pluginInstalled=!0,this.notifier.success(""+t.name+" installed."),t.installed=!0;},error:o=>{this.installing[t.npmName]=!1,this.notifier.handleError(o);}}));});}};S(bo,"\u0275fac",function(e){return new(e||bo)();}),S(bo,"\u0275cmp",O({type:bo,selectors:[["my-plugin-search"]],decls:10,vars:5,consts:()=>{let t;t="Search...";let e;e=" To load your new installed plugins or themes, refresh the page. ";let o;o="Popular themes";let _;_="Popular plugins";let g;g="{VAR_PLURAL, plural, =1 {result} other {results}}",g=X(g,{VAR_PLURAL:"\uFFFD1\uFFFD"});let M;M=" "+"\uFFFD0\uFFFD"+" "+g+" for \""+"\uFFFD2\uFFFD"+"\" ";let I;I="No results.";let P;P="This plugin is developed by Framasoft, the not-for-profit that develops PeerTube";let y;y="This plugin is recommended by Framasoft, the not-for-profit that develops PeerTube";let F;F="Settings";let h;h="Installed";let J;J="Official";let w;return w="Recommended",[e,o,_,M,I,h,J,w,["type","primary",1,"mt-3"],[1,"result-and-search"],[1,"search-bar"],["type","text","placeholder",t,"myAutofocus","",3,"input"],[1,"no-results"],["myInfiniteScroller","",1,"plugins",3,"nearOfBottom","dataObservable"],[3,"plugin","version","pluginType"],["iconName","trending","aria-hidden","true"],["iconName","search"],["ngProjectAs","badges",5,["badges"]],[1,"pt-badge","badge-success"],["title",P,1,"pt-badge","badge-primary"],["title",y,1,"pt-badge","badge-primary"],["ngProjectAs","buttons",5,["buttons"]],["label",F,3,"ptRouterLink","responsiveLabel"],["label","Install","icon","cloud-download",3,"loading","responsiveLabel"],["label","Install","icon","cloud-download",3,"click","loading","responsiveLabel"]];},template:function(e,o){e&1&&(c(0,Sc,2,0,"my-alert",8),r(1,"div",9),c(2,Ic,4,1,"div"),c(3,Ac,4,3,"div"),r(4,"div",10)(5,"input",11),T("input",function(g){return o.onSearchChange(g);}),i()()(),c(6,Tc,2,0,"div",12),r(7,"div",13),T("nearOfBottom",function(){return o.onNearOfBottom();}),pe(8,bc,8,8,"my-plugin-card",14,Ie),i()),e&2&&(u(o.pluginInstalled?0:-1),a(2),u(o.search?-1:2),a(),u(o.search&&!o.isSearching?3:-1),a(3),u(o.pagination.totalItems===0?6:-1),a(),d("dataObservable",o.onDataSubject.asObservable()),a(),ge(o.plugins));},dependencies:[Qe,y_,hi,vo,h_,bt,st],styles:[".result-and-search[_ngcontent-%COMP%]{font-size:22px;font-weight:600;margin:30px 0 15px;display:flex;flex-wrap:wrap;row-gap:.5rem;justify-content:space-between}.result-and-search[_ngcontent-%COMP%]   my-global-icon[_ngcontent-%COMP%]{display:inline-block;width:24px;height:24px;line-height:24px;margin-inline-end:.3125rem}
1.search-bar[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:500px;max-width:500px;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}.search-bar[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}.search-bar[_ngcontent-%COMP%]   input[readonly][_ngcontent-%COMP%]{color:var(--fg-300)}.search-bar[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]:focus, .search-bar[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}.search-bar[_ngcontent-%COMP%]   input[disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:540px){.search-bar[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{width:100%}}.pt-badge[_ngcontent-%COMP%]{font-size:13px;margin-inline-start:.9375rem}"]}));var pr=bo;function hc(n,t){if(n&1&&(r(0,"div",5),m(1,"my-dynamic-form-field",7),i()),n&2){let e=t.$implicit,o=s(3);d("id",o.getWrapperId(e)),a(),d("hidden",o.isSettingHidden(e))("form",o.form)("setting",e)("formErrors",o.formErrors);}}function yc(n,t){if(n&1){let e=H();r(0,"form",4),T("ngSubmit",function(){D(e);let _=s(2);return G(_.formValidated());}),pe(1,hc,2,5,"div",5,Ie),m(3,"input",6),i();}if(n&2){let e=s(2);d("formGroup",e.form),a(),ge(e.registeredSettings),a(2),d("disabled",!e.form.valid);}}function Dc(n,t){n&1&&(r(0,"div",8),l(1,0),i());}function Gc(n,t){n&1&&(r(0,"div",8),l(1,1),i());}function Lc(n,t){if(n&1&&c(0,Dc,2,0,"div",8)(1,Gc,2,0,"div",8),n&2){let e=s(2);u(e.isPlugin()?0:e.isTheme()?1:-1);}}function $c(n,t){if(n&1&&(r(0,"h2",2),E(1),C(2),N(),C(3),i(),c(4,yc,4,2,"form",3),c(5,Lc,2,1)),n&2){let e=s();a(2),f(e.pluginTypeLabel),a(),b(" ",e.plugin.name," "),a(),u(e.hasRegisteredSettings()?4:-1),a(),u(e.hasRegisteredSettings()?-1:5);}}var xn=class xn extends Jt{formReactiveService=p(Se);pluginService=p(Tn);pluginAPIService=p(jt);notifier=p(K);hooks=p(Fi);route=p($e);server=p(j);plugin;registeredSettings=[];pluginTypeLabel;sub;npmName;ngOnInit(){this.sub=this.route.params.subscribe(t=>{this.npmName=t.npmName,this.loadPlugin(this.npmName);});}ngOnDestroy(){this.sub&&this.sub.unsubscribe();}formValidated(){let t=this.form.value;this.pluginAPIService.updatePluginSettings(this.plugin.name,this.plugin.type,t).pipe(Be(()=>this.server.resetConfig())).subscribe({next:()=>{this.notifier.success("Settings updated.");},error:e=>this.notifier.handleError(e)});}hasRegisteredSettings(){return Array.isArray(this.registeredSettings)&&this.registeredSettings.length!==0;}isSettingHidden(t){let e=this.pluginService.getRegisteredSettingsScript(this.npmName);return e?.isSettingHidden?e.isSettingHidden({setting:t,formValues:this.form.value}):!1;}getWrapperId(t){if(t.name)return t.name+"-wrapper";}isTheme(){return this.plugin.type===_t.THEME;}isPlugin(){return this.plugin.type===_t.PLUGIN;}loadPlugin(t){this.pluginAPIService.getPlugin(t).pipe(Be(e=>this.pluginAPIService.getPluginRegisteredSettings(e.name,e.type).pipe(lt(o=>({plugin:e,registeredSettings:o.registeredSettings}))))).subscribe({next:_=>le(this,[_],function*({plugin:e,registeredSettings:o}){this.plugin=e,this.registeredSettings=yield this.translateSettings(o),this.pluginTypeLabel=this.pluginAPIService.getPluginTypeLabel(this.plugin.type),this.buildSettingsForm();}),error:e=>this.notifier.handleError(e)});}buildSettingsForm(){let t={},e={};for(let o of this.registeredSettings)t[o.name]=null,e[o.name]=this.getSetting(o.name);this.buildForm(t),this.form.patchValue(e),this.hooks.runAction("action:admin-plugin-settings.init","admin-plugin",{npmName:this.npmName});}getSetting(t){let e=this.plugin.settings;return e?.[t]!==void 0?e[t]:this.registeredSettings.find(_=>_.name===t).default;}translateSettings(t){return le(this,null,function*(){for(let e of t)yield this.pluginService.translateSetting(this.npmName,e);return t;});}};S(xn,"\u0275fac",(()=>{let t;return function(o){return(t||(t=Ut(xn)))(o||xn);};})()),S(xn,"\u0275cmp",O({type:xn,selectors:[["my-plugin-show-installed"]],features:[pt],decls:1,vars:1,consts:()=>{let t;t="This plugin does not have settings.";let e;return e="This theme does not have settings.",[t,e,[1,"mb-4"],[3,"formGroup"],[3,"ngSubmit","formGroup"],[3,"id"],["type","submit","value","Update plugin settings",1,"peertube-button","primary-button","mt-3",3,"disabled"],[3,"hidden","form","setting","formErrors"],[1,"n
1o-settings"]];},template:function(e,o){e&1&&c(0,$c,6,4),e&2&&u(o.plugin?0:-1);},dependencies:[ae,Ne,Ee,Re,Pe,D_],encapsulation:2}));var gr=xn;var j_=[{path:"plugins",canActivate:[ze],data:{userRight:q.MANAGE_PLUGINS},children:[{path:"",redirectTo:"list-installed?pluginType=1",pathMatch:"full"},{path:"list-installed",component:ur,data:{meta:{title:"List installed plugins"}}},{path:"search",component:pr,data:{meta:{title:"Search plugins"}}},{path:"show/:npmName",component:gr,data:{meta:{title:"Show plugin"}}}]}];var qt=class qt{authHttp=p(Rt);restExtractor=p(Ft);getDebug(){return this.authHttp.get(qt.BASE_DEBUG_URL).pipe(Ve(t=>this.restExtractor.handleError(t)));}testEmails(t){let e={command:"test-emails",email:t};return this.authHttp.post(qt.BASE_DEBUG_URL+"/run-command",e).pipe(Ve(o=>this.restExtractor.handleError(o)));}};S(qt,"BASE_DEBUG_URL",Tt.apiUrl+"/api/v1/server/debug"),S(qt,"\u0275fac",function(e){return new(e||qt)();}),S(qt,"\u0275prov",Ot({token:qt,factory:qt.ɵfac}));var ho=qt;var yo=class yo{debugService=p(ho);notifier=p(K);server=p(j);debug;testEmail;ngOnInit(){this.load();}isEmailDisabled(){return this.server.getHTMLConfig().email.enabled===!1;}load(){this.debugService.getDebug().subscribe({next:t=>this.debug=t,error:t=>this.notifier.handleError(t)});}sendTestEmails(){this.debugService.testEmails(this.testEmail).subscribe({next:()=>{this.testEmail="",this.notifier.success("Emails will be sent!");},error:t=>this.notifier.handleError(t)});}};S(yo,"\u0275fac",function(e){return new(e||yo)();}),S(yo,"\u0275cmp",O({type:yo,selectors:[["ng-component"]],decls:34,vars:4,consts:()=>{let t;t="Send test emails";let e;e="IP address";let o;o="PeerTube thinks your web browser public IP is "+"\uFFFD#6\uFFFD"+""+"\uFFFD0\uFFFD"+""+"\uFFFD/#6\uFFFD"+".";let _;_="If this is not your correct public IP, please consider fixing it because:";let g;g="Views may not be counted correctly (reduced compared to what they should be)";let M;M="Anti brute force system could be overzealous";let I;I="P2P system could not work correctly";let P;P="To fix it:";let y;y="Check the "+"\uFFFD#22\uFFFD"+"trust_proxy"+"\uFFFD/#22\uFFFD"+" configuration key";let F;F="Emails";let h;h="Send test emails to this address";let J;return J="PeerTube can send all available email templates to the following email address",[e,o,_,g,M,I,P,y,F,h,J,[1,"root"],[1,"fs-5"],[1,"mt-4",3,"hidden"],[3,"ngSubmit"],[1,"form-group"],["for","fromName"],[1,"form-group-description"],["type","email","id","test-email","name","test-email",1,"form-control",3,"ngModelChange","ngModel"],["type","submit","value",t,1,"peertube-button","primary-button",3,"disabled"]];},template:function(e,o){e&1&&(r(0,"div",11)(1,"div")(2,"h2",12),l(3,0),i(),r(4,"p"),V(5,1),m(6,"strong"),k(),i(),r(7,"p"),l(8,2),i(),r(9,"ul")(10,"li"),l(11,3),i(),r(12,"li"),l(13,4),i(),r(14,"li"),l(15,5),i()(),r(16,"p"),l(17,6),i(),m(18,"p"),r(19,"ul")(20,"li"),V(21,7),m(22,"code"),k(),i()()(),r(23,"div",13)(24,"h2",12),l(25,8),i(),r(26,"form",14),T("ngSubmit",function(){return o.sendTestEmails();}),r(27,"div",15)(28,"label",16),l(29,9),i(),r(30,"div",17),l(31,10),i(),r(32,"input",18),St("ngModelChange",function(g){return Nt(o.testEmail,g)||(o.testEmail=g),g;}),i()(),m(33,"input",19),i()()()),e&2&&(a(6),L(o.debug==null?null:o.debug.ip),$(5),a(17),d("hidden",o.isEmailDisabled()),a(9),Et("ngModel",o.testEmail),a(),d("disabled",!o.testEmail));},dependencies:[ae,Ne,De,se,Ee,kt,Nl],styles:["code[_ngcontent-%COMP%]{font-size:14px;font-weight:600}.root[_ngcontent-%COMP%]{max-width:500px}"]}));var Cr=yo;var nn=class nn{authHttp=p(Rt);restService=p(Wt);restExtractor=p(Ft);listJobs(t){let{jobState:e,jobType:o,pagination:_,sort:g}=t,M=new Pt();return M=this.restService.addRestGetParams(M,_,g),o&&(M=M.append("jobType",o)),this.authHttp.get(nn.BASE_JOB_URL+`/${e||""}`,{params:M}).pipe(lt(I=>this.restExtractor.convertResultListDateToHuman(I,["createdAt","processedOn","finishedOn"],"precise")),lt(I=>this.restExtractor.applyToResultListData(I,this.prettyPrintData.bind(this))),lt(I=>this.restExtractor.applyToResultListData(I,this.buildUniqId.bind(this))),Ve(I=>this.restExtractor.handleError(I)));}prettyPrintData(t){let e=JSON.stringify(t.data,null,2);return Object.assign(t,{data:e});}buildUniqId(t){return Object.assign(t,{uniqId:`${t.id}-${t.type}`});}};S(nn,"BASE_JOB_URL",Tt.apiUrl+"/api/v1/jobs"),S(nn,"\u0275fac",function(e){return new(e||nn)();}),S(nn,"\u0275prov",Ot({token:nn,factory:nn.ɵfac}));var Do=nn;var xc=["table"],wc=n=>({type:n}),Uc=n=>({state:n}),Vc=(n,t,e,o)=>[n,t,e,o];function kc(n,t){n&1&&(r(0,"div",9),V(1,5),m(2,"a",11),k(),i());}function zc(n,t){if(n&1&&(E(0),l(1,6),Q(2,"myNumberFormatter"),N()),n&2){let e=t.$implicit;a(2),L(e)(ke(2,2,e)),$(1);}}function Xc(n,t){if(n&1&&(r(0,"td",12),C(1),i()),n&2){let e=s().$implicit;d("title",e.id),a(),f(e.id);}}function Bc(n,t){if(n&1&&(r(0,"td",13)(1,"a",19),C(2),i()()),n&2){let e=s().$implicit,o=s();a(),d("queryParams",x(4,wc,e.type))("title",o.getTypeFilterTitle(e.type))("ngClass",o.getRandomJobTypeBadge(e.type)),a(),f(e.type);}}function Wc(n,t){if(n&1&&(r(0,"td",14),C(1),i()),n&2){let e=s().$implicit;a(),f(e.priority);}}function Hc(n,t){if(n&1&&(r(0,"td",15)(1,"a",20),C(2),i()()),n&2){let e=s().$implicit,o=s();a(),d("queryParams",x(4,Uc,e.state))("ngClass",o.getJobStateClasses(e.state))("title",o.getStateFilterTitle(e.state)),a(),f(e.state);}}function jc(n,t){if(n&1&&C(0),n&2){let e=s(2).$implicit,o=s();b(" ",o.getProgress(e)," ");}}function Qc(n,t){if(n&1&&(r(0,"td",16),c(1,jc,1,1),i()),n&2){let e=s().$implicit,o=s();a(),u(o.hasProgress(e)?1:-1);}}
1function Jc(n,t){if(n&1&&(r(0,"td",17),C(1),i()),n&2){let e=s().$implicit;a(),f(e.createdAt);}}function qc(n,t){if(n&1&&(r(0,"td",18)(1,"div"),C(2),i(),r(3,"div"),C(4),i()()),n&2){let e=s().$implicit;a(2),f(e.processedOn),a(2),f(e.finishedOn);}}function Kc(n,t){if(n&1&&(c(0,Xc,2,2,"td",12),c(1,Bc,3,6,"td",13),c(2,Wc,2,1,"td",14),c(3,Hc,3,6,"td",15),c(4,Qc,2,1,"td",16),c(5,Jc,2,1,"td",17),c(6,qc,5,2,"td",18)),n&2){s();let e=ue(2);u(e.isColumnDisplayed("id")?0:-1),a(),u(e.isColumnDisplayed("type")?1:-1),a(),u(e.isColumnDisplayed("priority")?2:-1),a(),u(e.isColumnDisplayed("state")&&e.isColumnDisplayed("state")?3:-1),a(),u(e.isColumnDisplayed("progress")?4:-1),a(),u(e.isColumnDisplayed("createdAt")?5:-1),a(),u(e.isColumnDisplayed("processed")?6:-1);}}function Yc(n,t){if(n&1&&(r(0,"div")(1,"pre"),C(2),i()(),r(3,"div")(4,"pre"),C(5),i()(),r(6,"div")(7,"pre"),C(8),i()()),n&2){let e=t.$implicit;a(2),f(pl(3,Vc,"Job: "+e.id,"Type: "+e.type,"Processed on "+(e.processedOn||"-"),"Finished on "+(e.finishedOn||"-")).join(`
2`)),a(3),f(e.data),a(3),f(e.error);}}function Zc(n,t){n&1&&(E(0),l(1,7),N());}function eu(n,t){n&1&&(E(0),l(1,8),N());}function tu(n,t){if(n&1&&(r(0,"div"),c(1,Zc,2,0,"ng-container")(2,eu,2,0,"ng-container"),i()),n&2){let e=t.search,o=t.filters;a(),u(e||o?1:2);}}var Go=class Go{server=p(j);jobsService=p(Do);peertubeBadgeService=p(ji);table=me("table");jobStates=["active","completed","failed","waiting","delayed"];jobTypes=["activitypub-cleaner","activitypub-follow","activitypub-http-broadcast-parallel","activitypub-http-broadcast","activitypub-http-fetcher","activitypub-http-unicast","activitypub-refresher","actor-keys","after-video-channel-import","create-user-export","email","federate-video","generate-video-storyboard","manage-video-torrent","move-to-file-system","move-to-object-storage","notify","transcoding-job-builder","video-channel-import","video-file-import","video-import","video-live-ending","video-redundancy","video-studio-edition","video-transcoding","video-transcription","videos-stats"];inputFilters=[{type:"select",key:"type",title:"Job type",clearable:!0,filter:!0,items:this.jobTypes.map(t=>({id:t,label:t.toLocaleUpperCase(),classes:["pt-badge",this.getRandomJobTypeBadge(t)]}))},{type:"select",key:"state",title:"Job state",clearable:!0,items:this.jobStates.map(t=>({id:t,label:t.toLocaleUpperCase(),classes:this.getJobStateClasses(t)}))}];columns=[{id:"id",class:"job-id",label:"ID",sortable:!1},{id:"type",class:"job-type",label:"Type",sortable:!1},{id:"priority",class:"job-priority",label:"Priority",labelSmall:"(1 = highest priority)",sortable:!1},{id:"state",class:"job-state",label:"State",sortable:!1},{id:"progress",class:"job-progress",label:"Progress",isDisplayed:()=>this.displayGlobalProgress,sortable:!1},{id:"createdAt",class:"job-date",label:"Created",sortable:!0},{id:"processed",label:"Processed/Finished",sortable:!1}];dataLoader;displayGlobalProgress=!0;constructor(){this.dataLoader=this._dataLoader.bind(this);}getJobStateClasses(t){switch(t){case void 0:case null:return[];case"active":return["pt-badge","badge-blue"];case"completed":return["pt-badge","badge-green"];case"delayed":case"prioritized":case"paused":return["pt-badge","badge-brown"];case"failed":return["pt-badge","badge-red"];case"waiting":case"waiting-children":return["pt-badge","badge-yellow"];}return t;}hasProgress(t){return t.type==="video-transcoding";}getProgress(t){return t.state==="active"?t.progress+"%":"";}getRandomJobTypeBadge(t){return this.peertubeBadgeService.getRandomBadge("type",t);}getStateFilterTitle(t){return"Filter by state: "+t.toLocaleUpperCase()+"";}getTypeFilterTitle(t){return"Filter by type: "+t.toLocaleUpperCase()+"";}isRunnerEnabled(){return this.server.isRemoteRunnersEnabled();}_dataLoader(t){let{pagination:e,sort:o,type:_,state:g}=t;return this.displayGlobalProgress=!_||_==="video-transcoding",this.jobsService.listJobs({jobState:g,jobType:_,pagination:e,sort:o});}};S(Go,"\u0275fac",function(e){return new(e||Go)();}),S(Go,"\u0275cmp",O({type:Go,selectors:[["my-jobs"]],viewQuery:function(e,o){e&1&&Ae(o.table,xc,5),e&2&&Te();},decls:11,vars:4,consts:()=>{let t;t="jobs per page";let e;e="Some jobs are also processed by "+"\uFFFD#2\uFFFD"+"remote runners"+"\uFFFD/#2\uFFFD"+".";let o;o="{VAR_PLURAL, plural, =0 {No job} =1 {1 job}
2 other {{INTERPOLATION} jobs}}",o=X(o,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let _;_="No job found for the current filters.";let g;return g="No job found.",[["table",""],["totalTitle",""],["tableCells",""],["expandedRow",""],["noResults",""],e,o,_,g,[1,"callout","callout-primary","mb-4"],["key","JobsComponent","dataKey","uniqId","paginatorText",t,"columnConfig","true","refreshButton","true",3,"defaultColumns","dataLoader","inputFilters"],["routerLink","/admin/settings/system/runners/jobs-list"],[1,"job-id",3,"title"],[1,"job-type"],[1,"job-priority"],[1,"job-state"],[1,"job-progress"],[1,"job-date"],[1,"fs-7"],["routerLink",".",1,"pt-badge","ellipsis",3,"queryParams","title","ngClass"],["routerLink",".",1,"ellipsis",3,"queryParams","ngClass","title"]];},template:function(e,o){e&1&&(c(0,kc,3,0,"div",9),r(1,"my-table",10,0),U(3,zc,3,4,"ng-template",null,1,v)(5,Kc,7,7,"ng-template",null,2,v)(7,Yc,9,8,"ng-template",null,3,v)(9,tu,3,1,"ng-template",null,4,v),i()),e&2&&(u(o.isRunnerEnabled()?0:-1),a(),d("defaultColumns",o.columns)("dataLoader",o.dataLoader)("inputFilters",o.inputFilters));},dependencies:[Le,Ce,ae,He,Oe,We],styles:["@media screen and (min-width:1000px){.job-id[_ngcontent-%COMP%]{max-width:30vw!important}.job-type[_ngcontent-%COMP%], .job-state[_ngcontent-%COMP%], .job-priority[_ngcontent-%COMP%]{width:150px!important}.job-date[_ngcontent-%COMP%]{width:200px!important}}pre[_ngcontent-%COMP%]{font-size:11px}.job-error[_ngcontent-%COMP%]{color:var(--red)}"]}));var Er=Go;var Nr=class{date;localeDate;level;message;meta;by;domain;action;constructor(t){this.date=new Date(t.timestamp),this.localeDate=this.date.toLocaleString(),this.level=t.level,this.message=t.message;let e=hl(t,"timestamp","level","message","label");if(Object.keys(e).length!==0&&(this.meta=JSON.stringify(e,void 0,2)),t.level==="audit")try{let o=JSON.parse(t.message);this.by=o.user,this.domain=o.domain,this.action=o.action,this.meta=JSON.stringify(o,null,2),this.message="";}catch(o){Ai.error("Cannot parse audit message.",o);}}};var xt=class xt{authHttp=p(Rt);restService=p(Wt);restExtractor=p(Ft);getLogs(t){let{isAuditLog:e,startDate:o,endDate:_,tagsOneOf:g}=t,M=new Pt();M=M.append("startDate",o),e||(M=M.append("level",t.level)),_&&(M=M.append("endDate",t.endDate)),g&&(M=this.restService.addArrayParams(M,"tagsOneOf",g));let I=e?xt.BASE_AUDIT_LOG_URL:xt.BASE_LOG_URL;return this.authHttp.get(I,{params:M}).pipe(lt(P=>P.map(y=>new Nr(y))),Ve(P=>this.restExtractor.handleError(P)));}};S(xt,"BASE_LOG_URL",Tt.apiUrl+"/api/v1/server/logs"),S(xt,"BASE_AUDIT_LOG_URL",Tt.apiUrl+"/api/v1/server/audit-logs"),S(xt,"\u0275fac",function(e){return new(e||xt)();}),S(xt,"\u0275prov",Ot({token:xt,factory:xt.ɵfac}));var Lo=xt;var nu=["logsElement"],ou=["logsContent"],iu=(n,t)=>({error:n,warn:t});function ru(n,t){if(n&1&&(r(0,"option",15),C(1),i()),n&2){let e=t.$implicit;d("value",e.id),a(),f(e.label);}}function au(n,t){if(n&1&&(C(0),Q(1,"ptDate"),r(2,"span"),l(3,6),i(),C(4,") ")),n&2){let e=t.$implicit;Zt(" ",e.label," (",_e(1,2,e.id,e.dateFormat)," - ");}}function lu(n,t){if(n&1&&(r(0,"span",24),C(1,"\u2B24"),i(),C(2)),n&2){let e=t.$implicit;d("ngClass",e.id),a(2),b(" ",e.label," ");}}function _u(n,t){if(n&1){let e=H();r(0,"div")(1,"label",25),l(2,7),i(),r(3,"my-select-tags",26),St("ngModelChange",function(_){D(e);let g=s(2);return Nt(g.tagsOneOf,_)||(g.tagsOneOf=_),G(_);}),T("ngModelChange",function(){D(e);let _=s(2);return G(_.refresh());}),i()();}if(n&2){let e=s(2);a(3),Et("ngModel",e.tagsOneOf);}}function su(n,t){if(n&1){let e=H();r(0,"div")(1,"label",20),l(2,4),i(),r(3,"my-select-options",21),St("ngModelChange",function(_){D(e);let g=s();return Nt(g.startDate,_)||(g.startDate=_),G(_);}),T("ngModelChange",function(){D(e);let _=s();return G(_.refresh());}),U(4,au,5,5,"ng-template",null,2,v),i()(),r(6,"div")(7,"label",22),l(8,5),i(),r(9,"my-select-options",23),St("ngModelChange",function(_){D(e);let g=s();return Nt(g.level,_)||(g.level=_),G(_);}),T("ngModelChange",function(){D(e);let _=s();return G(_.refresh());}),U(10,lu,3,2,"ng-template",null,2,v),i()(),c(12,_u,4,1,"div");}if(n&2){let e=s();a(3),d("items",e.timeChoices),Et("ngModel",e.startDate),a(6),d("items",e.levelChoices),Et("ngModel",e.level),a(3),u(e.isAuditLog()?-1:12);}}function du(n,t){n&1&&(r(0,"div"),l(1,8),i());}function mu(n,t){if(n&1&&m(0,"my-copy-button",18),n&2){s();let e=ue(17);d("elementContent",e);}}function cu(n,t){n&1&&(r(0,"div"),l(1,9),i());}function uu(n,t){if(n&1&&(r(0,"strong",29),l(1,10),i()),n&2){let e=s().$implicit;a(),L(e.by),$(1);}}function pu(n,t){if(n&1&&(r(0,"strong",30),C(1),i()),n&2){let e=s().$implicit;a(),Zt("",e.domain," -> ",e.action);}}function gu(n,t){if(n&1&&(r(0,"div",19)(1,"span",27),C(2),i(),r(3,"span",28),C(4),i(),c(5,uu,2,1,"strong",29),c(6,pu,2,2,"strong",30),C(7),r(8,"pre"),C(9),i()()),n&2){let e=t.$implicit;d("ngClass",ul(7,iu,e.level==="error",e.level==="warn")),a(2),f(e.level),a(2),b("[",e.localeDate,"]"),a(),u(e.by?5:-1),a(),u(e.domain?6:-1),a(),b(" ",e.message," "),a(2),f(e.meta);}}var on=class on{logsService=p(Lo);notifier=p(K);localStorage=p(Ul);logsElement=me("logsElement");logsContent=me("logsContent");loading=!1;rawLogs;logs=[];timeChoices=[];levelChoices=[];logTypeChoices=[];startDate;level;logType;tagsOneOf=[];ngOnInit(){this.buildTimeChoices(),this.buildLevelChoices(),this.buildLogTypeChoices(),this.loadPreviousChoices(),this.load();}refresh(){this.logs=[],this.localStorage.setItem(on.LS_LOG_TYPE_CHOICE_KEY,this.logType),this.load();}load(){this.loading=!0;let t=this.tagsOneOf.length!==0?this.tagsOneOf:void 0;this.logsService.getLogs({isAuditLog:this.isAuditLog(),level:this.level,startDate:this.startDate,tagsOneOf:t}).subscribe({next:e=>{this.logs=e,this.rawLogs=this.logs.map(o=>`${o.level} ${o.localeDate} ${o.message} ${o.meta}`).join(`
3`),setTimeout(()=>{this.logsElement().nativeElement.scrollIntoView({block:"end",inline:"nearest"});});},error:e=>this.notifier.handleError(e),complete:()=>this.loading=!1});}isAuditLog(){return this.logType==="audit";}buildTimeChoices(){let t=new Date();t.setHours(t.getHours()-1);let e=new Date();e.setDate(e.getDate()-1);let o=new Date();o.setDate(o.getDate()-7),this.timeChoices=[{id:o.toISOString(),label:"Last week",dateFormat:"shortDate"},{id:e.toISOString(),label:"Last day",dateFormat:"short"},{id:t.toISOString(),label:"Last hour",dateFormat:"mediumTime"}],this.startDate=t.toISOString();}buildLevelChoices(){this.levelChoices=[{id:"debug",label:"debug"},{id:"info",label:"info"},{id:"warn",label:"warning"},{id:"error",label:"error"}],this.level="warn";}buildLogTypeChoices(){this.logTypeChoices=[{id:"standard",label:"Standard logs"},{id:"audit",label:"Audit logs"}];}loadPreviousChoices(){this.logType=this.localStorage.getItem(on.LS_LOG_TYPE_CHOICE_KEY),this.logType!=="standard"&&this.logType!=="audit"&&(this.logType="audit");}};S(on,"LS_LOG_TYPE_CHOICE_KEY","admin-logs-log-type-choice"),S(on,"\u0275fac",function(e){return new(e||on)();}),S(on,"\u0275cmp",O({type:on,selectors:[["ng-component"]],viewQuery:function(e,o){e&1&&Ae(
3o.logsElement,nu,5)(o.logsContent,ou,5),e&2&&Te(2);},decls:20,vars:5,consts:()=>{let t;t="Refresh";let e;e="Logs copied";let o;o="Copy logs";let _;_="Log type";let g;g="Start date";let M;M="Log level";let I;I="now";let P;P="Example: ffmpeg, api";let y;y="Filter logs by tags";let F;F="Loading...";let h;h="No log.";let J;return J="By "+"\uFFFD0\uFFFD"+" ->",[["logsElement",""],["logsContent",""],["selectOption",""],_,g,M,I,y,F,h,J,[1,"header"],["for","log-type"],[1,"peertube-select-container"],["id","log-type",1,"form-control",3,"ngModelChange","ngModel"],[3,"value"],["label",t,"icon","refresh",1,"mt-auto",3,"click"],[1,"logs"],["notification",e,"title",o,"withBorder","true",3,"elementContent"],[1,"log-row",3,"ngClass"],["for","log-start-date"],["inputId","log-start-date",3,"ngModelChange","items","ngModel"],["for","log-level"],["inputId","log-level",3,"ngModelChange","items","ngModel"],[1,"level-choice","me-1",3,"ngClass"],["for","log-tags"],["inputId","log-tags","placeholder",P,3,"ngModelChange","ngModel"],[1,"log-level"],[1,"log-date"],[1,"log-by"],[1,"log-domain-action"]];},template:function(e,o){if(e&1){let _=H();r(0,"div",11)(1,"div")(2,"label",12),l(3,3),i(),r(4,"div",13)(5,"select",14),St("ngModelChange",function(M){return D(_),Nt(o.logType,M)||(o.logType=M),G(M);}),T("ngModelChange",function(){return o.refresh();}),pe(6,ru,2,2,"option",15,Ie),i()()(),c(8,su,13,5),r(9,"my-button",16),T("click",function(){return o.refresh();}),i()(),r(10,"div",17),c(11,du,2,0,"div"),r(12,"div",null,0),c(14,mu,1,1,"my-copy-button",18),c(15,cu,2,0,"div"),r(16,"div",null,1),pe(18,gu,10,10,"div",19,Ie),i()()();}e&2&&(a(5),Et("ngModel",o.logType),a(),ge(o.logTypeChoices),a(2),u(o.isAuditLog()?-1:8),a(3),u(o.loading?11:-1),a(3),u(o.logs.length!==0?14:-1),a(),u(!o.loading&&o.logs.length===0?15:-1),a(3),ge(o.logs));},dependencies:[ae,Xt,Bt,zt,se,kt,Ce,T_,bt,yi,It,qe],styles:[".logs[_ngcontent-%COMP%]{font-family:monospace;font-size:13px;max-height:500px;overflow-y:auto;color:#000;background:#fafafa;padding:20px}.logs[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{position:relative}.logs[_ngcontent-%COMP%]   .log-row[_ngcontent-%COMP%]{margin-top:1px;word-break:break-word}.logs[_ngcontent-%COMP%]   .log-row[_ngcontent-%COMP%]:hover{background:#00000012}.logs[_ngcontent-%COMP%]   .log-level[_ngcontent-%COMP%]{font-weight:600;margin-inline-end:.3125rem}.logs[_ngcontent-%COMP%]   .log-by[_ngcontent-%COMP%]{margin:0 5px}.logs[_ngcontent-%COMP%]   .warn[_ngcontent-%COMP%]{color:#c74801}.logs[_ngcontent-%COMP%]   .error[_ngcontent-%COMP%]{color:#dc262b}.logs[_ngcontent-%COMP%]   pre[_ngcontent-%COMP%]{margin-bottom:5px;white-space:pre-wrap;word-wrap:break-word}.header[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;flex-wrap:wrap;margin-bottom:10px}.header[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]{width:150px}@media screen and (max-width:180px){.header[_ngcontent-%COMP%]   .peertube-select-container[_ngcontent-%COMP%]{width:100%}}.header[_ngcontent-%COMP%]   my-select-tags[_ngcontent-%COMP%]{display:block;width:325px}.header[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{margin-bottom:10px;margin-inline-start:.625rem}.level-choice[_ngcontent-%COMP%]{font-size:14px;position:relative;top:-1px}.level-choice.debug[_ngcontent-%COMP%]{color:#c5c5c5}.level-choice.info[_ngcontent-%COMP%]{color:#88ccf7}.level-choice.warn[_ngcontent-%COMP%]{color:#fca607}.level-choice.error[_ngcontent-%COMP%]{color:var(--red)}my-copy-button[_ngcontent-%COMP%]{position:absolute;right:5px;background:var(--bg-secondary-300)}@media screen and (max-width:800px){.header[_ngcontent-%COMP%]{flex-direction:column}.header[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:100%!important;margin-inline-start:0!important}.header[_ngcontent-%COMP%]   my-button[_ngcontent-%COMP%]{text-align:center}}"]}));var Sr=on;var dt=class dt{authHttp=p(Rt);server=p(j);restService=p(Wt);restExtractor=p(Ft);listRegistrationTokens(t){let{pagination:e,sort:o}=t,_=new Pt();return _=this.restService.addRestGetParams(_,e,o),this.authHttp.get(dt.BASE_RUNNER_URL+"/registration-tokens",{params:_}).pipe(Ve(g=>this.restExtractor.handleError(g)));}generateToken(){return this.authHttp.post(dt.BASE_RUNNER_URL+"/registration-tokens/generate",{}).pipe(Ve(t=>this.restExtractor.handleError(t)));}
3removeToken(t){return this.authHttp.delete(dt.BASE_RUNNER_URL+"/registration-tokens/"+t.id).pipe(Ve(e=>this.restExtractor.handleError(e)));}listRunnerJobs(t){let{pagination:e,sort:o,search:_,stateOneOf:g,typeOneOf:M}=t,I=new Pt();return I=this.restService.addRestGetParams(I,e,o),_&&(I=I.append("search",_)),I=this.restService.addObjectParams(I,{stateOneOf:g,typeOneOf:M}),ol([this.authHttp.get(dt.BASE_RUNNER_URL+"/jobs",{params:I}),this.server.getServerLocale()]).pipe(lt(([P,y])=>{let F=P.data.map(h=>Xe(fe({},h),{state:{id:h.state.id,label:li(h.state.label,y)},payload:JSON.stringify(h.payload,null,2),privatePayload:JSON.stringify(h.privatePayload,null,2)}));return{total:P.total,data:F};}),lt(P=>this.restExtractor.convertResultListDateToHuman(P,["createdAt","startedAt","finishedAt"],"precise")),Ve(P=>this.restExtractor.handleError(P)));}cancelJobs(t){let e=Gn(t);return un(e).pipe(gn(o=>this.authHttp.post(dt.BASE_RUNNER_URL+"/jobs/"+o.uuid+"/cancel",{})),pn(),Ve(o=>this.restExtractor.handleError(o)));}removeJobs(t){let e=Gn(t);return un(e).pipe(gn(o=>this.authHttp.delete(dt.BASE_RUNNER_URL+"/jobs/"+o.uuid)),pn(),Ve(o=>this.restExtractor.handleError(o)));}listRunners(t){let{pagination:e,sort:o}=t,_=new Pt();return _=this.restService.addRestGetParams(_,e,o),this.authHttp.get(dt.BASE_RUNNER_URL+"/",{params:_}).pipe(Ve(g=>this.restExtractor.handleError(g)));}deleteRunner(t){return this.authHttp.delete(dt.BASE_RUNNER_URL+"/"+t.id).pipe(Ve(e=>this.restExtractor.handleError(e)));}};S(dt,"BASE_RUNNER_URL",Tt.apiUrl+"/api/v1/runners"),S(dt,"\u0275fac",function(e){return new(e||dt)();}),S(dt,"\u0275prov",Ot({token:dt,factory:dt.ɵfac}));var Kt=dt;var Cu=["table"],Eu=n=>({type:n}),Nu=n=>({state:n});function Su(n,t){if(n&1&&(E(0),l(1,6),Q(2,"myNumberFormatter"),N()),n&2){let e=t.$implicit;a(2),L(e)(ke(2,2,e)),$(1);}}function fu(n,t){if(n&1&&(r(0,"td"),C(1),i()),n&2){let e=s().$implicit;a(),f(e.uuid);}}function Mu(n,t){if(n&1&&(r(0,"td")(1,"a",12),C(2),i()()),n&2){let e=s().$implicit,o=s();a(),d("queryParams",x(4,Eu,e.type))("title",o.getTypeFilterTitle(e.type))("ngClass",o.getRandomRunnerTypeBadge(e.type)),a(),f(e.type);}}function Iu(n,t){if(n&1&&(r(0,"td")(1,"a",12),C(2),i()()),n&2){let e=s().$implicit,o=s();a(),d("queryParams",x(4,Nu,e.state.id))("title",o.getStateFilterTitle(e.state.label))("ngClass",o.getStateBadgeColor(e)),a(),f(e.state.label);}}function Au(n,t){if(n&1&&(r(0,"td"),C(1),i()),n&2){let e=s().$implicit;a(),f(e.priority);}}function Tu(n,t){if(n&1&&C(0),n&2){let e=s(2).$implicit;b(" ",e.progress,"% ");}}function Ou(n,t){if(n&1&&(r(0,"td"),c(1,Tu,1,1),i()),n&2){let e=s().$implicit;a(),u(e.progress?1:-1);}}function Pu(n,t){if(n&1&&(r(0,"div",13),C(1),i()),n&2){let e=s(2).$implicit,o=s();d("ngClass",o.getRandomRunnerNameBadge(e.runner.name)),a(),b(" ",e.runner.name," ");}}function Ru(n,t){if(n&1&&(r(0,"td"),c(1,Pu,2,2,"div",13),i()),n&2){let e=s().$implicit;a(),u(e.runner!=null&&e.runner.name?1:-1);}}function vu(n,t){if(n&1&&(r(0,"td"),C(1),i()),n&2){let e=s().$implicit;a(),f(e.createdAt);}}function Fu(n,t){if(n&1&&(r(0,"td",11)(1,"div"),C(2),i(),r(3,"div"),C(4),i()()),n&2){let e=s().$implicit;a(2),f(e.startedAt),a(2),f(e.finishedAt);}}function bu(n,t){if(n&1&&(c(0,fu,2,1,"td"),c(1,Mu,3,6,"td"),c(2,Iu,3,6,"td"),c(3,Au,2,1,"td"),c(4,Ou,2,1,"td"),c(5,Ru,2,1,"td"),c(6,vu,2,1,"td"),c(7,Fu,5,2,"td",11)),n&2){s();let e=ue(1);u(e.isColumnDisplayed("uuid")?0:-1),a(),u(e.isColumnDisplayed("type")?1:-1),a(),u(e.isColumnDisplayed("state")?2:-1),a(),u(e.isColumnDisplayed("priority")?3:-1),a(),u(e.isColumnDisplayed("progress")?4:-1),a(),u(e.isColumnDisplayed("runner")?5:-1),a(),u(e.isColumnDisplayed("createdAt")?6:-1),a(),u(e.isColumnDisplayed("processed")?7:-1);}}function hu(n,t){if(n&1&&m(0,"my-action-dropdown",14),n&2){let e=t.$implicit,o=s();d("actions",o.actions)("entry",e);}}function yu(n,t){if(n&1&&(r(0,"pre",17),C(1),i()),n&2){let e=s().$implicit;a(),f(e.error);}}function Du(n,t){if(n&1&&(r(0,"div",15),C(1),m(2,"br"),C(3),m(4,"br"),C(5),m(6,"br"),i(),r(7,"div",16)(8,"strong"),l(9,7),i(),r(10,"pre"),C(11),i()(),r(12,"div",16)(13,"strong"),l(14,8),i(),r(15,"pre"),C(16),i()(),c(17,yu,2,1,"pre",17)),n&2){let e=t.$implicit;a(),b(" Parent job: ",(e.parent==null?null:e.parent.uuid)||"-"," "),a(2),b(" Processed on ",e.startedAt||"-"," "),a(2),b(" Finished on ",e.finishedAt||"-"," "),a(6),f(e.payload),a(5),f(e.privatePayload),a(),u(e.error?17:-1);}}function Gu(n,t){n&1&&(E(0),l(1,9),N());}var $o=class $o{runnerService=p(Kt);notifier=p(K);confirmService=p(xe);peertubeBadgeService=p(ji);table=me("table");actions=[];bulkActions=[];jobStates=["completed","pending","processing","errored"];jobTypes=["vod-web-video-transcoding","vod-hls-transcoding","vod-audio-merge-transcoding","live-rtmp-hls-transcoding","video-studio-transcoding","video-transcription","generate-video-storyboard"];inputFilters=[{type:"select",key:"type",title:"Job type",clearable:!0,items:this.jobTypes.map(t=>({id:t,label:t.toLocaleUpperCase(),classes:["pt-badge",this.getRandomRunnerTypeBadge(t)]}))},{type:"select",key:"state",title:"Job state",clearable:!0,items:this.jobStates.map(t=>({id:t,label:t.toLocaleUpperCase(),classes:["pt-badge",this.getRandomRunnerNameBadge(t)]}))}];columns=[{id:"uuid",label:"UUID",sortable:!1},{id:"type",label:"Type",sortable:!1},{id:"state",label:"State",sortable:!0},{id:"priority",label:"Priority",sortable:!0},{id:"progress",label:"Progress",sortable:!0},{id:"runner",label:"Runner",sortable:!1},{id:"createdAt",label:"Created",sortable:!0},{id:"processed",label:"Processed/Finished",sortable:!1}];dataLoader;constructor(){this.dataLoader=this._dataLoader.bind(this);}ngOnInit(){let{simpleActions:t,bulkActions:e}=no([[{label:()=>"Cancel",handler:o=>this.cancelJobs(o),isDisplayed:o=>this.canCancelJob(o),enableBulk:!0}],[{label:()=>"Delete",handler:o=>this.removeJobs(o),enableBulk:!0}]]);this.actions=t,this.bulkActions=e;}cancelJobs(t){return le(this,null,function*(){let e=Y("Do you really want to cancel {count, plural, =1 {this job} other {{count} jobs}}? Children jobs will also be cancelled.",{count:t.length});(yield this.confirmService.confirm(e,"Cancel"))!==!1&&this.runnerService.cancelJobs(t).subscribe({next:()=>
3{this.table().loadData(),this.notifier.success(Y("{count, plural, =1 {Job cancelled} other {{count} jobs cancelled}}",{count:t.length}));},error:_=>this.notifier.handleError(_)});});}removeJobs(t){return le(this,null,function*(){let e=Y("Do you really want to remove {count, plural, =1 {this job} other {{count} jobs}}? Children jobs will also be removed.",{count:t.length});(yield this.confirmService.confirm(e,"Remove"))!==!1&&this.runnerService.removeJobs(t).subscribe({next:()=>{this.table().loadData(),this.notifier.success(Y("{count, plural, =1 {Job removed} other {{count} jobs removed}}",{count:t.length}));},error:_=>this.notifier.handleError(_)});});}getStateBadgeColor(t){switch(t.state.id){case ct.ERRORED:case ct.PARENT_ERRORED:return"badge-danger";case ct.COMPLETED:return"badge-success";case ct.PENDING:case ct.WAITING_FOR_PARENT_JOB:return"badge-warning";default:return"badge-info";}}getRandomRunnerNameBadge(t){return this.peertubeBadgeService.getRandomBadge("runner",t);}getRandomRunnerTypeBadge(t){return this.peertubeBadgeService.getRandomBadge("type",t);}getTypeFilterTitle(t){return"Filter jobs by type: "+t.toLocaleUpperCase()+"";}getStateFilterTitle(t){return"Filter jobs by state: "+t.toLocaleUpperCase()+"";}_dataLoader(t){let{pagination:e,sort:o,search:_,state:g,type:M}=t,I,P;return g&&(I=[],g==="completed"?I.push(ct.COMPLETED):g==="pending"?(I.push(ct.PENDING),I.push(ct.WAITING_FOR_PARENT_JOB)):g==="processing"?I.push(ct.PROCESSING):g==="errored"&&(I.push(ct.ERRORED),I.push(ct.PARENT_ERRORED))),M&&(P=[M]
3),this.runnerService.listRunnerJobs({pagination:e,sort:o,search:_,stateOneOf:I,typeOneOf:P});}canCancelJob(t){return t.state.id===ct.PENDING||t.state.id===ct.PROCESSING||t.state.id===ct.WAITING_FOR_PARENT_JOB;}};S($o,"\u0275fac",function(e){return new(e||$o)();}),S($o,"\u0275cmp",O({type:$o,selectors:[["my-runner-job-list"]],viewQuery:function(e,o){e&1&&Ae(o.table,Cu,5),e&2&&Te();},decls:12,vars:4,consts:()=>{let t;t="jobs per page";let e;e="{VAR_PLURAL, plural, =0 {No job} =1 {1 job} other {{INTERPOLATION} jobs}}",e=X(e,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let o;o="Actions";let _;_="Payload:";let g;g="Private payload:";let M;return M="No runner jobs found.",[["table",""],["totalTitle",""],["tableCells",""],["actionCell",""],["expandedRow",""],["noResults",""],e,_,g,M,["key","RunnerJobListComponent","dataKey","uuid","paginatorText",t,"columnConfig","true","searchInput","true","refreshButton","true",3,"defaultColumns","dataLoader","bulkActions","inputFilters"],[1,"fs-7"],["routerLink",".",1,"pt-badge","ellipsis",3,"queryParams","title","ngClass"],[1,"pt-badge",3,"ngClass"],["placement","bottom-right top-right left auto","container","body","label",o,3,"actions","entry"],[1,"mt-2","fs-7","font-monospace"],[1,"mt-2"],[1,"text-danger"]];},template:function(e,o){e&1&&(r(0,"my-table",10,0),U(2,Su,3,4,"ng-template",null,1,v)(4,bu,8,8,"ng-template",null,2,v)(6,hu,1,2,"ng-template",null,3,v)(8,Du,18,6,"ng-template",null,4,v)(10,Gu,2,0,"ng-template",null,5,v),i()),e&2&&d("defaultColumns",o.columns)("dataLoader",o.dataLoader)("bulkActions",o.bulkActions)("inputFilters",o.inputFilters);},dependencies:[Le,Ce,Oe,Qt,He,We],encapsulation:2}));var fr=$o;var Lu=["table"];function $u(n,t){if(n&1&&(E(0),l(1,5),Q(2,"myNumberFormatter"),N()),n&2){let e=t.$implicit;a(2),L(e)(ke(2,2,e)),$(1);}}function xu(n,t){if(n&1&&(r(0,"td"),C(1),i(),r(2,"td",8),C(3),i(),r(4,"td"),C(5),i(),r(6,"td"),C(7),i(),r(8,"td"),C(9),Q(10,"ptDate"),i(),r(11,"td"),C(12),Q(13,"ptDate"),i()),n&2){let e=t.$implicit;a(),f(e.name),a(2),f(e.description),a(2),f(e.ip),a(2),f(e.version),a(2),f(_e(10,6,e.lastContact,"short")),a(3),f(_e(13,9,e.createdAt,"short"));}}function wu(n,t){if(n&1&&m(0,"my-action-dropdown",9),n&2){let e=t.$implicit,o=s();d("actions",o.actions)("entry",e);}}function Uu(n,t){n&1&&(E(0),l(1,6),N());}var xo=class xo{runnerService=p(Kt);notifier=p(K);confirmService=p(xe);table=me("table");actions=[];columns=[{id:"name",label:"Name",sortable:!1},{id:"description",label:"Description",sortable:!1},{id:"ip",label:"IP",sortable:!1},{id:"version",label:"Version",sortable:!1},{id:"lastContact",label:"Last contact",sortable:!1},{id:"createdAt",label:"Created",sortable:!0}];dataLoader;constructor(){this.dataLoader=this._dataLoader.bind(this);}ngOnInit(){this.actions=[[{label:"Remove",handler:t=>this.deleteRunner(t)}]];}deleteRunner(t){return le(this,null,function*(){(yield this.confirmService.confirm("Do you really want to delete this runner? It won't be able to process jobs anymore.","Remove "+t.name+""))!==!1&&this.runnerService.deleteRunner(t).subscribe({next:()=>{this.table().loadData(),this.notifier.success("Runner removed.");},error:o=>this.notifier.handleError(o)});});}_dataLoader(t){return this.runnerService.listRunners(t);}};S(xo,"\u0275fac",function(e){return new(e||xo)();}),S(xo,"\u0275cmp",O({type:xo,selectors:[["my-runner-list"]],viewQuery:function(e,o){e&1&&Ae(o.table,Lu,5),e&2&&Te();},decls:10,vars:2,consts:()=>{let t;t="runners per page";let e;e="{VAR_PLURAL, plural, =0 {No runner} =1 {1 runner} other {{INTERPOLATION} runners}}",e=X(e,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let o;o="Actions";let _;return _="No remote runners found.",[["table",""],["totalTitle",""],["tableCells",""],["actionCell",""],["noResults",""],e,_,["key","RunnerListComponent","paginatorText",t,"columnConfig","false",3,"defaultColumns","dataLoader"],[1,"max-width-300px","ellipsis"],["placement","bottom-right top-right left auto","container","body","label",o,3,"actions","entry"]];},template:function(e,o){e&1&&(r(0,"my-table",7,0),U(2,$u,3,4,"ng-template",null,1,v)(4,xu,14,12,"ng-template",null,2,v)(6,wu,1,2,"ng-template",null,3,v)(8,Uu,2,0,"ng-template",null,4,v),i()),e&2&&d("defaultColumns",o.columns)("dataLoader",o.dataLoader);},dependencies:[Qt,He,qe,We],encapsulation:2}));var Mr=xo;var Vu=["table"];function ku(n,t){if(n&1&&(E(0),l(1,6),Q(2,"myNumberFormatter"),N()),n&2){let e=t.$implicit;a(2),L(e)(ke(2,2,e)),$(1);}}function zu(n,t){if(n&1){let e=H();r(0,"my-button",9),T("click",function(){D(e);let _=s();return G(_.generateToken());}),i();}}function Xu(n,t){if(n&1&&(r(0,"td"),C(1),m(2,"my-copy-button",10),i(),r(3,"td"),C(4),Q(5,"ptDate"),i(),r(6,"td"),C(7),i()),n&2){let e=t.$implicit;a(),b(" ",e.registrationToken," "),a(),d("value",e.registrationToken),a(2),f(_e(5,4,e.createdAt,"short")),a(3),f(e.registeredRunnersCount);}}function Bu(n,t){if(n&1&&m(0,"my-action-dropdown",11),n&2){let e=t.$implicit,o=s();d("actions",o.actions)("entry",e);}}function Wu(n,t){n&1&&(E(0),l(1,7),N());}var wo=class wo{runnerService=p(Kt);notifier=p(K);confirmService=p(xe);table=me("table");actions=[];columns=[{id:"token",label:"Token",sortable:!1},{id:"createdAt",label:"Created",sortable:!0},{id:"runners",label:"Associated runners",sortable:!1}];dataLoader;constructor(){this.dataLoader=this._dataLoader.bind(this);}ngOnInit(){this.actions=[[{label:"Remove this token",handler:t=>this.removeToken(t)}]];}generateToken(){this.runnerService.generateToken().subscribe({next:()=>
3{this.table().loadData(),this.notifier.success("Registration token generated.");},error:t=>this.notifier.handleError(t)});}removeToken(t){return le(this,null,function*(){(yield this.confirmService.confirm("Do you really want to remove this registration token? All associated runners will also be removed.","Remove registration token"))!==!1&&this.runnerService.removeToken(t).subscribe({next:()=>{this.table().loadData(),this.notifier.success("Registration token removed.");},error:o=>this.notifier.handleError(o)});});}_dataLoader(t){return this.runnerService.listRegistrationTokens(t);}};S(wo,"\u0275fac",function(e){return new(e||wo)();}),S(wo,"\u0275cmp",O({type:wo,selectors:[["my-runner-registration-token-list"]],viewQuery:function(e,o){e&1&&Ae(o.table,Vu,5),e&2&&Te();},decls:12,vars:2,consts:()=>{let t;t="tokens per page";let e;e="{VAR_PLURAL, plural, =0 {No token} =1 {1 token} other {{INTERPOLATION} tokens}}",e=X(e,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let o;o="Generate token";let _;_="Registration token copied";let g;g="Copy registration token";let M;M="Actions";let I;return I="No registration token found for remote runners.",[["table",""],["totalTitle",""],["captionRight",""],["tableCells",""],["actionCell",""],["noResults",""],e,I,["key","RunnerRegistrationTokenListComponent","paginatorText",t,"columnConfig","false",3,"defaultColumns","dataLoader"],["theme","primary","label",o,"icon","add",3,"click"],["notification",_,"title",g,3,"value"],["placement","bottom-right top-right left auto","container","body","label",M,3,"actions","entry"]];},template:function(e,o){e&1&&(r(0,"my-table",8,0),U(2,ku,3,4,"ng-template",null,1,v)(4,zu,1,0,"ng-template",null,2,v)(6,Xu,8,7,"ng-template",null,3,v)(8,Bu,1,2,"ng-template",null,4,v)(10,Wu,2,0,"ng-template",null,5,v),i()),e&2&&d("defaultColumns",o.columns)("dataLoader",o.dataLoader);},dependencies:[bt,Qt,yi,He,qe,We],styles:["my-copy-button[_ngcontent-%COMP%]{margin-inline-start:.1875rem}my-table[_ngcontent-%COMP%]     tr:not(:hover) my-copy-button{opacity:0}"]}));var Ir=wo;var Q_=[{path:"runners",canActivate:[ze],data:{userRight:q.MANAGE_RUNNERS},children:[{path:"",redirectTo:"jobs-list",pathMatch:"full"},{path:"jobs-list",component:fr,data:{meta:{title:"List runner jobs"}}},{path:"runners-list",component:Mr,data:{meta:{title:"List remote runners"}}},{path:"registration-tokens-list",component:Ir,data:{meta:{title:"List registration runner tokens"}}}]}];var J_=[{path:"system",children:[{path:"",redirectTo:"jobs",pathMatch:"full"},{path:"jobs",canActivate:[ze],component:Er,data:{meta:{userRight:q.MANAGE_JOBS,title:"Jobs"}}},{path:"logs",canActivate:[ze],component:Sr,data:{meta:{userRight:q.MANAGE_LOGS,title:"Logs"}}},{path:"debug",canActivate:[ze],component:Cr,data:{meta:{userRight:q.MANAGE_DEBUG,title:"Debug"}}},...Q_]}];var Uo=class Uo{auth=p(Mt);server=p(j);menuEntries=[];ngOnInit(){this.server.configReloaded.subscribe(()=>this.buildMenu()),this.buildMenu();}buildMenu(){if(this.menuEntries=[],this.hasRight(q.MANAGE_ABUSES)&&this.menuEntries.push({label:"Reports",routerLink:"/admin/moderation/abuses/list"}),this.hasRight(q.MANAGE_REGISTRATIONS)&&this.menuEntries.push({label:"Registrations",routerLink:"/admin/moderation/registrations/list"}),this.hasRight(q.MANAGE_VIDEO_BLACKLIST)&&this.menuEntries.push({label:"Video blocks",routerLink:"/admin/moderation/video-blocks/list"}),this.hasRight(q.MANAGE_ACCOUNTS_BLOCKLIST)||this.hasRight(q.MANAGE_SERVERS_BLOCKLIST)){let t={label:"Mutes",routerLink:"",children:[]};this.hasRight(q.MANAGE_ACCOUNTS_BLOCKLIST)&&t.children.push({label:"Muted accounts",routerLink:"/admin/moderation/blocklist/accounts"}),this.hasRight(q.MANAGE_SERVERS_BLOCKLIST)&&t.children.push({label:"Muted servers",routerLink:"/admin/moderation/blocklist/servers"}),t.routerLink=t.children[0].routerLink,this.menuEntries.push(t);}this.hasRight(q.MANAGE_INSTANCE_WATCHED_WORDS)&&this.menuEntries.push({label:"Watched words",routerLink:"/admin/moderation/watched-words/list"});}hasRight(t){return this.auth.getUser().hasRight(t);}};S(Uo,"\u0275fac",function(e){return new(e||Uo)();}),S(Uo,"\u0275cmp",O({type:Uo,selectors:[["my-admin-moderation"]],decls:8,vars:1,consts:()=>{let t;t="Moderation";let e;return e="Skip the sub menu",[["adminContent",""],e,[1,"root"],["href","#admin-moderation-content",1,"visually-hidden-focusable","skip-to-content-sub-menu",3,"click"],[1,"margin-content"],["h1",t,"h1Icon","moderation",3,"menuEntries"],["tabindex","-1","id","admin-moderation-content",1,"margin-content","outline-0"]];},template:function(e,o){if(e&1){let _=H();r(0,"div",2)(1,"a",3),T("click",function(M){D(_);let I=ue(6);return M.preventDefault(),G(I.focus());}),l(2,1),i(),r(3,"div",4),m(4,"my-horizontal-menu",5),i(),r(5,"div",6,0),m(7,"router-outlet"),i()();}e&2&&(a(4),d("menuEntries",o.menuEntries));},dependencies:[Kn,fn],encapsulation:2}));var Ar=Uo;var Vo=class Vo{auth=p(Mt);menuEntries=[];ngOnInit(){this.buildMenu();}buildMenu(){this.menuEntries=[],this.hasRight(q.MANAGE_USERS)&&this.menuEntries.push({label:"Users",routerLink:"/admin/overview/users"}
3),this.hasRight(q.SEE_ALL_VIDEOS)&&this.menuEntries.push({label:"Videos",routerLink:"/admin/overview/videos"}),this.hasRight(q.SEE_ALL_COMMENTS)&&this.menuEntries.push({label:"Comments",routerLink:"/admin/overview/comments"});}hasRight(t){return this.auth.getUser().hasRight(t);}};S(Vo,"\u0275fac",function(e){return new(e||Vo)();}),S(Vo,"\u0275cmp",O({type:Vo,selectors:[["my-admin-overview"]],decls:8,vars:1,consts:()=>{let t;t="Overview";let e;return e="Skip the sub menu",[["adminContent",""],e,[1,"root"],["href","#admin-overview-content",1,"visually-hidden-focusable","skip-to-content-sub-menu",3,"click"],[1,"margin-content"],["h1",t,"h1Icon","overview",3,"menuEntries"],["tabindex","-1","id","admin-overview-content",1,"margin-content","outline-0"]];},template:function(e,o){if(e&1){let _=H();r(0,"div",2)(1,"a",3),T("click",function(M){D(_);let I=ue(6);return M.preventDefault(),G(I.focus());}),l(2,1),i(),r(3,"div",4),m(4,"my-horizontal-menu",5),i(),r(5,"div",6,0),m(7,"router-outlet"),i()();}e&2&&(a(4),d("menuEntries",o.menuEntries));},dependencies:[Kn,fn],encapsulation:2}));var Tr=Vo;var ko=class ko{auth=p(Mt);server=p(j);menuEntries=[];ngOnInit(){this.server.configReloaded.subscribe(()=>this.buildMenu()),this.buildMenu();}buildMenu(){this.menuEntries=[],this.buildConfigurationItems(),this.buildFederationItems(),this.buildPluginItems(),this.buildRunnerItems(),this.buildSystemItems();}buildFederationItems(){this.hasRight(q.MANAGE_SERVER_FOLLOW)&&this.menuEntries.push({label:"Federation",routerLink:"/admin/settings/follows/following-list",children:[{label:"Following",routerLink:"/admin/settings/follows/following-list"},{label:"Followers",routerLink:"/admin/settings/follows/followers-list"},{label:"Video redundancies",routerLink:"/admin/settings/follows/video-redundancies-list"}]});}buildConfigurationItems(){this.hasRight(q.MANAGE_CONFIGURATION)&&this.menuEntries.push({label:"Configuration",routerLink:"/admin/settings/config"});}buildPluginItems(){this.hasRight(q.MANAGE_PLUGINS)&&this.menuEntries.push({label:"Plugins/Themes",routerLink:"/admin/settings/plugins",queryParams:{pluginType:_t.PLUGIN},children:[{label:"Installed plugins",routerLink:"/admin/settings/plugins/list-installed",queryParams:{pluginType:_t.PLUGIN}},{label:"Search plugins",routerLink:"/admin/settings/plugins/search",queryParams:{pluginType:_t.PLUGIN}},{label:"Installed themes",routerLink:"/admin/settings/plugins/list-installed",queryParams:{pluginType:_t.THEME}},{label:"Search themes",routerLink:"/admin/settings/plugins/search",queryParams:{pluginType:_t.THEME}}]});}buildRunnerItems(){!this.server.isRemoteRunnersEnabled()||!this.hasRight(q.MANAGE_RUNNERS)||this.menuEntries.push({label:"Runners",routerLink:"/admin/settings/system/runners/jobs-list",children:[{label:"Runner jobs",routerLink:"/admin/settings/system/runners/jobs-list"},{label:"Remote runners",routerLink:"/admin/settings/system/runners/runners-list"},{label:"Registration tokens",routerLink:"/admin/settings/system/runners/registration-tokens-list"}]});}buildSystemItems(){let t={label:"System",routerLink:"",children:[]};this.hasRight(q.MANAGE_JOBS)&&t.children.push({label:"Local jobs",routerLink:"/admin/settings/system/jobs"}),this.hasRight(q.MANAGE_LOGS)&&t.children.push({label:"Logs",routerLink:"/admin/settings/system/logs"}),this.hasRight(q.MANAGE_DEBUG)&&t.children.push({label:"Debug",routerLink:"/admin/settings/system/debug"}),t.children.length!==0&&(t.routerLink=t.children[0].routerLink,this.menuEntries.push(t));}hasRight(t){return this.auth.getUser().hasRight(t);}};S(ko,"\u0275fac",function(e){return new(e||ko)();}),S(ko,"\u0275cmp",O({type:ko,selectors:[["my-admin-settings"]],decls:8,vars:1,consts:()=>{let t;t="Settings";let e;return e="Skip the sub menu",[["adminContent",""],e,[1,"root"],["href","#admin-settings-content",1,"visually-hidden-focusable","skip-to-content-sub-menu",3,"click"],[1,"margin-content"],["h1",t,"h1Icon","config",3,"menuEntries"],["tabindex","-1","id","admin-settings-content",1,"margin-content","outline-0"]];},template:function(e,o){if(e&1){let _=H();r(0,"div",2)(1,"a",3),T("click",function(M){D(_);let I=ue(6);return M.preventDefault(),G(I.focus());}),l(2,1),i(),r(3,"div",4),m(4,"my-horizontal-menu",5),i(),r(5,"div",6,0),m(7,"router-outlet"),i()();}e&2&&(a(4),d("menuEntries",o.menuEntries));},dependencies:[Kn,fn],encapsulation:2}));var Or=ko;var Hu=["table"],jr=n=>({state:n});function ju(n,t){if(n&1&&(E(0),l(1,5),Q(2,"myNumberFormatter"),N()),n&2){let e=t.$implicit;a(2),L(e)(ke(2,2,e)),$(1);}}function Qu(n,t){if(n&1&&(r(0,"a",14),l(1,6),i()),n&2){let e=s().$implicit;d("queryParams",x(1,jr,e.state));}}function Ju(n,t){if(n&1&&(r(0,"a",15),l(1,7),i()),n&2){let e=s().$implicit;d("queryParams",x(1,jr,e.state));}}function qu(n,t){if(n&1&&(r(0,"a",16),l(1,8),i()),n&2){let e=s().$implicit;d("queryParams",x(1,jr,e.state));}}function Ku(n,t){if(n&1&&(r(0,"td")(1,"a",12),C(2),m(3,"my-global-icon",13),i()(),r(4,"td"),c(5,Qu,2,3,"a",14)(6,Ju,2,3,"a",15)(7,qu,2,3,"a",16),i(),r(8,"td"),C(9),i(),r(10,"td"),C(11),Q(12,"ptDate"),i()),n&2){let e=t.$implicit,o=s();a(),d("href",e.follower.url,at),a(),b(" ",o.buildFollowerName(e)," "),a(3),u(e.state==="accepted"?5:e.state==="pending"?6:e.state==="rejected"?7:-1),a(4),b("",e.score/1e4*100,"%"),a(2),f(_e(12,5,e.createdAt,"short"));}}function Yu(n,t){if(n&1){let e=H();r(0,"my-button",19),T("click",function(){D(e);let _=s().$implicit,g=s();return G(g.acceptFollower([_]));}),i();}}function Zu(n,t){if(n&1){let e=H();r(0,"my-button",20),T("click",function(){D(e);let _=s().$implicit,g=s();return G(g.rejectFollower([_]));}),i();}}function ep(n,t){if(n&1){let e=H();r(0,"my-delete-button",21),T("click",function(){D(e);let _=s().$implicit,g=s();return G(g.deleteFollowers([_]));}),i();}}function tp(n,t){if(n&1&&(c(0,Yu,1,0,"my-button",17),c(1,Zu,1,0,"my-button",18),c(2,ep,1,0,"my-delete-button")),n&2){let e=t.$implicit;u(e.state!=="accepted"?0:-1),a(),u(e.state!=="rejected"?1:-1),a(),u(e.state==="rejected"?2:-1);}}function np(n,t){n&1&&(E(0),l(1,9),N());}function op(n,t){n&1&&(E(0),l(1,10),N());}function ip(n,t){if(n&1&&c(0,np,2,0,"ng-container")(1,op,2,0,"ng-container"),n&2){let e=t.search,o=t.hasFilters;u(e||o?0:1);}}var zo=class zo{confirmService=p(xe);notifier=p(K);followService=p(vn);table=me("table");inputFilters=[];bulkActions=[];columns=[{id:"follower",label:"Follower",sortable:!1},{id:"state",label:"State",sortable:!0},{id:"score",label:"Reliability",sortable:!0},{id:"createdAt",label:"Created",sortable:!0}];dataLoader;constructor(){this.dataLoader=this._dataLoader.bind(this);}ngOnInit(){this.inputFilters=this.followService.buildFollowsListFilters(),this.bulkActions=[{label:"Reject",handler:t=>this.rejectFollower(t),isDisplayed:t=>t.every(e=>e.state!=="rejected")},{label:"Accept",handler:t=>this.acceptFollower(t),isDisplayed:t=>t.every(e=>e.state!=="accepted")},{label:"Delete",handler:t=>this.deleteFollowers(t),isDisplayed:t=>t.every(e=>e.state==="rejected")}];}acceptFollower(t){this.followService.acceptFollower(t).subscribe({next:()=>{let e=Y("Accepted {count, plural, =1 {{followerName} follow request} other {{count} follow requests}}",{count:t.length,followerName:this.buildFollowerName(t[0])});
3this.notifier.success(e),this.table().loadData();},error:e=>this.notifier.handleError(e)});}rejectFollower(t){return le(this,null,function*(){let e=Y("Do you really want to reject {count, plural, =1 {{followerName} follow request?} other {{count} follow requests?}}",{count:t.length,followerName:this.buildFollowerName(t[0])});(yield this.confirmService.confirm(e,"Reject"))!==!1&&this.followService.rejectFollower(t).subscribe({next:()=>{let _=Y("Rejected {count, plural, =1 {{followerName} follow request} other {{count} follow requests}}",{count:t.length,followerName:this.buildFollowerName(t[0])});this.notifier.success(_),this.table().loadData();},error:_=>this.notifier.handleError(_)});});}deleteFollowers(t){return le(this,null,function*(){let e={count:t.length,followerName:this.buildFollowerName(t[0])},o="Deleted followers will be able to send again a follow request.";o+="<br /><br />",o+=Y("Do you really want to delete {count, plural, =1 {{followerName} follow request?} other {{count} follow requests?}}",e),(yield this.confirmService.confirm(o,"Delete"))!==!1&&this.followService.removeFollower(t).subscribe({next:()=>{let g=Y("Removed {count, plural, =1 {{followerName} follow request} other {{count} follow requests}}",e);this.notifier.success(g),this.table().loadData();},error:g=>this.notifier.handleError(g)});});}buildFollowerName(t){return t.follower.name+"@"+t.follower.host;}_dataLoader(t){return this.followService.listFollowers(t);}};S(zo,"\u0275fac",function(e){return new(e||zo)();}),S(zo,"\u0275cmp",O({type:zo,selectors:[["my-followers-list"]],viewQuery:function(e,o){e&1&&Ae(o.table,Hu,5),e&2&&Te();},decls:10,vars:4,consts:()=>{let t;t="followers per page";let e;e="{VAR_PLURAL, plural, =0 {No follower} =1 {1 follower} other {{INTERPOLATION} followers}}",e=X(e,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let o;o="Open actor page in a new tab";let _;_="Accepted";let g;g="Pending";let M;M="Rejected";let I;I="Accept";let P;P="Reject";let y;y="No follower found matching current filters.";let F;return F="Your instance doesn't have any follower.",[["table",""],["totalTitle",""],["tableCells",""],["actionCell",""],["noResults",""],e,_,g,M,y,F,["key","FollowersListComponent","paginatorText",t,"columnConfig","false","refreshButton","true","searchInput","true",3,"defaultColumns","dataLoader","bulkActions","inputFilters"],["title",o,"target","_blank","rel","noopener noreferrer",3,"href"],["iconName","external-link"],["routerLink",".","title","Filter by state: Accepted",1,"pt-badge","badge-green",3,"queryParams"],["routerLink",".","title","Filter by state: Pending",1,"pt-badge","badge-yellow",3,"queryParams"],["routerLink",".","title","Filter by state: Rejected",1,"pt-badge","badge-red",3,"queryParams"],["title",I,"icon","tick"],["title",P,"icon","cross"],["title",I,"icon","tick",3,"click"],["title",P,"icon","cross",3,"click"],[3,"click"]];},template:function(e,o){e&1&&(r(0,"my-table",11,0),U(2,ju,3,4,"ng-template",null,1,v)(4,Ku,13,8,"ng-template",null,2,v)(6,tp,3,3,"ng-template",null,3,v)(8,ip,2,1,"ng-template",null,4,v),i()),e&2&&d("defaultColumns",o.columns)("dataLoader",o.dataLoader)("bulkActions",o.bulkActions)("inputFilters",o.inputFilters);},dependencies:[Oe,Qe,bt,Pn,He,qe,We],styles:["my-delete-button[_ngcontent-%COMP%]{max-width:130px}"]}));var Pr=zo;var rp=["modal"],ap=n=>({"input-error":n});function lp(n,t){if(n&1&&(r(0,"div"),C(1),i()),n&2){let e=s(3);a(),b(" ",e.form.controls.hostsOrHandles.errors.validHostsOrHandles.value," ");}}function _p(n,t){if(n&1&&(r(0,"div",13),C(1),c(2,lp,2,1,"div"),i()),n&2){let e=s(2);a(),b(" ",e.formErrors.hostsOrHandles," "),a(),u(e.form.controls.hostsOrHandles.errors.validHostsOrHandles?2:-1);}}function sp(n,t){n&1&&(r(0,"my-alert",14),l(1,3),i());}function dp(n,t){if(n&1){let e=H();r(0,"div",4)(1,"h4",5),l(2,1),i(),r(3,"button",6),T("click",function(){D(e);let _=s();return G(_.hide());}),m(4,"my-global-icon",7),i()(),r(5,"div",8)(6,"form",9),T("ngSubmit",function(){D(e);let _=s();return G(_.submit());}),r(7,"div",10)(8,"label",11),l(9,2),i(),m(10,"textarea",12),c(11,_p,3,2,"div",13),i(),c(12,sp,2,0,"my-alert",14),r(13,"div",15)(14,"input",16),T("click",function(){D(e);let _=s();return G(_.hide());})("key.enter",function(){D(e);let _=s();return G(_.hide());}),i(),m(15,"input",17),i()()();}if(n&2){let e=s();a(6),d("formGroup",e.form),a(4),d("placeholder",e.placeholder)("ngClass",x(6,ap,e.formErrors.hostsOrHandles)),a(),u(e.formErrors.hostsOrHandles?11:-1),a(),u(e.httpEnabled()===!1?12:-1),a(3),d("disabled",!e.form.valid);}}var wn=class wn extends Jt{formReactiveService=p(Se);
3modalService=p(Ti);followService=p(vn);notifier=p(K);modal=me("modal");newFollow=zn();placeholder=`example.com
4[email protected]
5[email protected]`;openedModal;ngOnInit(){this.buildForm({hostsOrHandles:R_});}openModal(){this.openedModal=this.modalService.open(this.modal(),{centered:!0});}hide(){this.openedModal.close();}submit(){this.addFollowing(),this.form.reset(),this.hide();}httpEnabled(){return window.location.protocol==="https:";}addFollowing(){let t=Ll(this.form.value.hostsOrHandles);this.followService.follow(t).subscribe({next:()=>{this.notifier.success(Y("{count, plural, =1 {Follow request sent!} other {Follow requests sent!}}",{count:t.length})),this.newFollow.emit();},error:e=>this.notifier.handleError(e)});}};S(wn,"\u0275fac",(()=>{let t;return function(o){return(t||(t=Ut(wn)))(o||wn);};})()),S(wn,"\u0275cmp",O({type:wn,selectors:[["my-follow-modal"]],viewQuery:function(e,o){e&1&&Ae(o.modal,rp,5),e&2&&Te();},outputs:{newFollow:"newFollow"},features:[pt],decls:2,vars:0,consts:()=>{let t;t="Close this modal";let e;e="Cancel";let o;o="Follow";let _;_="Follow";let g;g="1 domain (without \"http://\"), account handle or channel handle per line";let M;return M=" It seems that you are not on a HTTPS server. Your webserver needs to have TLS activated in order to follow servers. ",[["modal",""],_,g,M,[1,"modal-header"],[1,"modal-title"],["title",t,1,"border-0","p-0",3,"click"],["iconName","cross"],[1,"modal-body"],["novalidate","",3,"ngSubmit","formGroup"],[1,"form-group"],["for","hostsOrHandles"],["formControlName","hostsOrHandles","type","text","id","hostsOrHandles","name","hostsOrHandles","ngbAutofocus","",1,"form-control",3,"placeholder","ngClass"],["role","alert",1,"form-error"],["type","warning"],[1,"form-group","inputs"],["type","button","role","button","value",e,1,"peertube-button","secondary-button",3,"click","key.enter"],["type","submit","value",o,1,"peertube-button","primary-button",3,"disabled"]];},template:function(e,o){e&1&&U(0,dp,16,8,"ng-template",null,0,v);},dependencies:[Qe,ae,Ne,De,se,Ee,Re,Pe,Ge,Ce,st],styles:["textarea[_ngcontent-%COMP%]{height:200px}"]}));var Rr=wn;var Xo=class Xo{notifier=p(K);redundancyService=p(zi);host=ce(void 0);redundancyAllowed=gl(void 0);updateRedundancyState(){this.redundancyService.updateRedundancy(this.host(),this.redundancyAllowed()).subscribe({next:()=>{let t=this.redundancyAllowed()?"enabled":"disabled";this.notifier.success("Redundancy for "+this.host()+" is "+t+"");},error:t=>this.notifier.handleError(t)});}};S(Xo,"\u0275fac",function(e){return new(e||Xo)();}),S(Xo,"\u0275cmp",O({type:Xo,selectors:[["my-redundancy-checkbox"]],inputs:{host:[1,"host"],redundancyAllowed:[1,"redundancyAllowed"]},outputs:{redundancyAllowed:"redundancyAllowedChange"},decls:1,vars:2,consts:[[3,"ngModelChange","inputName","ngModel"]],template:function(e,o){e&1&&(r(0,"my-peertube-checkbox",0),St("ngModelChange",function(g){return Nt(o.redundancyAllowed,g)||(o.redundancyAllowed=g),g;}),T("ngModelChange",function(){return o.updateRedundancyState();}),i()),e&2&&(d("inputName",o.host()+"-redundancy-allowed"),Et("ngModel",o.redundancyAllowed));},dependencies:[Je,ae,se,kt],encapsulation:2}));var vr=Xo;var mp=["followModal"],cp=["table"],Qr=n=>({state:n});function up(n,t){if(n&1&&(E(0),l(1,7),Q(2,"myNumberFormatter"),N()),n&2){let e=t.$implicit;a(2),L(e)(ke(2,2,e)),$(1);}}function pp(n,t){if(n&1){let e=H();r(0,"button",15),T("click",function(){D(e);let _=s();return G(_.openFollowModal());}),m(1,"my-global-icon",16),E(2),l(3,8),N(),i();}}function gp(n,t){if(n&1&&(r(0,"a",19),l(1,9),i()),n&2){let e=s().$implicit;d("queryParams",x(1,Qr,e.state));}}function Cp(n,t){if(n&1&&(r(0,"a",20),l(1,10),i()),n&2){let e=s().$implicit;d("queryParams",x(1,Qr,e.state));}}function Ep(n,t){if(n&1&&(r(0,"a",21),l(1,11),i()),n&2){let e=s().$implicit;d("queryParams",x(1,Qr,e.state));}}function Np(n,t){if(n&1&&m(0,"my-redundancy-checkbox",22),n&2){let e=s().$implicit;d("host",e.following.host)("redundancyAllowed",e.following.hostRedundancyAllowed);}}function Sp(n,t){if(n&1&&(r(0,"td")(1,"a",17),C(2),m(3,"my-global-icon",18),i()(),r(4,"td"),c(5,gp,2,3,"a",19)(6,Cp,2,3,"a",20)(7,Ep,2,3,"a",21),i(),r(8,"td"),C(9),Q(10,"ptDate"),i(),r(11,"td"),c(12,Np,1,2,"my-redundancy-checkbox",22),i()),n&2){let e=t.$implicit,o=s();a(),d("href",e.following.url,at),a(),b(" ",o.buildFollowingName(e)," "),a(3),u(e.state==="accepted"?5:e.state==="pending"?6:e.state==="rejected"?7:-1),a(4),f(_e(10,5,e.createdAt,"short")),a(3),u(o.isInstanceFollowing(e)?12:-1);}}function fp(n,t){if(n&1){let e=H();r(0,"my-delete-button",23),T("click",function(){let _=D(e).$implicit,g=s();return G(g.removeFollowing([_]));}),i();}}function Mp(n,t){n&1&&(E(0),l(1,12),N());}function Ip(n,t){n&1&&(E(0),l(1,13),N());}function Ap(n,t){if(n&1&&c(0,Mp,2,0,"ng-container")(1,Ip,2,0,"ng-container"),n&2){let e=t.search,o=t.hasFilters;u(e||o?0:1);}}var Bo=class Bo{notifier=p(K);confirmService=p(xe);followService=p(vn);followModal=me("followModal");table=me("table");inputFilters=[];bulkActions=[];columns=[{id:"following",label:"Following",sortable:!1},{id:"state",label:"State",sortable:!0},{id:"createdAt",label:"Created",sortable:!0},{id:"redundancyAllowed",label:"Redundancy allowed",sortable:!0}];dataLoader;constructor(){this.dataLoader=this._dataLoader.bind(this);}ngOnInit(){this.inputFilters=this.followService.buildFollowsListFilters(),this.bulkActions=[{label:"Delete",handler:t=>this.removeFollowing(t)}];}openFollowModal(){this.followModal().openModal();}isInstanceFollowing(t){return t.following.name==="peertube";}buildFollowingName(t){return t.following.name+"@"+t.following.host;}removeFollowing(t){return le(this,null,function*(){let e={count:t.length,entryName:this.buildFollowingName(t[0])},o=Y("Do you really want to unfollow {count, plural, =1 {{entryName}?} other {{count} entries?}}",e);(yield this.confirmService.confirm(o,"Unfollow"))!==!1&&this.followService.unfollow(t).subscribe({next:()=>{let g=Y("You are not following {count, plural, =1 {{entryName} anymore.} other {these {count} entries anymore.}}",e);
5this.notifier.success(g),this.table().loadData();},error:g=>this.notifier.handleError(g)});});}_dataLoader(t){return this.followService.listSubscriptions(t);}};S(Bo,"\u0275fac",function(e){return new(e||Bo)();}),S(Bo,"\u0275cmp",O({type:Bo,selectors:[["ng-component"]],viewQuery:function(e,o){e&1&&Ae(o.followModal,mp,5)(o.table,cp,5),e&2&&Te(2);},decls:14,vars:4,consts:()=>{let t;t="subscriptions per page";let e;e="{VAR_PLURAL, plural, =0 {No subscription} =1 {1 subscription} other {{INTERPOLATION} subscriptions}}",e=X(e,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let o;o="Follow";let _;_="Open instance in a new tab";let g;g="Accepted";let M;M="Pending";let I;I="Rejected";let P;P="No host found matching current filters.";let y;return y="Your instance is not following anyone.",[["table",""],["totalTitle",""],["captionRight",""],["tableCells",""],["actionCell",""],["noResults",""],["followModal",""],e,o,g,M,I,P,y,["key","FollowingListComponent","paginatorText",t,"columnConfig","false","refreshButton","true","searchInput","true",3,"defaultColumns","dataLoader","bulkActions","inputFilters"],[1,"peertube-create-button",3,"click"],["iconName","following","aria-hidden","true"],["title",_,"target","_blank","rel","noopener noreferrer",3,"href"],["iconName","external-link"],["routerLink",".","title","Filter by state: Accepted",1,"pt-badge","badge-green",3,"queryParams"],["routerLink",".","title","Filter by state: Pending",1,"pt-badge","badge-yellow",3,"queryParams"],["routerLink",".","title","Filter by state: Rejected",1,"pt-badge","badge-red",3,"queryParams"],[3,"host","redundancyAllowed"],["label","",3,"click"]];},template:function(e,o){e&1&&(r(0,"my-table",14,0),U(2,up,3,4,"ng-template",null,1,v)(4,pp,4,0,"ng-template",null,2,v)(6,Sp,13,8,"ng-template",null,3,v)(8,fp,1,0,"ng-template",null,4,v)(10,Ap,2,1,"ng-template",null,5,v),i(),m(12,"my-follow-modal",null,6)),e&2&&d("defaultColumns",o.columns)("dataLoader",o.dataLoader)("bulkActions",o.bulkActions)("inputFilters",o.inputFilters);},dependencies:[Oe,Qe,Pn,vr,Rr,He,qe,We],styles:["my-delete-button[_ngcontent-%COMP%]{max-width:130px}"]}));var Fr=Bo;var Wo=class Wo{redundancyElement=ce(void 0);};S(Wo,"\u0275fac",function(e){return new(e||Wo)();}),S(Wo,"\u0275cmp",O({type:Wo,selectors:[["my-video-redundancy-information"]],inputs:{redundancyElement:[1,"redundancyElement"]},decls:23,vars:14,consts:[["target","_blank","rel","noopener noreferrer",3,"href"]],template:function(e,o){e&1&&(gt(0,"div")(1,"strong"),C(2,"Url"),Ct(),gt(3,"a",0),C(4),Ct()(),gt(5,"div")(6,"strong"),C(7,"Created on"),Ct(),gt(8,"span"),C(9),Q(10,"ptDate"),Ct()(),gt(11,"div")(12,"strong"),C(13,"Expires on"),Ct(),gt(14,"span"),C(15),Q(16,"ptDate"),Ct()(),gt(17,"div")(18,"strong"),C(19,"Size"),Ct(),gt(20,"span"),C(21),Q(22,"bytes"),Ct()()),e&2&&(a(3),fi("href",o.redundancyElement().fileUrl,at),a(),f(o.redundancyElement().fileUrl),a(5),f(_e(10,5,o.redundancyElement().createdAt,"medium")),a(6),f(_e(16,8,o.redundancyElement().expiresOn,"medium")),a(6),f(_e(22,11,o.redundancyElement().size,1)));},dependencies:[qe,ut],styles:["strong[_ngcontent-%COMP%]{display:inline-block;min-width:100px;font-weight:600;color:var(--fg-300)}"]}));var br=Wo;var Tp=["table"];function Op(n,t){if(n&1&&(E(0),l(1,7),Q(2,"myNumberFormatter"),N()),n&2){let e=t.$implicit;a(2),L(e)(ke(2,2,e)),$(1);}}function Pp(n,t){if(n&1){let e=H();r(0,"div",17)(1,"label",18),l(2,8),i(),r(3,"div",19)(4,"select",20),St("ngModelChange",function(_){D(e);let g=s();return Nt(g.displayType,_)||(g.displayType=_),G(_);}),T("ngModelChange",function(){D(e);let _=s();return G(_.onDisplayTypeChanged());}),r(5,"option",21),l(6,9),i(),r(7,"option",22),l(8,10),i()()()();}if(n&2){let e=s();a(4),Et("ngModel",e.displayType);}}function Rp(n,t){if(n&1&&(r(0,"td"),C(1),i()),n&2){let e=s().$implicit,o=s();a(),f(o.getRedundancyStrategy(e));}}function vp(n,t){if(n&1&&(r(0,"td"),C(1),Q(2,"bytes"),i()),n&2){let e=s().$implicit,o=s();a(),f(_e(2,1,o.getTotalSize(e),1));}}function Fp(n,t){if(n&1&&(c(0,Rp,2,1,"td"),r(1,"td")(2,"a",23),C(3),m(4,"my-global-icon",24),i()(),c(5,vp,3,4,"td")),n&2){let e=t.$implicit,o=s();u(o.isDisplayingRemoteVideos()?0:-1),a(2),d("href",e.url,at),a(),b(" ",e.name," "),a(2),u(o.isDisplayingRemoteVideos()?5:-1);}}function bp(n,t){if(n&1){let e=H();r(0,"my-delete-button",25),T("click",function(){let _=D(e).$implicit,g=s();return G(g.removeRedundancy(_));}),i();}}function hp(n,t){if(n&1&&(r(0,"div"),m(1,"my-video-redundancy-information",26),i()),n&2){let e=t.$implicit;a(),d("redundancyElement",e);}}function yp(n,t){if(n&1&&pe(0,hp,2,1,"div",null,Ie),n&2){let e=t.$implicit;ge(e.redundancies.streamingPlaylists);}}
5function Dp(n,t){n&1&&(E(0),l(1,11),N());}function Gp(n,t){n&1&&(E(0),l(1,12),N());}function Lp(n,t){if(n&1&&c(0,Dp,2,0,"ng-container")(1,Gp,2,0,"ng-container"),n&2){let e=s();u(e.isDisplayingRemoteVideos()?0:1);}}function $p(n,t){n&1&&(r(0,"div",28),l(1,14),i());}function xp(n,t){if(n&1&&(r(0,"div",29),m(1,"p-chart",30),i()),n&2){let e=t.$implicit;a(),d("ariaLabel",e.ariaLabel)("data",e.graphData)("options",e.options);}}function wp(n,t){if(n&1&&(r(0,"div",16)(1,"h6"),l(2,13),i(),r(3,"div",27),c(4,$p,2,0,"div",28),pe(5,xp,2,3,"div",29,Ie),i()()),n&2){let e=s();a(4),u(e.noRedundancies?4:-1),a(),ge(e.redundanciesGraphsData);}}var rn=class rn{notifier=p(K);confirmService=p(xe);redundancyService=p(zi);serverService=p(j);table=me("table");displayType="my-videos";redundanciesGraphsData=[];noRedundancies=!1;dataLoaded=!1;bytesPipe;columns;dataLoader;customUpdateUrl;customParseQueryParams;constructor(){this.bytesPipe=new ut(),this.customUpdateUrl=this._customUpdateUrl.bind(this),this.customParseQueryParams=this._customParseQueryParams.bind(this),this.dataLoader=this._dataLoader.bind(this);}ngOnInit(){this.loadSelectLocalStorage(),this.buildColumns(),this.serverService.getServerStats().subscribe(t=>{let e=t.videosRedundancy;e.length===0&&(this.noRedundancies=!0);for(let o of e)this.buildPieData(o);});}isDisplayingRemoteVideos(){return this.displayType==="remote-videos";}getTotalSize(t){return t.redundancies.streamingPlaylists.reduce((e,o)=>e+o.size,0);}onDisplayTypeChanged(){this.dataLoaded=!1,this.saveSelectLocalStorage(),this.buildColumns(),this.table().reloadData();}getRedundancyStrategy(t){return t.redundancies.streamingPlaylists.length!==0?t.redundancies.streamingPlaylists[0].strategy:"";}buildPieData(t){if(t.totalSize===0)return;let e=t.totalSize?t.totalSize-t.totalUsed:null,o=["Used ("+this.bytesToHuman(t.totalUsed)+")"],_=[t.totalUsed];e&&(o.push("Available ("+this.bytesToHuman(e)+")"),_.push(e)),this.redundanciesGraphsData.push({stats:t,ariaLabel:"Redundancy strategy \""+t.strategy+"\". "+o.join(". "),graphData:{labels:o,datasets:[{data:_,backgroundColor:["#FF6384","#36A2EB"],hoverBackgroundColor:["#FF6384","#36A2EB"]}]},options:{plugins:{title:{display:!0,text:t.strategy},tooltip:{callbacks:{label:g=>g.label}}}}});}removeRedundancy(t){return le(this,null,function*(){let e="Do you really want to remove this video redundancy?";(yield this.confirmService.confirm(e,"Remove redundancy"))!==!1&&this.redundancyService.removeVideoRedundancies(t).subscribe({next:()=>{this.notifier.success("Video redundancies removed!"),this.table().loadData();},error:_=>this.notifier.handleError(_)});});}_dataLoader(t){return this.redundancyService.listVideoRedundancies(Xe(fe({},t),{target:this.displayType})).pipe(Si(()=>this.dataLoaded=!0));}_customUpdateUrl(){return{displayType:this.displayType};}_customParseQueryParams(t){t.displayType&&(this.displayType=t.displayType);}buildColumns(){this.columns=[{id:"name",label:"Name",sortable:!0}],this.isDisplayingRemoteVideos()&&(this.columns=[{id:"strategy",label:"Strategy",sortable:!1},...this.columns,{id:"totalSize",label:"Total size",sortable:!1}]);}loadSelectLocalStorage(){let t=Xr.getItem(rn.LS_DISPLAY_TYPE);t&&(this.displayType=t);}saveSelectLocalStorage(){Xr.setItem(rn.LS_DISPLAY_TYPE,this.displayType);}bytesToHuman(t){return this.bytesPipe.transform(t,1);}};S(rn,"LS_DISPLAY_TYPE","video-redundancies-list-display-type"),S(rn,"\u0275fac",function(e){return new(e||rn)();}),S(rn,"\u0275cmp",O({type:rn,selectors:[["my-video-redundancies-list"]],viewQuery:function(e,o){e&1&&Ae(o.table,Tp,5),e&2&&Te();},decls:15,vars:5,consts:()=>{let t;t="redundancies per page";let e;e="{VAR_PLURAL, plural, =0 {No redundancy} =1 {1 redundancy} other {{INTERPOLATION} redundancies}}",e=X(e,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let o;o="Display";let _;_="My videos duplicated by remote instances";let g;g="Remote videos duplicated by my instance";let M;M="Open video in a new tab";let I;I="Your instance doesn't mirror any video.";let P;P="Your instance has no mirrored videos.";let y;y="Enabled strategies stats";let F;return F="No redundancy strategy is enabled on your instance.",[["table",""],["totalTitle",""],["captionRight",""],["tableCells",""],["actionCell",""],["expandedRow",""],["noResults",""],e,o,_,g,I,P,y,F,["key","VideoRedundanciesListComponent","defaultSort","name","defaultSortOrder","asc","paginatorText",t,"columnConfig","false",3,"defaultColumns","dataLoader","customParseQueryParams","customUpdateUrl"],[1,"redundancies-charts"],[1,"select-filter-block"],["for","displayType"],[1,"peertube-select-container"],["id","displayType","name","displayType",1,"form-control",3,"ngModelChange","ngModel"],["value","my-videos"],["value","remote-videos"],["title",M,"target","_blank","rel","noopener noreferrer",3,"href"],["iconName","external-link"],["label","",3,"click"],[3,"redundancyElement"],[1,"chart-blocks"],[1,"n
5o-results"],[1,"chart-block"],["type","pie","width","300px","height","300px",3,"ariaLabel","data","options"]];},template:function(e,o){e&1&&(r(0,"my-table",15,0),U(2,Op,3,4,"ng-template",null,1,v)(4,Pp,9,1,"ng-template",null,2,v)(6,Fp,6,4,"ng-template",null,3,v)(8,bp,1,0,"ng-template",null,4,v)(10,yp,2,0,"ng-template",null,5,v)(12,Lp,2,1,"ng-template",null,6,v),i(),c(14,wp,7,1,"div",16)),e&2&&(d("defaultColumns",o.columns)("dataLoader",o.dataLoader)("customParseQueryParams",o.customParseQueryParams)("customUpdateUrl",o.customUpdateUrl),a(14),u(o.isDisplayingRemoteVideos()&&o.dataLoaded?14:-1));},dependencies:[Qe,ae,Xt,Bt,zt,se,kt,Pn,br,$_,L_,He,ut,We],styles:[".redundancies-charts[_ngcontent-%COMP%]{margin-top:50px}.redundancies-charts[_ngcontent-%COMP%]   .chart-blocks[_ngcontent-%COMP%]{display:flex;justify-content:center}.redundancies-charts[_ngcontent-%COMP%]   .chart-blocks[_ngcontent-%COMP%]   .chart-block[_ngcontent-%COMP%]{margin:0 20px}"]}));var hr=rn;var q_=[{path:"follows",canActivate:[ze],data:{userRight:q.MANAGE_SERVER_FOLLOW},children:[{path:"",redirectTo:"following-list",pathMatch:"full"},{path:"following-list",component:Fr,data:{meta:{title:"Following"}}},{path:"followers-list",component:Pr,data:{meta:{title:"Followers"}}},{path:"following-add",redirectTo:"following-list"},{path:"video-redundancies-list",component:hr,data:{meta:{title:"Redundancy"}}}]}];var Ho=class Ho{syndicationItems=[{format:Dn.RSS,label:"media rss 2.0",url:oo.BASE_FEEDS_URL+Dn.RSS.toLowerCase()},{format:Dn.ATOM,label:"atom 1.0",url:oo.BASE_FEEDS_URL+Dn.ATOM.toLowerCase()},{format:Dn.JSON,label:"json 1.0",url:oo.BASE_FEEDS_URL+Dn.JSON.toLowerCase()}];};S(Ho,"\u0275fac",function(e){return new(e||Ho)();}),S(Ho,"\u0275cmp",O({type:Ho,selectors:[["my-video-comment-list"]],decls:1,vars:0,consts:[["mode","admin","key","AdminVideoCommentList"]],template:function(e,o){e&1&&m(0,"my-video-comment-list-admin-owner",0);},dependencies:[x_],encapsulation:2}));var yr=Ho;var Un=class Un extends Jt{videoQuotaOptions=[];videoQuotaDailyOptions=[];username;user;roles=[];serverConfig;ngOnInit(){this.serverConfig=this.serverService.getHTMLConfig(),this.buildRoles();}get subscribersCount(){let t=this.user?this.user.account.followersCount:0,e=this.user?this.user.videoChannels.map(o=>o.followersCount).reduce((o,_)=>o+_,0):0;return t+e;}getAuthPlugins(){return this.serverConfig.plugin.registeredIdAndPassAuths.map(t=>t.npmName).concat(this.serverConfig.plugin.registeredExternalAuths.map(t=>t.npmName));}buildRoles(){let t=this.auth.getUser();this.serverService.getServerLocale().subscribe(e=>{if(t.role.id===ft.ADMINISTRATOR){this.roles=Object.entries(kr).map(([o,_])=>({value:o.toString(),label:li(_,e)}));return;}this.roles=[{value:ft.USER.toString(),label:li(kr[ft.USER],e)}];});}displayPasswordZone(){return!(this.isCreation()||!this.user||this.user.pluginAuth||this.auth.getUser().id===this.user.id);}displayTokenSessions(){return!(this.isCreation()||!this.user);}resetPassword(){}disableTwoFactorAuth(){}getUserVideoQuota(){return this.form.value.videoQuota;}buildAdminFlags(t){return t.byPassAutoBlock?ii.BYPASS_VIDEO_AUTO_BLACKLIST:ii.NONE;}buildQuotaOptions(){this.videoQuotaOptions=xi(),this.videoQuotaDailyOptions=wi();}};S(Un,"\u0275fac",(()=>{let t;return function(o){return(t||(t=Ut(Un)))(o||Un);};})()),S(Un,"\u0275dir",_l({type:Un,features:[pt]}));var jo=Un;var Up=n=>({"input-error":n});function Vp(n,t){n&1&&(E(0),l(1,0),N());}function kp(n,t){n&1&&(E(0),l(1,1),N());}function zp(n,t){if(n&1&&(r(0,"div",6),C(1),i()),n&2){let e=s();a(),b(" ",e.formErrors.password," ");}}var Vn=class Vn extends Jt{formReactiveService=p(Se);notifier=p(K);userAdminService=p(Lt);serverService=p(j);userId=ce(void 0);username=ce(void 0);error;showPassword=!1;ngOnInit(){let{minLength:t,maxLength:e}=this.serverService.getHTMLConfig().fieldsConstraints.users.password;this.buildForm({password:Vi(t,e)});}formValidated(){this.error=void 0;let t=this.form.value;this.userAdminService.updateUser(this.userId(),t).subscribe({next:()=>this.notifier.success("Password changed for user "+this.username()+"."),error:e=>{this.error=e.message;}});}togglePasswordVisibility(){this.showPassword=!this.showPassword;}getFormButtonTitle(){return"Update user password";}};S(Vn,"\u0275fac",(()=>{let t;return function(o){return(t||(t=Ut(Vn)))(o||Vn);};})()),S(Vn,"\u0275cmp",O({type:Vn,selectors:[["my-user-password"]],inputs:{userId:[1,"userId"],username:[1,"username"]},features:[pt],decls:8,vars:10,consts:()=>{let t;t="Hide";let e;return e="Show",[t,e,[3,"ngSubmit","formGroup"],[1,"input-group"],["id","password","formControlName","password","autocomplete","new-password",1,"form-control",3,"ngClass"],["type","button",1,"btn",3,"click"],["role","alert",1,"form-error"],["type","submit",1,"peertube-button","danger-button","mt-2",3,"value","disabled"]];},template:function(e,o){e&1&&(r(0,"form",2),T("ngSubmit",function(){return o.formValidated();}),r(1,"div",3),m(2,"input",4),r(3,"button",5),T("click",function(){return o.togglePasswordVisibility();}),c(4,Vp,2,0,"ng-container")(5,kp,2,0,"ng-container"),i()(),c(6,zp,2,1,"div",6),m(7,"input",7),i()),e&2&&(d("formGroup",o.form),a(2),d("ngClass",x(8,Up,o.formErrors.password)),Cn("type",o.showPassword?"text":"password"),a(2),u(o.showPassword?4:5),a(2),u(o.formErrors.password?6:-1),a(),d("value",Vt(o.getFormButtonTitle()))("disabled",!o.form.valid));},dependencies:[ae,Ne,De,se,Ee,Re,Pe,Ge,Ce],styles:["input[type=text][_ngcontent-%COMP%], input[type=password][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:340px;max-width:340px;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}input[type=text][_ngcontent-%COMP%]::placeholder, input[type=password][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%], input[type=password][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible, input[type=password][_ngcontent-%COMP%]:focus, input[type=password][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%], input[type=password][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:380px){input[type=text][_ngcontent-%COMP%], input[type=password][_ngcontent-%COMP%]{width:100%}}.btn[_ngcontent-%COMP%]{background-color:var(--input-bg);border-left:1px solid var(--bg)}.btn[_ngcontent-%COMP%]:hover{opacity:.8}"]}));var Qo=Vn;var Jr=n=>({"input-error":n}),Xp=n=>["/a",n],K_=()=>["/admin/moderation/abuses/list"],Y_=n=>({search:n});function Bp(n,t){n&1&&(r(0,"li",31),l(1,7),i());}function Wp(n,t){if(n&1&&(r(0,"a",63),C(1),i()),n&2){let e=s(2);d("routerLink",x(2,Xp,e.user==null?null:e.user.username)),a(),f(e.user==null?null:e.user.username);}}function Hp(n,t){if(n&1&&(r(0,"li",31),l(1,8),i(),r(2,"li",62),c(3,Wp,2,4,"a",63),i()),n&2){let e=s();a(3),u(e.user?3:-1);}}function jp(n,t){if(n&1&&(r(0,"div",64)(1,"div")(2,"a")(3,"div",65),C(4),Q(5,"bytes"),i(),r(6,"div",66),l(7,9),i()()(),r(8,"div")(9,"a")(10,"div",65),C(11),i(),r(12,"div",66),l(13,10),i()()(),r(14,"div")(15,"a")(16,"div",65),C(17),i(),r(18,"div",66),l(19,11),i()()(),r(20,"div")(21,"a",67)(22,"div",65),C(23),i(),r(24,"div",66),l(25,12),i()()(),r(26,"div")(27,"a",67)(28,"div",65),C(29),i(),r(30,"div",66),l(31,13),i()()(),r(32,"div")(33,"a")(34,"div",65),C(35),i(),r(36,"div",66),l(37,14),i()()()()),n&2){let e=s(2);
5a(4),Zt("",e.user.videosCount," (",_e(5,16,e.user.videoQuotaUsed,0),")"),a(3),L(e.user.videosCount),$(7),a(4),f(e.user.videoChannels.length||0),a(2),L(e.user.videoChannels.length),$(13),a(4),f(e.subscribersCount),a(2),L(e.subscribersCount),$(19),a(2),d("routerLink",mt(19,K_))("queryParams",x(20,Y_,'reportee:"'+(e.user==null?null:e.user.account.displayName)+'"')),a(2),f(e.user.abusesCount),a(4),d("routerLink",mt(22,K_))("queryParams",x(23,Y_,'reporter:"'+(e.user==null?null:e.user.account.displayName)+'" state:accepted')),a(2),Zt("",e.user.abusesAcceptedCount," / ",e.user.abusesCreatedCount),a(6),f(e.user.videoCommentsCount),a(2),L(e.user.videoCommentsCount),$(37);}}function Qp(n,t){if(n&1&&c(0,jp,38,25,"div",64),n&2){let e=s();u(!e.isCreation()&&e.user?0:-1);}}function Jp(n,t){if(n&1&&(r(0,"my-alert",33),C(1),i()),n&2){let e=s();a(),f(e.error);}}function qp(n,t){}function Kp(n,t){n&1&&U(0,qp,0,0,"ng-template");}function Yp(n,t){n&1&&(r(0,"h2"),l(1,15),i());}function Zp(n,t){if(n&1&&(r(0,"h2",68),C(1),i(),m(2,"my-actor-avatar-edit",69)),n&2){let e=s();a(),b("EDIT USER ",e.user.username),a(),d("displayName",e.user.account.displayName)("avatars",e.user.account.avatars)("username",e.user.username);}}function e0(n,t){if(n&1&&(r(0,"div",47),C(1),i()),n&2){let e=s(2);a(),b(" ",e.formErrors.username," ");}}function t0(n,t){if(n&1&&(r(0,"div",44)(1,"label",70),l(2,16),i(),m(3,"input",71),c(4,e0,2,1,"div",47),i()),n&2){let e=s();a(3),d("ngClass",x(2,Jr,e.formErrors.username)),a(),u(e.formErrors.username?4:-1);}}function n0(n,t){if(n&1&&(r(0,"div",47),C(1),i()),n&2){let e=s(2);a(),b(" ",e.formErrors.channelName," ");}}function o0(n,t){if(n&1&&(r(0,"div",44)(1,"label",72),l(2,17),i(),m(3,"input",73),c(4,n0,2,1,"div",47),i()),n&2){let e=s();a(3),d("ngClass",x(2,Jr,e.formErrors.channelName)),a(),u(e.formErrors.channelName?4:-1);}}function i0(n,t){if(n&1&&(r(0,"div",47),C(1),i()),n&2){let e=s();a(),b(" ",e.formErrors.email," ");}}function r0(n,t){n&1&&(r(0,"div",75),l(1,19),i());}function a0(n,t){if(n&1&&(r(0,"div",44)(1,"label",74),l(2,18),i(),c(3,r0,2,0,"div",75),m(4,"my-input-text",76),i()),n&2){let e=s();a(3),u(e.isPasswordOptional()?3:-1),a(),d("formError",e.formErrors.password);}}function l0(n,t){if(n&1&&(r(0,"option",51),C(1),i()),n&2){let e=t.$implicit;d("value",e.value),a(),b(" ",e.label," ");}}function _0(n,t){if(n&1&&(r(0,"div",47),C(1),i()),n&2){let e=s();a(),b(" ",e.formErrors.role," ");}}function s0(n,t){if(n&1&&(r(0,"div",47),C(1),i()),n&2){let e=s();a(),b(" ",e.formErrors.videoQuota," ");}}function d0(n,t){if(n&1&&(r(0,"div",47),C(1),i()),n&2){let e=s();a(),b(" ",e.formErrors.videoQuotaDaily," ");}}function m0(n,t){if(n&1&&(r(0,"option",51),C(1),i()),n&2){let e=t.$implicit;d("value",e),a(),f(e);}}function c0(n,t){if(n&1&&(r(0,"div",44)(1,"label",77),l(2,20),i(),r(3,"div",49)(4,"select",78)(5,"option",51),l(6,21),i(),pe(7,m0,2,2,"option",51,Ie),i()()()),n&2){let e=s();a(5),d("value",null),a(2),ge(e.getAuthPlugins());}}function u0(n,t){}function p0(n,t){n&1&&U(0,u0,0,0,"ng-template");}function g0(n,t){if(n&1&&(r(0,"div",61)(1,"div",39),m(2,"div",79),r(3,"h2"),l(4,22),i()(),r(5,"div",41),m(6,"my-account-token-sessions",80),i()()),n&2){let e=s();a(6),d("user",e.user);}}function C0(n,t){if(n&1){let e=H();r(0,"div",44)(1,"div",83),l(2,27),i(),r(3,"button",84),T("click",function(){D(e);let _=s(2);return G(_.disableTwoFactorAuth());}),l(4,28),i()();}}function E0(n,t){if(n&1){let e=H();r(0,"div",61)(1,"div",39),m(2,"div",81),r(3,"h2",82),l(4,23),i()(),r(5,"div",41)(6,"div",44)(7,"div",83),l(8,24),i(),r(9,"button",84),T("click",function(){D(e);let _=s();return G(_.resetPassword());}),l(10,25),i()(),r(11,"div",44)(12,"div",83),l(13,26),i(),m(14,"my-user-password",85),i(),c(15,C0,5,0,"div",44),i()();}if(n&2){let e=s();a(14),d("userId",e.user.id)("username",e.user.username),a(),u(e.user.twoFactorEnabled?15:-1);}}var Jo=class Jo extends jo{serverService=p(j);formReactiveService=p(Se);configService=p(we);screenService=p(Hn);auth=p(Mt);router=p(Mn);notifier=p(K);userAdminService=p(Lt);error;constructor(){super(),this.buildQuotaOptions();}
5ngOnInit(){super.ngOnInit();let t={role:ft.USER.toString(),videoQuota:-1,videoQuotaDaily:-1},e=this.serverService.getHTMLConfig().fieldsConstraints.users.password;this.buildForm({username:__,channelName:s_,email:Ui,password:this.isPasswordOptional()?d_(e.minLength,e.maxLength):Vi(e.minLength,e.maxLength),role:ki,videoQuota:Jn,videoQuotaDaily:qn,byPassAutoBlock:null},t);}formValidated(){this.error=void 0;let t=this.form.value;t.adminFlags=this.buildAdminFlags(this.form.value),t.videoQuota=parseInt(this.form.value.videoQuota,10),t.videoQuotaDaily=parseInt(this.form.value.videoQuotaDaily,10),this.userAdminService.addUser(t).subscribe({next:()=>{this.notifier.success("User "+t.username+" created."),this.router.navigate(["/admin/overview/users/list"]);},error:e=>{this.error=e.message;}});}isCreation(){return!0;}isPasswordOptional(){return this.serverConfig.email.enabled;}getFormButtonTitle(){return"Create user";}};S(Jo,"\u0275fac",function(e){return new(e||Jo)();}),S(Jo,"\u0275cmp",O({type:Jo,selectors:[["my-user-create"]],features:[pt],decls:59,vars:28,consts:()=>{let t;t="[email protected]";let e;e="bytes";let o;o="bytes";let _;_="User bypasses video validation by moderators";let g;g="Users";let M;M="Email";let I;I="Role";let P;P="Video quota";let y;y="Daily video quota";let F;F=" Enable this checkbox if this user doesn't need to have its videos reviewed by moderators. ";let h;h="Create";let J;J="Edit";let w;w="{VAR_PLURAL, plural, =1 {Video} other {Videos}}",w=X(w,{VAR_PLURAL:"\uFFFD0\uFFFD"});let Z;Z="{VAR_PLURAL, plural, =1 {Channel} other {Channels}}",Z=X(Z,{VAR_PLURAL:"\uFFFD0\uFFFD"});let oe;oe="{VAR_PLURAL, plural, =1 {Subscriber} other {Subscribers}}",oe=X(oe,{VAR_PLURAL:"\uFFFD0\uFFFD"});let be;be="Incriminated in reports";let ve;ve="Authored reports accepted";let de;de="{VAR_PLURAL, plural, =1 {Comment} other {Comments}}",de=X(de,{VAR_PLURAL:"\uFFFD0\uFFFD"});let he;he="NEW USER";let Fe;Fe="john";let Me;Me="Username";let ye;ye="john_channel";let te;te="Channel name";let Ue;Ue="Password";let ie;ie=" If you leave the password empty, an email will be sent to the user. ";let je;je="Auth plugin";let re;re="None (local authentication)";let Ze;Ze="TOKEN SESSIONS";let et;et="DANGER ZONE";let tt;tt="Send a link to reset the password by email to the user";let nt;nt="Ask for new password";let ot;ot="Manually set the user password";let it;it="This user has two factor authentication enabled";let rt;return rt="Disable two factor authentication",[["dashboard",""],g,M,I,P,y,F,h,J,w,Z,oe,be,ve,de,he,Me,te,Ue,ie,je,re,Ze,et,tt,nt,ot,it,rt,["aria-label","breadcrumb"],[1,"pt-breadcrumb"],[1,"breadcrumb-item"],["routerLink","/admin/overview/users"],["type","danger"],[1,"pt-two-cols","d-xxl-none"],[1,"col-0","col-xl-3"],[1,"col-12","col-xl-9"],[4,"ngTemplateOutlet"],[1,"pt-two-cols","mt-4"],[1,"title-col"],["id","user",1,"anchor"],[1,"content-col"],[1,"row"],[1,"col",3,"ngSubmit","formGroup"],[1,"form-group"],["for","email"],["type","text","id","email","placeholder",t,"formControlName","email","autocomplete","off",1,"form-control",3,"ngClass","readonly"],["role","alert",1,"form-error"],["for","role"],[1,"peertube-select-container"],["id","role","formControlName","role",1,"form-control"],[3,"value"],["id","videoQuotaLabel","for","videoQuota"],["labelId","videoQuotaLabel","inputId","videoQuota","formControlName","videoQuota","inputSuffix",e,"inputType","number",3,"items","clearable"],[3,"videoQuota"],["id","videoQuotaDailyLabel","for","videoQuotaDaily"],["labelId","videoQuotaDailyLabel","inputId","videoQuotaDaily","formControlName","videoQuotaDaily","inputSuffix",o,"inputType","number",3,"items","clearable"],["inputName","byPassAutoBlock","formControlName","byPassAutoBlock","labelText",_],["ngProjectAs","description",5,["description"]],["type","submit",1,"peertube-button","primary-button",3,"value","disabled"],[1,"d-none","d-xxl-block","col-7"],[1,"pt-two-cols","mt-5"],["aria-current","page",1,"breadcrumb-item"],[3,"routerLink"],[1,"dashboard"],[1,"dashboard-num"],[1,"dashboard-label"],[3,"routerLink","queryParams"],[1,"visually-hidden"],["actorType","account","editable","false","displayUsern
5ame","false",3,"displayName","avatars","username"],["for","username"],["type","text","id","username","placeholder",Fe,"formControlName","username",1,"form-control",3,"ngClass"],["for","channelName"],["type","text","id","channelName","placeholder",ye,"formControlName","channelName",1,"form-control",3,"ngClass"],["for","password"],[1,"form-group-description"],["formControlName","password","inputId","password","autocomplete","new-password",3,"formError"],["for","pluginAuth"],["id","pluginAuth","formControlName","pluginAuth",1,"form-control"],["id","token-sessions",1,"anchor"],[3,"user"],["id","danger",1,"anchor"],[1,"pt-title-danger"],[1,"mb-1","fw-bold"],[1,"peertube-button","danger-button",3,"click"],[3,"userId","username"]];},template:function(e,o){if(e&1&&(r(0,"nav",29)(1,"ol",30)(2,"li",31)(3,"a",32),l(4,1),i()(),c(5,Bp,2,0,"li",31)(6,Hp,4,1),i()(),U(7,Qp,1,1,"ng-template",null,0,v),c(9,Jp,2,1,"my-alert",33),r(10,"div",34),m(11,"div",35),r(12,"div",36),U(13,Kp,1,0,null,37),i()(),r(14,"div",38)(15,"div",39),m(16,"div",40),c(17,Yp,2,0,"h2")(18,Zp,3,4),i(),r(19,"div",41)(20,"div",42)(21,"form",43),T("ngSubmit",function(){return o.formValidated();}),c(22,t0,5,4,"div",44),c(23,o0,5,4,"div",44),r(24,"div",44)(25,"label",45),l(26,2),i(),m(27,"input",46),c(28,i0,2,1,"div",47),i(),c(29,a0,5,2,"div",44),r(30,"div",44)(31,"label",48),l(32,3),i(),r(33,"div",49)(34,"select",50),pe(35,l0,2,2,"option",51,Ie),i()(),c(37,_0,2,1,"div",47),i(),r(38,"div",44)(39,"label",52),l(40,4),i(),m(41,"my-select-custom-value",53)(42,"my-user-real-quota-info",54),c(43,s0,2,1,"div",47),i(),r(44,"div",44)(45,"label",55),l(46,5),i(),m(47,"my-select-custom-value",56),c(48,d0,2,1,"div",47),i(),c(49,c0,9,1,"div",44),r(50,"div",44)(51,"my-peertube-checkbox",57),E(52,58),l(53,6),N(),i()(),m(54,"input",59),i(),r(55,"div",60),U(56,p0,1,0,null,37),i()()()(),c(57,g0,7,1,"div",61),c(58,E0,16,3,"div",61)),e&2){let _=ue(8);a(5),u(o.isCreation()?5:6),a(4),u(o.error?9:-1),a(4),d("ngTemplateOutlet",_),a(4),u(o.isCreation()?17:o.user?18:-1),a(4),d("formGroup",o.form),a(),u(o.isCreation()?22:-1),a(),u(o.isCreation()?23:-1),a(4),d("ngClass",x(26,Jr,o.formErrors.email))("readonly",o.user&&o.user.pluginAuth!==null),a(),u(o.formErrors.email?28:-1),a(),u(o.isCreation()?29:-1),a(6),ge(o.roles),a(2),u(o.formErrors.role?37:-1),a(4),d("items",o.videoQuotaOptions)("clearable",!1),a(),d("videoQuota",o.getUserVideoQuota()),a(),u(o.formErrors.videoQuota?43:-1),a(4),d("items",o.videoQuotaDailyOptions)("clearable",!1),a(),u(o.formErrors.videoQuotaDaily?48:-1),a(),u(!o.isCreation()&&o.getAuthPlugins().length!==0?49:-1),a(5),d("value",Vt(o.getFormButtonTitle()))("disabled",!o.form.valid),a(2),d("ngTemplateOutlet",_),a(),u(o.displayTokenSessions()?57:-1),a(),u(o.displayPasswordZone()?58:-1);}},dependencies:[Oe,Le,Ce,Sn,qi,ae,Ne,Xt,Bt,De,zt,se,Ee,Re,Pe,Ge,Di,At,Fn,Je,Qo,Ji,st,ut],styles:["input[_ngcontent-%COMP%]:not([type=submit]){font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:340px;max-width:340px;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}input[_ngcontent-%COMP%]:not([type=submit])::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[_ngcontent-%COMP%]:not([type=submit])[readonly]{color:var(--fg-300)}input[_ngcontent-%COMP%]:not([type=submit]):focus, input[_ngcontent-%COMP%]:not([type=submit]):focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[_ngcontent-%COMP%]:not([type=submit])[disabled]{color:var(--fg-300);opacity:.8}@media screen and (max-width:380px){input[_ngcontent-%COMP%]:not([type=submit]){width:100%}}my-input-text[_ngcontent-%COMP%]{display:block;width:340px}@media screen and (max-width:370px){my-input-text[_ngcontent-%COMP%]{width:100%}}.peertube-select-container[_ngcontent-%COMP%]{width:340px}@media screen and (max-width:370px){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){display:block;width:340px}@media screen and (max-width:370px){my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){width:100%}}my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{display:block;width:480px}@media screen and (max-width:510px){my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{width:100%}}.dashboard[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;margin:0 -5px;max-width:900px}.dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{box-sizing:border-box;flex:0 0 33.3333333333%;padding:0 5px;margin-bottom:10px}.dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{text-decoration:none;color:inherit;display:block;font-size:18px}.dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%], .dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:hover, .dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:focus, .dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:active{text-decoration:none}.dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none}.dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:active, .dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:focus, .dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:hover{opacity:.8}.dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%], .dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{padding:20px;background:var(--bg-secondary-400);border-radius:4px;box-sizing:border-box;height:100%}
5.dashboard[_ngcontent-%COMP%]   .dashboard-num[_ngcontent-%COMP%], .dashboard[_ngcontent-%COMP%]   .dashboard-text[_ngcontent-%COMP%]{text-align:center;font-size:130%;color:var(--fg);line-height:30px;margin-bottom:20px}.dashboard[_ngcontent-%COMP%]   .dashboard-label[_ngcontent-%COMP%]{font-size:90%;color:var(--fg-300);text-align:center}"]}));var Dr=Jo;var qr=n=>({"input-error":n}),N0=n=>["/a",n],Z_=()=>["/admin/moderation/abuses/list"],es=n=>({search:n});function S0(n,t){n&1&&(r(0,"li",31),l(1,7),i());}function f0(n,t){if(n&1&&(r(0,"a",63),C(1),i()),n&2){let e=s(2);d("routerLink",x(2,N0,e.user==null?null:e.user.username)),a(),f(e.user==null?null:e.user.username);}}function M0(n,t){if(n&1&&(r(0,"li",31),l(1,8),i(),r(2,"li",62),c(3,f0,2,4,"a",63),i()),n&2){let e=s();a(3),u(e.user?3:-1);}}function I0(n,t){if(n&1&&(r(0,"div",64)(1,"div")(2,"a")(3,"div",65),C(4),Q(5,"bytes"),i(),r(6,"div",66),l(7,9),i()()(),r(8,"div")(9,"a")(10,"div",65),C(11),i(),r(12,"div",66),l(13,10),i()()(),r(14,"div")(15,"a")(16,"div",65),C(17),i(),r(18,"div",66),l(19,11),i()()(),r(20,"div")(21,"a",67)(22,"div",65),C(23),i(),r(24,"div",66),l(25,12),i()()(),r(26,"div")(27,"a",67)(28,"div",65),C(29),i(),r(30,"div",66),l(31,13),i()()(),r(32,"div")(33,"a")(34,"div",65),C(35),i(),r(36,"div",66),l(37,14),i()()()()),n&2){let e=s(2);a(4),Zt("",e.user.videosCount," (",_e(5,16,e.user.videoQuotaUsed,0),")"),a(3),L(e.user.videosCount),$(7),a(4),f(e.user.videoChannels.length||0),a(2),L(e.user.videoChannels.length),$(13),a(4),f(e.subscribersCount),a(2),L(e.subscribersCount),$(19),a(2),d("routerLink",mt(19,Z_))("queryParams",x(20,es,'reportee:"'+(e.user==null?null:e.user.account.displayName)+'"')),a(2),f(e.user.abusesCount),a(4),d("routerLink",mt(22,Z_))("queryParams",x(23,es,'reporter:"'+(e.user==null?null:e.user.account.displayName)+'" state:accepted')),a(2),Zt("",e.user.abusesAcceptedCount," / ",e.user.abusesCreatedCount),a(6),f(e.user.videoCommentsCount),a(2),L(e.user.videoCommentsCount),$(37);}}function A0(n,t){if(n&1&&c(0,I0,38,25,"div",64),n&2){let e=s();u(!e.isCreation()&&e.user?0:-1);}}function T0(n,t){if(n&1&&(r(0,"my-alert",33),C(1),i()),n&2){let e=s();a(),f(e.error);}}function O0(n,t){}function P0(n,t){n&1&&U(0,O0,0,0,"ng-template");}function R0(n,t){n&1&&(r(0,"h2"),l(1,15),i());}function v0(n,t){if(n&1&&(r(0,"h2",68),C(1),i(),m(2,"my-actor-avatar-edit",69)),n&2){let e=s();a(),b("EDIT USER ",e.user.username),a(),d("displayName",e.user.account.displayName)("avatars",e.user.account.avatars)("username",e.user.username);}}function F0(n,t){if(n&1&&(r(0,"div",47),C(1),i()),n&2){let e=s(2);a(),b(" ",e.formErrors.username," ");}}function b0(n,t){if(n&1&&(r(0,"div",44)(1,"label",70),l(2,16),i(),m(3,"input",71),c(4,F0,2,1,"div",47),i()),n&2){let e=s();a(3),d("ngClass",x(2,qr,e.formErrors.username)),a(),u(e.formErrors.username?4:-1);}}function h0(n,t){if(n&1&&(r(0,"div",47),C(1),i()),n&2){let e=s(2);a(),b(" ",e.formErrors.channelName," ");}}function y0(n,t){if(n&1&&(r(0,"div",44)(1,"label",72),l(2,17),i(),m(3,"input",73),c(4,h0,2,1,"div",47),i()),n&2){let e=s();a(3),d("ngClass",x(2,qr,e.formErrors.channelName)),a(),u(e.formErrors.channelName?4:-1);}}function D0(n,t){if(n&1&&(r(0,"div",47),C(1),i()),n&2){let e=s();a(),b(" ",e.formErrors.email," ");}}function G0(n,t){n&1&&(r(0,"div",75),l(1,19),i());}function L0(n,t){if(n&1&&(r(0,"div",44)(1,"label",74),l(2,18),i(),c(3,G0,2,0,"div",75),m(4,"my-input-text",76),i()),n&2){let e=s();a(3),u(e.isPasswordOptional()?3:-1),a(),d("formError",e.formErrors.password);}}function $0(n,t){if(n&1&&(r(0,"option",51),C(1),i()),n&2){let e=t.$implicit;d("value",e.value),a(),b(" ",e.label," ");}}function x0(n,t){if(n&1&&(r(0,"div",47),C(1),i()),n&2){let e=s();a(),b(" ",e.formErrors.role," ");}}function w0(n,t){if(n&1&&(r(0,"div",47),C(1),i()),n&2){let e=s();a(),b(" ",e.formErrors.videoQuota," ");}}function U0(n,t){if(n&1&&(r(0,"div",47),C(1),i()),n&2){let e=s();a(),b(" ",e.formErrors.videoQuotaDaily," ");}}function V0(n,t){if(n&1&&(r(0,"option",51),C(1),i()),n&2){let e=t.$implicit;d("value",e),a(),f(e);}}function k0(n,t){if(n&1&&(r(0,"div",44)(1,"label",77),l(2,20),i(),r(3,"div",49)(4,"select",78)(5,"option",51),l(6,21),i(),pe(7,V0,2,2,"option",51,Ie),i()()()),n&2){let e=s();a(5),d("value",null),a(2),ge(e.getAuthPlugins());}}function z0(n,t){}function X0(n,t){n&1&&U(0,z0,0,0,"ng-template");}function B0(n,t){if(n&1&&(r(0,"div",61)(1,"div",39),m(2,"div",79),r(3,"h2"),l(4,22),i()(),r(5,"div",41),m(6,"my-account-token-sessions",80),i()()),n&2){let e=s();a(6),d("user",e.user);}}function W0(n,t){if(n&1){let e=H();r(0,"div",44)(1,"div",83),l(2,27),i(),r(3,"button",84),T("click",function(){D(e);let _=s(2);return G(_.disableTwoFactorAuth());}),l(4,28),i()();}}function H0(n,t){if(n&1){let e=H();r(0,"div",61)(1,"div",39),m(2,"div",81),r(3,"h2",82),l(4,23),i()(),r(5,"div",41)(6,"div",44)(7,"div",83),l(8,24),i(),r(9,"button",84),T("click",function(){D(e);let _=s();return G(_.resetPassword());}),l(10,25),i()(),r(11,"div",44)(12,"div",83),l(13,26),i(),m(14,"my-user-password",85),i(),c(15,W0,5,0,"div",44),i()();}if(n&2){let e=s();a(14),d("userId",e.user.id)("username",e.user.username),a(),u(e.user.twoFactorEnabled?15:-1);}}var qo=class qo extends jo{formReactiveService=p(Se);serverService=p(j);configService=p(we);screenService=p(Hn);auth=p(Mt);route=p($e);router=p(Mn);notifier=p(K);userService=p(bi);twoFactorService=p(Qi);userAdminService=p(Lt);error;paramsSub;constructor(){super(),this.buildQuotaOptions();}
5ngOnInit(){super.ngOnInit();let t={role:ft.USER.toString(),videoQuota:"-1",videoQuotaDaily:"-1"};this.buildForm({email:Ui,role:ki,videoQuota:Jn,videoQuotaDaily:qn,byPassAutoBlock:null,pluginAuth:null},t),this.paramsSub=this.route.params.subscribe(e=>{let o=e.id;this.userService.getUser(o,!0).subscribe({next:_=>this.onUserFetched(_),error:_=>{this.error=_.message;}});});}ngOnDestroy(){this.paramsSub.unsubscribe();}formValidated(){this.error=void 0;let t=this.form.value;t.adminFlags=this.buildAdminFlags(this.form.value),t.videoQuota=parseInt(this.form.value.videoQuota,10),t.videoQuotaDaily=parseInt(this.form.value.videoQuotaDaily,10),t.pluginAuth==="null"&&(t.pluginAuth=null),this.userAdminService.updateUser(this.user.id,t).subscribe({next:()=>{this.notifier.success("User "+this.user.username+" updated."),this.router.navigate(["/admin/overview/users/list"]);},error:e=>{this.error=e.message;}});}isCreation(){return!1;}isPasswordOptional(){return!1;}getFormButtonTitle(){return"Update user";}resetPassword(){this.userService.askResetPassword(this.user.email).subscribe({next:()=>{this.notifier.success("An email asking for password reset has been sent to "+this.user.username+".");},error:t=>this.notifier.handleError(t)});}disableTwoFactorAuth(){this.twoFactorService.disableTwoFactor({userId:this.user.id}).subscribe({next:()=>{this.user.twoFactorEnabled=!1,this.notifier.success("Two factor authentication of "+this.user.username+" disabled.");},error:t=>this.notifier.handleError(t)});}onUserFetched(t){this.user=new Dl(t),this.form.patchValue({email:t.email,role:t.role.id.toString(),videoQuota:t.videoQuota,videoQuotaDaily:t.videoQuotaDaily,pluginAuth:t.pluginAuth,byPassAutoBlock:t.adminFlags&ii.BYPASS_VIDEO_AUTO_BLACKLIST});}};S(qo,"\u0275fac",function(e){return new(e||qo)();}),S(qo,"\u0275cmp",O({type:qo,selectors:[["my-user-update"]],features:[pt],decls:59,vars:28,consts:()=>{let t;t="[email protected]";let e;e="bytes";let o;o="bytes";let _;_="User bypasses video validation by moderators";let g;g="Users";let M;M="Email";let I;I="Role";let P;P="Video quota";let y;y="Daily video quota";let F;F=" Enable this checkbox if this user doesn't need to have its videos reviewed by moderators. ";let h;h="Create";let J;J="Edit";let w;w="{VAR_PLURAL, plural, =1 {Video} other {Videos}}",w=X(w,{VAR_PLURAL:"\uFFFD0\uFFFD"});let Z;Z="{VAR_PLURAL, plural, =1 {Channel} other {Channels}}",Z=X(Z,{VAR_PLURAL:"\uFFFD0\uFFFD"});let oe;oe="{VAR_PLURAL, plural, =1 {Subscriber} other {Subscribers}}",oe=X(oe,{VAR_PLURAL:"\uFFFD0\uFFFD"});let be;be="Incriminated in reports";let ve;ve="Authored reports accepted";let de;de="{VAR_PLURAL, plural, =1 {Comment} other {Comments}}",de=X(de,{VAR_PLURAL:"\uFFFD0\uFFFD"});let he;he="NEW USER";let Fe;Fe="john";let Me;Me="Username";let ye;ye="john_channel";let te;te="Channel name";let Ue;Ue="Password";let ie;ie=" If you leave the password empty, an email will be sent to the user. ";let je;je="Auth plugin";let re;re="None (local authentication)";let Ze;Ze="TOKEN SESSIONS";let et;et="DANGER ZONE";let tt;tt="Send a link to reset the password by email to the user";let nt;nt="Ask for new password";let ot;ot="Manually set the user password";let it;it="This user has two factor authentication enabled";let rt;return rt="Disable two factor authentication",[["dashboard",""],g,M,I,P,y,F,h,J,w,Z,oe,be,ve,de,he,Me,te,Ue,ie,je,re,Ze,et,tt,nt,ot,it,rt,["aria-label","breadcrumb"],[1,"pt-breadcrumb"],[1,"breadcrumb-item"],["routerLink","/admin/overview/users"],["type","danger"],[1,"pt-two-cols","d-xxl-none"],[1,"col-0","col-xl-3"],[1,"col-12","col-xl-9"],[4,"ngTemplateOutlet"],[1,"pt-two-cols","mt-4"],[1,"title-col"],["id","user",1,"anchor"],[1,"content-col"],[1,"row"],[1,"col",3,"ngSubmit","formGroup"],[1,"form-group"],["for","email"],["type","text","id","email","placeholder",t,"formControlName","email","autocomplete","off",1,"form-control",3,"ngClass","readonly"],["role","alert",1,"form-error"],["for","role"],[1,"peertube-select-container"],["id","role","formControlName","role",1,"form-control"],[3,"value"],["id","videoQuotaLabel","for","videoQuota"],["labelId","videoQuotaLabel","inputId","videoQuota","formControlName","videoQuota","inputSuffix",e,"inputType","number",3,"items","clearable"],[3,"videoQuota"],["id","videoQuotaDailyLabel","for","videoQuotaDaily"],["labelId","videoQuotaDailyLabel","inputId","videoQuotaDaily","formControlName","videoQuotaDaily","inputSuffix",o,"inputType","number",3,"items","clearable"],["inputName","byPassAutoBlock","formControlName","byPassAutoBlock","labelText",_],["ngProjectAs","de
5scription",5,["description"]],["type","submit",1,"peertube-button","primary-button",3,"value","disabled"],[1,"d-none","d-xxl-block","col-7"],[1,"pt-two-cols","mt-5"],["aria-current","page",1,"breadcrumb-item"],[3,"routerLink"],[1,"dashboard"],[1,"dashboard-num"],[1,"dashboard-label"],[3,"routerLink","queryParams"],[1,"visually-hidden"],["actorType","account","editable","false","displayUsername","false",3,"displayName","avatars","username"],["for","username"],["type","text","id","username","placeholder",Fe,"formControlName","username",1,"form-control",3,"ngClass"],["for","channelName"],["type","text","id","channelName","placeholder",ye,"formControlName","channelName",1,"form-control",3,"ngClass"],["for","password"],[1,"form-group-description"],["formControlName","password","inputId","password","autocomplete","new-password",3,"formError"],["for","pluginAuth"],["id","pluginAuth","formControlName","pluginAuth",1,"form-control"],["id","token-sessions",1,"anchor"],[3,"user"],["id","danger",1,"anchor"],[1,"pt-title-danger"],[1,"mb-1","fw-bold"],[1,"peertube-button","danger-button",3,"click"],[3,"userId","username"]];},template:function(e,o){if(e&1&&(r(0,"nav",29)(1,"ol",30)(2,"li",31)(3,"a",32),l(4,1),i()(),c(5,S0,2,0,"li",31)(6,M0,4,1),i()(),U(7,A0,1,1,"ng-template",null,0,v),c(9,T0,2,1,"my-alert",33),r(10,"div",34),m(11,"div",35),r(12,"div",36),U(13,P0,1,0,null,37),i()(),r(14,"div",38)(15,"div",39),m(16,"div",40),c(17,R0,2,0,"h2")(18,v0,3,4),i(),r(19,"div",41)(20,"div",42)(21,"form",43),T("ngSubmit",function(){return o.formValidated();}),c(22,b0,5,4,"div",44),c(23,y0,5,4,"div",44),r(24,"div",44)(25,"label",45),l(26,2),i(),m(27,"input",46),c(28,D0,2,1,"div",47),i(),c(29,L0,5,2,"div",44),r(30,"div",44)(31,"label",48),l(32,3),i(),r(33,"div",49)(34,"select",50),pe(35,$0,2,2,"option",51,Ie),i()(),c(37,x0,2,1,"div",47),i(),r(38,"div",44)(39,"label",52),l(40,4),i(),m(41,"my-select-custom-value",53)(42,"my-user-real-quota-info",54),c(43,w0,2,1,"div",47),i(),r(44,"div",44)(45,"label",55),l(46,5),i(),m(47,"my-select-custom-value",56),c(48,U0,2,1,"div",47),i(),c(49,k0,9,1,"div",44),r(50,"div",44)(51,"my-peertube-checkbox",57),E(52,58),l(53,6),N(),i()(),m(54,"input",59),i(),r(55,"div",60),U(56,X0,1,0,null,37),i()()()(),c(57,B0,7,1,"div",61),c(58,H0,16,3,"div",61)),e&2){let _=ue(8);a(5),u(o.isCreation()?5:6),a(4),u(o.error?9:-1),a(4),d("ngTemplateOutlet",_),a(4),u(o.isCreation()?17:o.user?18:-1),a(4),d("formGroup",o.form),a(),u(o.isCreation()?22:-1),a(),u(o.isCreation()?23:-1),a(4),d("ngClass",x(26,qr,o.formErrors.email))("readonly",o.user&&o.user.pluginAuth!==null),a(),u(o.formErrors.email?28:-1),a(),u(o.isCreation()?29:-1),a(6),ge(o.roles),a(2),u(o.formErrors.role?37:-1),a(4),d("items",o.videoQuotaOptions)("clearable",!1),a(),d("videoQuota",o.getUserVideoQuota()),a(),u(o.formErrors.videoQuota?43:-1),a(4),d("items",o.videoQuotaDailyOptions)("clearable",!1),a(),u(o.formErrors.videoQuotaDaily?48:-1),a(),u(!o.isCreation()&&o.getAuthPlugins().length!==0?49:-1),a(5),d("value",Vt(o.getFormButtonTitle()))("disabled",!o.form.valid),a(2),d("ngTemplateOutlet",_),a(),u(o.displayTokenSessions()?57:-1),a(),u(o.displayPasswordZone()?58:-1);}},dependencies:[Oe,Sn,qi,ae,Ne,Xt,Bt,De,zt,se,Ee,Re,Pe,Ge,Le,Ce,Di,At,Fn,Je,Qo,Ji,st,ut],styles:["input[_ngcontent-%COMP%]:not([type=submit]){font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:340px;max-width:340px;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}input[_ngcontent-%COMP%]:not([type=submit])::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[_ngcontent-%COMP%]:not([type=submit])[readonly]{color:var(--fg-300)}input[_ngcontent-%COMP%]:not([type=submit]):focus, input[_ngcontent-%COMP%]:not([type=submit]):focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[_ngcontent-%COMP%]:not([type=submit])[disabled]{color:var(--fg-300);opacity:.8}@media screen and (max-width:380px){input[_ngcontent-%COMP%]:not([type=submit]){width:100%}}my-input-text[_ngcontent-%COMP%]{display:block;width:340px}@media screen and (max-width:370px){my-input-text[_ngcontent-%COMP%]{width:100%}}.peertube-select-container[_ngcontent-%COMP%]{width:340px}@media screen and (max-width:370px){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){display:block;width:340px}@media screen and (max-width:370px){my-select-custom-value[_ngcontent-%COMP%]:not(.has-custom-value){width:100%}}my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{display:block;width:480px}@media screen and (max-width:510px){my-select-custom-value.has-custom-value[_ngcontent-%COMP%]{width:100%}}.dashboard[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;margin:0 -5px;max-width:900px}.dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{box-sizing:border-box;flex:0 0 33.3333333333%;padding:0 5px;margin-bottom:10px}.dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{text-decoration:none;color:inherit;display:block;font-size:18px}.dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%], .dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:hover, .dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:focus, .dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:active{text-decoration:none}.dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none}.dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:active, .dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:focus, .dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]:hover{opacity:.8}.dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > a[_ngcontent-%COMP%], .dashboard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{padding:20px;background:var(--bg-secondary-400);border-radius:4px;box-sizing:border-box;height:100%}
5.dashboard[_ngcontent-%COMP%]   .dashboard-num[_ngcontent-%COMP%], .dashboard[_ngcontent-%COMP%]   .dashboard-text[_ngcontent-%COMP%]{text-align:center;font-size:130%;color:var(--fg);line-height:30px;margin-bottom:20px}.dashboard[_ngcontent-%COMP%]   .dashboard-label[_ngcontent-%COMP%]{font-size:90%;color:var(--fg-300);text-align:center}"]}));var Gr=qo;var j0=["userBanModal"],Q0=["table"],J0=n=>[n],ts=()=>({blocked:!0}),q0=n=>({role:n});function K0(n,t){if(n&1&&(E(0),l(1,7),Q(2,"myNumberFormatter"),N()),n&2){let e=t.$implicit;a(2),L(e)(ke(2,2,e)),$(1);}}function Y0(n,t){n&1&&(r(0,"a",16),m(1,"my-global-icon",17),E(2),l(3,8),N(),i());}function Z0(n,t){n&1&&(r(0,"div",24),l(1,9),i());}function e1(n,t){n&1&&(r(0,"a",25),l(1,10),i()),n&2&&d("queryParams",mt(1,ts));}function t1(n,t){if(n&1&&(r(0,"td",18)(1,"a",20)(2,"div",21),m(3,"my-actor-avatar",22),r(4,"div")(5,"span"),C(6),i(),r(7,"span",23),C(8),i()()()(),c(9,Z0,2,0,"div",24),c(10,e1,2,2,"a",25),i()),n&2){let e=s().$implicit;a(),d("routerLink",x(6,J0,"/a/"+e.username)),a(2),d("actor",e==null?null:e.account),a(3),f(e.account.displayName),a(2),f(e.username),a(),u(e.accountMutedStatus.mutedByInstance?9:-1),a(),u(e.blocked?10:-1);}}function n1(n,t){if(n&1&&(r(0,"a",26),C(1),i()),n&2){let e=s(2).$implicit;d("queryParams",mt(2,ts)),a(),f(e.role.label);}}function o1(n,t){if(n&1&&(r(0,"a",27),C(1),i()),n&2){let e=s(2).$implicit,o=s();d("queryParams",x(4,q0,e.role.id))("title",o.getRoleFilterTitle(e.role.label))("ngClass",o.getRoleClass(e.role.id)),a(),f(e.role.label);}}function i1(n,t){if(n&1&&(r(0,"td"),c(1,n1,2,3,"a",26)(2,o1,2,6,"a",27),i()),n&2){let e=s().$implicit;a(),u(e.blocked?1:2);}}function r1(n,t){if(n&1&&(r(0,"td"),m(1,"my-user-email-info",28),i()),n&2){let e=s().$implicit;a(),d("entry",e);}}function a1(n,t){if(n&1&&(r(0,"td"),m(1,"my-progress-bar",29),i()),n&2){let e=s().$implicit;a(),d("max",e.rawVideoQuota)("value",e.rawVideoQuotaUsed)("valueFormatted",e.videoQuotaUsed)("maxFormatted",e.videoQuota);}}function l1(n,t){if(n&1&&(r(0,"td"),m(1,"my-progress-bar",30),i()),n&2){let e=s().$implicit;a(),d("max",e.rawVideoQuotaDaily)("value",e.rawVideoQuotaUsedDaily)("valueFormatted",e.videoQuotaUsedDaily)("maxFormatted",e.videoQuotaDaily);}}function _1(n,t){if(n&1&&(r(0,"td"),C(1),Q(2,"bytes"),i()),n&2){let e=s().$implicit;a(),b(" ",ke(2,1,e.totalVideoFileSize)," ");}}function s1(n,t){n&1&&(r(0,"span",31),l(1,11),i());}function d1(n,t){if(n&1&&(r(0,"td"),c(1,s1,2,0,"span",31),i()),n&2){let e=s().$implicit;a(),u(e.twoFactorEnabled?1:-1);}}function m1(n,t){if(n&1&&(r(0,"span",32),C(1),i()),n&2){let e=s(2).$implicit;d("ngbTooltip",e.pluginAuth),a(),f(e.pluginAuth.replace("peertube-plugin-",""));}}function c1(n,t){if(n&1&&(r(0,"td"),c(1,m1,2,2,"span",32),i()),n&2){let e=s().$implicit;a(),u(e.pluginAuth?1:-1);}}function u1(n,t){if(n&1&&(r(0,"td",19),C(1),Q(2,"ptDate"),i()),n&2){let e=s().$implicit;d("title",e.createdAt),a(),f(_e(2,2,e.createdAt,"short"));}}function p1(n,t){if(n&1&&(C(0),Q(1,"ptDate")),n&2){let e=s(2).$implicit;b(" ",_e(1,1,e.lastLoginDate,"short")," ");}}function g1(n,t){n&1&&(r(0,"span"),l(1,12),i());}function C1(n,t){if(n&1&&(r(0,"td",19),c(1,p1,2,4)(2,g1,2,0,"span"),i()),n&2){let e=s().$implicit;d("title",e.lastLoginDate),a(),u(e.lastLoginDate?1:2);}}function E1(n,t){if(n&1&&(c(0,t1,11,8,"td",18),c(1,i1,3,1,"td"),c(2,r1,2,1,"td"),c(3,a1,2,4,"td"),c(4,l1,2,4,"td"),c(5,_1,3,3,"td"),c(6,d1,2,1,"td"),c(7,c1,2,1,"td"),c(8,u1,3,5,"td",19),c(9,C1,3,2,"td",19)),n&2){s();let e=ue(1);u(e.isColumnDisplayed("username")?0:-1),a(),u(e.isColumnDisplayed("role")?1:-1),a(),u(e.isColumnDisplayed("email")?2:-1),a(),u(e.isColumnDisplayed("videoQuotaUsed")?3:-1),a(),u(e.isColumnDisplayed("videoQuotaDailyUsed")?4:-1),a(),u(e.isColumnDisplayed("totalVideoFileSize")?5:-1),a(),u(e.isColumnDisplayed("twoFactorEnabled")?6:-1),a(),u(e.isColumnDisplayed("pluginAuth")?7:-1),a(),u(e.isColumnDisplayed("createdAt")?8:-1),a(),u(e.isColumnDisplayed("lastLoginDate")?9:-1);}}function N1(n,t){if(n&1){let e=H();r(0,"my-user-moderation-dropdown",33),T("userChanged",function(){D(e);let _=s();return G(_.onUserChanged());})("userDeleted",function(){D(e);let _=s();return G(_.onUserChanged());}),i();}if(n&2){let e=t.$implicit,o=s();d("user",e)("account",e.accountMutedStatus)("displayOptions",o.userModerationDisplayOptions);}}function S1(n,t){if(n&1&&(r(0,"span",34),l(1,13),i(),C(2)),n&2){let e=t.$implicit;a(2),b(" ",e.blockedReason," ");}}var Ko=class Ko{notifier=p(K);confirmService=p(xe);auth=p(Mt);blocklist=p(Rn);userAdminService=p(Lt);hooks=p(Fi);pluginService=p(Tn);userService=p(bi);userBanModal=me("userBanModal");table=me("table");bulkActions=[];inputFilters=[{type:"options",key:"blocked",title:"Ban status",options:[{value:"all",label:"All"},{value:!0,label:"Banned"},{value:!1,label:"Not banned"}]},{type:"options",key:"role",title:"Role",options:[{value:"all",label:"All"},{value:ft.ADMINISTRATOR,label:"Administrator"},{value:ft.MODERATOR,label:"Moderator"},{value:ft.USER,label:"User"}]}];userModerationDisplayOptions={instanceAccount:!0,instanceUser:!0,myAccount:!1};columns=[{id:"username",label:"Username",sortable:!0},{id:"role",label:"Role",sortable:!0},{id:"email",label:"Email",sortable:!1},{id:"videoQuotaUsed",label:"Video quota",sortable:!0},{id:"videoQuotaDailyUsed",label:"Daily quota",sortable:!1},{id:"totalVideoFileSize",label:"Total size",sortable:!1},{id:"twoFactorEnabled",label:"2FA",sortable:!1},{id:"pluginAuth",label:"Auth plugin",sortable:!1},{id:"createdAt",label:"Created",sortable:!0},{id:"lastLoginDate",label:"Last login",sortable:!0}];dataLoader;hasExpandedRow;constructor(){this.dataLoader=this._dataLoader.bind(this),this.hasExpandedRow=this._hasExpandedRow.bind(this);}get authUser(){return this.auth.getUser();}ngOnInit(){return le(this,null,function*(){this.pluginService.addAction("admin-users-l
5ist:load-data",()=>this.table().loadData());let t=[[{label:"Delete",description:"Videos will be deleted, comments will be tombstoned.",handler:e=>this.removeUsers(e),isDisplayed:e=>e.every(o=>this.authUser.canManageUser(o))},{label:"Ban",description:"User won't be able to login anymore, but videos and comments will be kept as is.",handler:e=>this.openBanUserModal(e),isDisplayed:e=>e.every(o=>this.authUser.canManageUser(o)&&o.blocked===!1)},{label:"Unban",handler:e=>this.unbanUsers(e),isDisplayed:e=>e.every(o=>this.authUser.canManageUser(o)&&o.blocked===!0)}],[{label:"Set email as verified",handler:e=>this.setEmailsAsVerified(e),isDisplayed:e=>e.every(o=>this.authUser.canManageUser(o)&&!o.blocked&&o.emailVerified!==!0)},{label:"Re-send verification emails",handler:e=>this.resendVerificationEmails(e),isDisplayed:e=>e.every(o=>this.authUser.canManageUser(o)&&!o.blocked&&o.emailVerified!==!0&&!o.pluginAuth)}]];this.bulkActions=yield this.hooks.wrapObject(t,"admin-users","filter:admin-users-list.bulk-actions.create.result");});}ngOnDestroy(){this.pluginService.removeAction("admin-users-list:load-data");}getRoleClass(t){switch(t){case ft.ADMINISTRATOR:return"badge-purple";case ft.MODERATOR:return"badge-blue";default:return"badge-yellow";}}openBanUserModal(t){for(let e of t)if(e.username==="root"){this.notifier.error("You cannot ban root.");return;}this.userBanModal().openModal(t);}onUserChanged(){this.table().loadData();}unbanUsers(t){return le(this,null,function*(){(yield this.confirmService.confirm(Y("Do you really want to unban {count, plural, =1 {1 user} other {{count} users}}?",{count:t.length}),"Unban"))!==!1&&this.userAdminService.unbanUsers(t).subscribe({next:()=>{this.notifier.success(Y("{count, plural, =1 {1 user unbanned.} other {{count} users unbanned.}}",{count:t.length})),this.table().loadData();},error:o=>this.notifier.handleError(o)});});}removeUsers(t){return le(this,null,function*(){if(t.some(_=>_.username==="root")){this.notifier.error("You cannot delete root.");return;}let e="<p>You can't create users or channels with a username that already used by a deleted user/channel.</p>"+"It means the following usernames will be permanently deleted and cannot be recovered:"+"<ul>"+t.map(_=>"<li>"+_.username+"</li>").join("")+"</ul>";(yield this.confirmService.confirm(e,"Delete"))!==!1&&this.userAdminService.removeUsers(t).subscribe({next:()=>{this.notifier.success(Y("{count, plural, =1 {1 user deleted.} other {{count} users deleted.}}",{count:t.length})),this.table().loadData();},error:_=>this.notifier.handleError(_)});});}setEmailsAsVerified(t){this.userAdminService.updateUsers(t,{emailVerified:!0}).subscribe({next:()=>{this.notifier.success(Y("{count, plural, =1 {1 user email set as verified.} other {{count} user emails set as verified.}}",{count:t.length})),this.table().loadData();},error:e=>this.notifier.handleError(e)});}resendVerificationEmails(t){this.userService.askSendVerifyEmail(t.map(e=>e.email)).subscribe({next:()=>{this.notifier.success(Y("{count, plural, =1 {1 verification email sent.} other {{count} verification emails sent.}}",{count:t.length}));},error:e=>this.notifier.handleError(e)});}getRoleFilterTitle(t){return"Filter by role: "+t+"";}_dataLoader(t){return this.userAdminService.listUsers(t).pipe(Be(e=>this.blocklist.getStatus({accounts:e.data.map(o=>o.username+"@"+Br())}).pipe(lt(o=>({result:e,blockStatus:o})))),lt(({result:e,blockStatus:o})=>({total:e.total,data:e.data.map(_=>Xe(fe({},_),{accountMutedStatus:Xe(fe({},_.account),{nameWithHost:yl.CREATE_BY_STRING(_.account.name,_.account.host),mutedByInstance:o.accounts[_.username+"@"+Br()].blockedByServer,mutedByUser:!1,mutedServerByInstance:!1,mutedServerByUser:!1})}))})));}_hasExpandedRow(t){return!!t.blockedReason;}};S(Ko,"\u0275fac",function(e){return new(e||Ko)();}),S(Ko,"\u0275cmp",O({type:Ko,selectors:[["my-user-list"]],viewQuery:function(e,o){e&1&&Ae(o.userBanModal,j0,5)(o.table,Q0,5),e&2&&Te(2);},decls:14,vars:5,consts:()=>{let t;t="users per page";let e;e="{VAR_PLURAL, plural, =0 {No users} =1 {1 user} other {{INTERPOLATION} users}}",e=X(e,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let o;o="Create user";let _;_="Open account in a new tab";let g;g="Filter by banned users";let M;M="Muted";let I;I="Banned";let P;P="Filter by banned users";let y;y="Total video quota";let F;F="Total daily video quota";let h;h="Two factor authentication is enabled";let J;J="2FA";let w;w="never";let Z;return Z="Ban reason:",[["table",""],["totalTitle",""],["captionRight",""],["tableCells",""],["actionCell",""],["expandedRow",""],["userBanModal",""],e,o,M,I,J,w,Z,["key","UserListComponent","defaultSort","createdAt","paginatorText",t,"defaultRowsPerPage","10","columnConfig","true","searchInput","true",3,"defaultColumns","bulkActions","dataLoader","hasExpandedRow","inputFilters"],[3,"userBanned"],["routerLink","/admin/overview/users/create",1,"peertube-create-button"],["
5iconName","user-add","aria-hidden","true"],[1,"cell-username"],[3,"title"],["title",_,"target","_blank","rel","noopener noreferrer",3,"routerLink"],[1,"chip","two-lines"],["actorType","account","size","32",3,"actor"],[1,"muted"],[1,"pt-badge","badge-red"],["routerLink",".","title",g,1,"pt-badge","badge-red",3,"queryParams"],["routerLink",".","title",P,1,"pt-badge","badge-banned",3,"queryParams"],["routerLink",".",1,"pt-badge",3,"queryParams","title","ngClass"],["showEmailVerifyInformation","true",3,"entry"],["label",y,"size","small",3,"max","value","valueFormatted","maxFormatted"],["label",F,"size","small",3,"max","value","valueFormatted","maxFormatted"],["ngbTooltip",h,1,"pt-badge","badge-green"],[3,"ngbTooltip"],["container","body",3,"userChanged","userDeleted","user","account","displayOptions"],[1,"ban-reason-label"]];},template:function(e,o){e&1&&(r(0,"my-table",14,0),U(2,K0,3,4,"ng-template",null,1,v)(4,Y0,4,0,"ng-template",null,2,v)(6,E1,10,10,"ng-template",null,3,v)(8,N1,1,3,"ng-template",null,4,v)(10,S1,3,1,"ng-template",null,5,v),i(),r(12,"my-user-ban-modal",15,6),T("userBanned",function(){return o.onUserChanged();}),i()),e&2&&d("defaultColumns",o.columns)("bulkActions",o.bulkActions)("dataLoader",o.dataLoader)("hasExpandedRow",o.hasExpandedRow)("inputFilters",o.inputFilters);},dependencies:[Qe,Le,Ce,Oe,ae,Oi,V_,zl,To,U_,w_,He,qe,ut,We],styles:[".banned-info[_ngcontent-%COMP%]{font-style:italic}.ban-reason-label[_ngcontent-%COMP%]{font-weight:600}.cell-username[_ngcontent-%COMP%]   .pt-badge[_ngcontent-%COMP%]{margin-inline-start:.9375rem}my-progress-bar[_ngcontent-%COMP%]{display:block;min-width:120px}"]}));var Lr=Ko;var kn=class kn{videoService=p(tn);authHttp=p(Rt);restExtractor=p(Ft);restService=p(Wt);listAdminVideos(t){let F=t,{pagination:e,search:o,excludeMuted:_,excludePublic:g}=F,M=Ci(F,["pagination","search","excludeMuted","excludePublic"]),I=new Pt();I=this.videoService.buildVideoListParams(fe({params:I},M));let P=An.BLACKLISTED|An.BLOCKED_OWNER|An.NOT_PUBLISHED_STATE|An.FILES|An.SOURCE|An.AUTOMATIC_TAGS,y=bl();return _&&(P&=~An.BLOCKED_OWNER),g&&(y=[ri.PRIVATE,ri.UNLISTED,ri.INTERNAL,ri.PASSWORD_PROTECTED]),I=this.restService.addObjectParams(I,{include:P,privacyOneOf:y,search:o,start:e.start,count:e.count}),this.authHttp.get(tn.BASE_VIDEO_URL,{params:I}).pipe(Be(h=>this.videoService.extractVideos(h)),Ve(h=>this.restExtractor.handleError(h)));}};S(kn,"\u0275fac",function(e){return new(e||kn)();}),S(kn,"\u0275prov",Ot({token:kn,factory:kn.ɵfac}));var Yo=kn;var f1=["videoBlockModal"],M1=["table"],I1=()=>["."],A1=n=>({autoTagOneOf:n});function T1(n,t){if(n&1&&(E(0),l(1,7),Q(2,"myNumberFormatter"),N()),n&2){let e=t.$implicit;a(2),L(e)(ke(2,2,e)),$(1);}}function O1(n,t){n&1&&(r(0,"span",24),l(1,8),i());}function P1(n,t){n&1&&(r(0,"span",25),l(1,9),i());}function R1(n,t){if(n&1&&(r(0,"span"),C(1),i()),n&2){let e=s().$implicit,o=s();ml(o.getVideoStateBadgeClass(e.state.id)),a(),f(e.state.label);}}function v1(n,t){n&1&&(r(0,"span",29),l(1,10),i());}function F1(n,t){if(n&1&&(r(0,"a",30),C(1),i()),n&2){let e=t.$implicit;d("routerLink",mt(3,I1))("queryParams",x(4,A1,e)),a(),f(e);}}function b1(n,t){n&1&&(r(0,"span",24),l(1,11),i());}function h1(n,t){n&1&&(r(0,"span",24),l(1,12),i());}function y1(n,t){if(n&1&&(r(0,"span",24),l(1,13),i()),n&2){let e=s().$implicit;a(),L(e.files.length),$(1);}}function D1(n,t){n&1&&(r(0,"span",24),l(1,14),i());}function G1(n,t){n&1&&(r(0,"span",25),l(1,15),i());}function L1(n,t){if(n&1&&(r(0,"span"),C(1),Q(2,"bytes"),i()),n&2){let e=s().$implicit,o=s();a(),f(_e(2,1,o.getFilesSize(e),1));}}function $1(n,t){if(n&1&&(r(0,"td"),m(1,"my-video-cell",23),i(),r(2,"td")(3,"div"),c(4,O1,2,0,"span",24)(5,P1,2,0,"span",25),m(6,"my-privacy-badge",26)(7,"my-video-nsfw-badge",27),c(8,R1,2,3,"span",28),c(9,v1,2,0,"span",29),i(),r(10,"div"),pe(11,F1,2,6,"a",30,Ie),i()(),r(13,"td"),c(14,b1,2,0,"span",24),c(15,h1,2,0,"span",24),c(16,y1,2,1,"span",24),c(17,D1,2,0,"span",24),c(18,G1,2,0,"span",25),c(19,L1,3,4,"span"),i(),r(20,"td"),C(21),Q(22,"ptDate"),i()),n&2){let e=t.$implicit,o=s();a(),d("video",e)("accountBlockBadges",o.accountBlocklist.get(e.account.id)),a(3),u(e.isLocal?4:5),a(2),d("video",e),a(),d("video",e),a(),u(o.isUnpublished(e)?8:-1),a(),u(o.isVideoBlocked(e)?9:-1),a(2),ge(e.automaticTags),a(3),u(o.hasOriginalFile(e)?14:-1),a(),u(o.hasHLS(e)?15:-1),a(),u(o.hasWebVideos(e)?16:-1),a(),u(e.isLive?17:-1),a(),u(o.hasObjectStorage(e)?18:-1),a(),u(!o.isImport(e)&&!e.isLive&&e.isLocal?19:-1),a(2),b(" ",_e(22,14,e.publishedAt,"short")," ");}}function x1(n,t){if(n&1){let e=H();r(0,"my-video-actions-dropdown",31),T("videoRemoved",function(){D(e),s();let _=ue(1);return G(_.loadData());})("videoFilesRemoved",function(){D(e),s();let _=ue(1);return G(_.loadData());})("transcodingCreated",function(){D(e),s();let _=ue(1);return G(_.loadData());})("muted",function(){D(e);let _=s();return G(_.loadBlockStatus());})("unmuted",function(){D(e);let _=s();return G(_.loadBlockStatus());}),i();}if(n&2){let e=t.$implicit,o=s();d("video",e)("displayOptions",o.videoActionsOptions)("muteStatus",o.accountBlocklist.get(e.account.id));}}function w1(n,t){if(n&1){let e=H();r(0,"div",33),E(1),l(2,16),N(),r(3,"ul")(4,"li")(5,"a",35),C(6),i(),C(7),Q(8,"bytes"),r(9,"button",36),T("click",function(){D(e);let _=s().$implicit,g=s();return G(g.removeVideoSourceFile(_));}),m(10,"my-global-icon",37),i()()()();}if(n&2){let e=s().$implicit,o=s();a(5),d("href",o.getDownloadUrl(e,e.videoSource.fileDownloadUrl),at),a(),f(e.videoSource.inputFilename),a(),b(": ",_e(8,3,e.videoSource.size,1)," ");}}function U1(n,t){if(n&1){let e=H();r(0,"button",40),T("click",function(){D(e);let _=s().$implicit,g=s(2).$implicit,M=s();return G(M.removeVideoFile(g,_,"web-videos"));}),m(1,"my-global-icon",37),i();}}function V1(n,t){if(n&1&&(r(0,"li")(1,"a",38),C(2),i(),C(3),Q(4,"bytes"),c(5,U1,2,0,"button",39),i()),n&2){let e=t.$implicit,o=s(2).$implicit,_=s();a(),d("href",_.getDownloadUrl(o,e.fileDownloadUrl),at),a(),f(e.resolution.label),a(),b(": ",_e(4,4,e.size,1)," "),a(2),u(_.canRemoveOneFile(o)?5:-1);}}function k1(n,t){if(n&1&&(r(0,"div",33),E(1),l(2,17),N(),r(3,"ul"),pe(4,V1,6,7,"li",null,Ie),i()()),n&2){let e=s().$implicit;a(4),ge(e.files);}}function z1(n,t){if(n&1){let e=H();r(0,"button",43),T("click",function(){D(e);let _=s().$implicit,g=s(2).$implicit,M=s();return G(M.removeVideoFile(g,_,"hls"));}),m(1,"my-global-icon",37),i();}}function X1(n,t){if(n&1&&(r(0,"li")(1,"a",41),C(2),i(),C(3),Q(4,"bytes"),c(5,z1,2,0,"button",42),i()),n&2){let e=t.$implicit,o=s(2).$implicit,_=s();a(),d("href",_.getDownloadUrl(o,e.fileDownloadUrl),at),a(),f(e.resolution.label),a(),b(": ",_e(4,4,e.size,1)," "),a(2),u(_.canRemoveOneFile(o)?5:-1);}}function B1(n,t){if(n&1&&(r(0,"div"),E(1),l(2,18),N(),r(3,"ul"),pe(4,X1,6,7,"li",null,Ie),i()()),n&2){let e=s().$implicit;a(4),ge(e.streamingPlaylists[0].files);}}function W1(n,t){if(n&1&&(r(0,"div",32),c(1,w1,11,6,"div",33),c(2,k1,6,0,"div",33),c(3,B1,6,0,"div"),m(4,"my-embed",34),i()),n&2){let e=t.$implicit,o=s();a(),u(o.hasOriginalFile(e)?1:-1),a(),u(o.hasWebVideos(e)?2:-1),a(),u(o.hasHLS(e)?3:-1),a(),d("video",e);}}function H1(n,t){n&1&&(E(0),l(1,19),N());}function j1(n,t){n&1&&(E(0),l(1,20),N());}function Q1(n,t){if(n&1&&c(0,H1,2,0,"ng-container")(1,j1,2,0,"ng-container"),n&2){let e=t.search,o=t.hasFilters;u(e||o?0:1);}}var Zo=class Zo{confirmService=p(xe);auth=p(Mt);notifier=p(K);videoService=p(tn);
5videoAdminService=p(Yo);videoBlockService=p(Zn);videoCaptionService=p(C_);server=p(j);videoFileTokenService=p(S_);blocklistService=p(Rn);videoBlockModal=me("videoBlockModal");table=me("table");bulkActions=[];defaultInputFilterValues={};inputFilters=[];videoActionsOptions={playlist:!1,download:!1,update:!0,blacklist:!0,delete:!0,report:!1,duplicate:!0,muteByUser:!1,muteByServer:!0,liveInfo:!1,removeFiles:!0,transcoding:!0,generateTranscription:!0};columns=[{id:"video",label:"Video",sortable:!1},{id:"info",label:"Info",sortable:!1},{id:"localVideoFilesSize",label:"Files",sortable:!0},{id:"publishedAt",label:"Published",sortable:!0}];accountBlocklist=new Map();videoFileTokens={};dataLoader;constructor(){this.dataLoader=this._dataLoader.bind(this);}get authUser(){return this.auth.getUser();}get serverConfig(){return this.server.getHTMLConfig();}ngOnInit(){this.defaultInputFilterValues={isLocal:!0},this.inputFilters=[{type:"options",key:"isLocal",title:"Videos scope",options:[{value:"all",label:"All"},{value:!1,label:"Remote videos"},{value:!0,label:"Local videos"}]},{type:"options",key:"nsfw",title:"Sensitive videos",options:[{value:"all",label:"All"},{value:"true",label:"Sensitive"},{value:"false",label:"Non sensitive"}]},{type:"title",title:"Moderation"},{type:"checkbox",key:"excludeMuted",label:"Exclude muted accounts"},{type:"checkbox",key:"excludePublic",label:"Exclude public videos"},{type:"options",key:"isLive",title:"Video type",options:[{value:"all",label:"All"},{value:!1,label:"VOD"},{value:!0,label:"Live"}]},{type:"select",key:"state",title:"Video state",clearable:!0,filter:!0,items:k_().map(t=>({id:t+"",label:z_(t).toLocaleUpperCase(),classes:["pt-badge",Wr(t)]}))},{type:"options",key:"hasWebVideoFiles",title:"Web files (local only)",options:[{value:"all",label:"All"},{value:!0,label:"With Web Videos files"},{value:!1,label:"Without Web Videos files"}]},{type:"options",key:"hasHLSFiles",title:"HLS files (local only)",options:[{value:"all",label:"All"},{value:!0,label:"With HLS files"},{value:!1,label:"Without HLS files"}]},{type:"tags",key:"autoTagOneOf",title:"Auto tags"}],this.bulkActions=[[{label:"Delete",handler:t=>this.removeVideos(t),isDisplayed:()=>this.authUser.hasRight(q.REMOVE_ANY_VIDEO),iconName:"delete"},{label:"Block",handler:t=>this.videoBlockModal().show(t),isDisplayed:t=>this.authUser.hasRight(q.MANAGE_VIDEO_BLACKLIST)&&t.every(e=>!e.blacklisted),iconName:"no"},{label:"Unblock",handler:t=>this.unblockVideos(t),isDisplayed:t=>this.authUser.hasRight(q.MANAGE_VIDEO_BLACKLIST)&&t.every(e=>e.blacklisted),iconName:"undo"}],[{label:"Run HLS transcoding",handler:t=>this.runTranscoding(t,"hls"),isDisplayed:t=>t.every(e=>e.canRunTranscoding(this.authUser)),iconName:"cog"},{label:"Run Web Video transcoding",handler:t=>this.runTranscoding(t,"web-video"),isDisplayed:t=>t.every(e=>e.canRunTranscoding(this.authUser)),iconName:"cog"},{label:"Delete HLS files",handler:t=>this.removeVideoFiles(t,"hls"),isDisplayed:t=>t.every(e=>e.canRemoveAllHLSOrWebFiles(this.authUser)),iconName:"delete"},{label:"Delete Web Video files",handler:t=>this.removeVideoFiles(t,"web-videos"),isDisplayed:t=>t.every(e=>e.canRemoveAllHLSOrWebFiles(this.authUser)),iconName:"delete"}],[{label:"Generate caption",handler:t=>this.generateCaption(t),isDisplayed:t=>t.every(e=>e.canGenerateTranscription(this.authUser,this.serverConfig.videoTranscription.enabled)),iconName:"video-lang"}]];}isUnpublished(t){return t.state.id!==ai.LIVE_ENDED&&t.state.id!==ai.PUBLISHED;}isVideoBlocked(t){return t.blacklisted;}isImport(t){let e=t.state.id;return e===ai.TO_IMPORT||e===ai.TO_IMPORT_FAILED;}hasOriginalFile(t){return!!t.videoSource?.fileDownloadUrl;}hasHLS(t){let e=t.streamingPlaylists.find(o=>o.type===Tl.HLS);return e?e.files.length!==0:!1;}hasWebVideos(t){return t.files.length!==0;}hasObjectStorage(t){return t.isLocal?zr(t).some(o=>o.storage===Ml.OBJECT_STORAGE):!1;}canRemoveOneFile(t){return t.canRemoveOneFile(this.authUser);}getFilesSize(t){let e=zr(t).reduce((o,_)=>o+=_.size,0);return t.videoSource?.fileDownloadUrl&&(e+=t.videoSource.size||0),e;}getVideoStateBadgeClass(t){return"pt-badge "+Wr(t);}removeVideoFile(t,e,o){return le(this,null,function*(){let _="Are you sure you want to delete this "+e.resolution.label+" file?";(yield this.confirmService.confirm(_,"Delete file"))!==!1&&this.videoService.removeFile(t.uuid,e.id,o).subscribe({next:()=>
5{this.notifier.success("File removed."),this.table().loadData();},error:M=>this.notifier.handleError(M)});});}removeVideoSourceFile(t){return le(this,null,function*(){let e="Are you sure you want to delete the original file of this video?";(yield this.confirmService.confirm(e,"Delete original file"))!==!1&&this.videoService.removeSourceFile(t.uuid).subscribe({next:()=>{this.notifier.success("Original file removed."),this.table().loadData();},error:_=>this.notifier.handleError(_)});});}onRowExpand(t){let e=t.data;!e.videoSource?.inputFilename&&!xl(e)||this.videoFileTokenService.getVideoFileToken({videoUUID:e.uuid}).subscribe(({token:o})=>{this.videoFileTokens[e.id]=o;});}getDownloadUrl(t,e){let o=this.videoFileTokens[t.id];return o?e+`?videoFileToken=${o}`:e;}onDataLoaded(){this.loadBlockStatus();}loadBlockStatus(){let t=this.table().data,e=this.getUniqueAccounts(t),o=this.getUniqueHosts(t);this.blocklistService.getStatus({accounts:e.map(_=>_.name+"@"+_.host),hosts:o}).subscribe(_=>{this.accountBlocklist=new Map();for(let g of e){let M=g.name+"@"+g.host;this.accountBlocklist.set(g.id,{mutedByInstance:_.accounts[M].blockedByServer,mutedServerByInstance:_.hosts[g.host].blockedByServer});}});}getUniqueAccounts(t){let e=new Set();return t.map(o=>!o.account||e.has(o.account.id)?null:(e.add(o.account.id),o.account)).filter(o=>!!o);}getUniqueHosts(t){return Array.from(new Set(t.map(e=>e.account.host)));}_dataLoader(t){return this.videoAdminService.listAdminVideos(fe({nsfwFlagsExcluded:Al.NONE,nsfw:"both",stateOneOf:t.state?[t.state]:void 0},t));}removeVideos(t){return le(this,null,function*(){let e=Y("Are you sure you want to delete {count, plural, =1 {this video} other {these {count} videos}}?",{count:t.length});(yield this.confirmService.confirm(e,"Delete"))!==!1&&this.videoService.removeVideo(t.map(_=>_.id)).subscribe({next:()=>{this.notifier.success(Y("Deleted {count, plural, =1 {1 video} other {{count} videos}}.",{count:t.length})),this.table().loadData();},error:_=>this.notifier.handleError(_)});});}unblockVideos(t){this.videoBlockService.unblockVideos(t.map(e=>e.id)).subscribe({next:()=>{this.notifier.success(Y("Unblocked {count, plural, =1 {1 video} other {{count} videos}}.",{count:t.length})),this.table().loadData();},error:e=>this.notifier.handleError(e)});}removeVideoFiles(t,e){return le(this,null,function*(){let o;e==="hls"?o=Y("Are you sure you want to delete {count, plural, =1 {1 HLS streaming playlist} other {{count} HLS streaming playlists}}?",{count:t.length}):o=Y("Are you sure you want to delete Web Video files of {count, plural, =1 {1 video} other {{count} videos}}?",{count:t.length}),(yield this.confirmService.confirm(o,"Delete"))!==!1&&this.videoService.removeVideoFiles(t.map(g=>g.id),e).subscribe({next:()=>{this.notifier.success("Files were removed."),this.table().loadData();},error:g=>this.notifier.handleError(g)});});}runTranscoding(t,e){this.videoService.runTranscoding({videos:t,type:e}).subscribe({next:()=>{this.notifier.success("Transcoding jobs created."),this.table().loadData();},error:o=>this.notifier.handleError(o)});}generateCaption(t){this.videoCaptionService.generateCaption({videos:t}).subscribe({next:e=>{e.success&&this.notifier.success(Y("{count, plural, =1 {1 transcription job created.} other {{count} transcription jobs created.}}",{count:e.success})),e.alreadyHasCaptions&&this.notifier.info(Y("{count, plural, =1 {1 video already has captions.} other {{count} videos already have captions.}}",{count:e.alreadyHasCaptions})),e.alreadyBeingTranscribed&&this.notifier.info(Y("{count, plural, =1 {1 video is already being transcribed.} other {{count} videos are already being transcribed.}}",{count:e.alreadyBeingTranscribed}));},error:e=>this.notifier.handleError(e)});}};S(Zo,"\u0275fac",function(e){return new(e||Zo)();}),S(Zo,"\u0275cmp",O({type:Zo,selectors:[["my-video-list"]],viewQuery:function(e,o){e&1&&Ae(o.videoBlockModal,f1,5)(o.table,M1,5),e&2&&Te(2);},decls:14,vars:5,consts:()=>{let t;t="videos per page";let e;e="{VAR_PLURAL, plural, =0 {No videos} =1 {1 video} other {{INTERPOLATION} videos}}",e=X(e,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let o;
5o="Only display videos with this tag";let _;_="Local";let g;g="Remote";let M;M="Blocked";let I;I="Original file";let P;P="HLS";let y;y="Web Videos ("+"\uFFFD0\uFFFD"+")";let F;F="Live";let h;h="Object storage";let J;J="Download this file";let w;w="Delete this file";let Z;Z="Original file:";let oe;oe="Web Videos:";let be;be="Download this file";let ve;ve="Delete this file";let de;de="HLS:";let he;he="Download this file";let Fe;Fe="Delete this file";let Me;Me="No videos found matching current filters.";let ye;return ye="Your platform doesn't have videos.",[["table",""],["totalTitle",""],["tableCells",""],["actionCell",""],["expandedRow",""],["noResults",""],["videoBlockModal",""],e,_,g,M,I,P,y,F,h,Z,oe,de,Me,ye,["key","VideoAdminListComponent","defaultSort","publishedAt","paginatorText",t,"defaultRowsPerPage","10","columnConfig","false","refreshButton","true","searchInput","true",3,"rowExpand","dataLoaded","defaultColumns","bulkActions","dataLoader","inputFilters","defaultInputFilterValues"],[3,"videoBlocked"],["accountBlockBadgesPlatformOnly","true","size","small",3,"video","accountBlockBadges"],[1,"pt-badge","badge-blue"],[1,"pt-badge","badge-purple"],[3,"video"],["theme","red",3,"video"],[3,"class"],[1,"pt-badge","badge-red"],["title",o,"queryParamsHandling","merge",1,"pt-badge","badge-secondary","me-1",3,"routerLink","queryParams"],["placement","bottom auto","buttonIcon","more-horizontal","buttonStyled","true",3,"videoRemoved","videoFilesRemoved","transcodingCreated","muted","unmuted","video","displayOptions","muteStatus"],[1,"video-expanded-info"],[1,"me-3"],[1,"ms-auto",3,"video"],["title",J,3,"href"],["title",w,1,"border-0","p-0",3,"click"],["iconName","delete"],["title",be,3,"href"],["title",ve,1,"border-0","p-0"],["title",ve,1,"border-0","p-0",3,"click"],["title",he,3,"href"],["title",Fe,1,"border-0","p-0"],["title",Fe,1,"border-0","p-0",3,"click"]];},template:function(e,o){if(e&1){let _=H();r(0,"my-table",21,0),T("rowExpand",function(M){return o.onRowExpand(M);})("dataLoaded",function(){return o.onDataLoaded();}),U(2,T1,3,4,"ng-template",null,1,v)(4,$1,23,17,"ng-template",null,2,v)(6,x1,1,3,"ng-template",null,3,v)(8,W1,5,4,"ng-template",null,4,v)(10,Q1,2,1,"ng-template",null,5,v),i(),r(12,"my-video-block",22,6),T("videoBlocked",function(){D(_);let M=ue(1);return G(M.loadData());}),i();}e&2&&d("defaultColumns",o.columns)("bulkActions",o.bulkActions)("dataLoader",o.dataLoader)("inputFilters",o.inputFilters)("defaultInputFilterValues",o.defaultInputFilterValues);},dependencies:[Qe,f_,Bi,Xi,N_,Oe,Wi,Hi,He,qe,ut,We],styles:["my-embed[_ngcontent-%COMP%]{display:block;max-width:500px;width:50%}.pt-badge[_ngcontent-%COMP%], my-privacy-badge[_ngcontent-%COMP%], my-video-nsfw-badge[_ngcontent-%COMP%]{margin-inline-end:.3125rem}.video-expanded-info[_ngcontent-%COMP%]{display:flex}.video-expanded-info[_ngcontent-%COMP%]   my-global-icon[_ngcontent-%COMP%]{position:relative;top:-2px;display:inline-block;width:16px;height:16px;line-height:16px;margin-inline-start:.1875rem}"]}));var $r=Zo;function Kr({url:n}){return`/admin/overview/${n.map(t=>t.path).join("/")}`;}var Yr=[{path:"comments",pathMatch:"prefix",redirectTo:Kr},{path:"videos",pathMatch:"prefix",redirectTo:Kr},{path:"users",pathMatch:"prefix",redirectTo:Kr},{path:"overview",children:[{path:"",pathMatch:"full",redirectTo:"users"},{path:"comments",canActivate:[ze],data:{userRight:q.SEE_ALL_COMMENTS},children:[{path:"",redirectTo:"list",pathMatch:"full"},{path:"list",component:yr,data:{meta:{title:"Comments list"}}}]},{path:"users",canActivate:[ze],data:{userRight:q.MANAGE_USERS},children:[{path:"",redirectTo:"list",pathMatch:"full"},{path:"list",component:Lr,data:{meta:{title:"Users list"}}},{path:"create",component:Dr,data:{meta:{title:"Create a user"}}},{path:"update/:id",component:Gr,data:{meta:{title:"Update a user"}}}]},{path:"videos",canActivate:[ze],data:{userRight:q.SEE_ALL_VIDEOS},children:[{path:"",redirectTo:"list",pathMatch:"full"},{path:"list",component:$r,data:{meta:{title:"Videos list"}}}]}]}];var Zr={path:"",providers:[Rn,Lt,G_,hn,eo,to,ho,vn,Do,Lo,jt,Kt,Qi,Lt,Yo,Zn,oo,we,E_,u_,g_,p_,F_]};function ns(n){if(n.length===0)return!1;let t=n[0].path;return Yr.some(e=>e.path===t||e.path.startsWith(`${t}/`));}function os(n){if(n.length===0)return!1;let t=n[0].path;return Hr.some(e=>e.path===t||e.path.startsWith(`${t}/`));}function xr({url:n}){return`/admin/settings/${n.map(t=>t.path).join("/")}`;}var eh=[{path:"",pathMatch:"full",redirectTo:"overview"},Xe(fe({},Zr),{component:Ar,canMatch:[(n,t)=>os(t)],children:Hr}),Xe(fe({},Zr),{component:Tr,canMatch:[(n,t)=>ns(t)],children:Yr}),{path:"config",pathMatch:"prefix",redirectTo:xr},{path:"follows",pathMatch:"prefix",redirectTo:xr},{path:"system",pathMatch:"prefix",redirectTo:xr},{path:"plugins",pathMatch:"prefix",redirectTo:xr},Xe(fe({},Zr),{path:"settings",component:Or,canMatch:[(n,t)=>!ns(t)&&!os(t)],children:[{path:"",redirectTo:"config",pathMatch:"full"},...B_,...q_,...J_,...j_]})];export{eh as default};/**i18n:347eeb695970c32bc275618edc2e751c67145d9fc3012e70543c114a99b9e016*/

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.