import{Ar as Tu,Br as Ux,Da as e5,Eo as kb,Fo as l$,Gr as Va,Ia as f$,Ic as zb,Io as lA,Is as rh,J as EI,Lr as Uj,Ms as r5,O as CV,Oo as kj,Pa as eh,Q as EV,Qi as bV,Qr as W$,Wa as g,Yi as bI,Za as gx,Zo as n5,_s as ph,as as oA,ea as bhe,fo as ih,gc as wf,ho as j$,it as FB,p as Au,pr as S3,rc as u$,ss as oh,u as AV,ua as cA,vc as wp,vt as Gc,z as DV}from"./chunk-B_pj7Jpm.js";import{A as qn,C as fn,O as ln,o as Je,r as D,s as Jn}from"./chunk-BPHMC4rz.js";var Z=[`*`];var ee=n=>({"label-secondary":n});var ne=(n,t)=>({"btn-group":n,"btn-group-vertical":t});var Y=(n,t)=>t.id;function te(n,t){if(n&1&&(wp(0,`label`,3),j$(1),kb()),n&2){let e=f$();gx(`for`,e.inputId())(`ngClass`,n5(3,ee,e.labelSecondary())),FB(),oA(e.label())}}function ie(n,t){if(n&1){let e=AV();wp(0,`input`,5),lA(`ngModelChange`,function(a){EI(e);let _=f$(2);return W$(_.value,a)||(_.value=a),bI(a)}),rh(`ngModelChange`,function(){EI(e);return bI(f$(2).update())}),kb(),kj(),wp(1,`label`,6),l$(2,0),kb()}if(n&2){let e=t.$implicit,i=f$(2);gx(`name`,i.inputId())(`id`,i.getRadioId(e))(`value`,e.id),cA(`ngModel`,i.value),Uj(),FB(),gx(`for`,i.getRadioId(e)),eh(`data-label`,e.label),FB(),Ux(e.label),u$(2)}}function oe(n,t){if(n&1&&(wp(0,`div`,4),CV(1,ie,3,7,null,null,Y),kb()),n&2){let e=f$();gx(`ngClass`,r5(1,ne,!e.isInMobileView(),e.isInMobileView())),FB(),DV(e.items())}}function ae(n,t){if(n&1&&(wp(0,`div`,10),j$(1),kb()),n&2){let e=f$().$implicit;FB(),zb(` `,e.description,` `)}}function re(n,t){if(n&1){let e=AV();wp(0,`div`,7)(1,`input`,8),lA(`ngModelChange`,function(a){EI(e);let _=f$(2);return W$(_.value,a)||(_.value=a),bI(a)}),rh(`ngModelChange`,function(){EI(e);return bI(f$(2).update())}),kb(),kj(),wp(2,`label`,9),l$(3,1),kb(),EV(4,ae,2,1,`div`,10),kb()}if(n&2){let e=t.$implicit,i=f$(2);FB(),gx(`name`,i.inputId())(`id`,i.getRadioId(e))(`value`,e.id),cA(`ngModel`,i.value),Uj(),FB(),gx(`for`,i.getRadioId(e)),FB(),Ux(e.label),u$(3),FB(),bV(e.description?4:-1)}}function le(n,t){if(n&1&&CV(0,re,5,7,`div`,7,Y),n&2)DV(f$().items())}var Q=class n{items=ph.required();inputId=ph.required();label=ph();isGroup=ph(!1,{transform:Tu});labelSecondary=ph(!1,{transform:Tu});screenService=g(Gc);value=bhe(``);disabled=!1;wroteValue;propagateChange=t=>{};writeValue(t){this.value.set(t)}registerOnChange(t){this.propagateChange=t}registerOnTouched(){}setDisabledState(t){this.disabled=t}update(){this.propagateChange(this.value())}getRadioId(t){return this.inputId()+`-`+t.id}isInMobileView(){return this.screenService.isInMobileView()}static ɵfac=function(e){return new(e||n)};static ɵcmp=Va({type:n,selectors:[[`my-select-radio`]],inputs:{items:[1,`items`],inputId:[1,`inputId`],label:[1,`label`],isGroup:[1,`isGroup`],labelSecondary:[1,`labelSecondary`],value:[1,`value`]},outputs:{value:`valueChange`},features:[e5([{provide:D,useExisting:wf(()=>n),multi:!0}])],ngContentSelectors:Z,decls:5,vars:2,consts:()=>{let t;t=`\n          ${`�0�`}\n        `;let e;return e=`\n          ${`�0�`}\n        `,[t,e,[`role`,`radiogroup`],[3,`for`,`ngClass`],[`role`,`group`,3,`ngClass`],[`type`,`radio`,`autocomplete`,`off`,1,`btn-check`,3,`ngModelChange`,`name`,`id`,`value`,`ngModel`],[1,`btn`,`btn-outline-primary`,3,`for`],[1,`peertube-radio-container`],[`type`,`radio`,`autocomplete`,`off`,3,`ngModelChange`,`name`,`id`,`value`,`ngModel`],[3,`for`],[1,`form-group-description`]]},template:function(e,i){e&1&&(oh(),wp(0,`div`,2),EV(1,te,2,5,`label`,3),ih(2),EV(3,oe,3,4,`div`,4)(4,le,2,0),kb()),e&2&&(FB(),bV(i.label()?1:-1),FB(2),bV(i.isGroup()?3:4))},dependencies:[Jn,Je,fn,qn,ln,Au,S3],styles:[`label[_ngcontent-%COMP%]{display:block}label.label-secondary[_ngcontent-%COMP%]{font-size:1rem;font-weight:400;color:var(--%NS%fg)}.peertube-radio-container[_ngcontent-%COMP%]{margin-bottom:.25rem}.peertube-radio-container[_ngcontent-%COMP%]   .form-group-description[_ngcontent-%COMP%]{margin-bottom:0}.btn-outline-primary[_ngcontent-%COMP%]:after{display:block;content:attr(data-label);font-weight:700;height:0;overflow:hidden;visibility:hidden}.btn-check[_ngcontent-%COMP%]:checked + .btn-outline-primary[_ngcontent-%COMP%]{font-weight:700;letter-spacing:0}`],changeDetection:1})};export{Q as t};
//# debugId=d000a761-a7ee-5334-859a-46a29366e8d5
//# sourceMappingURL=chunk-CEOUYBvT.js.map