import{a as R,d as b,e as N,g as V,h as x,i as F}from"./chunk-IW76GIZR.js";import{b as O}from"./chunk-UBU2CFVX.js";import{E as v,F as T,d as a,h as L,m as I,p as C}from"./chunk-U7YDHGE3.js";import{Da as l,Db as f,Dc as D,Ec as h,Hb as A,Ka as _,La as g,Na as E,Pa as S,Ug as M,Vb as P,ba as c,mb as s,nb as u,ob as p,pa as y,pb as m,te as d}from"./chunk-DZBHF6HI.js";import{i as n}from"./chunk-IQVXR75E.js";var $=(()=>{let t=class t{myFormInputError=h.required();hasError(){return this.myFormInputError().touched()&&this.myFormInputError().invalid();}};n(t,"\u0275fac",function(i){return new(i||t)();}),n(t,"\u0275dir",S({type:t,selectors:[["","myFormInputError",""]],hostVars:2,hostBindings:function(i,r){i&2&&P("input-error",r.hasError());},inputs:{myFormInputError:[1,"myFormInputError"]}}));let e=t;return e;})();var U={VALIDATORS:[a.required,a.minLength(1),a.maxLength(120)],MESSAGES:{required:"Zobrazovan\xE9 jm\xE9no je vy\u017Eadov\xE1no.",minlength:"Zobrazovan\xE9 jm\xE9no mus\xED m\xEDt alespo\u0148 1 znak.",maxlength:"Zobrazovan\xE9 jm\xE9no nesm\xED b\xFDt del\u0161\xED ne\u017E 120 znak\u016F."}};function Y(e){V(e,{message:"Zobrazovan\xE9 jm\xE9no je vy\u017Eadov\xE1no."}),N(e,1,{message:"Zobrazovan\xE9 jm\xE9no mus\xED m\xEDt alespo\u0148 1 znak."}),b(e,120,{message:"Zobrazovan\xE9 jm\xE9no nesm\xED b\xFDt del\u0161\xED ne\u017E 120 znak\u016F."});}var j={VALIDATORS:[a.required],MESSAGES:{required:"Soukrom\xED je vy\u017Eadov\xE1no."}},Q={VALIDATORS:[a.minLength(3),a.maxLength(1e3)],MESSAGES:{minlength:"Popis mus\xED m\xEDt d\xE9lku minim\xE1ln\u011B 3 znaky.",maxlength:"Popis nesm\xED b\xFDt del\u0161\xED ne\u017E 1000 znak\u016F."}},J={VALIDATORS:[],MESSAGES:{required:"Kan\xE1l je vy\u017Eadov\xE1n, pokud je playlist ve\u0159ejn\xFD."}};function W(e,t){t.toString()===d.PUBLIC.toString()?e.setValidators([a.required]):e.setValidators(null),e.markAsDirty(),e.updateValueAndValidity();}var de=(()=>{let t=class t{notifier=c(M);videoPlaylistService=c(O);playlistCreated=D();playlistModel=y({displayName:""});playlistForm=R(this.playlistModel,o=>{Y(o.displayName);});createPlaylist(){let i={displayName:this.playlistModel().displayName.trim(),privacy:d.PRIVATE};this.videoPlaylistService.createVideoPlaylist(i).subscribe({next:()=>{this.playlistCreated.emit();},error:r=>this.notifier.handleError(r)});}};n(t,"\u0275fac",function(i){return new(i||t)();}),n(t,"\u0275cmp",E({type:t,selectors:[["my-playlist-create-block"]],outputs:{playlistCreated:"playlistCreated"},decls:7,vars:4,consts:()=>{let o;o="Vytvo\u0159it";let i;return i="Zobrazovan\xE9 jm\xE9no",[i,[3,"ngSubmit"],[1,"form-group"],["for","displayName"],["type","text","id","displayName",1,"form-control",3,"formField","myFormInputError"],[3,"field"],["type","submit","value",o,1,"peertube-button","primary-button",3,"disabled"]];},template:function(i,r){i&1&&(u(0,"form",1),A("ngSubmit",function(){return r.createPlaylist();}),u(1,"div",2)(2,"label",3),f(3,0),p(),m(4,"input",4),_(),m(5,"my-form-error",5),p(),m(6,"input",6),p()),i&2&&(l(4),s("formField",r.playlistForm.displayName)("myFormInputError",r.playlistForm.displayName()),g(),l(),s("field",r.playlistForm.displayName()),l(),s("disabled",!r.playlistForm().valid()));},dependencies:[v,C,L,I,T,$,x,F],styles:[`my-global-icon[_ngcontent-%COMP%]{position:relative;left:-1px;top:-1px;width:21px;height:21px;line-height:21px;display:inline-block;color:var(--fg-400);margin-inline-end:.8125rem}input[type=text][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:100%;max-width:100%;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{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width: calc(100% + 40px)){input[type=text][_ngcontent-%COMP%]{width:100%}}
/*# sourceMappingURL=playlist-create-block.component-6CYQPSY2.css.map */`]}));let e=t;return e;})();export{U as a,j as b,Q as c,J as d,W as e,de as f};/**i18n:347eeb695970c32bc275618edc2e751c67145d9fc3012e70543c114a99b9e016*///# sourceMappingURL=chunk-BZREIAP3.js.map