import{r as i,c as r,h as o,g as t}from"./p-f06dc8f3.js";import{m as s}from"./p-84ba0a57.js";const a=class{constructor(o){i(this,o),this.onchange=r(this,"onchange",7),this.inline=!1,this.error=!1,this.required=!1,this.requiredMessage="Selecciona una opción",this.containerClass=()=>s("ibk-radio-group",[{inline:this.inline},{error:this.error}]),this.listenSlottedEvents=()=>{const i=this.host.querySelectorAll("ibk-radio");Array.from(i,(r=>{r.addEventListener("onselect",(r=>{this.onchange.emit(r.detail),this.error=!1,Array.from(i,(i=>{i.getAttribute("value")!=r.detail.value&&i.removeAttribute("selected"),i.removeAttribute("error")}))})),this.error&&r.setAttribute("error","")}))}}componentDidLoad(){this.listenSlottedEvents()}render(){return o("div",{class:this.containerClass()},o("div",{class:"ibk-radio-group__list"},this.subtitle&&o("p",{class:"ibk-radio-group__subtitle",innerHTML:this.subtitle}),o("slot",null)),this.error&&o("span",{class:"ibk-radio-group__error-message",innerHTML:this.requiredMessage}))}get host(){return t(this)}};a.style=".ibk-radio-group:not(.ibk-radio-group--inline) ibk-radio:not(:last-child){display:block;margin-bottom:10px}.ibk-radio-group__subtitle{margin:0 0 12px 0;font-family:var(--fontMontserrat);font-size:14px}.ibk-radio-group__error-message{color:var(--extendedWatermelon1);font-size:12px;font-family:var(--fontMontserrat);font-weight:500;min-height:15px;margin-top:7px;display:block}.ibk-radio-group--inline .ibk-radio-group__list{display:flex;align-items:center;flex-wrap:wrap}.ibk-radio-group--inline ibk-radio:not(:last-child){margin-right:30px}.ibk-radio-group--inline ibk-radio{display:inline-block}";export{a as ibk_radio_group}