import{Cr as Qx,Ja as g,Nr as S$,Ns as rh,Rr as Si,S as Ahe,Zs as th,_s as ph,ai as Vj,an as Je,gt as Ex,io as hn,jt as Gj,k as Bb,n as $B,nc as uIe,s as $a,yc as wp}from"./chunk-b0nJCs5_.js";import{F as ye,N as rn,_ as Zn,s as Jn,t as $n,u as Qn}from"./chunk-Cmet2Nw-.js";import{t as Z}from"./chunk-D3sqbh442.js";import{a as gn,l as vn,o as lr,r as bn,t as $t,u as yn}from"./chunk-B1JWCK7G.js";var e=class t{myFormInputError=ph.required();hasError(){return this.myFormInputError().touched()&&this.myFormInputError().invalid()}static ɵfac=function(r){return new(r||t)};static ɵdir=hn({type:t,selectors:[[``,`myFormInputError`,``]],hostVars:2,hostBindings:function(r,s){r&2&&Qx(`input-error`,s.hasError())},inputs:{myFormInputError:[1,`myFormInputError`]}})};var q={VALIDATORS:[ye.required,ye.minLength(1),ye.maxLength(120)],MESSAGES:{required:"الاسم العلني مطلوب.",minlength:"يجب ألا يقل الاسم العلني عن محرف واحد.",maxlength:"يجب ألاّ يزيد طول الاسم العلني عن 120 محرفًا."}};function M(e){bn(e,{message:"الاسم العلني مطلوب."}),yn(e,1,{message:"يجب ألا يقل الاسم العلني عن محرف واحد."}),gn(e,120,{message:"يجب ألاّ يزيد طول الاسم العلني عن 120 محرفًا."})}var k={VALIDATORS:[ye.required],MESSAGES:{required:"الخصوصية مطلوبة."}};var w={VALIDATORS:[ye.minLength(3),ye.maxLength(1e3)],MESSAGES:{minlength:"يجب ألاّ يقل الوصف عن 3 محراف.",maxlength:"يجب ألاّ يزيد الوصف عن 1000 محرف."}};var G={VALIDATORS:[],MESSAGES:{required:"القناة مطلوبة عندما تكون قائمة التشغيل عامة."}};function K(e,t){t.toString()===uIe.PUBLIC.toString()?e.setValidators([ye.required]):e.setValidators(null),e.markAsDirty(),e.updateValueAndValidity()}var R=class e$1{notifier=g(Si);videoPlaylistService=g(Z);playlistCreated=Ahe();playlistModel=Je({displayName:``});playlistForm=lr(this.playlistModel,t=>{M(t.displayName)});createPlaylist(){let i={displayName:this.playlistModel().displayName.trim(),privacy:uIe.PRIVATE};this.videoPlaylistService.createVideoPlaylist(i).subscribe({next:()=>{this.playlistCreated.emit()},error:r=>this.notifier.handleError(r)})}static ɵfac=function(i){return new(i||e$1)};static ɵcmp=$a({type:e$1,selectors:[[`my-playlist-create-block`]],outputs:{playlistCreated:`playlistCreated`},decls:7,vars:4,consts:()=>{let t;t="أنشئ";let i;return i="الإسم العلني",[i,[3,`ngSubmit`],[1,`form-group`],[`for`,`displayName`],[`type`,`text`,`id`,`displayName`,1,`form-control`,3,`formField`,`myFormInputError`],[3,`field`],[`type`,`submit`,`value`,t,1,`peertube-button`,`primary-button`,3,`disabled`]]},template:function(i,r){i&1&&(wp(0,`form`,1),rh(`ngSubmit`,function(){return r.createPlaylist()}),wp(1,`div`,2)(2,`label`,3),S$(3,0),Bb(),th(4,`input`,4),Vj(),th(5,`my-form-error`,5),Bb(),th(6,`input`,6),Bb()),i&2&&($B(4),Ex(`formField`,r.playlistForm.displayName)(`myFormInputError`,r.playlistForm.displayName()),Gj(),$B(),Ex(`field`,r.playlistForm.displayName()),$B(),Ex(`disabled`,!r.playlistForm().valid()))},dependencies:[Jn,Zn,$n,rn,Qn,e,vn,$t],styles:[`my-global-icon[_ngcontent-%COMP%]{position:relative;left:-1px;top:-1px;width:21px;height:21px;line-height:21px;display:inline-block;color:var(--%NS%fg-400);margin-inline-end:.8125rem}input[type=text][_ngcontent-%COMP%]{font-size:16px;padding:var(--%NS%input-y-padding) var(--%NS%input-x-padding);width:100%;max-width:100%;color:var(--%NS%input-fg);background-color:var(--%NS%input-bg);border:var(--%NS%input-border-width) solid var(--%NS%input-border-color);border-radius:var(--%NS%input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--%NS%input-placeholder-color);font-size:var(--%NS%input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%]{color:var(--%NS%fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--%NS%fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%]{color:var(--%NS%fg-300);opacity:.8}@media screen and (max-width: calc(100% + 40px)){input[type=text][_ngcontent-%COMP%]{width:100%}}`],changeDetection:1})};export{q as a,k as i,K as n,w as o,R as r,e as s,G as t};
//# debugId=32d4e956-435b-516f-8ea9-c1c8e653ec2f
//# sourceMappingURL=chunk-LQEJZ9jr2.js.map