import{n as x,o as C,f as M,r as u,v as S,j as d,w as F,x as v,d8 as U,k as j}from"./index-c3f592b2.js";import{a as N}from"./Radio-0d4822c6.js";import{a as P,f as k,u as D}from"./Grow-f61cc5ca.js";function V(o){return x("MuiFormGroup",o)}C("MuiFormGroup",["root","row","error"]);const $=o=>{const{classes:r,row:e,error:t}=o;return v({root:["root",e&&"row",t&&"error"]},V,r)},b=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=P(),n=k({props:t,muiFormControl:p,states:["error"]}),l={...t,row:c,error:n.error},f=$(l);return d.jsx(b,{className:F(f.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,...f}=r,m=u.useRef(null),y=H(r),[R,w]=D({controlled:l,default:i,name:"RadioGroup"});u.useImperativeHandle(t,()=>({focus:()=>{let s=m.current.querySelector("input:not(:disabled):checked");s||(s=m.current.querySelector("input:not(:disabled)")),s&&s.focus()}}),[]);const g=U(e,m),G=j(p),h=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(N.Provider,{value:h,children:d.jsx(E,{role:"radiogroup",ref:g,className:F(y.root,c),...f,children:a})})}),J=W;export{J as R};
