import{cF as lo,cG as so,r as d,f as u,cO as io,cP as no,cH as t,$ as w,cI as po,cJ as co,q as uo,cQ as mo,cK as i,cL as W,cR as v,j as n,cM as xo}from"./index-7414fd54.js";function bo(e){return lo("MuiDialog",e)}const ho=so("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),y=ho,go=d.createContext({}),ko=go,yo=u(io,{name:"MuiDialog",slot:"Backdrop",overrides:(e,o)=>o.backdrop})({zIndex:-1}),So=e=>{const{classes:o,scroll:a,maxWidth:p,fullWidth:c,fullScreen:m}=e,x={root:["root"],container:["container",`scroll${t(a)}`],paper:["paper",`paperScroll${t(a)}`,`paperWidth${t(String(p))}`,c&&"paperFullWidth",m&&"paperFullScreen"]};return xo(x,bo,o)},fo=u(no,{name:"MuiDialog",slot:"Root"})({"@media print":{position:"absolute !important"}}),Co=u("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,o)=>{const{ownerState:a}=e;return[o.container,o[`scroll${t(a.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"}}}]}),Po=u(w,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,o)=>{const{ownerState:a}=e;return[o.paper,o[`scrollPaper${t(a.scroll)}`],o[`paperWidth${t(String(a.maxWidth))}`],a.fullWidth&&o.paperFullWidth,a.fullScreen&&o.paperFullScreen]}})(po(({theme:e})=>({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:e.breakpoints.unit==="px"?Math.max(e.breakpoints.values.xs,444):`max(${e.breakpoints.values.xs}${e.breakpoints.unit}, 444px)`,[`&.${y.paperScrollBody}`]:{[e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+32*2)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(e.breakpoints.values).filter(o=>o!=="xs").map(o=>({props:{maxWidth:o},style:{maxWidth:`${e.breakpoints.values[o]}${e.breakpoints.unit}`,[`&.${y.paperScrollBody}`]:{[e.breakpoints.down(e.breakpoints.values[o]+32*2)]:{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,[`&.${y.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),Do=d.forwardRef(function(o,a){const p=co({props:o,name:"MuiDialog"}),c=uo(),m={enter:c.transitions.duration.enteringScreen,exit:c.transitions.duration.leavingScreen},{"aria-describedby":x,"aria-labelledby":$,"aria-modal":M=!0,BackdropComponent:F,BackdropProps:T,children:B,className:R,disableEscapeKeyDown:S=!1,fullScreen:j=!1,fullWidth:A=!1,maxWidth:I="sm",onClick:f,onClose:b,open:C,PaperComponent:N=w,PaperProps:P={},scroll:E="paper",slots:L={},slotProps:U={},TransitionComponent:H=v,transitionDuration:D=m,TransitionProps:K,...X}=p,r={...p,disableEscapeKeyDown:S,fullScreen:j,fullWidth:A,maxWidth:I,scroll:E},h=So(r),g=d.useRef(),Y=s=>{g.current=s.target===s.currentTarget},z=s=>{f&&f(s),g.current&&(g.current=null,b&&b(s,"backdropClick"))},k=mo($),O=d.useMemo(()=>({titleId:k}),[k]),q={transition:H,...L},G={transition:K,paper:P,backdrop:T,...U},l={slots:q,slotProps:G},[J,Q]=i("root",{elementType:fo,shouldForwardComponentProp:!0,externalForwardedProps:l,ownerState:r,className:W(h.root,R),ref:a}),[V,Z]=i("backdrop",{elementType:yo,shouldForwardComponentProp:!0,externalForwardedProps:l,ownerState:r}),[_,oo]=i("paper",{elementType:Po,shouldForwardComponentProp:!0,externalForwardedProps:l,ownerState:r,className:W(h.paper,P.className)}),[eo,ao]=i("container",{elementType:Co,externalForwardedProps:l,ownerState:r,className:h.container}),[ro,to]=i("transition",{elementType:v,externalForwardedProps:l,ownerState:r,additionalProps:{appear:!0,in:C,timeout:D,role:"presentation"}});return n.jsx(J,{closeAfterTransition:!0,slots:{backdrop:V},slotProps:{backdrop:{transitionDuration:D,as:F,...Z}},disableEscapeKeyDown:S,onClose:b,open:C,onClick:z,...Q,...X,children:n.jsx(ro,{...to,children:n.jsx(eo,{onMouseDown:Y,...ao,children:n.jsx(_,{as:N,elevation:24,role:"dialog","aria-describedby":x,"aria-labelledby":k,"aria-modal":M,...oo,children:n.jsx(ko.Provider,{value:O,children:B})})})})})}),vo=Do;export{vo as D,ko as a};
