import { OverlayScrollbars as a, ClickScrollPlugin as s } from "overlayscrollbars";
const i = {
  name: "dt-scrollbar-directive",
  install(l) {
    a.plugin(s);
    const e = /* @__PURE__ */ new WeakMap();
    l.directive("dt-scrollbar", {
      mounted(r, t) {
        const o = a({
          target: r,
          elements: {
            viewport: r.children[0]
          }
        }, {
          scrollbars: {
            autoHide: `${t.arg || "leave"}`,
            clickScroll: !0,
            autoHideDelay: `${!t.arg || t.arg === "leave" ? 0 : 1300}`
          }
        });
        r.setAttribute("data-overlayscrollbars-initialize", !0), r.classList.add("d-scrollbar"), e.set(r, o);
      },
      unmounted(r) {
        e.get(r).destroy();
      }
    });
  }
};
export {
  i as DtScrollbarDirective,
  i as default
};
//# sourceMappingURL=scrollbar.js.map
