import { DEFAULT_PREFIX as R, DEFAULT_VALIDATION_MESSAGE_TYPE as S, VALIDATION_MESSAGE_TYPES as r } from "../constants/index.js";
import { configVue2StyleClassAttrs as c } from "../config/index.js";
import { Comment as x, Text as y, h as C } from "vue";
let O = 0, s;
const A = "input:not([type=hidden]):not(:disabled)", T = "select:not(:disabled),textarea:not(:disabled),button:not(:disabled)", L = `${A},${T}`, _ = `a,frame,iframe,${L},*[tabindex]`, w = typeof setImmediate == "function" ? setImmediate : setTimeout;
function N(e = R) {
  return `${e}${O++}`;
}
function I(e, t) {
  if (t) {
    const n = U(t);
    return e[Math.abs(n) % e.length];
  } else
    return e[u(e.length)];
}
function U(e) {
  let t;
  for (let n = 0; n < e.length; n++)
    t = Math.imul(31, t) + e.charCodeAt(n) | 0;
  return t;
}
function u(e) {
  return Math.floor(Math.random() * e);
}
function j(e) {
  return e ? e.map((t) => typeof t == "string" ? {
    message: t,
    type: S
  } : t) : [];
}
function $(e) {
  const t = l(e);
  return !e || !t ? [] : e.filter((n) => !!n.message && n.type === t);
}
function l(e) {
  return e ? o(e, r.ERROR) ? r.ERROR : o(e, r.WARNING) ? r.WARNING : o(e, r.SUCCESS) ? r.SUCCESS : null : null;
}
function o(e, t) {
  return !e || !t ? !1 : e.some((n) => (n == null ? void 0 : n.type) === t);
}
function ie(e) {
  return e == null ? void 0 : e.querySelector(_);
}
const D = (e) => C("div", { innerHTML: e.html }), F = () => new Promise((e) => {
  w(e);
});
function se(e, t = {}) {
  return e ? e(t).some((n) => n.type === x || Array.isArray(n.children) && !n.children.length ? !1 : n.type !== y || typeof n.children == "string" && n.children.trim() !== "") : !1;
}
const W = (e) => e == null ? void 0 : e.toLowerCase().split("-").map((t) => t.charAt(0).toUpperCase() + t.slice(1)).join(""), ce = (e) => e.replace(/\.?([A-Z0-9]+)/g, (t, n) => "-" + n.toLowerCase()).replace(/^-/, ""), P = (e) => {
  const t = Object.entries(e).filter(([n]) => n.match(/on[A-Z]/));
  return Object.fromEntries(t);
}, k = (e) => {
  const t = Object.entries(e).filter(([n]) => !n.match(/on[A-Z]/));
  return Object.fromEntries(t);
}, a = (e) => (e == null ? void 0 : e.nodeType) === Node.ELEMENT_NODE ? e : e != null && e.nodeType ? a(e == null ? void 0 : e.nextSibling) : null;
function v(e) {
  if (!c) return e;
  const t = Object.entries(e).filter(([n]) => !["class", "style"].includes(n));
  return Object.fromEntries(t);
}
function z(e) {
  return c ? {
    class: e.class,
    style: e.style
  } : {};
}
function B(e, t = 300) {
  clearTimeout(s), s = setTimeout(e, t);
}
function H(e) {
  const t = e.getBoundingClientRect(), n = {
    top: t.top < 0,
    left: t.left < 0,
    bottom: t.bottom > (window.innerHeight || document.documentElement.clientHeight),
    right: t.right > (window.innerWidth || document.documentElement.clientWidth)
  };
  return n.any = Object.values(n).some((i) => i), n.all = Object.values(n).every((i) => i), n;
}
const M = /(?:(?:[^\s!@#$%^&*()_=+[\]{}\\|;:'",.<>/?]+)\.)/, V = new RegExp(
  "(?:com|ru|org|net|de|jp|uk|br|it|pl|fr|in|au|ir|info|nl|cn|es|cz|kr|ca|eu|ua|co|gr|za|ro|biz|ch|se|tw|mx|vn|hu|be|tr|at|dk|tv|me|ar|sk|no|us|fi|id|cl|xyz|io|pt|by|il|ie|nz|kz|hk|lt|cc|my|sg|club|bg|edu|рф|pk|su|top|th|hr|rs|pe|pro|si|az|lv|pw|ae|ph|online|ng|ee|ws|ve|cat)"
), G = new RegExp(
  "(?:(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])\\.){3}(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])"
), f = new RegExp(
  "(?:" + [
    [
      M.source,
      V.source
    ].join("+"),
    G.source
  ].join("|") + ")"
), Z = /(?:(?:[;/][^#?<>\s]*)?)/, d = /(?:(?:\?[^#<>\s]+)?(?:#[^<>\s]+)?)/, m = new RegExp(
  "\\b" + [
    f.source,
    Z.source,
    d.source,
    "(?!\\w)"
  ].join("+")
), h = /\b[a-z\d.-]+:\/\/[^<>\s]+/, E = new RegExp(
  "(?:mailto:)?[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@" + [
    f.source,
    d.source
  ].join("+") + "(?!\\w)"
);
function b(e = 7, t = 15) {
  try {
    return new RegExp(
      `(?:^|(?<=\\W))(?![\\s\\-])\\+?(?:[0-9()\\- \\t]{${e},${t}})(?=\\b)(?=\\W(?=\\W|$)|\\s|$)`
    );
  } catch {
    console.warn("This browser doesn't support regex lookahead/lookbehind");
  }
  return new RegExp(
    `(?![\\s\\-])\\+?(?:[0-9()\\- \\t]{${e},${t}})(?=\\b)(?=\\W(?=\\W|$)|\\s|$)`
  );
}
const p = b(), q = new RegExp(
  [
    m.source,
    h.source,
    E.source,
    p.source
  ].join("|"),
  "gi"
);
function K(e) {
  var t;
  return !e || !["string", "number"].includes(typeof e) ? !1 : (e = e.toString(), ((t = p.exec(e)) == null ? void 0 : t[0]) === e);
}
function Q(e) {
  var t, n;
  return !e || typeof e != "string" ? !1 : ((t = m.exec(e)) == null ? void 0 : t[0]) === e || ((n = h.exec(e)) == null ? void 0 : n[0]) === e;
}
function Y(e) {
  var t;
  return !e || typeof e != "string" ? !1 : ((t = E.exec(e)) == null ? void 0 : t[0]) === e;
}
function X(e) {
  return e.filter((t) => !!t).join(", ");
}
function J(e, t = "en-US") {
  return e.replace(new RegExp("^\\p{CWU}", "u"), (n) => n.toLocaleUpperCase(t));
}
function ue(e, t) {
  typeof process > "u" || process.env.NODE_ENV === "test" && (!e || !(e instanceof HTMLElement) || !(document != null && document.body) || document.body.contains(e) || console.warn(`The ${t} component is not attached to the document body. This may cause issues.`));
}
function g(e = document.documentElement) {
  return !!e.hasAttribute("data-overlayscrollbars");
}
function ee(e = document.documentElement) {
  g(e) ? e.classList.add("d-scrollbar-disabled") : e.classList.add("d-of-hidden");
}
function te(e = document.documentElement) {
  g(e) ? e.classList.remove("d-scrollbar-disabled") : e.classList.remove("d-of-hidden");
}
function le(e) {
  return e.replaceAll(/[ -]/g, "_").replaceAll(/\W/g, "").toUpperCase();
}
const ae = {
  getUniqueString: N,
  getRandomElement: I,
  getRandomInt: u,
  formatMessages: j,
  filterFormattedMessages: $,
  hasFormattedMessageOfType: o,
  getValidationState: l,
  htmlFragment: D,
  flushPromises: F,
  kebabCaseToPascalCase: W,
  extractVueListeners: P,
  extractNonListeners: k,
  removeClassStyleAttrs: v,
  addClassStyleAttrs: z,
  returnFirstEl: a,
  debounce: B,
  isOutOfViewPort: H,
  getPhoneNumberRegex: b,
  linkRegex: q,
  isEmailAddress: Y,
  isPhoneNumber: K,
  isURL: Q,
  safeConcatStrings: X,
  capitalizeFirstLetter: J,
  disableRootScrolling: ee,
  enableRootScrolling: te
};
export {
  z as addClassStyleAttrs,
  J as capitalizeFirstLetter,
  B as debounce,
  ae as default,
  ee as disableRootScrolling,
  te as enableRootScrolling,
  k as extractNonListeners,
  P as extractVueListeners,
  $ as filterFormattedMessages,
  ie as findFirstFocusableNode,
  F as flushPromises,
  j as formatMessages,
  b as getPhoneNumberRegex,
  I as getRandomElement,
  u as getRandomInt,
  N as getUniqueString,
  l as getValidationState,
  o as hasFormattedMessageOfType,
  se as hasSlotContent,
  D as htmlFragment,
  Y as isEmailAddress,
  H as isOutOfViewPort,
  K as isPhoneNumber,
  Q as isURL,
  U as javaHashCode,
  W as kebabCaseToPascalCase,
  q as linkRegex,
  ce as pascalCaseToKebabCase,
  v as removeClassStyleAttrs,
  a as returnFirstEl,
  X as safeConcatStrings,
  le as toFluentKeyString,
  ue as warnIfUnmounted
};
//# sourceMappingURL=index.js.map
