import{V as v,W as y,_ as j,A as V,b,d as w,f as P}from"./OdysseyThemeProvider-Bh0Bu-2o.js";import{r as t}from"./index-NdkWRN8K.js";import{a as U}from"./Radio-B4gVvwps.js";import{j as m}from"./jsx-runtime-CnH95YSl.js";import{u as _}from"./useControlled-NQulfz4l.js";import{u as F}from"./useIsFocusVisible-DH0qxT5e.js";import{F as M}from"./FormGroup-HFkGZ983.js";function N(r){return v("MuiRadioGroup",r)}y("MuiRadioGroup",["root","row","error"]);const S=["actions","children","className","defaultValue","name","onChange","value"],k=r=>{const{classes:e,row:s,error:a}=r;return P({root:["root",s&&"row",a&&"error"]},N,e)},z=t.forwardRef(function(e,s){const{actions:a,children:l,className:f,defaultValue:p,name:R,onChange:u,value:x}=e,h=j(e,S),n=t.useRef(null),C=k(e),[i,c]=_({controlled:x,default:p,name:"RadioGroup"});t.useImperativeHandle(a,()=>({focus:()=>{let o=n.current.querySelector("input:not(:disabled):checked");o||(o=n.current.querySelector("input:not(:disabled)")),o&&o.focus()}}),[]);const g=F(s,n),d=V(R),G=t.useMemo(()=>({name:d,onChange(o){c(o.target.value),u&&u(o,o.target.value)},value:i}),[d,u,c,i]);return m.jsx(U.Provider,{value:G,children:m.jsx(M,b({role:"radiogroup",ref:g,className:w(C.root,f)},h,{children:l}))})});export{z as R};
