import{r as y}from"./redux-1.0.63-Df-eBzJn.js";import{h as _,g as tt,i as et,L as nt,j as S,c as it,l as ot,m as rt}from"./Typography-1.0.63-mecuj_Wl.js";import{u as st,f as at,a as lt}from"./ButtonBase-1.0.63-CF10PFMS.js";import{j as E}from"./cm-1.0.63-CSIRHMXC.js";import{T as pt,a as N}from"./Modal-1.0.63-fMXTbfks.js";function dt(n){return _("MuiCollapse",n)}tt("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const ct=n=>{const{orientation:e,classes:r}=n,h={root:["root",`${e}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${e}`],wrapperInner:["wrapperInner",`${e}`]};return ot(h,dt,r)},ut=S("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:r}=n;return[e.root,e[r.orientation],r.state==="entered"&&e.entered,r.state==="exited"&&!r.in&&r.collapsedSize==="0px"&&e.hidden]}})(rt(({theme:n})=>({height:0,overflow:"hidden",transition:n.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:n.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:e})=>e.state==="exited"&&!e.in&&e.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),ht=S("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(n,e)=>e.wrapper})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),mt=S("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(n,e)=>e.wrapperInner})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),P=y.forwardRef(function(e,r){const h=et({props:e,name:"MuiCollapse"}),{addEndListener:R,children:U,className:A,collapsedSize:m="0px",component:b,easing:T,in:D,onEnter:$,onEntered:j,onEntering:W,onExit:I,onExited:O,onExiting:M,orientation:F="vertical",style:C,timeout:s=nt.standard,TransitionComponent:k=pt,...q}=h,f={...h,orientation:F,collapsedSize:m},p=ct(f),H=st(),B=at(),a=y.useRef(null),v=y.useRef(),g=typeof m=="number"?`${m}px`:m,d=F==="horizontal",c=d?"width":"height",w=y.useRef(null),G=lt(r,w),l=t=>i=>{if(t){const o=w.current;i===void 0?t(o):t(o,i)}},z=()=>a.current?a.current[d?"clientWidth":"clientHeight"]:0,J=l((t,i)=>{a.current&&d&&(a.current.style.position="absolute"),t.style[c]=g,$&&$(t,i)}),K=l((t,i)=>{const o=z();a.current&&d&&(a.current.style.position="");const{duration:u,easing:x}=N({style:C,timeout:s,easing:T},{mode:"enter"});if(s==="auto"){const L=H.transitions.getAutoHeightDuration(o);t.style.transitionDuration=`${L}ms`,v.current=L}else t.style.transitionDuration=typeof u=="string"?u:`${u}ms`;t.style[c]=`${o}px`,t.style.transitionTimingFunction=x,W&&W(t,i)}),Q=l((t,i)=>{t.style[c]="auto",j&&j(t,i)}),V=l(t=>{t.style[c]=`${z()}px`,I&&I(t)}),X=l(O),Y=l(t=>{const i=z(),{duration:o,easing:u}=N({style:C,timeout:s,easing:T},{mode:"exit"});if(s==="auto"){const x=H.transitions.getAutoHeightDuration(i);t.style.transitionDuration=`${x}ms`,v.current=x}else t.style.transitionDuration=typeof o=="string"?o:`${o}ms`;t.style[c]=g,t.style.transitionTimingFunction=u,M&&M(t)}),Z=t=>{s==="auto"&&B.start(v.current||0,t),R&&R(w.current,t)};return E.jsx(k,{in:D,onEnter:J,onEntered:Q,onEntering:K,onExit:V,onExited:X,onExiting:Y,addEndListener:Z,nodeRef:w,timeout:s==="auto"?null:s,...q,children:(t,{ownerState:i,...o})=>E.jsx(ut,{as:b,className:it(p.root,A,{entered:p.entered,exited:!D&&g==="0px"&&p.hidden}[t]),style:{[d?"minWidth":"minHeight"]:g,...C},ref:G,ownerState:{...f,state:t},...o,children:E.jsx(ht,{ownerState:{...f,state:t},className:p.wrapper,ref:a,children:E.jsx(mt,{ownerState:{...f,state:t},className:p.wrapperInner,children:U})})})})});P&&(P.muiSupportAuto=!0);export{P as C};
