import{m as x,n as C,f as M,r as u,t as S,j as d,v as F,w as v,d5 as j}from"./index-952e178b.js";import{a as U}from"./Radio-06fc49c1.js";import{h as N,j as P,a as D,u as V}from"./Select-41d78585.js";function $(o){return x("MuiFormGroup",o)}C("MuiFormGroup",["root","row","error"]);const b=o=>{const{classes:r,row:e,error:t}=o;return v({root:["root",e&&"row",t&&"error"]},$,r)},k=M("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(o,r)=>{const{ownerState:e}=o;return[r.root,e.row&&r.row]}})({display:"flex",flexDirection:"column",flexWrap:"wrap",variants:[{props:{row:!0},style:{flexDirection:"row"}}]}),q=u.forwardRef(function(r,e){const t=S({props:r,name:"MuiFormGroup"}),{className:a,row:c=!1,...i}=t,p=N(),n=P({props:t,muiFormControl:p,states:["error"]}),l={...t,row:c,error:n.error},m=b(l);return d.jsx(k,{className:F(m.root,a),ownerState:l,ref:e,...i})}),E=q;function I(o){return x("MuiRadioGroup",o)}C("MuiRadioGroup",["root","row","error"]);const H=o=>{const{classes:r,row:e,error:t}=o;return v({root:["root",e&&"row",t&&"error"]},I,r)},W=u.forwardRef(function(r,e){const{actions:t,children:a,className:c,defaultValue:i,name:p,onChange:n,value:l,...m}=r,f=u.useRef(null),h=H(r),[R,w]=D({controlled:l,default:i,name:"RadioGroup"});u.useImperativeHandle(t,()=>({focus:()=>{let s=f.current.querySelector("input:not(:disabled):checked");s||(s=f.current.querySelector("input:not(:disabled)")),s&&s.focus()}}),[]);const y=j(e,f),G=V(p),g=u.useMemo(()=>({name:G,onChange(s){w(s.target.value),n&&n(s,s.target.value)},value:R}),[G,n,w,R]);return d.jsx(U.Provider,{value:g,children:d.jsx(E,{role:"radiogroup",ref:y,className:F(h.root,c),...m,children:a})})}),J=W;export{J as R};
