import{T as e,F as n,u as r}from"./2c1ab0fe.Dbn2KvkT.js";import{U as t}from"./4b4bc88f.z1yoAwwH.js";import{a1 as i,a2 as o}from"./164ad2e3.FTBuhkTQ.js";var c="qp9ybh1";function s(e){return Number(e.replace(/\D/g,""))}function u({config:u,children:a,contentRef:d,onTransitionEnd:b}){const f=e(null),l=e(),h=e(),v=e(b),g=i(),m=e({duration:s(o.transitionDuration.base),easing:o.transitionTimingFunction.easeOut});return n(()=>{m.current={duration:u?.duration??s(o.transitionDuration.base),easing:u?.easing??o.transitionTimingFunction.easeOut}},[u]),n(()=>{v.current=b},[b]),n(()=>{l.current=void 0;const e=f.current;if(g||!e||!window.ResizeObserver)return;let n=!1;const r=()=>{h.current?.cancel(),h.current=void 0,f.current?.classList.remove(c)},i=t=>{if(n)return;const i=h.current,o=i?parseFloat(window.getComputedStyle(e).height):l.current;r();const s=t();if(l.current=s,null==o||"function"!=typeof e.animate)return;if(o===s)return void(i&&v.current?.());e.classList.add(c);const u=e.animate([{height:`${o}px`},{height:`${s}px`}],m.current);h.current=u,u.onfinish=()=>{h.current===u&&(h.current=void 0,e.classList.remove(c),v.current?.())}},o=d?.current,s=new window.ResizeObserver(([e])=>{if(!n){if(!e)throw new t("ResizeObserver callback received no entries");o?i(()=>e.borderBoxSize?.[0]?.blockSize??o.offsetHeight):h.current||(l.current=e.contentRect.height)}});o?s.observe(o,{box:"border-box"}):s.observe(e);const u=!o&&window.MutationObserver?new window.MutationObserver(()=>{i(()=>e.getBoundingClientRect().height)}):void 0;return u?.observe(e,{childList:!0}),()=>{n=!0,s.disconnect(),u?.disconnect(),r()}},[d,g]),r("div",{ref:f,className:"qp9ybh0",children:a})}export{u as T};