import{r as y}from"./redux-1.0.74-D8bIc6ki.js";import{g as _,e as tt,u as et,J as nt,f as S,h as it,j as ot,m as rt}from"./CircularProgress-1.0.74-QfwfRJ7i.js";import{u as st,d as at,a as lt}from"./ButtonBase-1.0.74-W6tAH7AI.js";import{j as E}from"./tanstack-1.0.74-aU0azVkW.js";import{T as pt,a as P}from"./Portal-1.0.74-BrUPeMX9.js";function dt(n){return _("MuiCollapse",n)}tt("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const ut=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)},ct=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%"}}]}),U=y.forwardRef(function(e,r){const h=et({props:e,name:"MuiCollapse"}),{addEndListener:R,children:A,className:L,collapsedSize:m="0px",component:b,easing:T,in:D,onEnter:$,onEntered:j,onEntering:W,onExit:I,onExited:J,onExiting:M,orientation:F="vertical",style:C,timeout:s=nt.standard,TransitionComponent:O=pt,...k}=h,f={...h,orientation:F,collapsedSize:m},p=ut(f),H=st(),q=at(),a=y.useRef(null),v=y.useRef(),g=typeof m=="number"?`${m}px`:m,d=F==="horizontal",u=d?"width":"height",w=y.useRef(null),B=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,G=l((t,i)=>{a.current&&d&&(a.current.style.position="absolute"),t.style[u]=g,$&&$(t,i)}),K=l((t,i)=>{const o=z();a.current&&d&&(a.current.style.position="");const{duration:c,easing:x}=P({style:C,timeout:s,easing:T},{mode:"enter"});if(s==="auto"){const N=H.transitions.getAutoHeightDuration(o);t.style.transitionDuration=`${N}ms`,v.current=N}else t.style.transitionDuration=typeof c=="string"?c:`${c}ms`;t.style[u]=`${o}px`,t.style.transitionTimingFunction=x,W&&W(t,i)}),Q=l((t,i)=>{t.style[u]="auto",j&&j(t,i)}),V=l(t=>{t.style[u]=`${z()}px`,I&&I(t)}),X=l(J),Y=l(t=>{const i=z(),{duration:o,easing:c}=P({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[u]=g,t.style.transitionTimingFunction=c,M&&M(t)}),Z=t=>{s==="auto"&&q.start(v.current||0,t),R&&R(w.current,t)};return E.jsx(O,{in:D,onEnter:G,onEntered:Q,onEntering:K,onExit:V,onExited:X,onExiting:Y,addEndListener:Z,nodeRef:w,timeout:s==="auto"?null:s,...k,children:(t,{ownerState:i,...o})=>E.jsx(ct,{as:b,className:it(p.root,L,{entered:p.entered,exited:!D&&g==="0px"&&p.hidden}[t]),style:{[d?"minWidth":"minHeight"]:g,...C},ref:B,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:A})})})})});U&&(U.muiSupportAuto=!0);export{U as C};
