@ampgroep/vuetify-query-builder
Version:
1,761 lines • 253 kB
JavaScript
var Fi = Object.defineProperty;
var Ri = (e, t, n) => t in e ? Fi(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
var Gt = (e, t, n) => (Ri(e, typeof t != "symbol" ? t + "" : t, n), n);
import { Fragment as se, reactive as cn, computed as h, watchEffect as He, toRefs as na, capitalize as la, isVNode as Mi, Comment as $i, shallowRef as G, unref as xe, warn as dn, getCurrentInstance as Di, ref as H, provide as Re, inject as be, defineComponent as zn, camelize as aa, h as fn, TransitionGroup as Hn, Transition as ot, createVNode as u, mergeProps as Q, isRef as yt, toRef as z, Text as Ni, watch as U, onBeforeMount as ia, nextTick as pe, onBeforeUnmount as De, withDirectives as Fe, resolveDirective as St, vShow as Ct, onScopeDispose as Ie, effectScope as jn, toRaw as ue, onMounted as pt, onUpdated as zi, readonly as qn, resolveDynamicComponent as Hi, Teleport as ji, onDeactivated as qi, cloneVNode as Wi, createTextVNode as en, openBlock as he, createElementBlock as Te, normalizeStyle as Gi, createElementVNode as Le, createBlock as vt, withCtx as gt, toDisplayString as fl, createCommentVNode as Ue, resolveComponent as vl, renderList as ml } from "vue";
const Ui = {
name: "QueryBuilderRule",
data() {
return {
operator: this.getOperator()
};
},
props: {
rule: {
type: Object,
required: !0
},
id: {
type: Number,
required: !0
},
fields: {
type: Array,
required: !0
},
operators: {
type: Object,
required: !0
}
},
computed: {
value: {
get: function() {
let e = this.rule.query.value;
if (this.operator.type === "array") {
if (typeof e != "object")
try {
typeof e == "string" ? e = [...new Set(JSON.parse(e))] : e = [e];
} catch {
e = [];
}
typeof e == "object" && (e == null || e.sort());
} else if (this.operator.type === "regexp")
return e ? e.toString().replace(/^\/|\/g$/g, "") : "";
return e;
},
set: function(e) {
if (typeof e == "object")
e = JSON.stringify(e);
else if (this.operator.type === "regexp") {
if (!this.validRegexp(e.toString()))
return;
e = "/" + e + "/g";
}
this.rule.query.value = e;
}
},
hideValue() {
return this.operator.type === "none";
},
showTextField() {
return this.operator.type === "string";
},
showCombobox() {
return this.operator.type === "array";
},
showRegexpField() {
return this.operator.type === "regexp";
},
showPlaceHolder() {
return this.operator.type === "placeholder";
}
},
watch: {
operator(e, t) {
e.type !== t.type && (this.value = ""), this.rule.query.operator = e.value;
}
},
methods: {
removeRule() {
this.$emit("remove-rule", this.id);
},
validRegexp(e) {
try {
return new RegExp(e), !0;
} catch {
return !1;
}
},
validRegexpInput(e) {
return this.validRegexp(e) || "Invalid regexp format";
},
getOperator() {
let e = this.rule.query.value;
if (typeof this.rule.query.value == "string")
try {
e = JSON.parse((e == null ? void 0 : e.toString()) ?? "");
} catch {
e = this.rule.query.value;
}
const t = this.rule.query.operator.toLowerCase(), n = typeof e != "object", l = t === "in" || t === "not in";
return this.operators.find(
(a) => a.value === t && (n && l ? a.type === "placeholder" : !0)
) ?? this.operators[0];
}
}
}, oa = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M9,3V4H4V6H5V19A2,2%200%200,0%207,21H17A2,2%200%200,0%2019,19V6H20V4H15V3H9M9,8H11V17H9V8M13,8H15V17H13V8Z'%20/%3e%3c/svg%3e", ra = (e, t) => {
const n = e.__vccOpts || e;
for (const [l, a] of t)
n[l] = a;
return n;
}, me = typeof window < "u", Wn = me && "IntersectionObserver" in window;
function sa(e, t, n) {
const l = t.length - 1;
if (l < 0)
return e === void 0 ? n : e;
for (let a = 0; a < l; a++) {
if (e == null)
return n;
e = e[t[a]];
}
return e == null || e[t[l]] === void 0 ? n : e[t[l]];
}
function wt(e, t) {
if (e === t)
return !0;
if (e instanceof Date && t instanceof Date && e.getTime() !== t.getTime() || e !== Object(e) || t !== Object(t))
return !1;
const n = Object.keys(e);
return n.length !== Object.keys(t).length ? !1 : n.every((l) => wt(e[l], t[l]));
}
function Ki(e, t, n) {
return e == null || !t || typeof t != "string" ? n : e[t] !== void 0 ? e[t] : (t = t.replace(/\[(\w+)\]/g, ".$1"), t = t.replace(/^\./, ""), sa(e, t.split("."), n));
}
function Me(e, t, n) {
if (t === !0)
return e === void 0 ? n : e;
if (t == null || typeof t == "boolean")
return n;
if (e !== Object(e)) {
if (typeof t != "function")
return n;
const a = t(e, n);
return typeof a > "u" ? n : a;
}
if (typeof t == "string")
return Ki(e, t, n);
if (Array.isArray(t))
return sa(e, t, n);
if (typeof t != "function")
return n;
const l = t(e, n);
return typeof l > "u" ? n : l;
}
function X(e) {
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "px";
if (!(e == null || e === ""))
return isNaN(+e) ? String(e) : isFinite(+e) ? `${Number(e)}${t}` : void 0;
}
function Pn(e) {
return e !== null && typeof e == "object" && !Array.isArray(e);
}
function ua(e) {
if (e && "$el" in e) {
const t = e.$el;
return (t == null ? void 0 : t.nodeType) === Node.TEXT_NODE ? t.nextElementSibling : t;
}
return e;
}
const gl = Object.freeze({
enter: 13,
tab: 9,
delete: 46,
esc: 27,
space: 32,
up: 38,
down: 40,
left: 37,
right: 39,
end: 35,
home: 36,
del: 46,
backspace: 8,
insert: 45,
pageup: 33,
pagedown: 34,
shift: 16
});
function Sn(e, t) {
return t.every((n) => e.hasOwnProperty(n));
}
function ca(e, t) {
const n = {}, l = new Set(Object.keys(e));
for (const a of t)
l.has(a) && (n[a] = e[a]);
return n;
}
function yl(e, t, n) {
const l = /* @__PURE__ */ Object.create(null), a = /* @__PURE__ */ Object.create(null);
for (const i in e)
t.some((o) => o instanceof RegExp ? o.test(i) : o === i) && !(n != null && n.some((o) => o === i)) ? l[i] = e[i] : a[i] = e[i];
return [l, a];
}
function st(e, t) {
const n = {
...e
};
return t.forEach((l) => delete n[l]), n;
}
function Yi(e, t) {
const n = {};
return t.forEach((l) => n[l] = e[l]), n;
}
const da = /^on[^a-z]/, Gn = (e) => da.test(e), Xi = ["onAfterscriptexecute", "onAnimationcancel", "onAnimationend", "onAnimationiteration", "onAnimationstart", "onAuxclick", "onBeforeinput", "onBeforescriptexecute", "onChange", "onClick", "onCompositionend", "onCompositionstart", "onCompositionupdate", "onContextmenu", "onCopy", "onCut", "onDblclick", "onFocusin", "onFocusout", "onFullscreenchange", "onFullscreenerror", "onGesturechange", "onGestureend", "onGesturestart", "onGotpointercapture", "onInput", "onKeydown", "onKeypress", "onKeyup", "onLostpointercapture", "onMousedown", "onMousemove", "onMouseout", "onMouseover", "onMouseup", "onMousewheel", "onPaste", "onPointercancel", "onPointerdown", "onPointerenter", "onPointerleave", "onPointermove", "onPointerout", "onPointerover", "onPointerup", "onReset", "onSelect", "onSubmit", "onTouchcancel", "onTouchend", "onTouchmove", "onTouchstart", "onTransitioncancel", "onTransitionend", "onTransitionrun", "onTransitionstart", "onWheel"], Qi = ["ArrowUp", "ArrowDown", "ArrowRight", "ArrowLeft", "Enter", "Escape", "Tab", " "];
function Ji(e) {
return e.isComposing && Qi.includes(e.key);
}
function fa(e) {
const [t, n] = yl(e, [da]), l = st(t, Xi), [a, i] = yl(n, ["class", "style", "id", /^data-/]);
return Object.assign(a, t), Object.assign(i, l), [a, i];
}
function ke(e) {
return e == null ? [] : Array.isArray(e) ? e : [e];
}
function Zi(e, t) {
let n = 0;
const l = function() {
for (var a = arguments.length, i = new Array(a), o = 0; o < a; o++)
i[o] = arguments[o];
clearTimeout(n), n = setTimeout(() => e(...i), xe(t));
};
return l.clear = () => {
clearTimeout(n);
}, l.immediate = e, l;
}
function Ye(e) {
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1;
return Math.max(t, Math.min(n, e));
}
function hl(e, t) {
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "0";
return e + n.repeat(Math.max(0, t - e.length));
}
function eo(e) {
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1;
const n = [];
let l = 0;
for (; l < e.length; )
n.push(e.substr(l, t)), l += t;
return n;
}
function ze() {
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = arguments.length > 2 ? arguments[2] : void 0;
const l = {};
for (const a in e)
l[a] = e[a];
for (const a in t) {
const i = e[a], o = t[a];
if (Pn(i) && Pn(o)) {
l[a] = ze(i, o, n);
continue;
}
if (Array.isArray(i) && Array.isArray(o) && n) {
l[a] = n(i, o);
continue;
}
l[a] = o;
}
return l;
}
function va(e) {
return e.map((t) => t.type === se ? va(t.children) : t).flat();
}
function nt() {
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
if (nt.cache.has(e))
return nt.cache.get(e);
const t = e.replace(/[^a-z]/gi, "-").replace(/\B([A-Z])/g, "-$1").toLowerCase();
return nt.cache.set(e, t), t;
}
nt.cache = /* @__PURE__ */ new Map();
function At(e, t) {
if (!t || typeof t != "object")
return [];
if (Array.isArray(t))
return t.map((n) => At(e, n)).flat(1);
if (t.suspense)
return At(e, t.ssContent);
if (Array.isArray(t.children))
return t.children.map((n) => At(e, n)).flat(1);
if (t.component) {
if (Object.getOwnPropertySymbols(t.component.provides).includes(e))
return [t.component];
if (t.component.subTree)
return At(e, t.component.subTree).flat(1);
}
return [];
}
function Un(e) {
const t = cn({}), n = h(e);
return He(() => {
for (const l in n.value)
t[l] = n.value[l];
}, {
flush: "sync"
}), na(t);
}
function tn(e, t) {
return e.includes(t);
}
function ma(e) {
return e[2].toLowerCase() + e.slice(3);
}
const Ve = () => [Function, Array];
function bl(e, t) {
return t = "on" + la(t), !!(e[t] || e[`${t}Once`] || e[`${t}Capture`] || e[`${t}OnceCapture`] || e[`${t}CaptureOnce`]);
}
function to(e) {
for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), l = 1; l < t; l++)
n[l - 1] = arguments[l];
if (Array.isArray(e))
for (const a of e)
a(...n);
else
typeof e == "function" && e(...n);
}
function nn(e) {
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
const n = ["button", "[href]", 'input:not([type="hidden"])', "select", "textarea", "[tabindex]"].map((l) => `${l}${t ? ':not([tabindex="-1"])' : ""}:not([disabled])`).join(", ");
return [...e.querySelectorAll(n)];
}
function ga(e, t, n) {
let l, a = e.indexOf(document.activeElement);
const i = t === "next" ? 1 : -1;
do
a += i, l = e[a];
while ((!l || l.offsetParent == null || !((n == null ? void 0 : n(l)) ?? !0)) && a < e.length && a >= 0);
return l;
}
function Et(e, t) {
var l, a, i, o;
const n = nn(e);
if (!t)
(e === document.activeElement || !e.contains(document.activeElement)) && ((l = n[0]) == null || l.focus());
else if (t === "first")
(a = n[0]) == null || a.focus();
else if (t === "last")
(i = n.at(-1)) == null || i.focus();
else if (typeof t == "number")
(o = n[t]) == null || o.focus();
else {
const r = ga(n, t);
r ? r.focus() : Et(e, t === "next" ? "first" : "last");
}
}
function no() {
}
function ln(e, t) {
if (!(me && typeof CSS < "u" && typeof CSS.supports < "u" && CSS.supports(`selector(${t})`)))
return null;
try {
return !!e && e.matches(t);
} catch {
return null;
}
}
function Kn(e) {
return e.some((t) => Mi(t) ? t.type === $i ? !1 : t.type !== se || Kn(t.children) : !0) ? e : null;
}
function lo(e, t) {
if (!me || e === 0)
return t(), () => {
};
const n = window.setTimeout(t, e);
return () => window.clearTimeout(n);
}
function ao(e, t) {
const n = e.clientX, l = e.clientY, a = t.getBoundingClientRect(), i = a.left, o = a.top, r = a.right, s = a.bottom;
return n >= i && n <= r && l >= o && l <= s;
}
function En() {
const e = G(), t = (n) => {
e.value = n;
};
return Object.defineProperty(t, "value", {
enumerable: !0,
get: () => e.value,
set: (n) => e.value = n
}), Object.defineProperty(t, "el", {
enumerable: !0,
get: () => ua(e.value)
}), t;
}
function On(e) {
const t = e.key.length === 1, n = !e.ctrlKey && !e.metaKey && !e.altKey;
return t && n;
}
const ya = ["top", "bottom"], io = ["start", "end", "left", "right"];
function Bn(e, t) {
let [n, l] = e.split(" ");
return l || (l = tn(ya, n) ? "start" : tn(io, n) ? "top" : "center"), {
side: Sl(n, t),
align: Sl(l, t)
};
}
function Sl(e, t) {
return e === "start" ? t ? "right" : "left" : e === "end" ? t ? "left" : "right" : e;
}
function Cn(e) {
return {
side: {
center: "center",
top: "bottom",
bottom: "top",
left: "right",
right: "left"
}[e.side],
align: e.align
};
}
function pn(e) {
return {
side: e.side,
align: {
center: "center",
top: "bottom",
bottom: "top",
left: "right",
right: "left"
}[e.align]
};
}
function Cl(e) {
return {
side: e.align,
align: e.side
};
}
function pl(e) {
return tn(ya, e.side) ? "y" : "x";
}
class lt {
constructor(t) {
let {
x: n,
y: l,
width: a,
height: i
} = t;
this.x = n, this.y = l, this.width = a, this.height = i;
}
get top() {
return this.y;
}
get bottom() {
return this.y + this.height;
}
get left() {
return this.x;
}
get right() {
return this.x + this.width;
}
}
function wl(e, t) {
return {
x: {
before: Math.max(0, t.left - e.left),
after: Math.max(0, e.right - t.right)
},
y: {
before: Math.max(0, t.top - e.top),
after: Math.max(0, e.bottom - t.bottom)
}
};
}
function ha(e) {
return Array.isArray(e) ? new lt({
x: e[0],
y: e[1],
width: 0,
height: 0
}) : e.getBoundingClientRect();
}
function Yn(e) {
const t = e.getBoundingClientRect(), n = getComputedStyle(e), l = n.transform;
if (l) {
let a, i, o, r, s;
if (l.startsWith("matrix3d("))
a = l.slice(9, -1).split(/, /), i = +a[0], o = +a[5], r = +a[12], s = +a[13];
else if (l.startsWith("matrix("))
a = l.slice(7, -1).split(/, /), i = +a[0], o = +a[3], r = +a[4], s = +a[5];
else
return new lt(t);
const c = n.transformOrigin, v = t.x - r - (1 - i) * parseFloat(c), m = t.y - s - (1 - o) * parseFloat(c.slice(c.indexOf(" ") + 1)), f = i ? t.width / i : e.offsetWidth + 1, d = o ? t.height / o : e.offsetHeight + 1;
return new lt({
x: v,
y: m,
width: f,
height: d
});
} else
return new lt(t);
}
function mt(e, t, n) {
if (typeof e.animate > "u")
return {
finished: Promise.resolve()
};
let l;
try {
l = e.animate(t, n);
} catch {
return {
finished: Promise.resolve()
};
}
return typeof l.finished > "u" && (l.finished = new Promise((a) => {
l.onfinish = () => {
a(l);
};
})), l;
}
const Xt = /* @__PURE__ */ new WeakMap();
function oo(e, t) {
Object.keys(t).forEach((n) => {
if (Gn(n)) {
const l = ma(n), a = Xt.get(e);
if (t[n] == null)
a == null || a.forEach((i) => {
const [o, r] = i;
o === l && (e.removeEventListener(l, r), a.delete(i));
});
else if (!a || ![...a].some((i) => i[0] === l && i[1] === t[n])) {
e.addEventListener(l, t[n]);
const i = a || /* @__PURE__ */ new Set();
i.add([l, t[n]]), Xt.has(e) || Xt.set(e, i);
}
} else
t[n] == null ? e.removeAttribute(n) : e.setAttribute(n, t[n]);
});
}
function ro(e, t) {
Object.keys(t).forEach((n) => {
if (Gn(n)) {
const l = ma(n), a = Xt.get(e);
a == null || a.forEach((i) => {
const [o, r] = i;
o === l && (e.removeEventListener(l, r), a.delete(i));
});
} else
e.removeAttribute(n);
});
}
const ft = 2.4, xl = 0.2126729, kl = 0.7151522, Vl = 0.072175, so = 0.55, uo = 0.58, co = 0.57, fo = 0.62, Ut = 0.03, Il = 1.45, vo = 5e-4, mo = 1.25, go = 1.25, _l = 0.078, Al = 12.82051282051282, Kt = 0.06, Pl = 1e-3;
function El(e, t) {
const n = (e.r / 255) ** ft, l = (e.g / 255) ** ft, a = (e.b / 255) ** ft, i = (t.r / 255) ** ft, o = (t.g / 255) ** ft, r = (t.b / 255) ** ft;
let s = n * xl + l * kl + a * Vl, c = i * xl + o * kl + r * Vl;
if (s <= Ut && (s += (Ut - s) ** Il), c <= Ut && (c += (Ut - c) ** Il), Math.abs(c - s) < vo)
return 0;
let v;
if (c > s) {
const m = (c ** so - s ** uo) * mo;
v = m < Pl ? 0 : m < _l ? m - m * Al * Kt : m - Kt;
} else {
const m = (c ** fo - s ** co) * go;
v = m > -Pl ? 0 : m > -_l ? m - m * Al * Kt : m + Kt;
}
return v * 100;
}
function at(e) {
dn(`Vuetify: ${e}`);
}
function yo(e) {
dn(`Vuetify error: ${e}`);
}
function ho(e, t) {
t = Array.isArray(t) ? t.slice(0, -1).map((n) => `'${n}'`).join(", ") + ` or '${t.at(-1)}'` : `'${t}'`, dn(`[Vuetify UPGRADE] '${e}' is deprecated, use ${t} instead.`);
}
function Tn(e) {
return !!e && /^(#|var\(--|(rgb|hsl)a?\()/.test(e);
}
function bo(e) {
return Tn(e) && !/^((rgb|hsl)a?\()?var\(--/.test(e);
}
const Ol = /^(?<fn>(?:rgb|hsl)a?)\((?<values>.+)\)/, So = {
rgb: (e, t, n, l) => ({
r: e,
g: t,
b: n,
a: l
}),
rgba: (e, t, n, l) => ({
r: e,
g: t,
b: n,
a: l
}),
hsl: (e, t, n, l) => Bl({
h: e,
s: t,
l: n,
a: l
}),
hsla: (e, t, n, l) => Bl({
h: e,
s: t,
l: n,
a: l
}),
hsv: (e, t, n, l) => Ot({
h: e,
s: t,
v: n,
a: l
}),
hsva: (e, t, n, l) => Ot({
h: e,
s: t,
v: n,
a: l
})
};
function Pt(e) {
if (typeof e == "number")
return (isNaN(e) || e < 0 || e > 16777215) && at(`'${e}' is not a valid hex color`), {
r: (e & 16711680) >> 16,
g: (e & 65280) >> 8,
b: e & 255
};
if (typeof e == "string" && Ol.test(e)) {
const {
groups: t
} = e.match(Ol), {
fn: n,
values: l
} = t, a = l.split(/,\s*/).map((i) => i.endsWith("%") && ["hsl", "hsla", "hsv", "hsva"].includes(n) ? parseFloat(i) / 100 : parseFloat(i));
return So[n](...a);
} else if (typeof e == "string") {
let t = e.startsWith("#") ? e.slice(1) : e;
[3, 4].includes(t.length) ? t = t.split("").map((l) => l + l).join("") : [6, 8].includes(t.length) || at(`'${e}' is not a valid hex(a) color`);
const n = parseInt(t, 16);
return (isNaN(n) || n < 0 || n > 4294967295) && at(`'${e}' is not a valid hex(a) color`), Co(t);
} else if (typeof e == "object") {
if (Sn(e, ["r", "g", "b"]))
return e;
if (Sn(e, ["h", "s", "l"]))
return Ot(ba(e));
if (Sn(e, ["h", "s", "v"]))
return Ot(e);
}
throw new TypeError(`Invalid color: ${e == null ? e : String(e) || e.constructor.name}
Expected #hex, #hexa, rgb(), rgba(), hsl(), hsla(), object or number`);
}
function Ot(e) {
const {
h: t,
s: n,
v: l,
a
} = e, i = (r) => {
const s = (r + t / 60) % 6;
return l - l * n * Math.max(Math.min(s, 4 - s, 1), 0);
}, o = [i(5), i(3), i(1)].map((r) => Math.round(r * 255));
return {
r: o[0],
g: o[1],
b: o[2],
a
};
}
function Bl(e) {
return Ot(ba(e));
}
function ba(e) {
const {
h: t,
s: n,
l,
a
} = e, i = l + n * Math.min(l, 1 - l), o = i === 0 ? 0 : 2 - 2 * l / i;
return {
h: t,
s: o,
v: i,
a
};
}
function Co(e) {
e = po(e);
let [t, n, l, a] = eo(e, 2).map((i) => parseInt(i, 16));
return a = a === void 0 ? a : a / 255, {
r: t,
g: n,
b: l,
a
};
}
function po(e) {
return e.startsWith("#") && (e = e.slice(1)), e = e.replace(/([^0-9a-f])/gi, "F"), (e.length === 3 || e.length === 4) && (e = e.split("").map((t) => t + t).join("")), e.length !== 6 && (e = hl(hl(e, 6), 8, "F")), e;
}
function wo(e) {
const t = Math.abs(El(Pt(0), Pt(e)));
return Math.abs(El(Pt(16777215), Pt(e))) > Math.min(t, 50) ? "#fff" : "#000";
}
function F(e, t) {
return (n) => Object.keys(e).reduce((l, a) => {
const o = typeof e[a] == "object" && e[a] != null && !Array.isArray(e[a]) ? e[a] : {
type: e[a]
};
return n && a in n ? l[a] = {
...o,
default: n[a]
} : l[a] = o, t && !l[a].source && (l[a].source = t), l;
}, {});
}
const ae = F({
class: [String, Array, Object],
style: {
type: [String, Array, Object],
default: null
}
}, "component");
function ge(e, t) {
const n = Di();
if (!n)
throw new Error(`[Vuetify] ${e} must be called from inside a setup function`);
return n;
}
function Ne() {
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "composables";
const t = ge(e).type;
return nt((t == null ? void 0 : t.aliasName) || (t == null ? void 0 : t.name));
}
let Sa = 0, Qt = /* @__PURE__ */ new WeakMap();
function je() {
const e = ge("getUid");
if (Qt.has(e))
return Qt.get(e);
{
const t = Sa++;
return Qt.set(e, t), t;
}
}
je.reset = () => {
Sa = 0, Qt = /* @__PURE__ */ new WeakMap();
};
function xo(e) {
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ge("injectSelf");
const {
provides: n
} = t;
if (n && e in n)
return n[e];
}
const an = Symbol.for("vuetify:defaults");
function Xn() {
const e = be(an);
if (!e)
throw new Error("[Vuetify] Could not find defaults instance");
return e;
}
function Mt(e, t) {
const n = Xn(), l = H(e), a = h(() => {
if (xe(t == null ? void 0 : t.disabled))
return n.value;
const o = xe(t == null ? void 0 : t.scoped), r = xe(t == null ? void 0 : t.reset), s = xe(t == null ? void 0 : t.root);
if (l.value == null && !(o || r || s))
return n.value;
let c = ze(l.value, {
prev: n.value
});
if (o)
return c;
if (r || s) {
const v = Number(r || 1 / 0);
for (let m = 0; m <= v && !(!c || !("prev" in c)); m++)
c = c.prev;
return c && typeof s == "string" && s in c && (c = ze(ze(c, {
prev: c
}), c[s])), c;
}
return c.prev ? ze(c.prev, c) : c;
});
return Re(an, a), a;
}
function ko(e, t) {
var n, l;
return typeof ((n = e.props) == null ? void 0 : n[t]) < "u" || typeof ((l = e.props) == null ? void 0 : l[nt(t)]) < "u";
}
function Vo() {
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Xn();
const l = ge("useDefaults");
if (t = t ?? l.type.name ?? l.type.__name, !t)
throw new Error("[Vuetify] Could not determine component name");
const a = h(() => {
var s;
return (s = n.value) == null ? void 0 : s[e._as ?? t];
}), i = new Proxy(e, {
get(s, c) {
var m, f, d, g, y, b, S;
const v = Reflect.get(s, c);
return c === "class" || c === "style" ? [(m = a.value) == null ? void 0 : m[c], v].filter((A) => A != null) : typeof c == "string" && !ko(l.vnode, c) ? ((f = a.value) == null ? void 0 : f[c]) !== void 0 ? (d = a.value) == null ? void 0 : d[c] : ((y = (g = n.value) == null ? void 0 : g.global) == null ? void 0 : y[c]) !== void 0 ? (S = (b = n.value) == null ? void 0 : b.global) == null ? void 0 : S[c] : v : v;
}
}), o = G();
He(() => {
if (a.value) {
const s = Object.entries(a.value).filter((c) => {
let [v] = c;
return v.startsWith(v[0].toUpperCase());
});
o.value = s.length ? Object.fromEntries(s) : void 0;
} else
o.value = void 0;
});
function r() {
const s = xo(an, l);
Re(an, h(() => o.value ? ze((s == null ? void 0 : s.value) ?? {}, o.value) : s == null ? void 0 : s.value));
}
return {
props: i,
provideSubDefaults: r
};
}
function $t(e) {
if (e._setup = e._setup ?? e.setup, !e.name)
return at("The component is missing an explicit name, unable to generate default prop value"), e;
if (e._setup) {
e.props = F(e.props ?? {}, e.name)();
const t = Object.keys(e.props).filter((n) => n !== "class" && n !== "style");
e.filterProps = function(l) {
return ca(l, t);
}, e.props._as = String, e.setup = function(l, a) {
const i = Xn();
if (!i.value)
return e._setup(l, a);
const {
props: o,
provideSubDefaults: r
} = Vo(l, l._as ?? e.name, i), s = e._setup(o, a);
return r(), s;
};
}
return e;
}
function K() {
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0;
return (t) => (e ? $t : zn)(t);
}
function Io(e) {
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "div", n = arguments.length > 2 ? arguments[2] : void 0;
return K()({
name: n ?? la(aa(e.replace(/__/g, "-"))),
props: {
tag: {
type: String,
default: t
},
...ae()
},
setup(l, a) {
let {
slots: i
} = a;
return () => {
var o;
return fn(l.tag, {
class: [e, l.class],
style: l.style
}, (o = i.default) == null ? void 0 : o.call(i));
};
}
});
}
function Ca(e) {
if (typeof e.getRootNode != "function") {
for (; e.parentNode; )
e = e.parentNode;
return e !== document ? null : document;
}
const t = e.getRootNode();
return t !== document && t.getRootNode({
composed: !0
}) !== document ? null : t;
}
const on = "cubic-bezier(0.4, 0, 0.2, 1)", _o = "cubic-bezier(0.0, 0, 0.2, 1)", Ao = "cubic-bezier(0.4, 0, 1, 1)";
function pa(e) {
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
for (; e; ) {
if (t ? Po(e) : Qn(e))
return e;
e = e.parentElement;
}
return document.scrollingElement;
}
function rn(e, t) {
const n = [];
if (t && e && !t.contains(e))
return n;
for (; e && (Qn(e) && n.push(e), e !== t); )
e = e.parentElement;
return n;
}
function Qn(e) {
if (!e || e.nodeType !== Node.ELEMENT_NODE)
return !1;
const t = window.getComputedStyle(e);
return t.overflowY === "scroll" || t.overflowY === "auto" && e.scrollHeight > e.clientHeight;
}
function Po(e) {
if (!e || e.nodeType !== Node.ELEMENT_NODE)
return !1;
const t = window.getComputedStyle(e);
return ["scroll", "auto"].includes(t.overflowY);
}
function Eo(e) {
for (; e; ) {
if (window.getComputedStyle(e).position === "fixed")
return !0;
e = e.offsetParent;
}
return !1;
}
function ee(e) {
const t = ge("useRender");
t.render = e;
}
const Oo = F({
disabled: Boolean,
group: Boolean,
hideOnLeave: Boolean,
leaveAbsolute: Boolean,
mode: String,
origin: String
}, "transition");
function Oe(e, t, n) {
return K()({
name: e,
props: Oo({
mode: n,
origin: t
}),
setup(l, a) {
let {
slots: i
} = a;
const o = {
onBeforeEnter(r) {
l.origin && (r.style.transformOrigin = l.origin);
},
onLeave(r) {
if (l.leaveAbsolute) {
const {
offsetTop: s,
offsetLeft: c,
offsetWidth: v,
offsetHeight: m
} = r;
r._transitionInitialStyles = {
position: r.style.position,
top: r.style.top,
left: r.style.left,
width: r.style.width,
height: r.style.height
}, r.style.position = "absolute", r.style.top = `${s}px`, r.style.left = `${c}px`, r.style.width = `${v}px`, r.style.height = `${m}px`;
}
l.hideOnLeave && r.style.setProperty("display", "none", "important");
},
onAfterLeave(r) {
if (l.leaveAbsolute && (r != null && r._transitionInitialStyles)) {
const {
position: s,
top: c,
left: v,
width: m,
height: f
} = r._transitionInitialStyles;
delete r._transitionInitialStyles, r.style.position = s || "", r.style.top = c || "", r.style.left = v || "", r.style.width = m || "", r.style.height = f || "";
}
}
};
return () => {
const r = l.group ? Hn : ot;
return fn(r, {
name: l.disabled ? "" : e,
css: !l.disabled,
...l.group ? void 0 : {
mode: l.mode
},
...l.disabled ? {} : o
}, i.default);
};
}
});
}
function wa(e, t) {
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "in-out";
return K()({
name: e,
props: {
mode: {
type: String,
default: n
},
disabled: Boolean,
group: Boolean
},
setup(l, a) {
let {
slots: i
} = a;
const o = l.group ? Hn : ot;
return () => fn(o, {
name: l.disabled ? "" : e,
css: !l.disabled,
// mode: props.mode, // TODO: vuejs/vue-next#3104
...l.disabled ? {} : t
}, i.default);
}
});
}
function xa() {
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
const n = (arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1) ? "width" : "height", l = aa(`offset-${n}`);
return {
onBeforeEnter(o) {
o._parent = o.parentNode, o._initialStyle = {
transition: o.style.transition,
overflow: o.style.overflow,
[n]: o.style[n]
};
},
onEnter(o) {
const r = o._initialStyle;
o.style.setProperty("transition", "none", "important"), o.style.overflow = "hidden";
const s = `${o[l]}px`;
o.style[n] = "0", o.offsetHeight, o.style.transition = r.transition, e && o._parent && o._parent.classList.add(e), requestAnimationFrame(() => {
o.style[n] = s;
});
},
onAfterEnter: i,
onEnterCancelled: i,
onLeave(o) {
o._initialStyle = {
transition: "",
overflow: o.style.overflow,
[n]: o.style[n]
}, o.style.overflow = "hidden", o.style[n] = `${o[l]}px`, o.offsetHeight, requestAnimationFrame(() => o.style[n] = "0");
},
onAfterLeave: a,
onLeaveCancelled: a
};
function a(o) {
e && o._parent && o._parent.classList.remove(e), i(o);
}
function i(o) {
const r = o._initialStyle[n];
o.style.overflow = o._initialStyle.overflow, r != null && (o.style[n] = r), delete o._initialStyle;
}
}
const Bo = F({
target: [Object, Array]
}, "v-dialog-transition"), ka = K()({
name: "VDialogTransition",
props: Bo(),
setup(e, t) {
let {
slots: n
} = t;
const l = {
onBeforeEnter(a) {
a.style.pointerEvents = "none", a.style.visibility = "hidden";
},
async onEnter(a, i) {
var f;
await new Promise((d) => requestAnimationFrame(d)), await new Promise((d) => requestAnimationFrame(d)), a.style.visibility = "";
const {
x: o,
y: r,
sx: s,
sy: c,
speed: v
} = Ll(e.target, a), m = mt(a, [{
transform: `translate(${o}px, ${r}px) scale(${s}, ${c})`,
opacity: 0
}, {}], {
duration: 225 * v,
easing: _o
});
(f = Tl(a)) == null || f.forEach((d) => {
mt(d, [{
opacity: 0
}, {
opacity: 0,
offset: 0.33
}, {}], {
duration: 225 * 2 * v,
easing: on
});
}), m.finished.then(() => i());
},
onAfterEnter(a) {
a.style.removeProperty("pointer-events");
},
onBeforeLeave(a) {
a.style.pointerEvents = "none";
},
async onLeave(a, i) {
var f;
await new Promise((d) => requestAnimationFrame(d));
const {
x: o,
y: r,
sx: s,
sy: c,
speed: v
} = Ll(e.target, a);
mt(a, [{}, {
transform: `translate(${o}px, ${r}px) scale(${s}, ${c})`,
opacity: 0
}], {
duration: 125 * v,
easing: Ao
}).finished.then(() => i()), (f = Tl(a)) == null || f.forEach((d) => {
mt(d, [{}, {
opacity: 0,
offset: 0.2
}, {
opacity: 0
}], {
duration: 125 * 2 * v,
easing: on
});
});
},
onAfterLeave(a) {
a.style.removeProperty("pointer-events");
}
};
return () => e.target ? u(ot, Q({
name: "dialog-transition"
}, l, {
css: !1
}), n) : u(ot, {
name: "dialog-transition"
}, n);
}
});
function Tl(e) {
var n;
const t = (n = e.querySelector(":scope > .v-card, :scope > .v-sheet, :scope > .v-list")) == null ? void 0 : n.children;
return t && [...t];
}
function Ll(e, t) {
const n = ha(e), l = Yn(t), [a, i] = getComputedStyle(t).transformOrigin.split(" ").map((S) => parseFloat(S)), [o, r] = getComputedStyle(t).getPropertyValue("--v-overlay-anchor-origin").split(" ");
let s = n.left + n.width / 2;
o === "left" || r === "left" ? s -= n.width / 2 : (o === "right" || r === "right") && (s += n.width / 2);
let c = n.top + n.height / 2;
o === "top" || r === "top" ? c -= n.height / 2 : (o === "bottom" || r === "bottom") && (c += n.height / 2);
const v = n.width / l.width, m = n.height / l.height, f = Math.max(1, v, m), d = v / f || 0, g = m / f || 0, y = l.width * l.height / (window.innerWidth * window.innerHeight), b = y > 0.12 ? Math.min(1.5, (y - 0.12) * 10 + 1) : 1;
return {
x: s - (a + l.left),
y: c - (i + l.top),
sx: d,
sy: g,
speed: b
};
}
Oe("fab-transition", "center center", "out-in");
Oe("dialog-bottom-transition");
Oe("dialog-top-transition");
const Fl = Oe("fade-transition");
Oe("scale-transition");
Oe("scroll-x-transition");
Oe("scroll-x-reverse-transition");
Oe("scroll-y-transition");
Oe("scroll-y-reverse-transition");
Oe("slide-x-transition");
Oe("slide-x-reverse-transition");
const Va = Oe("slide-y-transition");
Oe("slide-y-reverse-transition");
const To = wa("expand-transition", xa()), Ia = wa("expand-x-transition", xa("", !0)), Lo = F({
defaults: Object,
disabled: Boolean,
reset: [Number, String],
root: [Boolean, String],
scoped: Boolean
}, "VDefaultsProvider"), Ce = K(!1)({
name: "VDefaultsProvider",
props: Lo(),
setup(e, t) {
let {
slots: n
} = t;
const {
defaults: l,
disabled: a,
reset: i,
root: o,
scoped: r
} = na(e);
return Mt(l, {
reset: i,
root: o,
scoped: r,
disabled: a
}), () => {
var s;
return (s = n.default) == null ? void 0 : s.call(n);
};
}
});
function Jn(e) {
return Un(() => {
const t = [], n = {};
if (e.value.background)
if (Tn(e.value.background)) {
if (n.backgroundColor = e.value.background, !e.value.text && bo(e.value.background)) {
const l = Pt(e.value.background);
if (l.a == null || l.a === 1) {
const a = wo(l);
n.color = a, n.caretColor = a;
}
}
} else
t.push(`bg-${e.value.background}`);
return e.value.text && (Tn(e.value.text) ? (n.color = e.value.text, n.caretColor = e.value.text) : t.push(`text-${e.value.text}`)), {
colorClasses: t,
colorStyles: n
};
});
}
function $e(e, t) {
const n = h(() => ({
text: yt(e) ? e.value : t ? e[t] : null
})), {
colorClasses: l,
colorStyles: a
} = Jn(n);
return {
textColorClasses: l,
textColorStyles: a
};
}
function Xe(e, t) {
const n = h(() => ({
background: yt(e) ? e.value : t ? e[t] : null
})), {
colorClasses: l,
colorStyles: a
} = Jn(n);
return {
backgroundColorClasses: l,
backgroundColorStyles: a
};
}
const re = [String, Function, Object, Array], Fo = Symbol.for("vuetify:icons"), vn = F({
icon: {
type: re
},
// Could not remove this and use makeTagProps, types complained because it is not required
tag: {
type: String,
required: !0
}
}, "icon"), Rl = K()({
name: "VComponentIcon",
props: vn(),
setup(e, t) {
let {
slots: n
} = t;
return () => {
const l = e.icon;
return u(e.tag, null, {
default: () => {
var a;
return [e.icon ? u(l, null, null) : (a = n.default) == null ? void 0 : a.call(n)];
}
});
};
}
}), Ro = $t({
name: "VSvgIcon",
inheritAttrs: !1,
props: vn(),
setup(e, t) {
let {
attrs: n
} = t;
return () => u(e.tag, Q(n, {
style: null
}), {
default: () => [u("svg", {
class: "v-icon__svg",
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
role: "img",
"aria-hidden": "true"
}, [Array.isArray(e.icon) ? e.icon.map((l) => Array.isArray(l) ? u("path", {
d: l[0],
"fill-opacity": l[1]
}, null) : u("path", {
d: l
}, null)) : u("path", {
d: e.icon
}, null)])]
});
}
});
$t({
name: "VLigatureIcon",
props: vn(),
setup(e) {
return () => u(e.tag, null, {
default: () => [e.icon]
});
}
});
$t({
name: "VClassIcon",
props: vn(),
setup(e) {
return () => u(e.tag, {
class: e.icon
}, null);
}
});
const Mo = (e) => {
const t = be(Fo);
if (!t)
throw new Error("Missing Vuetify Icons provide!");
return {
iconData: h(() => {
var s;
const l = xe(e);
if (!l)
return {
component: Rl
};
let a = l;
if (typeof a == "string" && (a = a.trim(), a.startsWith("$") && (a = (s = t.aliases) == null ? void 0 : s[a.slice(1)])), a || at(`Could not find aliased icon "${l}"`), Array.isArray(a))
return {
component: Ro,
icon: a
};
if (typeof a != "string")
return {
component: Rl,
icon: a
};
const i = Object.keys(t.sets).find((c) => typeof a == "string" && a.startsWith(`${c}:`)), o = i ? a.slice(i.length + 1) : a;
return {
component: t.sets[i ?? t.defaultSet].component,
icon: o
};
})
};
}, $o = ["x-small", "small", "default", "large", "x-large"], Dt = F({
size: {
type: [String, Number],
default: "default"
}
}, "size");
function Nt(e) {
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Ne();
return Un(() => {
let n, l;
return tn($o, e.size) ? n = `${t}--size-${e.size}` : e.size && (l = {
width: X(e.size),
height: X(e.size)
}), {
sizeClasses: n,
sizeStyles: l
};
});
}
const _e = F({
tag: {
type: String,
default: "div"
}
}, "tag"), Ml = Symbol.for("vuetify:theme"), Se = F({
theme: String
}, "theme");
function Ae(e) {
ge("provideTheme");
const t = be(Ml, null);
if (!t)
throw new Error("Could not find Vuetify theme injection");
const n = h(() => e.theme ?? t.name.value), l = h(() => t.themes.value[n.value]), a = h(() => t.isDisabled ? void 0 : `v-theme--${n.value}`), i = {
...t,
name: n,
current: l,
themeClasses: a
};
return Re(Ml, i), i;
}
const Do = F({
color: String,
disabled: Boolean,
start: Boolean,
end: Boolean,
icon: re,
...ae(),
...Dt(),
..._e({
tag: "i"
}),
...Se()
}, "VIcon"), fe = K()({
name: "VIcon",
props: Do(),
setup(e, t) {
let {
attrs: n,
slots: l
} = t;
const a = H(), {
themeClasses: i
} = Ae(e), {
iconData: o
} = Mo(h(() => a.value || e.icon)), {
sizeClasses: r
} = Nt(e), {
textColorClasses: s,
textColorStyles: c
} = $e(z(e, "color"));
return ee(() => {
var f, d;
const v = (f = l.default) == null ? void 0 : f.call(l);
v && (a.value = (d = va(v).filter((g) => g.type === Ni && g.children && typeof g.children == "string")[0]) == null ? void 0 : d.children);
const m = !!(n.onClick || n.onClickOnce);
return u(o.value.component, {
tag: e.tag,
icon: o.value.icon,
class: ["v-icon", "notranslate", i.value, r.value, s.value, {
"v-icon--clickable": m,
"v-icon--disabled": e.disabled,
"v-icon--start": e.start,
"v-icon--end": e.end
}, e.class],
style: [r.value ? void 0 : {
fontSize: X(e.size),
height: X(e.size),
width: X(e.size)
}, c.value, e.style],
role: m ? "button" : void 0,
"aria-hidden": !m,
tabindex: m ? e.disabled ? -1 : 0 : void 0
}, {
default: () => [v]
});
}), {};
}
}), ut = F({
height: [Number, String],
maxHeight: [Number, String],
maxWidth: [Number, String],
minHeight: [Number, String],
minWidth: [Number, String],
width: [Number, String]
}, "dimension");
function ct(e) {
return {
dimensionStyles: h(() => {
const n = {}, l = X(e.height), a = X(e.maxHeight), i = X(e.maxWidth), o = X(e.minHeight), r = X(e.minWidth), s = X(e.width);
return l != null && (n.height = l), a != null && (n.maxHeight = a), i != null && (n.maxWidth = i), o != null && (n.minHeight = o), r != null && (n.minWidth = r), s != null && (n.width = s), n;
})
};
}
function No(e) {
return {
aspectStyles: h(() => {
const t = Number(e.aspectRatio);
return t ? {
paddingBottom: String(1 / t * 100) + "%"
} : void 0;
})
};
}
const _a = F({
aspectRatio: [String, Number],
contentClass: null,
inline: Boolean,
...ae(),
...ut()
}, "VResponsive"), $l = K()({
name: "VResponsive",
props: _a(),
setup(e, t) {
let {
slots: n
} = t;
const {
aspectStyles: l
} = No(e), {
dimensionStyles: a
} = ct(e);
return ee(() => {
var i;
return u("div", {
class: ["v-responsive", {
"v-responsive--inline": e.inline
}, e.class],
style: [a.value, e.style]
}, [u("div", {
class: "v-responsive__sizer",
style: l.value
}, null), (i = n.additional) == null ? void 0 : i.call(n), n.default && u("div", {
class: ["v-responsive__content", e.contentClass]
}, [n.default()])]);
}), {};
}
}), qe = F({
rounded: {
type: [Boolean, Number, String],
default: void 0
},
tile: Boolean
}, "rounded");
function We(e) {
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Ne();
return {
roundedClasses: h(() => {
const l = yt(e) ? e.value : e.rounded, a = yt(e) ? e.value : e.tile, i = [];
if (l === !0 || l === "")
i.push(`${t}--rounded`);
else if (typeof l == "string" || l === 0)
for (const o of String(l).split(" "))
i.push(`rounded-${o}`);
else
(a || l === !1) && i.push("rounded-0");
return i;
})
};
}
const xt = F({
transition: {
type: [Boolean, String, Object],
default: "fade-transition",
validator: (e) => e !== !0
}
}, "transition"), Ke = (e, t) => {
let {
slots: n
} = t;
const {
transition: l,
disabled: a,
group: i,
...o
} = e, {
component: r = i ? Hn : ot,
...s
} = typeof l == "object" ? l : {};
return fn(r, Q(typeof l == "string" ? {
name: a ? "" : l
} : s, typeof l == "string" ? {} : Object.fromEntries(Object.entries({
disabled: a,
group: i
}).filter((c) => {
let [v, m] = c;
return m !== void 0;
})), o), n);
};
function zo(e, t) {
if (!Wn)
return;
const n = t.modifiers || {}, l = t.value, {
handler: a,
options: i
} = typeof l == "object" ? l : {
handler: l,
options: {}
}, o = new IntersectionObserver(function() {
var m;
let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], s = arguments.length > 1 ? arguments[1] : void 0;
const c = (m = e._observe) == null ? void 0 : m[t.instance.$.uid];
if (!c)
return;
const v = r.some((f) => f.isIntersecting);
a && (!n.quiet || c.init) && (!n.once || v || c.init) && a(v, r, s), v && n.once ? Aa(e, t) : c.init = !0;
}, i);
e._observe = Object(e._observe), e._observe[t.instance.$.uid] = {
init: !1,
observer: o
}, o.observe(e);
}
function Aa(e, t) {
var l;
const n = (l = e._observe) == null ? void 0 : l[t.instance.$.uid];
n && (n.observer.unobserve(e), delete e._observe[t.instance.$.uid]);
}
const Pa = {
mounted: zo,
unmounted: Aa
}, Ho = F({
absolute: Boolean,
alt: String,
cover: Boolean,
color: String,
draggable: {
type: [Boolean, String],
default: void 0
},
eager: Boolean,
gradient: String,
lazySrc: String,
options: {
type: Object,
// For more information on types, navigate to:
// https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API
default: () => ({
root: void 0,
rootMargin: void 0,
threshold: void 0
})
},
sizes: String,
src: {
type: [String, Object],
default: ""
},
crossorigin: String,
referrerpolicy: String,
srcset: String,
position: String,
..._a(),
...ae(),
...qe(),
...xt()
}, "VImg"), jo = K()({
name: "VImg",
directives: {
intersect: Pa
},
props: Ho(),
emits: {
loadstart: (e) => !0,
load: (e) => !0,
error: (e) => !0
},
setup(e, t) {
let {
emit: n,
slots: l
} = t;
const {
backgroundColorClasses: a,
backgroundColorStyles: i
} = Xe(z(e, "color")), {
roundedClasses: o
} = We(e), r = ge("VImg"), s = G(""), c = H(), v = G(e.eager ? "loading" : "idle"), m = G(), f = G(), d = h(() => e.src && typeof e.src == "object" ? {
src: e.src.src,
srcset: e.srcset || e.src.srcset,
lazySrc: e.lazySrc || e.src.lazySrc,
aspect: Number(e.aspectRatio || e.src.aspect || 0)
} : {
src: e.src,
srcset: e.srcset,
lazySrc: e.lazySrc,
aspect: Number(e.aspectRatio || 0)
}), g = h(() => d.value.aspect || m.value / f.value || 0);
U(() => e.src, () => {
y(v.value !== "idle");
}), U(g, (k, O) => {
!k && O && c.value && _(c.value);
}), ia(() => y());
function y(k) {
if (!(e.eager && k) && !(Wn && !k && !e.eager)) {
if (v.value = "loading", d.value.lazySrc) {
const O = new Image();
O.src = d.value.lazySrc, _(O, null);
}
d.value.src && pe(() => {
var O;
n("loadstart", ((O = c.value) == null ? void 0 : O.currentSrc) || d.value.src), setTimeout(() => {
var L;
if (!r.isUnmounted)
if ((L = c.value) != null && L.complete) {
if (c.value.naturalWidth || S(), v.value === "error")
return;
g.value || _(c.value, null), v.value === "loading" && b();
} else
g.value || _(c.value), A();
});
});
}
}
function b() {
var k;
r.isUnmounted || (A(), _(c.value), v.value = "loaded", n("load", ((k = c.value) == null ? void 0 : k.currentSrc) || d.value.src));
}
function S() {
var k;
r.isUnmounted || (v.value = "error", n("error", ((k = c.value) == null ? void 0 : k.currentSrc) || d.value.src));
}
function A() {
const k = c.value;
k && (s.value = k.currentSrc || k.src);
}
let E = -1;
De(() => {
clearTimeout(E);
});
function _(k) {
let O = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 100;
const L = () => {
if (clearTimeout(E), r.isUnmounted)
return;
const {
naturalHeight: M,
naturalWidth: q
} = k;
M || q ? (m.value = q, f.value = M) : !k.complete && v.value === "loading" && O != null ? E = window.setTimeout(L, O) : (k.currentSrc.endsWith(".svg") || k.currentSrc.startsWith("data:image/svg+xml")) && (m.value = 1, f.value = 1);
};
L();
}
const B = h(() => ({
"v-img__img--cover": e.cover,
"v-img__img--contain": !e.cover
})), x = () => {
var L;
if (!d.value.src || v.value === "idle")
return null;
const k = u("img", {
class: ["v-img__img", B.value],
style: {
objectPosition: e.position
},
src: d.value.src,
srcset: d.value.srcset,
alt: e.alt,
crossorigin: e.crossorigin,
referrerpolicy: e.referrerpolicy,
draggable: e.draggable,
sizes: e.sizes,
ref: c,
onLoad: b,
onError: S
}, null), O = (L = l.sources) == null ? void 0 : L.call(l);
return u(Ke, {
transition: e.transition,
appear: !0
}, {
default: () => [Fe(O ? u("picture", {
class: "v-img__picture"
}, [O, k]) : k, [[Ct, v.value === "loaded"]])]
});
}, I = () => u(Ke, {
transition: e.transition
}, {
default: () => [d.value.lazySrc && v.value !== "loaded" && u("img", {
class: ["v-img__img", "v-img__img--preload", B.value],
style: {
objectPosition: e.position
},
src: d.value.lazySrc,
alt: e.alt,
crossorigin: e.crossorigin,
referrerpolicy: e.referrerpolicy