import{n as E,m as U,f as v,o as L,q as F,r as P,t as A,x as z,T as x,j as d,v as y,w as B}from"./index-e0c07a84.js";import{a as H,f as I}from"./Grow-5c4c469c.js";function W(e){return U("MuiFormControlLabel",e)}const G=E("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),l=G,J=e=>{const{classes:o,disabled:s,labelPlacement:r,error:m,required:b}=e,u={root:["root",s&&"disabled",`labelPlacement${L(r)}`,m&&"error",b&&"required"],label:["label",s&&"disabled"],asterisk:["asterisk",m&&"error"]};return B(u,W,o)},K=v("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:s}=e;return[{[`& .${l.label}`]:o.label},o.root,o[`labelPlacement${L(s.labelPlacement)}`]]}})(F(({theme:e})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${l.disabled}`]:{cursor:"default"},[`& .${l.label}`]:{[`&.${l.disabled}`]:{color:(e.vars||e).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:o})=>o==="start"||o==="top"||o==="bottom",style:{marginLeft:16}}]}))),O=v("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(e,o)=>o.asterisk})(F(({theme:e})=>({[`&.${l.error}`]:{color:(e.vars||e).palette.error.main}}))),Q=P.forwardRef(function(o,s){const r=A({props:o,name:"MuiFormControlLabel"}),{checked:m,className:b,componentsProps:u={},control:a,disabled:R,disableTypography:$,inputRef:V,label:q,labelPlacement:w="end",name:X,onChange:Y,required:T,slots:k={},slotProps:S={},value:Z,...j}=r,n=H(),g=R??a.props.disabled??(n==null?void 0:n.disabled),f=T??a.props.required,h={disabled:g,required:f};["checked","name","onChange","value","inputRef"].forEach(p=>{typeof a.props[p]>"u"&&typeof r[p]<"u"&&(h[p]=r[p])});const M=I({props:r,muiFormControl:n,states:["error"]}),i={...r,disabled:g,labelPlacement:w,required:f,error:M.error},C=J(i),N={slots:k,slotProps:{...u,...S}},[D,c]=z("typography",{elementType:x,externalForwardedProps:N,ownerState:i});let t=q;return t!=null&&t.type!==x&&!$&&(t=d.jsx(D,{component:"span",...c,className:y(C.label,c==null?void 0:c.className),children:t})),d.jsxs(K,{className:y(C.root,b),ownerState:i,ref:s,...j,children:[P.cloneElement(a,h),f?d.jsxs("div",{children:[t,d.jsxs(O,{ownerState:i,"aria-hidden":!0,className:C.asterisk,children:[" ","*"]})]}):t]})}),oe=Q;export{oe as F};
