import { jsx as e } from "react/jsx-runtime";
import { AnimatePresence as u, motion as I } from "motion/react";
import { noop as o } from "es-toolkit/function";
const x = 200, S = (a) => {
  const {
    open: t = !1,
    unmountOnExit: i = !1,
    appear: l = !1,
    timeout: s = x,
    onEntered: p = o,
    onExited: c = o,
    onAnimationStart: m = o,
    children: r
  } = a, d = !i, h = () => m(), A = (n) => {
    n === "open" && p(), n === "collapsed" && c();
  }, f = {
    open: { opacity: 1, height: "auto" },
    collapsed: { opacity: 0, height: 0 }
  };
  return /* @__PURE__ */ e(u, { initial: l, mode: "wait", children: (t || d) && /* @__PURE__ */ e(
    I.div,
    {
      initial: "collapsed",
      animate: t ? "open" : "collapsed",
      exit: "collapsed",
      className: "collapse display-block width-100pct",
      variants: f,
      transition: { duration: s / 1e3, ease: "easeIn" },
      onAnimationComplete: A,
      onAnimationStart: h,
      children: r
    },
    "content"
  ) });
};
export {
  S as default
};
//# sourceMappingURL=Collapse.js.map
