import{Z}from'./chunk-DKL7x6EW.js';import{L as qp,bK as sn,b_ as vx,bR as ye,dK as sIe,g,a as rc,C as Cpe,aL as Ye,b as Pa,J as Jn,Z as Zn,a0 as $n,cn as rn,Q as Qn,s as sp,F as Fp,y as yV,u as ub,e as Pp,t as GH,z as zB,a3 as B0,W as WH}from'./main-BiUBeaMj.js';import{o as or,m as mn,f as fn,c as cn,g as gn,E as En}from'./chunk-ZCgWdH_J.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&&vx("input-error",m.hasError());},inputs:{myFormInputError:[1,"myFormInputError"]}});}return r;})();/**i18n:fad79908930cbb4c308e7550a5fe49bb3841dbb330066a6429aebaa006173605*/var Y={VALIDATORS:[ye.required,ye.minLength(1),ye.maxLength(120)],MESSAGES:{required:"Le nom d'affichage est requis.",minlength:"Votre nom affich\xE9 doit contenir au moins un caract\xE8re.",maxlength:"Le nom d'affichage ne peut pas faire plus de 120 caract\xE8res."}};function N(e){mn(e,{message:"Le nom d'affichage est requis."}),fn(e,1,{message:"Votre nom affich\xE9 doit contenir au moins un caract\xE8re."}),cn(e,120,{message:"Le nom d'affichage ne peut pas faire plus de 120 caract\xE8res."});}var H={VALIDATORS:[ye.required],MESSAGES:{required:"Confidentialit\xE9 requise."}},q={VALIDATORS:[ye.minLength(3),ye.maxLength(1e3)],MESSAGES:{minlength:"La description doit \xEAtre compos\xE9e d'au moins 3 caract\xE8res.",maxlength:"La description ne peut pas faire plus de 1000 caract\xE8res de long."}},w={VALIDATORS:[],MESSAGES:{required:"La cha\xEEne est requise quand la liste de lecture est publique."}};function G(e,V){V.toString()===sIe.PUBLIC.toString()?e.setValidators([ye.required]):e.setValidators(null),e.markAsDirty(),e.updateValueAndValidity();}var re=(()=>{class e{notifier=g(rc);videoPlaylistService=g(Z);playlistCreated=Cpe();playlistModel=Ye({displayName:""});playlistForm=or(this.playlistModel,r=>{N(r.displayName);});createPlaylist(){let t={displayName:this.playlistModel().displayName.trim(),privacy:sIe.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="Cr\xE9er";let t;return t="Nom affich\xE9",[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),yV(3,0),ub(),Pp(4,"input",4),GH(),Pp(5,"my-form-error",5),ub(),Pp(6,"input",6),ub()),t&2&&(zB(4),B0("formField",i.playlistForm.displayName)("myFormInputError",i.playlistForm.displayName()),WH(),zB(),B0("field",i.playlistForm.displayName()),zB(),B0("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:fad79908930cbb4c308e7550a5fe49bb3841dbb330066a6429aebaa006173605*/export{G,H,Y,c,q,re as r,w};//# sourceMappingURL=chunk-CB82O7Po.js.map