import { unref } from "vue";
import { useTimeout as m } from "../use-timeout/index.mjs";
import { buildProps as j } from "../../utils/vue/props/runtime.mjs";
import { isNumber as i } from "../../utils/types.mjs";
const A = j({
  showAfter: {
    type: Number,
    default: 0
  },
  hideAfter: {
    type: Number,
    default: 200
  },
  autoClose: {
    type: Number,
    default: 0
  }
}), N = ({
  showAfter: m$1,
  hideAfter: i$1,
  autoClose: n,
  open: l,
  close: r
}) => {
  const { registerTimeout: u } = m(), {
    registerTimeout: p,
    cancelTimeout: f
  } = m();
  return {
    onOpen: (e) => {
      u(() => {
        l(e);
        const o = unref(n);
        i(o) && o > 0 && p(() => {
          r(e);
        }, o);
      }, unref(m$1));
    },
    onClose: (e) => {
      f(), u(() => {
        r(e);
      }, unref(i$1));
    }
  };
};
export {
  N as useDelayedToggle,
  A as useDelayedToggleProps
};
