import{Z}from'./chunk-qdb8laCV.js';import{K as qp,bK as sn,b_ as Ex,bR as ye,dK as aIe,g,a as rc,_ as _pe,aL as Ye,b as Pa,J as Jn,Z as Zn,a0 as $n,cn as rn,Q as Qn,s as sp,e as Fp,v as vV,d as lb,f as Pp,m as zH,W as WB,a3 as H0,y as qH}from'./main-C0Sl1OBd.js';import{o as or,m as mn,f as fn,c as cn,g as gn,E as En}from'./chunk-CL-NC5ZB.js';var c=(()=>{class r{myFormInputError=qp.required();hasError(){return this.myFormInputError().touched()&&this.myFormInputError().invalid();}static ɵfac=function(t){return new(t||r)();};static ɵdir=sn({type:r,selectors:[["","myFormInputError",""]],hostVars:2,hostBindings:function(t,m){t&2&&Ex("input-error",m.hasError());},inputs:{myFormInputError:[1,"myFormInputError"]}});}return r;})();/**i18n:c8855ca17fb20171aa9dd43d012e42547cb1f0cfd9c21d4dc05679bbbdf5ccb8*/var Y={VALIDATORS:[ye.required,ye.minLength(1),ye.maxLength(120)],MESSAGES:{required:"Visningsnamn kr\xE4vs.",minlength:"Visningsnamnet m\xE5ste inneh\xE5lla minst ett tecken.",maxlength:"Visningsnamnet f\xE5r inte vara mer \xE4n 120 tecken l\xE5ngt."}};function N(e){mn(e,{message:"Visningsnamn kr\xE4vs."}),fn(e,1,{message:"Visningsnamnet m\xE5ste inneh\xE5lla minst ett tecken."}),cn(e,120,{message:"Visningsnamnet f\xE5r inte vara mer \xE4n 120 tecken l\xE5ngt."});}var H={VALIDATORS:[ye.required],MESSAGES:{required:"Synligheten m\xE5ste anges."}},q={VALIDATORS:[ye.minLength(3),ye.maxLength(1e3)],MESSAGES:{minlength:"Beskrivningen m\xE5ste inneh\xE5lla minst tre tecken.",maxlength:"Beskrivningen f\xE5r inte vara mer \xE4n 1000 tecken l\xE5ng."}},w={VALIDATORS:[],MESSAGES:{required:"En kanal m\xE5ste anges f\xF6r \xF6ppet tillg\xE4ngliga spellistor."}};function G(e,V){V.toString()===aIe.PUBLIC.toString()?e.setValidators([ye.required]):e.setValidators(null),e.markAsDirty(),e.updateValueAndValidity();}var re=(()=>{class e{notifier=g(rc);videoPlaylistService=g(Z);playlistCreated=_pe();playlistModel=Ye({displayName:""});playlistForm=or(this.playlistModel,r=>{N(r.displayName);});createPlaylist(){let t={displayName:this.playlistModel().displayName.trim(),privacy:aIe.PRIVATE};this.videoPlaylistService.createVideoPlaylist(t).subscribe({next:()=>{this.playlistCreated.emit();},error:i=>this.notifier.handleError(i)});}static ɵfac=function(t){return new(t||e)();};static ɵcmp=Pa({type:e,selectors:[["my-playlist-create-block"]],outputs:{playlistCreated:"playlistCreated"},decls:7,vars:4,consts:()=>{let r;r="Skapa";let t;return t="Visningsnamn",[t,[3,"ngSubmit"],[1,"form-group"],["for","displayName"],["type","text","id","displayName",1,"form-control",3,"formField","myFormInputError"],[3,"field"],["type","submit","value",r,1,"peertube-button","primary-button",3,"disabled"]];},template:function(t,i){t&1&&(sp(0,"form",1),Fp("ngSubmit",function(){return i.createPlaylist();}),sp(1,"div",2)(2,"label",3),vV(3,0),lb(),Pp(4,"input",4),zH(),Pp(5,"my-form-error",5),lb(),Pp(6,"input",6),lb()),t&2&&(WB(4),H0("formField",i.playlistForm.displayName)("myFormInputError",i.playlistForm.displayName()),qH(),WB(),H0("field",i.playlistForm.displayName()),WB(),H0("disabled",!i.playlistForm().valid()));},dependencies:[Jn,Zn,$n,rn,Qn,c,gn,En],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%}}"],changeDetection:1});}return e;})();/**i18n:c8855ca17fb20171aa9dd43d012e42547cb1f0cfd9c21d4dc05679bbbdf5ccb8*/export{G,H,Y,c,q,re as r,w};//# sourceMappingURL=chunk-CXHCdBKp.js.map