function p(t, e) {
  return t ? t instanceof ShadowRoot ? p(t.host, e) : t instanceof HTMLElement && t.matches(e) ? t : p(t.parentNode, e) : null;
}
function g(t, e) {
  let n = t;
  for (; n !== null; ) {
    if (n === e)
      return !0;
    n = n.parentNode, n instanceof ShadowRoot && (n = n.host);
  }
  return !1;
}
function h(t = document) {
  const e = t.activeElement;
  if (!!Boolean(e))
    return Boolean(e.shadowRoot) ? h(e.shadowRoot) : e;
}
const w = () => document.documentElement.classList.contains("disable-desktop-style-tweaks") ? window.matchMedia(null) : window.matchMedia("(min-width: 992px) and (max-width: 1439px) and (hover: hover), (min-width: 1440px)");
function M(t, e, n = !1) {
  let s;
  return async function() {
    const i = this, c = arguments, o = function() {
      s = null, n || t.apply(i, c);
    }, r = n && !Boolean(s);
    clearTimeout(s), s = setTimeout(o, e), r && t.apply(i, c);
  };
}
function S(t, e) {
  const n = e.scrollTop, s = n + e.clientHeight, a = e.getBoundingClientRect(), o = {
    top: t.getBoundingClientRect().top - a.top
  }.top + n, r = o + t.offsetHeight, l = o < n ? n : o;
  return (r > s ? s : r) - l;
}
function x() {
  return !window.matchMedia("(min-width: 768px)").matches;
}
function v() {
  return window.matchMedia("(min-width: 992px)").matches;
}
function R() {
  return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
}
function u(t, e, n = []) {
  return t ? t instanceof ShadowRoot ? u(t.host, e, n) : t instanceof HTMLElement && t.matches(e) ? u(t.parentNode, e, [...n, t]) : u(t.parentNode, e, n) : n;
}
function D(t, e) {
  function n(a, i) {
    if (!Boolean(i))
      return [];
    const c = Array.from(i.querySelectorAll(a)), o = Boolean(window.HTMLSlotElement) && i instanceof HTMLSlotElement ? i.assignedElements() : [], r = [...Array.from(i.children), ...o], l = i.shadowRoot, f = n(a, l);
    return [
      ...c,
      ...r.map((d) => n(a, d)).flat(),
      ...f
    ];
  }
  return n(e, t).filter((a, i, c) => !c.some((o, r) => o.isSameNode(a) && r > i));
}
function E(t) {
  const e = new Date(t);
  return e.setMinutes(e.getMinutes() + e.getTimezoneOffset()), e;
}
function T(t) {
  if (t instanceof Date)
    return `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, "0")}-${String(t.getDate()).padStart(2, "0")}`;
}
function W(t, e) {
  return (t % e + e) % e;
}
function B(t) {
  return [
    "image/jpeg",
    "image/png",
    "image/avif",
    "image/gif",
    "image/webp"
  ].includes(t);
}
function b(t) {
  return t.startsWith("video/");
}
function y(t) {
  return t.startsWith("audio/");
}
function A(t) {
  return t.startsWith("application/pdf");
}
function N(t) {
  return t.startsWith("application/zip") || t.startsWith("application/x-zip") || t.startsWith("application/vnd.rar") || t.startsWith("application/x-7z") || t.startsWith("application/x-tar") || t.startsWith("application/x-gzip");
}
function H(t) {
  return t.startsWith("application/msword") || t.startsWith("application/vnd.openxmlformats-officedocument.wordprocessingml.document") || t.startsWith("application/vnd.apple.pages");
}
function k(t) {
  return +getComputedStyle(document.documentElement).getPropertyValue(t).replace("rem", "") * 16;
}
export {
  B as a,
  b,
  y as c,
  M as d,
  A as e,
  N as f,
  w as g,
  H as h,
  x as i,
  g as j,
  h as k,
  p as l,
  u as m,
  W as n,
  k as o,
  R as p,
  D as q,
  v as r,
  E as s,
  T as t,
  S as u
};
