"use client";
import{l}from"./chunk-CLTGASR6.js";import{m as p}from"./chunk-3CHPBNY2.js";import{cloneElement as k,forwardRef as z,useEffect as I,useRef as M,useState as N}from"react";import{Transition as $}from"react-transition-group";var f=p("div")({height:"auto",overflow:"hidden"});import{jsx as d}from"react/jsx-runtime";var m=z(({addEndListener:u,appear:c=!0,children:e,collapsedSize:t="0px",easing:h,in:n=!1,onEnter:E,onEntered:x,onEntering:g,onExit:y,onExited:R,onExiting:T,style:o,timeout:r,...C},S)=>{let i=typeof t=="number"?`${t}px`:t,s=M(null),[b,w]=N(!1);I(()=>{w(n)},[n]);let{defaultTimeout:P,handleOnEnter:a,handleRef:W,nodeRef:v}=l({children:e,easing:h,onEnter:E,onExit:y,ref:S,style:o,timeout:r,type:"height"}),H={entered:{height:s.current?.clientHeight||i},exited:{height:i}};return d($,{addEndListener:u,appear:c,in:b,nodeRef:v,onEnter:a("enter"),onEntered:x,onEntering:g,onExit:a("exit"),onExited:R,onExiting:T,timeout:r||P,...C,children:L=>d(f,{ref:W,style:{height:0,...H[L],...o,...e.props.style},children:k(e,{...e.props,ref:s})})})});m.displayName="Collapse";var q=m;export{q as a};
