import{jsx as d,Fragment as p}from"react/jsx-runtime";import{useDisplayState as F}from"../../hooks/useDisplayState.js";import{Children as $,cloneElement as g}from"react";const f="cubic-bezier(0.33, 1.33, 0.23, 1)",w=r=>{const{show:n=!0,children:t,type:i="fade",duration:o=300,timingFunction:a=f,asChild:l,onHidden:s=()=>{},onShown:u=()=>{}}=r,{displayed:c,onShow:m,onHide:e}=F({animate:!0,show:n,onHidden:s,onShown:u});return c?l?d(p,{children:$.map(t,h=>g(h,{style:{animationFillMode:"both",...n?{animationName:`${i}In`,animationDuration:`${o}ms`,animationTimingFunction:a}:{animationName:`${i}Out`,animationDuration:`${o}ms`,animationTimingFunction:a}},onAnimationEnd:n?m:e}))}):d("div",{style:{animationFillMode:"both",...n?{animationName:`${i}In`,animationDuration:`${o}ms`,animationTimingFunction:a}:{animationName:`${i}Out`,animationDuration:`${o}ms`,animationTimingFunction:a}},onAnimationEnd:n?m:e,children:t}):null};export{w as default};
//# sourceMappingURL=animate.js.map
