import { DEFAULT_VALIDATION_MESSAGE_TYPE as e, VALIDATION_MESSAGE_TYPES as t } from "../constants/index.js";
import { configVue2StyleClassAttrs as n } from "../config/index.js";
import { Comment as r, Text as i, h as a } from "vue";
//#region common/utils/index.js
var o = 0, s, c = "a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]", l = typeof setImmediate == "function" ? setImmediate : setTimeout;
function u(e = "dt") {
	return `${e}${o++}`;
}
function d(e, t) {
	if (t) {
		let n = f(t);
		return e[Math.abs(n) % e.length];
	} else return e[p(e.length)];
}
function f(e) {
	let t;
	for (let n = 0; n < e.length; n++) t = Math.imul(31, t) + e.charCodeAt(n) | 0;
	return t;
}
function p(e) {
	return Math.floor(Math.random() * e);
}
function m(t) {
	return t ? t.map((t) => typeof t == "string" ? {
		message: t,
		type: e
	} : t) : [];
}
function h(e) {
	let t = g(e);
	return !e || !t ? [] : e.filter((e) => !!e.message && e.type === t);
}
function g(e) {
	return e ? _(e, t.ERROR) ? t.ERROR : _(e, t.WARNING) ? t.WARNING : _(e, t.SUCCESS) ? t.SUCCESS : null : null;
}
function _(e, t) {
	return !e || !t ? !1 : e.some((e) => e?.type === t);
}
function v(e) {
	return e?.querySelector(c);
}
var y = (e) => a("div", { innerHTML: e.html }), b = () => new Promise((e) => {
	l(e);
});
function x(e, t = {}) {
	return e ? e(t).some((e) => e.type === r || Array.isArray(e.children) && !e.children.length ? !1 : e.type !== i || typeof e.children == "string" && e.children.trim() !== "") : !1;
}
var S = (e) => e?.toLowerCase().split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(""), C = (e) => e.replace(/\.?([A-Z0-9]+)/g, (e, t) => "-" + t.toLowerCase()).replace(/^-/, ""), w = (e) => {
	let t = Object.entries(e).filter(([e]) => e.match(/on[A-Z]/));
	return Object.fromEntries(t);
}, T = (e) => {
	let t = Object.entries(e).filter(([e]) => !e.match(/on[A-Z]/));
	return Object.fromEntries(t);
}, E = (e) => e?.nodeType === Node.ELEMENT_NODE ? e : e?.nodeType ? E(e?.nextSibling) : null;
function D(e) {
	if (!n) return e;
	let t = Object.entries(e).filter(([e]) => !["class", "style"].includes(e));
	return Object.fromEntries(t);
}
function O(e) {
	return n ? {
		class: e.class,
		style: e.style
	} : {};
}
function k(e, t = 300) {
	clearTimeout(s), s = setTimeout(e, t);
}
function A(e) {
	let 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((e) => e), n.all = Object.values(n).every((e) => e), n;
}
var j = /(?:(?:[^\s!@#$%^&*()_=+[\]{}\\|;:'",.<>/?]+)\.)/, M = /* @__PURE__ */ 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)"), N = /* @__PURE__ */ 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])"), P = RegExp("(?:" + [[j.source, M.source].join("+"), N.source].join("|") + ")"), F = /(?:(?:[;/][^#?<>\s]*)?)/, I = /(?:(?:\?[^#<>\s]+)?(?:#[^<>\s]+)?)/, L = RegExp("\\b" + [
	P.source,
	F.source,
	I.source,
	"(?!\\w)"
].join("+")), R = /\b[a-z\d.-]+:\/\/[^<>\s]+/, z = RegExp("(?:mailto:)?[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@" + [P.source, I.source].join("+") + "(?!\\w)");
function B(e = 7, t = 15) {
	try {
		return RegExp(`(?:^|(?<=\\W))(?![\\s\\-])\\+?(?:[0-9()\\- \\t]{${e},${t}})(?=\\b)(?=\\W(?=\\W|\$)|\\s|\$)`);
	} catch {
		console.warn("This browser doesn't support regex lookahead/lookbehind");
	}
	return RegExp(`(?![\\s\\-])\\+?(?:[0-9()\\- \\t]{${e},${t}})(?=\\b)(?=\\W(?=\\W|\$)|\\s|\$)`);
}
var V = B(), H = new RegExp([
	L.source,
	R.source,
	z.source,
	V.source
].join("|"), "gi");
function U(e) {
	return !e || !["string", "number"].includes(typeof e) ? !1 : (e = e.toString(), V.exec(e)?.[0] === e);
}
function W(e) {
	return !e || typeof e != "string" ? !1 : L.exec(e)?.[0] === e || R.exec(e)?.[0] === e;
}
function G(e) {
	return !e || typeof e != "string" ? !1 : z.exec(e)?.[0] === e;
}
function K(e) {
	return e.filter((e) => !!e).join(", ");
}
function q(e, t = "en-US") {
	return e.replace(/^\p{CWU}/u, (e) => e.toLocaleUpperCase(t));
}
function J(e, t) {
	typeof process > "u" || process.env.NODE_ENV === "test" && (!e || !(e instanceof HTMLElement) || !document?.body || document.body.contains(e) || console.warn(`The ${t} component is not attached to the document body. This may cause issues.`));
}
function Y(e = document.documentElement) {
	return !!e.hasAttribute("data-overlayscrollbars");
}
function X(e = document.documentElement) {
	Y(e) ? e.classList.add("d-scrollbar-disabled") : e.classList.add("d-of-hidden");
}
function Z(e = document.documentElement) {
	Y(e) ? e.classList.remove("d-scrollbar-disabled") : e.classList.remove("d-of-hidden");
}
function Q(e) {
	return e.replaceAll(/[ -]/g, "_").replaceAll(/\W/g, "").toUpperCase();
}
var $ = {
	getUniqueString: u,
	getRandomElement: d,
	getRandomInt: p,
	formatMessages: m,
	filterFormattedMessages: h,
	hasFormattedMessageOfType: _,
	getValidationState: g,
	htmlFragment: y,
	flushPromises: b,
	kebabCaseToPascalCase: S,
	extractVueListeners: w,
	extractNonListeners: T,
	removeClassStyleAttrs: D,
	addClassStyleAttrs: O,
	returnFirstEl: E,
	debounce: k,
	isOutOfViewPort: A,
	getPhoneNumberRegex: B,
	linkRegex: H,
	isEmailAddress: G,
	isPhoneNumber: U,
	isURL: W,
	safeConcatStrings: K,
	capitalizeFirstLetter: q,
	disableRootScrolling: X,
	enableRootScrolling: Z
};
//#endregion
export { O as addClassStyleAttrs, q as capitalizeFirstLetter, k as debounce, $ as default, X as disableRootScrolling, Z as enableRootScrolling, T as extractNonListeners, w as extractVueListeners, h as filterFormattedMessages, v as findFirstFocusableNode, b as flushPromises, m as formatMessages, B as getPhoneNumberRegex, d as getRandomElement, p as getRandomInt, u as getUniqueString, g as getValidationState, _ as hasFormattedMessageOfType, x as hasSlotContent, y as htmlFragment, G as isEmailAddress, A as isOutOfViewPort, U as isPhoneNumber, W as isURL, f as javaHashCode, S as kebabCaseToPascalCase, H as linkRegex, C as pascalCaseToKebabCase, D as removeClassStyleAttrs, E as returnFirstEl, K as safeConcatStrings, Q as toFluentKeyString, J as warnIfUnmounted };

//# sourceMappingURL=index.js.map