v-dashkit
Version:
This template should help get you started developing with Vue 3 in Vite.
1,270 lines (1,269 loc) • 44.8 kB
JavaScript
function x(n, t) {
var e = typeof Symbol < "u" && n[Symbol.iterator] || n["@@iterator"];
if (!e) {
if (Array.isArray(n) || (e = P(n)) || t && n && typeof n.length == "number") {
e && (n = e);
var r = 0, i = function() {
};
return { s: i, n: function() {
return r >= n.length ? { done: !0 } : { done: !1, value: n[r++] };
}, e: function(l) {
throw l;
}, f: i };
}
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
var o = !0, a = !1, s;
return { s: function() {
e = e.call(n);
}, n: function() {
var l = e.next();
return o = l.done, l;
}, e: function(l) {
a = !0, s = l;
}, f: function() {
try {
!o && e.return != null && e.return();
} finally {
if (a)
throw s;
}
} };
}
function R(n) {
return U(n) || V(n) || P(n) || B();
}
function B() {
throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function V(n) {
if (typeof Symbol < "u" && n[Symbol.iterator] != null || n["@@iterator"] != null)
return Array.from(n);
}
function U(n) {
if (Array.isArray(n))
return I(n);
}
function b(n) {
"@babel/helpers - typeof";
return b = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
return typeof t;
} : function(t) {
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
}, b(n);
}
function A(n, t) {
return q(n) || Z(n, t) || P(n, t) || M();
}
function M() {
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function P(n, t) {
if (n) {
if (typeof n == "string")
return I(n, t);
var e = Object.prototype.toString.call(n).slice(8, -1);
if (e === "Object" && n.constructor && (e = n.constructor.name), e === "Map" || e === "Set")
return Array.from(n);
if (e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))
return I(n, t);
}
}
function I(n, t) {
(t == null || t > n.length) && (t = n.length);
for (var e = 0, r = new Array(t); e < t; e++)
r[e] = n[e];
return r;
}
function Z(n, t) {
var e = n == null ? null : typeof Symbol < "u" && n[Symbol.iterator] || n["@@iterator"];
if (e != null) {
var r, i, o, a, s = [], u = !0, l = !1;
try {
if (o = (e = e.call(n)).next, t === 0) {
if (Object(e) !== e)
return;
u = !1;
} else
for (; !(u = (r = o.call(e)).done) && (s.push(r.value), s.length !== t); u = !0)
;
} catch (f) {
l = !0, i = f;
} finally {
try {
if (!u && e.return != null && (a = e.return(), Object(a) !== a))
return;
} finally {
if (l)
throw i;
}
}
return s;
}
}
function q(n) {
if (Array.isArray(n))
return n;
}
var K = {
innerWidth: function(t) {
if (t) {
var e = t.offsetWidth, r = getComputedStyle(t);
return e += parseFloat(r.paddingLeft) + parseFloat(r.paddingRight), e;
}
return 0;
},
width: function(t) {
if (t) {
var e = t.offsetWidth, r = getComputedStyle(t);
return e -= parseFloat(r.paddingLeft) + parseFloat(r.paddingRight), e;
}
return 0;
},
getWindowScrollTop: function() {
var t = document.documentElement;
return (window.pageYOffset || t.scrollTop) - (t.clientTop || 0);
},
getWindowScrollLeft: function() {
var t = document.documentElement;
return (window.pageXOffset || t.scrollLeft) - (t.clientLeft || 0);
},
getOuterWidth: function(t, e) {
if (t) {
var r = t.offsetWidth;
if (e) {
var i = getComputedStyle(t);
r += parseFloat(i.marginLeft) + parseFloat(i.marginRight);
}
return r;
}
return 0;
},
getOuterHeight: function(t, e) {
if (t) {
var r = t.offsetHeight;
if (e) {
var i = getComputedStyle(t);
r += parseFloat(i.marginTop) + parseFloat(i.marginBottom);
}
return r;
}
return 0;
},
getClientHeight: function(t, e) {
if (t) {
var r = t.clientHeight;
if (e) {
var i = getComputedStyle(t);
r += parseFloat(i.marginTop) + parseFloat(i.marginBottom);
}
return r;
}
return 0;
},
getViewport: function() {
var t = window, e = document, r = e.documentElement, i = e.getElementsByTagName("body")[0], o = t.innerWidth || r.clientWidth || i.clientWidth, a = t.innerHeight || r.clientHeight || i.clientHeight;
return {
width: o,
height: a
};
},
getOffset: function(t) {
if (t) {
var e = t.getBoundingClientRect();
return {
top: e.top + (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0),
left: e.left + (window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0)
};
}
return {
top: "auto",
left: "auto"
};
},
index: function(t) {
if (t)
for (var e, r = (e = this.getParentNode(t)) === null || e === void 0 ? void 0 : e.childNodes, i = 0, o = 0; o < r.length; o++) {
if (r[o] === t)
return i;
r[o].nodeType === 1 && i++;
}
return -1;
},
addMultipleClasses: function(t, e) {
var r = this;
t && e && [e].flat().filter(Boolean).forEach(function(i) {
return i.split(" ").forEach(function(o) {
return r.addClass(t, o);
});
});
},
removeMultipleClasses: function(t, e) {
var r = this;
t && e && [e].flat().filter(Boolean).forEach(function(i) {
return i.split(" ").forEach(function(o) {
return r.removeClass(t, o);
});
});
},
addClass: function(t, e) {
t && e && !this.hasClass(t, e) && (t.classList ? t.classList.add(e) : t.className += " " + e);
},
removeClass: function(t, e) {
t && e && (t.classList ? t.classList.remove(e) : t.className = t.className.replace(new RegExp("(^|\\b)" + e.split(" ").join("|") + "(\\b|$)", "gi"), " "));
},
hasClass: function(t, e) {
return t ? t.classList ? t.classList.contains(e) : new RegExp("(^| )" + e + "( |$)", "gi").test(t.className) : !1;
},
addStyles: function(t) {
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
t && Object.entries(e).forEach(function(r) {
var i = A(r, 2), o = i[0], a = i[1];
return t.style[o] = a;
});
},
find: function(t, e) {
return this.isElement(t) ? t.querySelectorAll(e) : [];
},
findSingle: function(t, e) {
return this.isElement(t) ? t.querySelector(e) : null;
},
createElement: function(t) {
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
if (t) {
var r = document.createElement(t);
this.setAttributes(r, e);
for (var i = arguments.length, o = new Array(i > 2 ? i - 2 : 0), a = 2; a < i; a++)
o[a - 2] = arguments[a];
return r.append.apply(r, o), r;
}
},
setAttribute: function(t) {
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", r = arguments.length > 2 ? arguments[2] : void 0;
this.isElement(t) && r !== null && r !== void 0 && t.setAttribute(e, r);
},
setAttributes: function(t) {
var e = this, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
if (this.isElement(t)) {
var i = function o(a, s) {
var u, l, f = t != null && (u = t.$attrs) !== null && u !== void 0 && u[a] ? [t == null || (l = t.$attrs) === null || l === void 0 ? void 0 : l[a]] : [];
return [s].flat().reduce(function(c, d) {
if (d != null) {
var h = b(d);
if (h === "string" || h === "number")
c.push(d);
else if (h === "object") {
var y = Array.isArray(d) ? o(a, d) : Object.entries(d).map(function(g) {
var E = A(g, 2), p = E[0], v = E[1];
return a === "style" && (v || v === 0) ? "".concat(p.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(), ":").concat(v) : v ? p : void 0;
});
c = y.length ? c.concat(y.filter(function(g) {
return !!g;
})) : c;
}
}
return c;
}, f);
};
Object.entries(r).forEach(function(o) {
var a = A(o, 2), s = a[0], u = a[1];
if (u != null) {
var l = s.match(/^on(.+)/);
l ? t.addEventListener(l[1].toLowerCase(), u) : s === "p-bind" ? e.setAttributes(t, u) : (u = s === "class" ? R(new Set(i("class", u))).join(" ").trim() : s === "style" ? i("style", u).join(";").trim() : u, (t.$attrs = t.$attrs || {}) && (t.$attrs[s] = u), t.setAttribute(s, u));
}
});
}
},
getAttribute: function(t, e) {
if (this.isElement(t)) {
var r = t.getAttribute(e);
return isNaN(r) ? r === "true" || r === "false" ? r === "true" : r : +r;
}
},
isAttributeEquals: function(t, e, r) {
return this.isElement(t) ? this.getAttribute(t, e) === r : !1;
},
isAttributeNotEquals: function(t, e, r) {
return !this.isAttributeEquals(t, e, r);
},
getHeight: function(t) {
if (t) {
var e = t.offsetHeight, r = getComputedStyle(t);
return e -= parseFloat(r.paddingTop) + parseFloat(r.paddingBottom) + parseFloat(r.borderTopWidth) + parseFloat(r.borderBottomWidth), e;
}
return 0;
},
getWidth: function(t) {
if (t) {
var e = t.offsetWidth, r = getComputedStyle(t);
return e -= parseFloat(r.paddingLeft) + parseFloat(r.paddingRight) + parseFloat(r.borderLeftWidth) + parseFloat(r.borderRightWidth), e;
}
return 0;
},
absolutePosition: function(t, e) {
var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0;
if (t) {
var i = t.offsetParent ? {
width: t.offsetWidth,
height: t.offsetHeight
} : this.getHiddenElementDimensions(t), o = i.height, a = i.width, s = e.offsetHeight, u = e.offsetWidth, l = e.getBoundingClientRect(), f = this.getWindowScrollTop(), c = this.getWindowScrollLeft(), d = this.getViewport(), h, y, g = "top";
l.top + s + o > d.height ? (h = l.top + f - o, g = "bottom", h < 0 && (h = f)) : h = s + l.top + f, l.left + a > d.width ? y = Math.max(0, l.left + c + u - a) : y = l.left + c, t.style.top = h + "px", t.style.left = y + "px", t.style.transformOrigin = g, r && (t.style.marginTop = g === "bottom" ? "calc(var(--p-anchor-gutter) * -1)" : "calc(var(--p-anchor-gutter))");
}
},
relativePosition: function(t, e) {
var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0;
if (t) {
var i = t.offsetParent ? {
width: t.offsetWidth,
height: t.offsetHeight
} : this.getHiddenElementDimensions(t), o = e.offsetHeight, a = e.getBoundingClientRect(), s = this.getViewport(), u, l, f = "top";
a.top + o + i.height > s.height ? (u = -1 * i.height, f = "bottom", a.top + u < 0 && (u = -1 * a.top)) : u = o, i.width > s.width ? l = a.left * -1 : a.left + i.width > s.width ? l = (a.left + i.width - s.width) * -1 : l = 0, t.style.top = u + "px", t.style.left = l + "px", t.style.transformOrigin = f, r && (t.style.marginTop = f === "bottom" ? "calc(var(--p-anchor-gutter) * -1)" : "calc(var(--p-anchor-gutter))");
}
},
nestedPosition: function(t, e) {
if (t) {
var r = t.parentElement, i = this.getOffset(r), o = this.getViewport(), a = t.offsetParent ? t.offsetWidth : this.getHiddenElementOuterWidth(t), s = this.getOuterWidth(r.children[0]), u;
parseInt(i.left, 10) + s + a > o.width - this.calculateScrollbarWidth() ? parseInt(i.left, 10) < a ? e % 2 === 1 ? u = parseInt(i.left, 10) ? "-" + parseInt(i.left, 10) + "px" : "100%" : e % 2 === 0 && (u = o.width - a - this.calculateScrollbarWidth() + "px") : u = "-100%" : u = "100%", t.style.top = "0px", t.style.left = u;
}
},
getParentNode: function(t) {
var e = t == null ? void 0 : t.parentNode;
return e && e instanceof ShadowRoot && e.host && (e = e.host), e;
},
getParents: function(t) {
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [], r = this.getParentNode(t);
return r === null ? e : this.getParents(r, e.concat([r]));
},
getScrollableParents: function(t) {
var e = [];
if (t) {
var r = this.getParents(t), i = /(auto|scroll)/, o = function(E) {
try {
var p = window.getComputedStyle(E, null);
return i.test(p.getPropertyValue("overflow")) || i.test(p.getPropertyValue("overflowX")) || i.test(p.getPropertyValue("overflowY"));
} catch {
return !1;
}
}, a = x(r), s;
try {
for (a.s(); !(s = a.n()).done; ) {
var u = s.value, l = u.nodeType === 1 && u.dataset.scrollselectors;
if (l) {
var f = l.split(","), c = x(f), d;
try {
for (c.s(); !(d = c.n()).done; ) {
var h = d.value, y = this.findSingle(u, h);
y && o(y) && e.push(y);
}
} catch (g) {
c.e(g);
} finally {
c.f();
}
}
u.nodeType !== 9 && o(u) && e.push(u);
}
} catch (g) {
a.e(g);
} finally {
a.f();
}
}
return e;
},
getHiddenElementOuterHeight: function(t) {
if (t) {
t.style.visibility = "hidden", t.style.display = "block";
var e = t.offsetHeight;
return t.style.display = "none", t.style.visibility = "visible", e;
}
return 0;
},
getHiddenElementOuterWidth: function(t) {
if (t) {
t.style.visibility = "hidden", t.style.display = "block";
var e = t.offsetWidth;
return t.style.display = "none", t.style.visibility = "visible", e;
}
return 0;
},
getHiddenElementDimensions: function(t) {
if (t) {
var e = {};
return t.style.visibility = "hidden", t.style.display = "block", e.width = t.offsetWidth, e.height = t.offsetHeight, t.style.display = "none", t.style.visibility = "visible", e;
}
return 0;
},
fadeIn: function(t, e) {
if (t) {
t.style.opacity = 0;
var r = +/* @__PURE__ */ new Date(), i = 0, o = function a() {
i = +t.style.opacity + ((/* @__PURE__ */ new Date()).getTime() - r) / e, t.style.opacity = i, r = +/* @__PURE__ */ new Date(), +i < 1 && (window.requestAnimationFrame && requestAnimationFrame(a) || setTimeout(a, 16));
};
o();
}
},
fadeOut: function(t, e) {
if (t)
var r = 1, i = 50, o = e, a = i / o, s = setInterval(function() {
r -= a, r <= 0 && (r = 0, clearInterval(s)), t.style.opacity = r;
}, i);
},
getUserAgent: function() {
return navigator.userAgent;
},
appendChild: function(t, e) {
if (this.isElement(e))
e.appendChild(t);
else if (e.el && e.elElement)
e.elElement.appendChild(t);
else
throw new Error("Cannot append " + e + " to " + t);
},
isElement: function(t) {
return (typeof HTMLElement > "u" ? "undefined" : b(HTMLElement)) === "object" ? t instanceof HTMLElement : t && b(t) === "object" && t !== null && t.nodeType === 1 && typeof t.nodeName == "string";
},
scrollInView: function(t, e) {
var r = getComputedStyle(t).getPropertyValue("borderTopWidth"), i = r ? parseFloat(r) : 0, o = getComputedStyle(t).getPropertyValue("paddingTop"), a = o ? parseFloat(o) : 0, s = t.getBoundingClientRect(), u = e.getBoundingClientRect(), l = u.top + document.body.scrollTop - (s.top + document.body.scrollTop) - i - a, f = t.scrollTop, c = t.clientHeight, d = this.getOuterHeight(e);
l < 0 ? t.scrollTop = f + l : l + d > c && (t.scrollTop = f + l - c + d);
},
clearSelection: function() {
if (window.getSelection)
window.getSelection().empty ? window.getSelection().empty() : window.getSelection().removeAllRanges && window.getSelection().rangeCount > 0 && window.getSelection().getRangeAt(0).getClientRects().length > 0 && window.getSelection().removeAllRanges();
else if (document.selection && document.selection.empty)
try {
document.selection.empty();
} catch {
}
},
getSelection: function() {
return window.getSelection ? window.getSelection().toString() : document.getSelection ? document.getSelection().toString() : document.selection ? document.selection.createRange().text : null;
},
calculateScrollbarWidth: function() {
if (this.calculatedScrollbarWidth != null)
return this.calculatedScrollbarWidth;
var t = document.createElement("div");
this.addStyles(t, {
width: "100px",
height: "100px",
overflow: "scroll",
position: "absolute",
top: "-9999px"
}), document.body.appendChild(t);
var e = t.offsetWidth - t.clientWidth;
return document.body.removeChild(t), this.calculatedScrollbarWidth = e, e;
},
calculateBodyScrollbarWidth: function() {
return window.innerWidth - document.documentElement.offsetWidth;
},
getBrowser: function() {
if (!this.browser) {
var t = this.resolveUserAgent();
this.browser = {}, t.browser && (this.browser[t.browser] = !0, this.browser.version = t.version), this.browser.chrome ? this.browser.webkit = !0 : this.browser.webkit && (this.browser.safari = !0);
}
return this.browser;
},
resolveUserAgent: function() {
var t = navigator.userAgent.toLowerCase(), e = /(chrome)[ ]([\w.]+)/.exec(t) || /(webkit)[ ]([\w.]+)/.exec(t) || /(opera)(?:.*version|)[ ]([\w.]+)/.exec(t) || /(msie) ([\w.]+)/.exec(t) || t.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(t) || [];
return {
browser: e[1] || "",
version: e[2] || "0"
};
},
isVisible: function(t) {
return t && t.offsetParent != null;
},
invokeElementMethod: function(t, e, r) {
t[e].apply(t, r);
},
isExist: function(t) {
return !!(t !== null && typeof t < "u" && t.nodeName && this.getParentNode(t));
},
isClient: function() {
return !!(typeof window < "u" && window.document && window.document.createElement);
},
focus: function(t, e) {
t && document.activeElement !== t && t.focus(e);
},
isFocusableElement: function(t) {
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
return this.isElement(t) ? t.matches('button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])'.concat(e, `,
[href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`).concat(e, `,
input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`).concat(e, `,
select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`).concat(e, `,
textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`).concat(e, `,
[tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`).concat(e, `,
[contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`).concat(e)) : !1;
},
getFocusableElements: function(t) {
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", r = this.find(t, 'button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])'.concat(e, `,
[href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`).concat(e, `,
input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`).concat(e, `,
select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`).concat(e, `,
textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`).concat(e, `,
[tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`).concat(e, `,
[contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`).concat(e)), i = [], o = x(r), a;
try {
for (o.s(); !(a = o.n()).done; ) {
var s = a.value;
getComputedStyle(s).display != "none" && getComputedStyle(s).visibility != "hidden" && i.push(s);
}
} catch (u) {
o.e(u);
} finally {
o.f();
}
return i;
},
getFirstFocusableElement: function(t, e) {
var r = this.getFocusableElements(t, e);
return r.length > 0 ? r[0] : null;
},
getLastFocusableElement: function(t, e) {
var r = this.getFocusableElements(t, e);
return r.length > 0 ? r[r.length - 1] : null;
},
getNextFocusableElement: function(t, e, r) {
var i = this.getFocusableElements(t, r), o = i.length > 0 ? i.findIndex(function(s) {
return s === e;
}) : -1, a = o > -1 && i.length >= o + 1 ? o + 1 : -1;
return a > -1 ? i[a] : null;
},
getPreviousElementSibling: function(t, e) {
for (var r = t.previousElementSibling; r; ) {
if (r.matches(e))
return r;
r = r.previousElementSibling;
}
return null;
},
getNextElementSibling: function(t, e) {
for (var r = t.nextElementSibling; r; ) {
if (r.matches(e))
return r;
r = r.nextElementSibling;
}
return null;
},
isClickable: function(t) {
if (t) {
var e = t.nodeName, r = t.parentElement && t.parentElement.nodeName;
return e === "INPUT" || e === "TEXTAREA" || e === "BUTTON" || e === "A" || r === "INPUT" || r === "TEXTAREA" || r === "BUTTON" || r === "A" || !!t.closest(".p-button, .p-checkbox, .p-radiobutton");
}
return !1;
},
applyStyle: function(t, e) {
if (typeof e == "string")
t.style.cssText = e;
else
for (var r in e)
t.style[r] = e[r];
},
isIOS: function() {
return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
},
isAndroid: function() {
return /(android)/i.test(navigator.userAgent);
},
isTouchDevice: function() {
return "ontouchstart" in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
},
hasCSSAnimation: function(t) {
if (t) {
var e = getComputedStyle(t), r = parseFloat(e.getPropertyValue("animation-duration") || "0");
return r > 0;
}
return !1;
},
hasCSSTransition: function(t) {
if (t) {
var e = getComputedStyle(t), r = parseFloat(e.getPropertyValue("transition-duration") || "0");
return r > 0;
}
return !1;
},
exportCSV: function(t, e) {
var r = new Blob([t], {
type: "application/csv;charset=utf-8;"
});
if (window.navigator.msSaveOrOpenBlob)
navigator.msSaveOrOpenBlob(r, e + ".csv");
else {
var i = document.createElement("a");
i.download !== void 0 ? (i.setAttribute("href", URL.createObjectURL(r)), i.setAttribute("download", e + ".csv"), i.style.display = "none", document.body.appendChild(i), i.click(), document.body.removeChild(i)) : (t = "data:text/csv;charset=utf-8," + t, window.open(encodeURI(t)));
}
},
blockBodyScroll: function() {
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "p-overflow-hidden";
document.body.style.setProperty("--scrollbar-width", this.calculateBodyScrollbarWidth() + "px"), this.addClass(document.body, t);
},
unblockBodyScroll: function() {
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "p-overflow-hidden";
document.body.style.removeProperty("--scrollbar-width"), this.removeClass(document.body, t);
}
};
function S(n) {
"@babel/helpers - typeof";
return S = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
return typeof t;
} : function(t) {
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
}, S(n);
}
function z(n, t) {
if (!(n instanceof t))
throw new TypeError("Cannot call a class as a function");
}
function L(n, t) {
for (var e = 0; e < t.length; e++) {
var r = t[e];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(n, Y(r.key), r);
}
}
function X(n, t, e) {
return t && L(n.prototype, t), e && L(n, e), Object.defineProperty(n, "prototype", { writable: !1 }), n;
}
function Y(n) {
var t = J(n, "string");
return S(t) == "symbol" ? t : String(t);
}
function J(n, t) {
if (S(n) != "object" || !n)
return n;
var e = n[Symbol.toPrimitive];
if (e !== void 0) {
var r = e.call(n, t || "default");
if (S(r) != "object")
return r;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (t === "string" ? String : Number)(n);
}
var bt = /* @__PURE__ */ function() {
function n(t) {
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : function() {
};
z(this, n), this.element = t, this.listener = e;
}
return X(n, [{
key: "bindScrollListener",
value: function() {
this.scrollableParents = K.getScrollableParents(this.element);
for (var e = 0; e < this.scrollableParents.length; e++)
this.scrollableParents[e].addEventListener("scroll", this.listener);
}
}, {
key: "unbindScrollListener",
value: function() {
if (this.scrollableParents)
for (var e = 0; e < this.scrollableParents.length; e++)
this.scrollableParents[e].removeEventListener("scroll", this.listener);
}
}, {
key: "destroy",
value: function() {
this.unbindScrollListener(), this.element = null, this.listener = null, this.scrollableParents = null;
}
}]), n;
}();
function mt() {
var n = /* @__PURE__ */ new Map();
return {
on: function(e, r) {
var i = n.get(e);
i ? i.push(r) : i = [r], n.set(e, i);
},
off: function(e, r) {
var i = n.get(e);
i && i.splice(i.indexOf(r) >>> 0, 1);
},
emit: function(e, r) {
var i = n.get(e);
i && i.slice().map(function(o) {
o(r);
});
}
};
}
function W(n, t) {
return tt(n) || Q(n, t) || _(n, t) || G();
}
function G() {
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function Q(n, t) {
var e = n == null ? null : typeof Symbol < "u" && n[Symbol.iterator] || n["@@iterator"];
if (e != null) {
var r, i, o, a, s = [], u = !0, l = !1;
try {
if (o = (e = e.call(n)).next, t === 0) {
if (Object(e) !== e)
return;
u = !1;
} else
for (; !(u = (r = o.call(e)).done) && (s.push(r.value), s.length !== t); u = !0)
;
} catch (f) {
l = !0, i = f;
} finally {
try {
if (!u && e.return != null && (a = e.return(), Object(a) !== a))
return;
} finally {
if (l)
throw i;
}
}
return s;
}
}
function tt(n) {
if (Array.isArray(n))
return n;
}
function $(n) {
return rt(n) || nt(n) || _(n) || et();
}
function et() {
throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function nt(n) {
if (typeof Symbol < "u" && n[Symbol.iterator] != null || n["@@iterator"] != null)
return Array.from(n);
}
function rt(n) {
if (Array.isArray(n))
return T(n);
}
function C(n, t) {
var e = typeof Symbol < "u" && n[Symbol.iterator] || n["@@iterator"];
if (!e) {
if (Array.isArray(n) || (e = _(n)) || t && n && typeof n.length == "number") {
e && (n = e);
var r = 0, i = function() {
};
return { s: i, n: function() {
return r >= n.length ? { done: !0 } : { done: !1, value: n[r++] };
}, e: function(l) {
throw l;
}, f: i };
}
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
var o = !0, a = !1, s;
return { s: function() {
e = e.call(n);
}, n: function() {
var l = e.next();
return o = l.done, l;
}, e: function(l) {
a = !0, s = l;
}, f: function() {
try {
!o && e.return != null && e.return();
} finally {
if (a)
throw s;
}
} };
}
function _(n, t) {
if (n) {
if (typeof n == "string")
return T(n, t);
var e = Object.prototype.toString.call(n).slice(8, -1);
if (e === "Object" && n.constructor && (e = n.constructor.name), e === "Map" || e === "Set")
return Array.from(n);
if (e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))
return T(n, t);
}
}
function T(n, t) {
(t == null || t > n.length) && (t = n.length);
for (var e = 0, r = new Array(t); e < t; e++)
r[e] = n[e];
return r;
}
function m(n) {
"@babel/helpers - typeof";
return m = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
return typeof t;
} : function(t) {
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
}, m(n);
}
var j = {
equals: function(t, e, r) {
return r ? this.resolveFieldData(t, r) === this.resolveFieldData(e, r) : this.deepEquals(t, e);
},
deepEquals: function(t, e) {
if (t === e)
return !0;
if (t && e && m(t) == "object" && m(e) == "object") {
var r = Array.isArray(t), i = Array.isArray(e), o, a, s;
if (r && i) {
if (a = t.length, a != e.length)
return !1;
for (o = a; o-- !== 0; )
if (!this.deepEquals(t[o], e[o]))
return !1;
return !0;
}
if (r != i)
return !1;
var u = t instanceof Date, l = e instanceof Date;
if (u != l)
return !1;
if (u && l)
return t.getTime() == e.getTime();
var f = t instanceof RegExp, c = e instanceof RegExp;
if (f != c)
return !1;
if (f && c)
return t.toString() == e.toString();
var d = Object.keys(t);
if (a = d.length, a !== Object.keys(e).length)
return !1;
for (o = a; o-- !== 0; )
if (!Object.prototype.hasOwnProperty.call(e, d[o]))
return !1;
for (o = a; o-- !== 0; )
if (s = d[o], !this.deepEquals(t[s], e[s]))
return !1;
return !0;
}
return t !== t && e !== e;
},
resolveFieldData: function(t, e) {
if (!t || !e)
return null;
try {
var r = t[e];
if (this.isNotEmpty(r))
return r;
} catch {
}
if (Object.keys(t).length) {
if (this.isFunction(e))
return e(t);
if (e.indexOf(".") === -1)
return t[e];
for (var i = e.split("."), o = t, a = 0, s = i.length; a < s; ++a) {
if (o == null)
return null;
o = o[i[a]];
}
return o;
}
return null;
},
getItemValue: function(t) {
for (var e = arguments.length, r = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
r[i - 1] = arguments[i];
return this.isFunction(t) ? t.apply(void 0, r) : t;
},
filter: function(t, e, r) {
var i = [];
if (t) {
var o = C(t), a;
try {
for (o.s(); !(a = o.n()).done; ) {
var s = a.value, u = C(e), l;
try {
for (u.s(); !(l = u.n()).done; ) {
var f = l.value;
if (String(this.resolveFieldData(s, f)).toLowerCase().indexOf(r.toLowerCase()) > -1) {
i.push(s);
break;
}
}
} catch (c) {
u.e(c);
} finally {
u.f();
}
}
} catch (c) {
o.e(c);
} finally {
o.f();
}
}
return i;
},
reorderArray: function(t, e, r) {
t && e !== r && (r >= t.length && (r %= t.length, e %= t.length), t.splice(r, 0, t.splice(e, 1)[0]));
},
findIndexInList: function(t, e) {
var r = -1;
if (e) {
for (var i = 0; i < e.length; i++)
if (e[i] === t) {
r = i;
break;
}
}
return r;
},
contains: function(t, e) {
if (t != null && e && e.length) {
var r = C(e), i;
try {
for (r.s(); !(i = r.n()).done; ) {
var o = i.value;
if (this.equals(t, o))
return !0;
}
} catch (a) {
r.e(a);
} finally {
r.f();
}
}
return !1;
},
insertIntoOrderedArray: function(t, e, r, i) {
if (r.length > 0) {
for (var o = !1, a = 0; a < r.length; a++) {
var s = this.findIndexInList(r[a], i);
if (s > e) {
r.splice(a, 0, t), o = !0;
break;
}
}
o || r.push(t);
} else
r.push(t);
},
removeAccents: function(t) {
return t && t.search(/[\xC0-\xFF]/g) > -1 && (t = t.replace(/[\xC0-\xC5]/g, "A").replace(/[\xC6]/g, "AE").replace(/[\xC7]/g, "C").replace(/[\xC8-\xCB]/g, "E").replace(/[\xCC-\xCF]/g, "I").replace(/[\xD0]/g, "D").replace(/[\xD1]/g, "N").replace(/[\xD2-\xD6\xD8]/g, "O").replace(/[\xD9-\xDC]/g, "U").replace(/[\xDD]/g, "Y").replace(/[\xDE]/g, "P").replace(/[\xE0-\xE5]/g, "a").replace(/[\xE6]/g, "ae").replace(/[\xE7]/g, "c").replace(/[\xE8-\xEB]/g, "e").replace(/[\xEC-\xEF]/g, "i").replace(/[\xF1]/g, "n").replace(/[\xF2-\xF6\xF8]/g, "o").replace(/[\xF9-\xFC]/g, "u").replace(/[\xFE]/g, "p").replace(/[\xFD\xFF]/g, "y")), t;
},
getVNodeProp: function(t, e) {
if (t) {
var r = t.props;
if (r) {
var i = e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(), o = Object.prototype.hasOwnProperty.call(r, i) ? i : e;
return t.type.extends.props[e].type === Boolean && r[o] === "" ? !0 : r[o];
}
}
return null;
},
toFlatCase: function(t) {
return this.isString(t) ? t.replace(/(-|_)/g, "").toLowerCase() : t;
},
toKebabCase: function(t) {
return this.isString(t) ? t.replace(/(_)/g, "-").replace(/[A-Z]/g, function(e, r) {
return r === 0 ? e : "-" + e.toLowerCase();
}).toLowerCase() : t;
},
toCapitalCase: function(t) {
return this.isString(t, {
empty: !1
}) ? t[0].toUpperCase() + t.slice(1) : t;
},
isEmpty: function(t) {
return t == null || t === "" || Array.isArray(t) && t.length === 0 || !(t instanceof Date) && m(t) === "object" && Object.keys(t).length === 0;
},
isNotEmpty: function(t) {
return !this.isEmpty(t);
},
isFunction: function(t) {
return !!(t && t.constructor && t.call && t.apply);
},
isObject: function(t) {
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
return t instanceof Object && t.constructor === Object && (e || Object.keys(t).length !== 0);
},
isDate: function(t) {
return t instanceof Date && t.constructor === Date;
},
isArray: function(t) {
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
return Array.isArray(t) && (e || t.length !== 0);
},
isString: function(t) {
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
return typeof t == "string" && (e || t !== "");
},
isPrintableCharacter: function() {
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
return this.isNotEmpty(t) && t.length === 1 && t.match(/\S| /);
},
/**
* Firefox-v103 does not currently support the "findLast" method. It is stated that this method will be supported with Firefox-v104.
* https://caniuse.com/mdn-javascript_builtins_array_findlast
*/
findLast: function(t, e) {
var r;
if (this.isNotEmpty(t))
try {
r = t.findLast(e);
} catch {
r = $(t).reverse().find(e);
}
return r;
},
/**
* Firefox-v103 does not currently support the "findLastIndex" method. It is stated that this method will be supported with Firefox-v104.
* https://caniuse.com/mdn-javascript_builtins_array_findlastindex
*/
findLastIndex: function(t, e) {
var r = -1;
if (this.isNotEmpty(t))
try {
r = t.findLastIndex(e);
} catch {
r = t.lastIndexOf($(t).reverse().find(e));
}
return r;
},
sort: function(t, e) {
var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, i = arguments.length > 3 ? arguments[3] : void 0, o = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : 1, a = this.compare(t, e, i, r), s = r;
return (this.isEmpty(t) || this.isEmpty(e)) && (s = o === 1 ? r : o), s * a;
},
compare: function(t, e, r) {
var i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 1, o = -1, a = this.isEmpty(t), s = this.isEmpty(e);
return a && s ? o = 0 : a ? o = i : s ? o = -i : typeof t == "string" && typeof e == "string" ? o = r(t, e) : o = t < e ? -1 : t > e ? 1 : 0, o;
},
localeComparator: function() {
return new Intl.Collator(void 0, {
numeric: !0
}).compare;
},
nestedKeys: function() {
var t = this, e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
return Object.entries(e).reduce(function(i, o) {
var a = W(o, 2), s = a[0], u = a[1], l = r ? "".concat(r, ".").concat(s) : s;
return t.isObject(u) ? i = i.concat(t.nestedKeys(u, l)) : i.push(l), i;
}, []);
},
stringify: function(t) {
var e = this, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 2, i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0, o = " ".repeat(i), a = " ".repeat(i + r);
return this.isArray(t) ? "[" + t.map(function(s) {
return e.stringify(s, r, i + r);
}).join(", ") + "]" : this.isDate(t) ? t.toISOString() : this.isFunction(t) ? t.toString() : this.isObject(t) ? `{
` + Object.entries(t).map(function(s) {
var u = W(s, 2), l = u[0], f = u[1];
return "".concat(a).concat(l, ": ").concat(e.stringify(f, r, i + r));
}).join(`,
`) + `
`.concat(o) + "}" : JSON.stringify(t);
}
};
function w(n) {
"@babel/helpers - typeof";
return w = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
return typeof t;
} : function(t) {
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
}, w(n);
}
function it(n) {
return ut(n) || st(n) || at(n) || ot();
}
function ot() {
throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function at(n, t) {
if (n) {
if (typeof n == "string")
return O(n, t);
var e = Object.prototype.toString.call(n).slice(8, -1);
if (e === "Object" && n.constructor && (e = n.constructor.name), e === "Map" || e === "Set")
return Array.from(n);
if (e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))
return O(n, t);
}
}
function st(n) {
if (typeof Symbol < "u" && n[Symbol.iterator] != null || n["@@iterator"] != null)
return Array.from(n);
}
function ut(n) {
if (Array.isArray(n))
return O(n);
}
function O(n, t) {
(t == null || t > n.length) && (t = n.length);
for (var e = 0, r = new Array(t); e < t; e++)
r[e] = n[e];
return r;
}
function lt(n, t) {
if (!(n instanceof t))
throw new TypeError("Cannot call a class as a function");
}
function H(n, t) {
for (var e = 0; e < t.length; e++) {
var r = t[e];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(n, N(r.key), r);
}
}
function ft(n, t, e) {
return t && H(n.prototype, t), e && H(n, e), Object.defineProperty(n, "prototype", { writable: !1 }), n;
}
function D(n, t, e) {
return t = N(t), t in n ? Object.defineProperty(n, t, { value: e, enumerable: !0, configurable: !0, writable: !0 }) : n[t] = e, n;
}
function N(n) {
var t = ct(n, "string");
return w(t) == "symbol" ? t : String(t);
}
function ct(n, t) {
if (w(n) != "object" || !n)
return n;
var e = n[Symbol.toPrimitive];
if (e !== void 0) {
var r = e.call(n, t || "default");
if (w(r) != "object")
return r;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (t === "string" ? String : Number)(n);
}
var St = /* @__PURE__ */ function() {
function n(t) {
var e = t.init, r = t.type;
lt(this, n), D(this, "helpers", void 0), D(this, "type", void 0), this.helpers = new Set(e), this.type = r;
}
return ft(n, [{
key: "add",
value: function(e) {
this.helpers.add(e);
}
}, {
key: "update",
value: function() {
}
}, {
key: "delete",
value: function(e) {
this.helpers.delete(e);
}
}, {
key: "clear",
value: function() {
this.helpers.clear();
}
}, {
key: "get",
value: function(e, r) {
var i = this._get(e, r), o = i ? this._recursive(it(this.helpers), i) : null;
return j.isNotEmpty(o) ? o : null;
}
}, {
key: "_isMatched",
value: function(e, r) {
var i, o = e == null ? void 0 : e.parent;
return (o == null || (i = o.vnode) === null || i === void 0 ? void 0 : i.key) === r || o && this._isMatched(o, r) || !1;
}
}, {
key: "_get",
value: function(e, r) {
var i, o;
return ((i = r || (e == null ? void 0 : e.$slots)) === null || i === void 0 || (o = i.default) === null || o === void 0 ? void 0 : o.call(i)) || null;
}
}, {
key: "_recursive",
value: function() {
var e = this, r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [], o = [];
return i.forEach(function(a) {
a.children instanceof Array ? o = o.concat(e._recursive(o, a.children)) : a.type.name === e.type ? o.push(a) : j.isNotEmpty(a.key) && (o = o.concat(r.filter(function(s) {
return e._isMatched(s, a.key);
}).map(function(s) {
return s.vnode;
})));
}), o;
}
}]), n;
}(), k = 0;
function wt() {
var n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "pv_id_";
return k++, "".concat(n).concat(k);
}
function dt(n) {
return pt(n) || yt(n) || ht(n) || gt();
}
function gt() {
throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function ht(n, t) {
if (n) {
if (typeof n == "string")
return F(n, t);
var e = Object.prototype.toString.call(n).slice(8, -1);
if (e === "Object" && n.constructor && (e = n.constructor.name), e === "Map" || e === "Set")
return Array.from(n);
if (e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))
return F(n, t);
}
}
function yt(n) {
if (typeof Symbol < "u" && n[Symbol.iterator] != null || n["@@iterator"] != null)
return Array.from(n);
}
function pt(n) {
if (Array.isArray(n))
return F(n);
}
function F(n, t) {
(t == null || t > n.length) && (t = n.length);
for (var e = 0, r = new Array(t); e < t; e++)
r[e] = n[e];
return r;
}
function vt() {
var n = [], t = function(s, u) {
var l = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 999, f = i(s, u, l), c = f.value + (f.key === s ? 0 : l) + 1;
return n.push({
key: s,
value: c
}), c;
}, e = function(s) {
n = n.filter(function(u) {
return u.value !== s;
});
}, r = function(s, u) {
return i(s, u).value;
}, i = function(s, u) {
var l = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
return dt(n).reverse().find(function(f) {
return u ? !0 : f.key === s;
}) || {
key: s,
value: l
};
}, o = function(s) {
return s && parseInt(s.style.zIndex, 10) || 0;
};
return {
get: o,
set: function(s, u, l) {
u && (u.style.zIndex = String(t(s, !0, l)));
},
clear: function(s) {
s && (e(o(s)), s.style.zIndex = "");
},
getCurrent: function(s) {
return r(s, !0);
}
};
}
var Et = vt();
export {
bt as C,
K as D,
j as O,
wt as U,
Et as Z,
St as _,
mt as p
};