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