import{b,m as v,h as w,ap as E}from"./app-DzAYC6xy.js";const H=b({name:"QSlideTransition",props:{appear:Boolean,duration:{type:Number,default:300}},emits:["show","hide"],setup(r,{slots:p,emit:g}){let a=!1,d,f,i=null,o=null,n,h;function u(){d?.(),d=null,a=!1,i!==null&&(clearTimeout(i),i=null),o!==null&&(clearTimeout(o),o=null),f?.removeEventListener("transitionend",n),n=null}function m(t,e,l){e!==void 0&&(t.style.height=`${e}px`),t.style.transition=`height ${r.duration}ms cubic-bezier(.25, .8, .50, 1)`,a=!0,d=l}function c(t,e){t.style.overflowY=null,t.style.height=null,t.style.transition=null,u(),e!==h&&g(e)}function y(t,e){let l=0;f=t,a===!0?(u(),l=t.offsetHeight===t.scrollHeight?0:void 0):(h="hide",t.style.overflowY="hidden"),m(t,l,e),i=setTimeout(()=>{i=null,t.style.height=`${t.scrollHeight}px`,n=s=>{o=null,(Object(s)!==s||s.target===t)&&c(t,"show")},t.addEventListener("transitionend",n),o=setTimeout(n,r.duration*1.1)},100)}function T(t,e){let l;f=t,a===!0?u():(h="show",t.style.overflowY="hidden",l=t.scrollHeight),m(t,l,e),i=setTimeout(()=>{i=null,t.style.height=0,n=s=>{o=null,(Object(s)!==s||s.target===t)&&c(t,"hide")},t.addEventListener("transitionend",n),o=setTimeout(n,r.duration*1.1)},100)}return v(()=>{a===!0&&u()}),()=>w(E,{css:!1,appear:r.appear,onEnter:y,onLeave:T},p.default)}});export{H as Q};
