import{U as h,V as $,y as F,S as K,ap as N,r as S,aq as de,G as v,a2 as ue,a3 as ie,Z as y,j as _,o as B,c as R,a as g,d as q,c4 as A,ae as e,D as P,ad as m,af as V,h as j,t as D,ak as L,am as x,x as Z,al as pe,aC as be,a0 as ce,a1 as me,I as fe,av as ve,k as ye,m as ge,P as he,a9 as ke,an as Se,aw as H,__tla as _e}from"./index.b5692aad.js";import{U as G,C as Be}from"./event.569a7c00.js";let J,M,Re=Promise.all([(()=>{try{return _e}catch{}})()]).then(async()=>{const I=Symbol("radioGroupKey"),C=h({size:$,disabled:Boolean,label:{type:[String,Number,Boolean],default:""}}),O=h({...C,modelValue:{type:[String,Number,Boolean],default:""},name:{type:String,default:""},border:Boolean}),E={[G]:s=>F(s)||K(s)||N(s),[Be]:s=>F(s)||K(s)||N(s)},w=(s,b)=>{const r=S(),a=de(I,void 0),u=v(()=>!!a),c=v({get(){return u.value?a.modelValue:s.modelValue},set(d){u.value?a.changeEvent(d):b&&b(G,d),r.value.checked=s.modelValue===s.label}}),t=ue(v(()=>a==null?void 0:a.size)),i=ie(v(()=>a==null?void 0:a.disabled)),o=S(!1),p=v(()=>i.value||u.value&&c.value!==s.label?-1:0);return{radioRef:r,isGroup:u,radioGroup:a,focus:o,size:t,disabled:i,tabIndex:p,modelValue:c}},Q=["value","name","disabled"],T=y({name:"ElRadio"}),W=y({...T,props:O,emits:E,setup(s,{emit:b}){const r=s,a=_("radio"),{radioRef:u,radioGroup:c,focus:t,size:i,disabled:o,modelValue:p}=w(r,b);function d(){Z(()=>b("change",p.value))}return(l,n)=>{var f;return B(),R("label",{class:m([e(a).b(),e(a).is("disabled",e(o)),e(a).is("focus",e(t)),e(a).is("bordered",l.border),e(a).is("checked",e(p)===l.label),e(a).m(e(i))])},[g("span",{class:m([e(a).e("input"),e(a).is("disabled",e(o)),e(a).is("checked",e(p)===l.label)])},[q(g("input",{ref_key:"radioRef",ref:u,"onUpdate:modelValue":n[0]||(n[0]=k=>P(p)?p.value=k:null),class:m(e(a).e("original")),value:l.label,name:l.name||((f=e(c))==null?void 0:f.name),disabled:e(o),type:"radio",onFocus:n[1]||(n[1]=k=>t.value=!0),onBlur:n[2]||(n[2]=k=>t.value=!1),onChange:d},null,42,Q),[[A,e(p)]]),g("span",{class:m(e(a).e("inner"))},null,2)],2),g("span",{class:m(e(a).e("label")),onKeydown:n[3]||(n[3]=L(()=>{},["stop"]))},[V(l.$slots,"default",{},()=>[j(D(l.label),1)])],34)],2)}}});var X=x(W,[["__file","/home/runner/work/element-plus/element-plus/packages/components/radio/src/radio.vue"]]);const Y=h({...C,name:{type:String,default:""}}),ee=["value","name","disabled"],ae=y({name:"ElRadioButton"}),le=y({...ae,props:Y,setup(s){const b=s,r=_("radio"),{radioRef:a,focus:u,size:c,disabled:t,modelValue:i,radioGroup:o}=w(b),p=v(()=>({backgroundColor:(o==null?void 0:o.fill)||"",borderColor:(o==null?void 0:o.fill)||"",boxShadow:o!=null&&o.fill?`-1px 0 0 0 ${o.fill}`:"",color:(o==null?void 0:o.textColor)||""}));return(d,l)=>{var n;return B(),R("label",{class:m([e(r).b("button"),e(r).is("active",e(i)===d.label),e(r).is("disabled",e(t)),e(r).is("focus",e(u)),e(r).bm("button",e(c))])},[q(g("input",{ref_key:"radioRef",ref:a,"onUpdate:modelValue":l[0]||(l[0]=f=>P(i)?i.value=f:null),class:m(e(r).be("button","original-radio")),value:d.label,type:"radio",name:d.name||((n=e(o))==null?void 0:n.name),disabled:e(t),onFocus:l[1]||(l[1]=f=>u.value=!0),onBlur:l[2]||(l[2]=f=>u.value=!1)},null,42,ee),[[A,e(i)]]),g("span",{class:m(e(r).be("button","inner")),style:pe(e(i)===d.label?e(p):{}),onKeydown:l[3]||(l[3]=L(()=>{},["stop"]))},[V(d.$slots,"default",{},()=>[j(D(d.label),1)])],38)],2)}}});var z=x(le,[["__file","/home/runner/work/element-plus/element-plus/packages/components/radio/src/radio-button.vue"]]);const oe=h({id:{type:String,default:void 0},size:$,disabled:Boolean,modelValue:{type:[String,Number,Boolean],default:""},fill:{type:String,default:""},label:{type:String,default:void 0},textColor:{type:String,default:""},name:{type:String,default:void 0},validateEvent:{type:Boolean,default:!0}}),se=E,re=["id","aria-label","aria-labelledby"],ne=y({name:"ElRadioGroup"}),te=y({...ne,props:oe,emits:se,setup(s,{emit:b}){const r=s,a=_("radio"),u=be(),c=S(),{formItem:t}=ce(),{inputId:i,isLabeledByFormItem:o}=me(r,{formItemContext:t}),p=l=>{b(G,l),Z(()=>b("change",l))};fe(()=>{const l=c.value.querySelectorAll("[type=radio]"),n=l[0];!Array.from(l).some(f=>f.checked)&&n&&(n.tabIndex=0)});const d=v(()=>r.name||u.value);return ve(I,ye({...ge(r),changeEvent:p,name:d})),he(()=>r.modelValue,()=>{r.validateEvent&&(t==null||t.validate("change").catch(l=>ke()))}),(l,n)=>(B(),R("div",{id:e(i),ref_key:"radioGroupRef",ref:c,class:m(e(a).b("group")),role:"radiogroup","aria-label":e(o)?void 0:l.label||"radio-group","aria-labelledby":e(o)?e(t).labelId:void 0},[V(l.$slots,"default")],10,re))}});var U=x(te,[["__file","/home/runner/work/element-plus/element-plus/packages/components/radio/src/radio-group.vue"]]);J=Se(X,{RadioButton:z,RadioGroup:U}),M=H(U),H(z)});export{J as E,Re as __tla,M as a};
