import cssAnimation from"css-animation";import getRequestAnimationFrame,{cancelRequestAnimationFrame}from"./getRequestAnimationFrame";var reqAnimFrame=getRequestAnimationFrame();function animate(t,e,n){var i=void 0,a=void 0;return cssAnimation(t,"dt-motion-collapse",{start:function(){e?(i=t.offsetHeight,t.style.height="0px",t.style.opacity="0"):(t.style.height=t.offsetHeight+"px",t.style.opacity="1")},active:function(){a&&cancelRequestAnimationFrame(a),a=reqAnimFrame(function(){t.style.height=(e?i:0)+"px",t.style.opacity=e?"1":"0"})},end:function(){a&&cancelRequestAnimationFrame(a),t.style.height="",t.style.opacity="",n()}})}var animation={enter:function(t,e){return animate(t,!0,e)},leave:function(t,e){return animate(t,!1,e)},appear:function(t,e){return animate(t,!0,e)}};export default animation;