'use strict';

/*!
 * @techmely/utils
 * Copyright(c) 2021-2024 Techmely <techmely.creation@gmail.com>
 * MIT Licensed
 */


// src/isServer.ts
function isServer() {
  return typeof window === "undefined";
}

// src/onClickOutside/index.ts
function onClickOutside(element, callback) {
  if (isServer())
    return;
  document.addEventListener("click", (e) => {
    if (!element.contains(e.target))
      callback();
  });
}

exports.onClickOutside = onClickOutside;
