import{g as lo,f as so,r as u,b as io,w as no,P as v,t as po,D as i,c as W,j as n,E as t,d as co,s as m,m as uo}from"./render-D1ZqzUbP.js";import{F as w,M as mo,B as bo}from"./formControlState-C1XOL3mQ.js";function xo(a){return lo("MuiDialog",a)}const f=so("MuiDialog",["root","backdrop","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),ho=u.createContext({}),go=m(bo,{name:"MuiDialog",slot:"Backdrop"})({zIndex:-1}),ko=a=>{const{classes:o,scroll:e,maxWidth:p,fullWidth:c,fullScreen:b}=a,x={root:["root"],backdrop:["backdrop"],container:["container",`scroll${t(e)}`],paper:["paper",`paperScroll${t(e)}`,`paperWidth${t(String(p))}`,c&&"paperFullWidth",b&&"paperFullScreen"]};return co(x,xo,o)},fo=m(mo,{name:"MuiDialog",slot:"Root"})({"@media print":{position:"absolute !important"}}),yo=m("div",{name:"MuiDialog",slot:"Container",overridesResolver:(a,o)=>{const{ownerState:e}=a;return[o.container,o[`scroll${t(e.scroll)}`]]}})({height:"100%","@media print":{height:"auto"},outline:0,variants:[{props:{scroll:"paper"},style:{display:"flex",justifyContent:"center",alignItems:"center"}},{props:{scroll:"body"},style:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}}]}),So=m(v,{name:"MuiDialog",slot:"Paper",overridesResolver:(a,o)=>{const{ownerState:e}=a;return[o.paper,o[`scrollPaper${t(e.scroll)}`],o[`paperWidth${t(String(e.maxWidth))}`],e.fullWidth&&o.paperFullWidth,e.fullScreen&&o.paperFullScreen]}})(uo(({theme:a})=>({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"},variants:[{props:{scroll:"paper"},style:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"}},{props:{scroll:"body"},style:{display:"inline-block",verticalAlign:"middle",textAlign:"initial"}},{props:({ownerState:o})=>!o.maxWidth,style:{maxWidth:"calc(100% - 64px)"}},{props:{maxWidth:"xs"},style:{maxWidth:a.breakpoints.unit==="px"?Math.max(a.breakpoints.values.xs,444):`max(${a.breakpoints.values.xs}${a.breakpoints.unit}, 444px)`,[`&.${f.paperScrollBody}`]:{[a.breakpoints.down(Math.max(a.breakpoints.values.xs,444)+64)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(a.breakpoints.values).filter(o=>o!=="xs").map(o=>({props:{maxWidth:o},style:{maxWidth:`${a.breakpoints.values[o]}${a.breakpoints.unit}`,[`&.${f.paperScrollBody}`]:{[a.breakpoints.down(a.breakpoints.values[o]+64)]:{maxWidth:"calc(100% - 64px)"}}}})),{props:({ownerState:o})=>o.fullWidth,style:{width:"calc(100% - 64px)"}},{props:({ownerState:o})=>o.fullScreen,style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${f.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),Do=u.forwardRef(function(o,e){const p=io({props:o,name:"MuiDialog"}),c=no(),b={enter:c.transitions.duration.enteringScreen,exit:c.transitions.duration.leavingScreen},{"aria-describedby":x,"aria-labelledby":M,"aria-modal":B=!0,BackdropComponent:F,BackdropProps:T,children:$,className:j,disableEscapeKeyDown:y=!1,fullScreen:R=!1,fullWidth:N=!1,maxWidth:A="sm",onClick:S,onClose:h,open:P,PaperComponent:E=v,PaperProps:C={},scroll:I="paper",slots:U={},slotProps:L={},TransitionComponent:X=w,transitionDuration:D=b,TransitionProps:Y,...z}=p,r={...p,disableEscapeKeyDown:y,fullScreen:R,fullWidth:N,maxWidth:A,scroll:I},d=ko(r),g=u.useRef(),H=s=>{g.current=s.target===s.currentTarget},K=s=>{S&&S(s),g.current&&(g.current=null,h&&h(s,"backdropClick"))},k=po(M),O=u.useMemo(()=>({titleId:k}),[k]),V={transition:X,...U},q={transition:Y,paper:C,backdrop:T,...L},l={slots:V,slotProps:q},[G,J]=i("root",{elementType:fo,shouldForwardComponentProp:!0,externalForwardedProps:l,ownerState:r,className:W(d.root,j),ref:e}),[Q,Z]=i("backdrop",{elementType:go,shouldForwardComponentProp:!0,externalForwardedProps:l,ownerState:r,className:d.backdrop}),[_,oo]=i("paper",{elementType:So,shouldForwardComponentProp:!0,externalForwardedProps:l,ownerState:r,className:W(d.paper,C.className)}),[ao,eo]=i("container",{elementType:yo,externalForwardedProps:l,ownerState:r,className:d.container}),[ro,to]=i("transition",{elementType:w,externalForwardedProps:l,ownerState:r,additionalProps:{appear:!0,in:P,timeout:D,role:"presentation"}});return n.jsx(G,{closeAfterTransition:!0,slots:{backdrop:Q},slotProps:{backdrop:{transitionDuration:D,as:F,...Z}},disableEscapeKeyDown:y,onClose:h,open:P,onClick:K,...J,...z,children:n.jsx(ro,{...to,children:n.jsx(ao,{onMouseDown:H,...eo,children:n.jsx(_,{as:E,elevation:24,role:"dialog","aria-describedby":x,"aria-labelledby":k,"aria-modal":B,...oo,children:n.jsx(ho.Provider,{value:O,children:$})})})})})});export{Do as D,ho as a};
//# sourceMappingURL=Dialog-aanaDG86.js.map
