import{m as Y,n as q,r as p,f as c,dp as z,de as H,o as t,P as W,q as K,t as O,F as V,j as l,v as b,w as G,dq as J}from"./index-e6164346.js";import{u as Q}from"./Select-9c2d8cd2.js";function Z(a){return Y("MuiDialog",a)}const _=q("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),f=_,ee=p.createContext({}),ae=ee,oe=c(z,{name:"MuiDialog",slot:"Backdrop",overrides:(a,e)=>e.backdrop})({zIndex:-1}),re=a=>{const{classes:e,scroll:o,maxWidth:s,fullWidth:i,fullScreen:d}=a,u={root:["root"],container:["container",`scroll${t(o)}`],paper:["paper",`paperScroll${t(o)}`,`paperWidth${t(String(s))}`,i&&"paperFullWidth",d&&"paperFullScreen"]};return G(u,Z,e)},te=c(H,{name:"MuiDialog",slot:"Root",overridesResolver:(a,e)=>e.root})({"@media print":{position:"absolute !important"}}),le=c("div",{name:"MuiDialog",slot:"Container",overridesResolver:(a,e)=>{const{ownerState:o}=a;return[e.container,e[`scroll${t(o.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"}}}]}),se=c(W,{name:"MuiDialog",slot:"Paper",overridesResolver:(a,e)=>{const{ownerState:o}=a;return[e.paper,e[`scrollPaper${t(o.scroll)}`],e[`paperWidth${t(String(o.maxWidth))}`],o.fullWidth&&e.paperFullWidth,o.fullScreen&&e.paperFullScreen]}})(K(({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:e})=>!e.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)+32*2)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(a.breakpoints.values).filter(e=>e!=="xs").map(e=>({props:{maxWidth:e},style:{maxWidth:`${a.breakpoints.values[e]}${a.breakpoints.unit}`,[`&.${f.paperScrollBody}`]:{[a.breakpoints.down(a.breakpoints.values[e]+32*2)]:{maxWidth:"calc(100% - 64px)"}}}})),{props:({ownerState:e})=>e.fullWidth,style:{width:"calc(100% - 64px)"}},{props:({ownerState:e})=>e.fullScreen,style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${f.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),ie=p.forwardRef(function(e,o){const s=O({props:e,name:"MuiDialog"}),i=V(),d={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{"aria-describedby":u,"aria-labelledby":w,BackdropComponent:P,BackdropProps:$,children:M,className:B,disableEscapeKeyDown:k=!1,fullScreen:j=!1,fullWidth:F=!1,maxWidth:R="sm",onBackdropClick:y,onClick:D,onClose:x,open:v,PaperComponent:T=W,PaperProps:C={},scroll:A="paper",TransitionComponent:N=J,transitionDuration:S=d,TransitionProps:E,...I}=s,n={...s,disableEscapeKeyDown:k,fullScreen:j,fullWidth:F,maxWidth:R,scroll:A},m=re(n),g=p.useRef(),U=r=>{g.current=r.target===r.currentTarget},L=r=>{D&&D(r),g.current&&(g.current=null,y&&y(r),x&&x(r,"backdropClick"))},h=Q(w),X=p.useMemo(()=>({titleId:h}),[h]);return l.jsx(te,{className:b(m.root,B),closeAfterTransition:!0,components:{Backdrop:oe},componentsProps:{backdrop:{transitionDuration:S,as:P,...$}},disableEscapeKeyDown:k,onClose:x,open:v,ref:o,onClick:L,ownerState:n,...I,children:l.jsx(N,{appear:!0,in:v,timeout:S,role:"presentation",...E,children:l.jsx(le,{className:b(m.container),onMouseDown:U,ownerState:n,children:l.jsx(se,{as:T,elevation:24,role:"dialog","aria-describedby":u,"aria-labelledby":h,...C,className:b(m.paper,C.className),ownerState:n,children:l.jsx(ae.Provider,{value:X,children:M})})})})})}),ce=ie;export{ce as D,ae as a};
