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:"Tha feum air ainm-taisbeanaidh.",minlength:"Feumaidh an t-ainm-taisbeanaidh a bhith 1 charactar a dh\u2019fhaid air a char as giorra.",maxlength:"Chan fhaod an t-ainm-seallaidh a bhith nas fhaide na 120 caractar."}};function Y(e){V(e,{message:"Tha feum air ainm-taisbeanaidh."}),N(e,1,{message:"Feumaidh an t-ainm-taisbeanaidh a bhith 1 charactar a dh\u2019fhaid air a char as giorra."}),b(e,120,{message:"Chan fhaod an t-ainm-seallaidh a bhith nas fhaide na 120 caractar."});}var j={VALIDATORS:[a.required],MESSAGES:{required:"Tha pr\xECobhaideachd riatanach."}},Q={VALIDATORS:[a.minLength(3),a.maxLength(1e3)],MESSAGES:{minlength:"Feumaidh an tuairisgeul a bhith 3 caractaran a dh\u2019fhaid air a char as giorra.",maxlength:"Chan fhaod an tuairisgeul a bhith nas fhaide na 1000 caractar."}},J={VALIDATORS:[],MESSAGES:{required:"Tha an t-seanail riatanach nuair a bhios an liosta-chluich poblach."}};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="Cruthaich";let i;return i="Ainm-taisbeanaidh",[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