import{_ as p}from"./emotion-use-insertion-effect-with-fallbacks.browser.esm-e1338cfd.js";import{_ as j,j as J}from"./styled-6f3628cf.js";import{r as M,m as N,a as Q}from"./mergeSlotProps-6b33c8de.js";import{u as C}from"./useForkRef-8c462693.js";import{r as y}from"./index-8ee6c85d.js";import{u as U}from"./useTheme-6d97fb94.js";import{T as V,r as X,g as L}from"./utils-a7649ee6.js";import{u as Y}from"./useTimeout-82a9add1.js";const Z=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function ut(r){var u;const{elementType:P,externalSlotProps:f,ownerState:m,skipResolvingSlotProps:c=!1}=r,g=j(r,Z),s=c?{}:M(f,m),{props:E,internalRef:T}=N(p({},g,{externalSlotProps:s})),S=C(T,s==null?void 0:s.ref,(u=r.additionalProps)==null?void 0:u.ref);return Q(P,p({},E,{ref:S}),m)}const I=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function A(r){return`scale(${r}, ${r**2})`}const tt={entering:{opacity:1,transform:A(1)},entered:{opacity:1,transform:"none"}},_=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),$=y.forwardRef(function(u,P){const{addEndListener:f,appear:m=!0,children:c,easing:g,in:s,onEnter:E,onEntered:T,onEntering:S,onExit:v,onExited:D,onExiting:G,style:R,timeout:i="auto",TransitionComponent:H=V}=u,F=j(u,I),b=Y(),w=y.useRef(),a=U(),h=y.useRef(null),k=C(h,c.ref,P),d=t=>e=>{if(t){const o=h.current;e===void 0?t(o):t(o,e)}},W=d(S),z=d((t,e)=>{X(t);const{duration:o,delay:x,easing:n}=L({style:R,timeout:i,easing:g},{mode:"enter"});let l;i==="auto"?(l=a.transitions.getAutoHeightDuration(t.clientHeight),w.current=l):l=o,t.style.transition=[a.transitions.create("opacity",{duration:l,delay:x}),a.transitions.create("transform",{duration:_?l:l*.666,delay:x,easing:n})].join(","),E&&E(t,e)}),K=d(T),O=d(G),q=d(t=>{const{duration:e,delay:o,easing:x}=L({style:R,timeout:i,easing:g},{mode:"exit"});let n;i==="auto"?(n=a.transitions.getAutoHeightDuration(t.clientHeight),w.current=n):n=e,t.style.transition=[a.transitions.create("opacity",{duration:n,delay:o}),a.transitions.create("transform",{duration:_?n:n*.666,delay:_?o:o||n*.333,easing:x})].join(","),t.style.opacity=0,t.style.transform=A(.75),v&&v(t)}),B=d(D);return J(H,p({appear:m,in:s,nodeRef:h,onEnter:z,onEntered:K,onEntering:W,onExit:q,onExited:B,onExiting:O,addEndListener:t=>{i==="auto"&&b.start(w.current||0,t),f&&f(h.current,t)},timeout:i==="auto"?null:i},F,{children:(t,e)=>y.cloneElement(c,p({style:p({opacity:0,transform:A(.75),visibility:t==="exited"&&!s?"hidden":void 0},tt[t],R,c.props.style),ref:k},e))}))});$.muiSupportAuto=!0;const ct=$;export{ct as G,ut as u};
