const y = [
  "de",
  "del",
  "la",
  "las",
  "el",
  "los",
  "y",
  "e",
  "o",
  "u",
  "a",
  "al",
  "con",
  "en",
  "por",
  "para",
  "sin",
  "sobre"
], L = [
  "a",
  "an",
  "and",
  "as",
  "at",
  "but",
  "by",
  "for",
  "from",
  "in",
  "into",
  "of",
  "on",
  "or",
  "the",
  "to",
  "with"
];
function h(e) {
  return !e || typeof e != "string" ? "" : e.charAt(0).toUpperCase() + e.slice(1).toLowerCase();
}
function A(e, o = {}) {
  if (!e || typeof e != "string")
    return "";
  const {
    language: l = "es",
    strict: d = !1,
    customExceptions: a = []
  } = o, n = l === "en" ? [...L, ...a] : [...y, ...a];
  return e.toLowerCase().split(/\s+/).map((i, r) => r === 0 || d || !n.includes(i) ? h(i) : i).join(" ");
}
function T(e) {
  return A(e, { strict: !0 });
}
function w(e) {
  if (!e || typeof e != "string")
    return "";
  const o = e.toLowerCase();
  return o.charAt(0).toUpperCase() + o.slice(1);
}
function b(e, o = 300, l = {}) {
  if (typeof e != "function")
    throw new TypeError("Expected a function");
  const { leading: d = !1, trailing: a = !0 } = l;
  let n, s, i, r, c;
  function g(t) {
    const u = s, f = i;
    return s = i = void 0, r = e.apply(f, u), r;
  }
  function S(t) {
    return n = setTimeout(p, o), d ? g() : r;
  }
  function W(t) {
    const u = t - c;
    return o - u;
  }
  function C(t) {
    const u = t - c;
    return c === void 0 || u >= o;
  }
  function p() {
    const t = Date.now();
    if (C(t))
      return E();
    n = setTimeout(p, W(t));
  }
  function E(t) {
    return n = void 0, a && s ? g() : (s = i = void 0, r);
  }
  function m(...t) {
    const u = Date.now(), f = C(u);
    return s = t, i = this, c = u, f && n === void 0 ? S() : (n === void 0 && (n = setTimeout(p, o)), r);
  }
  return m.cancel = function() {
    n !== void 0 && clearTimeout(n), c = n = s = i = void 0;
  }, m.flush = function() {
    return n === void 0 ? r : E();
  }, m;
}
export {
  A as capitalize,
  b as debounce,
  w as sentenceCase,
  T as titleCase
};
