import{bz as Z,bA as tt,r as y,av as et,bI as nt,bJ as it,aw as ot,az as o,O as rt,bK as st,aA as at,a9 as C,aB as T,aC as lt,aD as pt,bL as H}from"./index-BiWH3VAt.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:D,children:N,className:P,collapsedSize:g="0px",component:U,easing:S,in:$,onEnter:b,onEntered:W,onEntering:I,onExit:j,onExited:_,onExiting:L,orientation:M="vertical",style:z,timeout:a=it.standard,TransitionComponent:B=nt}=d,J=ot(d,ct),f=o({},d,{orientation:M,collapsedSize:g}),c=ut(f),A=rt(),K=st(),l=y.useRef(null),v=y.useRef(),x=typeof g=="number"?`${g}px`:g,u=M==="horizontal",h=u?"width":"height",E=y.useRef(null),O=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,k=p((t,i)=>{l.current&&u&&(l.current.style.position="absolute"),t.style[h]=x,b&&b(t,i)}),q=p((t,i)=>{const s=R();l.current&&u&&(l.current.style.position="");const{duration:m,easing:w}=H({style:z,timeout:a,easing:S},{mode:"enter"});if(a==="auto"){const F=A.transitions.getAutoHeightDuration(s);t.style.transitionDuration=`${F}ms`,v.current=F}else t.style.transitionDuration=typeof m=="string"?m:`${m}ms`;t.style[h]=`${s}px`,t.style.transitionTimingFunction=w,I&&I(t,i)}),G=p((t,i)=>{t.style[h]="auto",W&&W(t,i)}),Q=p(t=>{t.style[h]=`${R()}px`,j&&j(t)}),V=p(_),X=p(t=>{const i=R(),{duration:s,easing:m}=H({style:z,timeout:a,easing:S},{mode:"exit"});if(a==="auto"){const w=A.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,L&&L(t)}),Y=t=>{a==="auto"&&K.start(v.current||0,t),D&&D(E.current,t)};return C.jsx(B,o({in:$,onEnter:k,onEntered:G,onEntering:q,onExit:Q,onExited:V,onExiting:X,addEndListener:Y,nodeRef:E,timeout:a==="auto"?null:a},J,{children:(t,i)=>C.jsx(ht,o({as:U,className:lt(c.root,P,{entered:c.entered,exited:!$&&x==="0px"&&c.hidden}[t]),style:o({[u?"minWidth":"minHeight"]:x},z),ref:O},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:N})})}))}))});ft.muiSupportAuto=!0;export{ft as C};
