"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const Vue = require("vue");
const index = require("../use-timeout/index.js");
const runtime = require("../../utils/vue/props/runtime.js");
const types = require("../../utils/types.js");
const A = runtime.buildProps({
  showAfter: {
    type: Number,
    default: 0
  },
  hideAfter: {
    type: Number,
    default: 200
  },
  autoClose: {
    type: Number,
    default: 0
  }
}), N = ({
  showAfter: m,
  hideAfter: i,
  autoClose: n,
  open: l,
  close: r
}) => {
  const { registerTimeout: u } = index.useTimeout(), {
    registerTimeout: p,
    cancelTimeout: f
  } = index.useTimeout();
  return {
    onOpen: (e) => {
      u(() => {
        l(e);
        const o = Vue.unref(n);
        types.isNumber(o) && o > 0 && p(() => {
          r(e);
        }, o);
      }, Vue.unref(m));
    },
    onClose: (e) => {
      f(), u(() => {
        r(e);
      }, Vue.unref(i));
    }
  };
};
exports.useDelayedToggle = N;
exports.useDelayedToggleProps = A;
