@visitscotland/component-library
Version:
VisitScotland Component Library
1,759 lines (1,758 loc) • 440 kB
JavaScript
import { defineComponent as ne, computed as I, h as ut, Teleport as Ko, ref as te, watch as Ue, onMounted as xa, nextTick as Mn, toRef as U, createBlock as X, openBlock as P, resolveDynamicComponent as Ve, normalizeClass as Q, withCtx as ee, renderSlot as W, createTextVNode as Te, toDisplayString as Ee, toValue as Pt, inject as Gt, mergeModels as ct, useModel as Lt, withDirectives as Wr, createElementBlock as j, unref as K, Fragment as rt, renderList as ur, vModelSelect as ew, mergeProps as xe, createCommentVNode as $e, createVNode as Rt, useAttrs as fs, getCurrentInstance as ds, useSlots as fr, onActivated as tw, normalizeProps as Wt, createElementVNode as je, vModelRadio as nw, provide as Sa, normalizeStyle as dn, vModelCheckbox as rw, vShow as cs, guardReactiveProps as An, watchEffect as aw, onBeforeUnmount as ow, withModifiers as ga, withKeys as Rr, onUnmounted as iw, shallowRef as Ac, render as Cc, shallowReadonly as Tr, getCurrentScope as Tc, onScopeDispose as Ec, readonly as Jl, Transition as lw, customRef as sw, resolveComponent as qt, createStaticVNode as uw } from "vue";
import { defineStore as fw, mapState as dw } from "pinia";
const rn = (a, r) => {
const n = a.__vccOpts || a;
for (const [o, l] of r)
n[o] = l;
return n;
};
var cw = {}, pw = Object.defineProperty, vw = (a, r, n) => r in a ? pw(a, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : a[r] = n, Bn = (a, r, n) => (vw(a, typeof r != "symbol" ? r + "" : r, n), n);
const kc = (a) => I(() => {
const r = Pt(a);
return r ? `justify-content-${r}` : "";
}), Jo = (a, r) => I(() => {
const n = Pt(a), o = Pt(r);
return n === !0 ? "true" : typeof n == "string" ? n : o === !1 ? "true" : n === !1 ? "false" : void 0;
});
class ba {
constructor(r, n = {}) {
if (Bn(this, "cancelable", !0), Bn(this, "componentId", null), Bn(this, "_defaultPrevented", !1), Bn(this, "eventType", ""), Bn(this, "nativeEvent", null), Bn(this, "_preventDefault"), Bn(this, "relatedTarget", null), Bn(this, "target", null), !r)
throw new TypeError(
`Failed to construct '${this.constructor.name}'. 1 argument required, ${arguments.length} given.`
);
Object.assign(this, ba.Defaults, n, { eventType: r }), this._preventDefault = function() {
this.cancelable && (this.defaultPrevented = !0);
};
}
// Readable by everyone,
// But only overwritten by inherrited constructors
get defaultPrevented() {
return this._defaultPrevented;
}
set defaultPrevented(r) {
this._defaultPrevented = r;
}
// I think this is right
// We want to be able to have it callable to everyone,
// But only overwritten by inherrited constructors
get preventDefault() {
return this._preventDefault;
}
// This may not be correct, because it doesn't get correct type inferences in children
// Ex overwrite this.preventDefault = () => true is valid. Could be a TS issue
set preventDefault(r) {
this._preventDefault = r;
}
static get Defaults() {
return {
cancelable: !0,
componentId: null,
eventType: "",
nativeEvent: null,
relatedTarget: null,
target: null
};
}
}
class ps extends ba {
constructor(r, n = {}) {
super(r, n), Bn(this, "trigger", null), Object.assign(this, ba.Defaults, n, { eventType: r });
}
static get Defaults() {
return {
...super.Defaults,
trigger: null
};
}
}
const gw = (a, r = {}) => {
const n = (l = []) => {
const { activeElement: s } = document;
return s && !l.some((f) => f === s) ? s : null;
}, o = (l) => l === n();
try {
a.focus(r);
} catch (l) {
console.error(l);
}
return o(a);
}, Un = (a) => ((a == null ? void 0 : a()) ?? []).length === 0, hw = (a) => {
if (a.getAttribute("display") === "none")
return !1;
const r = a.getBoundingClientRect();
return !!(r && r.height > 0 && r.width > 0);
}, mw = (a) => {
const r = window.getComputedStyle(a), n = r.transitionDelay.split(",")[0] || "", o = r.transitionDuration.split(",")[0] || "", l = Number(n.slice(0, -1)) * 1e3, s = Number(o.slice(0, -1)) * 1e3;
return l + s;
}, Oc = typeof window < "u" && typeof document < "u" && typeof navigator < "u", $c = ["top", "right", "bottom", "left"], cd = ["start", "end"], pd = /* @__PURE__ */ $c.reduce((a, r) => a.concat(r, r + "-" + cd[0], r + "-" + cd[1]), []), nn = Math.min, ft = Math.max, Do = Math.round, Ao = Math.floor, Wn = (a) => ({
x: a,
y: a
}), yw = {
left: "right",
right: "left",
bottom: "top",
top: "bottom"
}, bw = {
start: "end",
end: "start"
};
function Xl(a, r, n) {
return ft(a, nn(r, n));
}
function kn(a, r) {
return typeof a == "function" ? a(r) : a;
}
function jt(a) {
return a.split("-")[0];
}
function tn(a) {
return a.split("-")[1];
}
function Rc(a) {
return a === "x" ? "y" : "x";
}
function vs(a) {
return a === "y" ? "height" : "width";
}
function qr(a) {
return ["top", "bottom"].includes(jt(a)) ? "y" : "x";
}
function gs(a) {
return Rc(qr(a));
}
function Fc(a, r, n) {
n === void 0 && (n = !1);
const o = tn(a), l = gs(a), s = vs(l);
let f = l === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
return r.reference[s] > r.floating[s] && (f = Mo(f)), [f, Mo(f)];
}
function _w(a) {
const r = Mo(a);
return [zo(a), r, zo(r)];
}
function zo(a) {
return a.replace(/start|end/g, (r) => bw[r]);
}
function ww(a, r, n) {
const o = ["left", "right"], l = ["right", "left"], s = ["top", "bottom"], f = ["bottom", "top"];
switch (a) {
case "top":
case "bottom":
return n ? r ? l : o : r ? o : l;
case "left":
case "right":
return r ? s : f;
default:
return [];
}
}
function xw(a, r, n, o) {
const l = tn(a);
let s = ww(jt(a), n === "start", o);
return l && (s = s.map((f) => f + "-" + l), r && (s = s.concat(s.map(zo)))), s;
}
function Mo(a) {
return a.replace(/left|right|bottom|top/g, (r) => yw[r]);
}
function Sw(a) {
return {
top: 0,
right: 0,
bottom: 0,
left: 0,
...a
};
}
function hs(a) {
return typeof a != "number" ? Sw(a) : {
top: a,
right: a,
bottom: a,
left: a
};
}
function Dr(a) {
return {
...a,
top: a.y,
left: a.x,
right: a.x + a.width,
bottom: a.y + a.height
};
}
function vd(a, r, n) {
let {
reference: o,
floating: l
} = a;
const s = qr(r), f = gs(r), d = vs(f), p = jt(r), g = s === "y", m = o.x + o.width / 2 - l.width / 2, w = o.y + o.height / 2 - l.height / 2, S = o[d] / 2 - l[d] / 2;
let b;
switch (p) {
case "top":
b = {
x: m,
y: o.y - l.height
};
break;
case "bottom":
b = {
x: m,
y: o.y + o.height
};
break;
case "right":
b = {
x: o.x + o.width,
y: w
};
break;
case "left":
b = {
x: o.x - l.width,
y: w
};
break;
default:
b = {
x: o.x,
y: o.y
};
}
switch (tn(r)) {
case "start":
b[f] -= S * (n && g ? -1 : 1);
break;
case "end":
b[f] += S * (n && g ? -1 : 1);
break;
}
return b;
}
const Bw = async (a, r, n) => {
const {
placement: o = "bottom",
strategy: l = "absolute",
middleware: s = [],
platform: f
} = n, d = s.filter(Boolean), p = await (f.isRTL == null ? void 0 : f.isRTL(r));
let g = await f.getElementRects({
reference: a,
floating: r,
strategy: l
}), {
x: m,
y: w
} = vd(g, o, p), S = o, b = {}, y = 0;
for (let x = 0; x < d.length; x++) {
const {
name: B,
fn: E
} = d[x], {
x: F,
y: L,
data: $,
reset: k
} = await E({
x: m,
y: w,
initialPlacement: o,
placement: S,
strategy: l,
middlewareData: b,
rects: g,
platform: f,
elements: {
reference: a,
floating: r
}
});
m = F ?? m, w = L ?? w, b = {
...b,
[B]: {
...b[B],
...$
}
}, k && y <= 50 && (y++, typeof k == "object" && (k.placement && (S = k.placement), k.rects && (g = k.rects === !0 ? await f.getElementRects({
reference: a,
floating: r,
strategy: l
}) : k.rects), {
x: m,
y: w
} = vd(g, S, p)), x = -1);
}
return {
x: m,
y: w,
placement: S,
strategy: l,
middlewareData: b
};
};
async function zr(a, r) {
var n;
r === void 0 && (r = {});
const {
x: o,
y: l,
platform: s,
rects: f,
elements: d,
strategy: p
} = a, {
boundary: g = "clippingAncestors",
rootBoundary: m = "viewport",
elementContext: w = "floating",
altBoundary: S = !1,
padding: b = 0
} = kn(r, a), y = hs(b), x = d[S ? w === "floating" ? "reference" : "floating" : w], B = Dr(await s.getClippingRect({
element: (n = await (s.isElement == null ? void 0 : s.isElement(x))) == null || n ? x : x.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(d.floating)),
boundary: g,
rootBoundary: m,
strategy: p
})), E = w === "floating" ? {
...f.floating,
x: o,
y: l
} : f.reference, F = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(d.floating)), L = await (s.isElement == null ? void 0 : s.isElement(F)) ? await (s.getScale == null ? void 0 : s.getScale(F)) || {
x: 1,
y: 1
} : {
x: 1,
y: 1
}, $ = Dr(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
elements: d,
rect: E,
offsetParent: F,
strategy: p
}) : E);
return {
top: (B.top - $.top + y.top) / L.y,
bottom: ($.bottom - B.bottom + y.bottom) / L.y,
left: (B.left - $.left + y.left) / L.x,
right: ($.right - B.right + y.right) / L.x
};
}
const Aw = (a) => ({
name: "arrow",
options: a,
async fn(r) {
const {
x: n,
y: o,
placement: l,
rects: s,
platform: f,
elements: d,
middlewareData: p
} = r, {
element: g,
padding: m = 0
} = kn(a, r) || {};
if (g == null)
return {};
const w = hs(m), S = {
x: n,
y: o
}, b = gs(l), y = vs(b), x = await f.getDimensions(g), B = b === "y", E = B ? "top" : "left", F = B ? "bottom" : "right", L = B ? "clientHeight" : "clientWidth", $ = s.reference[y] + s.reference[b] - S[b] - s.floating[y], k = S[b] - s.reference[b], z = await (f.getOffsetParent == null ? void 0 : f.getOffsetParent(g));
let H = z ? z[L] : 0;
(!H || !await (f.isElement == null ? void 0 : f.isElement(z))) && (H = d.floating[L] || s.floating[y]);
const ie = $ / 2 - k / 2, se = H / 2 - x[y] / 2 - 1, Ae = nn(w[E], se), Ie = nn(w[F], se), Ce = Ae, Re = H - x[y] - Ie, q = H / 2 - x[y] / 2 + ie, ge = Xl(Ce, q, Re), de = !p.arrow && tn(l) != null && q !== ge && s.reference[y] / 2 - (q < Ce ? Ae : Ie) - x[y] / 2 < 0, Se = de ? q < Ce ? q - Ce : q - Re : 0;
return {
[b]: S[b] + Se,
data: {
[b]: ge,
centerOffset: q - ge - Se,
...de && {
alignmentOffset: Se
}
},
reset: de
};
}
});
function Cw(a, r, n) {
return (a ? [...n.filter((o) => tn(o) === a), ...n.filter((o) => tn(o) !== a)] : n.filter((o) => jt(o) === o)).filter((o) => a ? tn(o) === a || (r ? zo(o) !== o : !1) : !0);
}
const Tw = function(a) {
return a === void 0 && (a = {}), {
name: "autoPlacement",
options: a,
async fn(r) {
var n, o, l;
const {
rects: s,
middlewareData: f,
placement: d,
platform: p,
elements: g
} = r, {
crossAxis: m = !1,
alignment: w,
allowedPlacements: S = pd,
autoAlignment: b = !0,
...y
} = kn(a, r), x = w !== void 0 || S === pd ? Cw(w || null, b, S) : S, B = await zr(r, y), E = ((n = f.autoPlacement) == null ? void 0 : n.index) || 0, F = x[E];
if (F == null)
return {};
const L = Fc(F, s, await (p.isRTL == null ? void 0 : p.isRTL(g.floating)));
if (d !== F)
return {
reset: {
placement: x[0]
}
};
const $ = [B[jt(F)], B[L[0]], B[L[1]]], k = [...((o = f.autoPlacement) == null ? void 0 : o.overflows) || [], {
placement: F,
overflows: $
}], z = x[E + 1];
if (z)
return {
data: {
index: E + 1,
overflows: k
},
reset: {
placement: z
}
};
const H = k.map((se) => {
const Ae = tn(se.placement);
return [se.placement, Ae && m ? (
// Check along the mainAxis and main crossAxis side.
se.overflows.slice(0, 2).reduce((Ie, Ce) => Ie + Ce, 0)
) : (
// Check only the mainAxis.
se.overflows[0]
), se.overflows];
}).sort((se, Ae) => se[1] - Ae[1]), ie = ((l = H.filter((se) => se[2].slice(
0,
// Aligned placements should not check their opposite crossAxis
// side.
tn(se[0]) ? 2 : 3
).every((Ae) => Ae <= 0))[0]) == null ? void 0 : l[0]) || H[0][0];
return ie !== d ? {
data: {
index: E + 1,
overflows: k
},
reset: {
placement: ie
}
} : {};
}
};
}, Ew = function(a) {
return a === void 0 && (a = {}), {
name: "flip",
options: a,
async fn(r) {
var n, o;
const {
placement: l,
middlewareData: s,
rects: f,
initialPlacement: d,
platform: p,
elements: g
} = r, {
mainAxis: m = !0,
crossAxis: w = !0,
fallbackPlacements: S,
fallbackStrategy: b = "bestFit",
fallbackAxisSideDirection: y = "none",
flipAlignment: x = !0,
...B
} = kn(a, r);
if ((n = s.arrow) != null && n.alignmentOffset)
return {};
const E = jt(l), F = jt(d) === d, L = await (p.isRTL == null ? void 0 : p.isRTL(g.floating)), $ = S || (F || !x ? [Mo(d)] : _w(d));
!S && y !== "none" && $.push(...xw(d, x, y, L));
const k = [d, ...$], z = await zr(r, B), H = [];
let ie = ((o = s.flip) == null ? void 0 : o.overflows) || [];
if (m && H.push(z[E]), w) {
const Ce = Fc(l, f, L);
H.push(z[Ce[0]], z[Ce[1]]);
}
if (ie = [...ie, {
placement: l,
overflows: H
}], !H.every((Ce) => Ce <= 0)) {
var se, Ae;
const Ce = (((se = s.flip) == null ? void 0 : se.index) || 0) + 1, Re = k[Ce];
if (Re)
return {
data: {
index: Ce,
overflows: ie
},
reset: {
placement: Re
}
};
let q = (Ae = ie.filter((ge) => ge.overflows[0] <= 0).sort((ge, de) => ge.overflows[1] - de.overflows[1])[0]) == null ? void 0 : Ae.placement;
if (!q)
switch (b) {
case "bestFit": {
var Ie;
const ge = (Ie = ie.map((de) => [de.placement, de.overflows.filter((Se) => Se > 0).reduce((Se, pe) => Se + pe, 0)]).sort((de, Se) => de[1] - Se[1])[0]) == null ? void 0 : Ie[0];
ge && (q = ge);
break;
}
case "initialPlacement":
q = d;
break;
}
if (l !== q)
return {
reset: {
placement: q
}
};
}
return {};
}
};
};
function gd(a, r) {
return {
top: a.top - r.height,
right: a.right - r.width,
bottom: a.bottom - r.height,
left: a.left - r.width
};
}
function hd(a) {
return $c.some((r) => a[r] >= 0);
}
const kw = function(a) {
return a === void 0 && (a = {}), {
name: "hide",
options: a,
async fn(r) {
const {
rects: n
} = r, {
strategy: o = "referenceHidden",
...l
} = kn(a, r);
switch (o) {
case "referenceHidden": {
const s = await zr(r, {
...l,
elementContext: "reference"
}), f = gd(s, n.reference);
return {
data: {
referenceHiddenOffsets: f,
referenceHidden: hd(f)
}
};
}
case "escaped": {
const s = await zr(r, {
...l,
altBoundary: !0
}), f = gd(s, n.floating);
return {
data: {
escapedOffsets: f,
escaped: hd(f)
}
};
}
default:
return {};
}
}
};
};
function Pc(a) {
const r = nn(...a.map((s) => s.left)), n = nn(...a.map((s) => s.top)), o = ft(...a.map((s) => s.right)), l = ft(...a.map((s) => s.bottom));
return {
x: r,
y: n,
width: o - r,
height: l - n
};
}
function Ow(a) {
const r = a.slice().sort((l, s) => l.y - s.y), n = [];
let o = null;
for (let l = 0; l < r.length; l++) {
const s = r[l];
!o || s.y - o.y > o.height / 2 ? n.push([s]) : n[n.length - 1].push(s), o = s;
}
return n.map((l) => Dr(Pc(l)));
}
const $w = function(a) {
return a === void 0 && (a = {}), {
name: "inline",
options: a,
async fn(r) {
const {
placement: n,
elements: o,
rects: l,
platform: s,
strategy: f
} = r, {
padding: d = 2,
x: p,
y: g
} = kn(a, r), m = Array.from(await (s.getClientRects == null ? void 0 : s.getClientRects(o.reference)) || []), w = Ow(m), S = Dr(Pc(m)), b = hs(d);
function y() {
if (w.length === 2 && w[0].left > w[1].right && p != null && g != null)
return w.find((B) => p > B.left - b.left && p < B.right + b.right && g > B.top - b.top && g < B.bottom + b.bottom) || S;
if (w.length >= 2) {
if (qr(n) === "y") {
const Ae = w[0], Ie = w[w.length - 1], Ce = jt(n) === "top", Re = Ae.top, q = Ie.bottom, ge = Ce ? Ae.left : Ie.left, de = Ce ? Ae.right : Ie.right, Se = de - ge, pe = q - Re;
return {
top: Re,
bottom: q,
left: ge,
right: de,
width: Se,
height: pe,
x: ge,
y: Re
};
}
const B = jt(n) === "left", E = ft(...w.map((Ae) => Ae.right)), F = nn(...w.map((Ae) => Ae.left)), L = w.filter((Ae) => B ? Ae.left === F : Ae.right === E), $ = L[0].top, k = L[L.length - 1].bottom, z = F, H = E, ie = H - z, se = k - $;
return {
top: $,
bottom: k,
left: z,
right: H,
width: ie,
height: se,
x: z,
y: $
};
}
return S;
}
const x = await s.getElementRects({
reference: {
getBoundingClientRect: y
},
floating: o.floating,
strategy: f
});
return l.reference.x !== x.reference.x || l.reference.y !== x.reference.y || l.reference.width !== x.reference.width || l.reference.height !== x.reference.height ? {
reset: {
rects: x
}
} : {};
}
};
};
async function Rw(a, r) {
const {
placement: n,
platform: o,
elements: l
} = a, s = await (o.isRTL == null ? void 0 : o.isRTL(l.floating)), f = jt(n), d = tn(n), p = qr(n) === "y", g = ["left", "top"].includes(f) ? -1 : 1, m = s && p ? -1 : 1, w = kn(r, a);
let {
mainAxis: S,
crossAxis: b,
alignmentAxis: y
} = typeof w == "number" ? {
mainAxis: w,
crossAxis: 0,
alignmentAxis: null
} : {
mainAxis: 0,
crossAxis: 0,
alignmentAxis: null,
...w
};
return d && typeof y == "number" && (b = d === "end" ? y * -1 : y), p ? {
x: b * m,
y: S * g
} : {
x: S * g,
y: b * m
};
}
const Lc = function(a) {
return a === void 0 && (a = 0), {
name: "offset",
options: a,
async fn(r) {
var n, o;
const {
x: l,
y: s,
placement: f,
middlewareData: d
} = r, p = await Rw(r, a);
return f === ((n = d.offset) == null ? void 0 : n.placement) && (o = d.arrow) != null && o.alignmentOffset ? {} : {
x: l + p.x,
y: s + p.y,
data: {
...p,
placement: f
}
};
}
};
}, Fw = function(a) {
return a === void 0 && (a = {}), {
name: "shift",
options: a,
async fn(r) {
const {
x: n,
y: o,
placement: l
} = r, {
mainAxis: s = !0,
crossAxis: f = !1,
limiter: d = {
fn: (B) => {
let {
x: E,
y: F
} = B;
return {
x: E,
y: F
};
}
},
...p
} = kn(a, r), g = {
x: n,
y: o
}, m = await zr(r, p), w = qr(jt(l)), S = Rc(w);
let b = g[S], y = g[w];
if (s) {
const B = S === "y" ? "top" : "left", E = S === "y" ? "bottom" : "right", F = b + m[B], L = b - m[E];
b = Xl(F, b, L);
}
if (f) {
const B = w === "y" ? "top" : "left", E = w === "y" ? "bottom" : "right", F = y + m[B], L = y - m[E];
y = Xl(F, y, L);
}
const x = d.fn({
...r,
[S]: b,
[w]: y
});
return {
...x,
data: {
x: x.x - n,
y: x.y - o
}
};
}
};
}, Pw = function(a) {
return a === void 0 && (a = {}), {
name: "size",
options: a,
async fn(r) {
const {
placement: n,
rects: o,
platform: l,
elements: s
} = r, {
apply: f = () => {
},
...d
} = kn(a, r), p = await zr(r, d), g = jt(n), m = tn(n), w = qr(n) === "y", {
width: S,
height: b
} = o.floating;
let y, x;
g === "top" || g === "bottom" ? (y = g, x = m === (await (l.isRTL == null ? void 0 : l.isRTL(s.floating)) ? "start" : "end") ? "left" : "right") : (x = g, y = m === "end" ? "top" : "bottom");
const B = b - p[y], E = S - p[x], F = !r.middlewareData.shift;
let L = B, $ = E;
if (w) {
const z = S - p.left - p.right;
$ = m || F ? nn(E, z) : z;
} else {
const z = b - p.top - p.bottom;
L = m || F ? nn(B, z) : z;
}
if (F && !m) {
const z = ft(p.left, 0), H = ft(p.right, 0), ie = ft(p.top, 0), se = ft(p.bottom, 0);
w ? $ = S - 2 * (z !== 0 || H !== 0 ? z + H : ft(p.left, p.right)) : L = b - 2 * (ie !== 0 || se !== 0 ? ie + se : ft(p.top, p.bottom));
}
await f({
...r,
availableWidth: $,
availableHeight: L
});
const k = await l.getDimensions(s.floating);
return S !== k.width || b !== k.height ? {
reset: {
rects: !0
}
} : {};
}
};
};
function Tn(a) {
return ms(a) ? (a.nodeName || "").toLowerCase() : "#document";
}
function Ft(a) {
var r;
return (a == null || (r = a.ownerDocument) == null ? void 0 : r.defaultView) || window;
}
function On(a) {
var r;
return (r = (ms(a) ? a.ownerDocument : a.document) || window.document) == null ? void 0 : r.documentElement;
}
function ms(a) {
return a instanceof Node || a instanceof Ft(a).Node;
}
function En(a) {
return a instanceof Element || a instanceof Ft(a).Element;
}
function cn(a) {
return a instanceof HTMLElement || a instanceof Ft(a).HTMLElement;
}
function md(a) {
return typeof ShadowRoot > "u" ? !1 : a instanceof ShadowRoot || a instanceof Ft(a).ShadowRoot;
}
function Ba(a) {
const {
overflow: r,
overflowX: n,
overflowY: o,
display: l
} = Kt(a);
return /auto|scroll|overlay|hidden|clip/.test(r + o + n) && !["inline", "contents"].includes(l);
}
function Lw(a) {
return ["table", "td", "th"].includes(Tn(a));
}
function ys(a) {
const r = bs(), n = Kt(a);
return n.transform !== "none" || n.perspective !== "none" || (n.containerType ? n.containerType !== "normal" : !1) || !r && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !r && (n.filter ? n.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((o) => (n.willChange || "").includes(o)) || ["paint", "layout", "strict", "content"].some((o) => (n.contain || "").includes(o));
}
function Iw(a) {
let r = Mr(a);
for (; cn(r) && !Xo(r); ) {
if (ys(r))
return r;
r = Mr(r);
}
return null;
}
function bs() {
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
}
function Xo(a) {
return ["html", "body", "#document"].includes(Tn(a));
}
function Kt(a) {
return Ft(a).getComputedStyle(a);
}
function Yo(a) {
return En(a) ? {
scrollLeft: a.scrollLeft,
scrollTop: a.scrollTop
} : {
scrollLeft: a.pageXOffset,
scrollTop: a.pageYOffset
};
}
function Mr(a) {
if (Tn(a) === "html")
return a;
const r = (
// Step into the shadow DOM of the parent of a slotted node.
a.assignedSlot || // DOM Element detected.
a.parentNode || // ShadowRoot detected.
md(a) && a.host || // Fallback.
On(a)
);
return md(r) ? r.host : r;
}
function Ic(a) {
const r = Mr(a);
return Xo(r) ? a.ownerDocument ? a.ownerDocument.body : a.body : cn(r) && Ba(r) ? r : Ic(r);
}
function _a(a, r, n) {
var o;
r === void 0 && (r = []), n === void 0 && (n = !0);
const l = Ic(a), s = l === ((o = a.ownerDocument) == null ? void 0 : o.body), f = Ft(l);
return s ? r.concat(f, f.visualViewport || [], Ba(l) ? l : [], f.frameElement && n ? _a(f.frameElement) : []) : r.concat(l, _a(l, [], n));
}
function Nc(a) {
const r = Kt(a);
let n = parseFloat(r.width) || 0, o = parseFloat(r.height) || 0;
const l = cn(a), s = l ? a.offsetWidth : n, f = l ? a.offsetHeight : o, d = Do(n) !== s || Do(o) !== f;
return d && (n = s, o = f), {
width: n,
height: o,
$: d
};
}
function _s(a) {
return En(a) ? a : a.contextElement;
}
function Ir(a) {
const r = _s(a);
if (!cn(r))
return Wn(1);
const n = r.getBoundingClientRect(), {
width: o,
height: l,
$: s
} = Nc(r);
let f = (s ? Do(n.width) : n.width) / o, d = (s ? Do(n.height) : n.height) / l;
return (!f || !Number.isFinite(f)) && (f = 1), (!d || !Number.isFinite(d)) && (d = 1), {
x: f,
y: d
};
}
const Nw = /* @__PURE__ */ Wn(0);
function Vc(a) {
const r = Ft(a);
return !bs() || !r.visualViewport ? Nw : {
x: r.visualViewport.offsetLeft,
y: r.visualViewport.offsetTop
};
}
function Vw(a, r, n) {
return r === void 0 && (r = !1), !n || r && n !== Ft(a) ? !1 : r;
}
function lr(a, r, n, o) {
r === void 0 && (r = !1), n === void 0 && (n = !1);
const l = a.getBoundingClientRect(), s = _s(a);
let f = Wn(1);
r && (o ? En(o) && (f = Ir(o)) : f = Ir(a));
const d = Vw(s, n, o) ? Vc(s) : Wn(0);
let p = (l.left + d.x) / f.x, g = (l.top + d.y) / f.y, m = l.width / f.x, w = l.height / f.y;
if (s) {
const S = Ft(s), b = o && En(o) ? Ft(o) : o;
let y = S, x = y.frameElement;
for (; x && o && b !== y; ) {
const B = Ir(x), E = x.getBoundingClientRect(), F = Kt(x), L = E.left + (x.clientLeft + parseFloat(F.paddingLeft)) * B.x, $ = E.top + (x.clientTop + parseFloat(F.paddingTop)) * B.y;
p *= B.x, g *= B.y, m *= B.x, w *= B.y, p += L, g += $, y = Ft(x), x = y.frameElement;
}
}
return Dr({
width: m,
height: w,
x: p,
y: g
});
}
const Dw = [":popover-open", ":modal"];
function Dc(a) {
return Dw.some((r) => {
try {
return a.matches(r);
} catch {
return !1;
}
});
}
function zw(a) {
let {
elements: r,
rect: n,
offsetParent: o,
strategy: l
} = a;
const s = l === "fixed", f = On(o), d = r ? Dc(r.floating) : !1;
if (o === f || d && s)
return n;
let p = {
scrollLeft: 0,
scrollTop: 0
}, g = Wn(1);
const m = Wn(0), w = cn(o);
if ((w || !w && !s) && ((Tn(o) !== "body" || Ba(f)) && (p = Yo(o)), cn(o))) {
const S = lr(o);
g = Ir(o), m.x = S.x + o.clientLeft, m.y = S.y + o.clientTop;
}
return {
width: n.width * g.x,
height: n.height * g.y,
x: n.x * g.x - p.scrollLeft * g.x + m.x,
y: n.y * g.y - p.scrollTop * g.y + m.y
};
}
function Mw(a) {
return Array.from(a.getClientRects());
}
function zc(a) {
return lr(On(a)).left + Yo(a).scrollLeft;
}
function Hw(a) {
const r = On(a), n = Yo(a), o = a.ownerDocument.body, l = ft(r.scrollWidth, r.clientWidth, o.scrollWidth, o.clientWidth), s = ft(r.scrollHeight, r.clientHeight, o.scrollHeight, o.clientHeight);
let f = -n.scrollLeft + zc(a);
const d = -n.scrollTop;
return Kt(o).direction === "rtl" && (f += ft(r.clientWidth, o.clientWidth) - l), {
width: l,
height: s,
x: f,
y: d
};
}
function Uw(a, r) {
const n = Ft(a), o = On(a), l = n.visualViewport;
let s = o.clientWidth, f = o.clientHeight, d = 0, p = 0;
if (l) {
s = l.width, f = l.height;
const g = bs();
(!g || g && r === "fixed") && (d = l.offsetLeft, p = l.offsetTop);
}
return {
width: s,
height: f,
x: d,
y: p
};
}
function Ww(a, r) {
const n = lr(a, !0, r === "fixed"), o = n.top + a.clientTop, l = n.left + a.clientLeft, s = cn(a) ? Ir(a) : Wn(1), f = a.clientWidth * s.x, d = a.clientHeight * s.y, p = l * s.x, g = o * s.y;
return {
width: f,
height: d,
x: p,
y: g
};
}
function yd(a, r, n) {
let o;
if (r === "viewport")
o = Uw(a, n);
else if (r === "document")
o = Hw(On(a));
else if (En(r))
o = Ww(r, n);
else {
const l = Vc(a);
o = {
...r,
x: r.x - l.x,
y: r.y - l.y
};
}
return Dr(o);
}
function Mc(a, r) {
const n = Mr(a);
return n === r || !En(n) || Xo(n) ? !1 : Kt(n).position === "fixed" || Mc(n, r);
}
function qw(a, r) {
const n = r.get(a);
if (n)
return n;
let o = _a(a, [], !1).filter((d) => En(d) && Tn(d) !== "body"), l = null;
const s = Kt(a).position === "fixed";
let f = s ? Mr(a) : a;
for (; En(f) && !Xo(f); ) {
const d = Kt(f), p = ys(f);
!p && d.position === "fixed" && (l = null), (s ? !p && !l : !p && d.position === "static" && l && ["absolute", "fixed"].includes(l.position) || Ba(f) && !p && Mc(a, f)) ? o = o.filter((g) => g !== f) : l = d, f = Mr(f);
}
return r.set(a, o), o;
}
function Gw(a) {
let {
element: r,
boundary: n,
rootBoundary: o,
strategy: l
} = a;
const s = [...n === "clippingAncestors" ? qw(r, this._c) : [].concat(n), o], f = s[0], d = s.reduce((p, g) => {
const m = yd(r, g, l);
return p.top = ft(m.top, p.top), p.right = nn(m.right, p.right), p.bottom = nn(m.bottom, p.bottom), p.left = ft(m.left, p.left), p;
}, yd(r, f, l));
return {
width: d.right - d.left,
height: d.bottom - d.top,
x: d.left,
y: d.top
};
}
function jw(a) {
const {
width: r,
height: n
} = Nc(a);
return {
width: r,
height: n
};
}
function Kw(a, r, n) {
const o = cn(r), l = On(r), s = n === "fixed", f = lr(a, !0, s, r);
let d = {
scrollLeft: 0,
scrollTop: 0
};
const p = Wn(0);
if (o || !o && !s)
if ((Tn(r) !== "body" || Ba(l)) && (d = Yo(r)), o) {
const w = lr(r, !0, s, r);
p.x = w.x + r.clientLeft, p.y = w.y + r.clientTop;
} else
l && (p.x = zc(l));
const g = f.left + d.scrollLeft - p.x, m = f.top + d.scrollTop - p.y;
return {
x: g,
y: m,
width: f.width,
height: f.height
};
}
function bd(a, r) {
return !cn(a) || Kt(a).position === "fixed" ? null : r ? r(a) : a.offsetParent;
}
function Hc(a, r) {
const n = Ft(a);
if (!cn(a) || Dc(a))
return n;
let o = bd(a, r);
for (; o && Lw(o) && Kt(o).position === "static"; )
o = bd(o, r);
return o && (Tn(o) === "html" || Tn(o) === "body" && Kt(o).position === "static" && !ys(o)) ? n : o || Iw(a) || n;
}
const Jw = async function(a) {
const r = this.getOffsetParent || Hc, n = this.getDimensions;
return {
reference: Kw(a.reference, await r(a.floating), a.strategy),
floating: {
x: 0,
y: 0,
...await n(a.floating)
}
};
};
function Xw(a) {
return Kt(a).direction === "rtl";
}
const Yw = {
convertOffsetParentRelativeRectToViewportRelativeRect: zw,
getDocumentElement: On,
getClippingRect: Gw,
getOffsetParent: Hc,
getElementRects: Jw,
getClientRects: Mw,
getDimensions: jw,
getScale: Ir,
isElement: En,
isRTL: Xw
};
function Zw(a, r) {
let n = null, o;
const l = On(a);
function s() {
var d;
clearTimeout(o), (d = n) == null || d.disconnect(), n = null;
}
function f(d, p) {
d === void 0 && (d = !1), p === void 0 && (p = 1), s();
const {
left: g,
top: m,
width: w,
height: S
} = a.getBoundingClientRect();
if (d || r(), !w || !S)
return;
const b = Ao(m), y = Ao(l.clientWidth - (g + w)), x = Ao(l.clientHeight - (m + S)), B = Ao(g), E = {
rootMargin: -b + "px " + -y + "px " + -x + "px " + -B + "px",
threshold: ft(0, nn(1, p)) || 1
};
let F = !0;
function L($) {
const k = $[0].intersectionRatio;
if (k !== p) {
if (!F)
return f();
k ? f(!1, k) : o = setTimeout(() => {
f(!1, 1e-7);
}, 100);
}
F = !1;
}
try {
n = new IntersectionObserver(L, {
...E,
// Handle <iframe>s
root: l.ownerDocument
});
} catch {
n = new IntersectionObserver(L, E);
}
n.observe(a);
}
return f(!0), s;
}
function Uc(a, r, n, o) {
o === void 0 && (o = {});
const {
ancestorScroll: l = !0,
ancestorResize: s = !0,
elementResize: f = typeof ResizeObserver == "function",
layoutShift: d = typeof IntersectionObserver == "function",
animationFrame: p = !1
} = o, g = _s(a), m = l || s ? [...g ? _a(g) : [], ..._a(r)] : [];
m.forEach((E) => {
l && E.addEventListener("scroll", n, {
passive: !0
}), s && E.addEventListener("resize", n);
});
const w = g && d ? Zw(g, n) : null;
let S = -1, b = null;
f && (b = new ResizeObserver((E) => {
let [F] = E;
F && F.target === g && b && (b.unobserve(r), cancelAnimationFrame(S), S = requestAnimationFrame(() => {
var L;
(L = b) == null || L.observe(r);
})), n();
}), g && !p && b.observe(g), b.observe(r));
let y, x = p ? lr(a) : null;
p && B();
function B() {
const E = lr(a);
x && (E.x !== x.x || E.y !== x.y || E.width !== x.width || E.height !== x.height) && n(), x = E, y = requestAnimationFrame(B);
}
return n(), () => {
var E;
m.forEach((F) => {
l && F.removeEventListener("scroll", n), s && F.removeEventListener("resize", n);
}), w == null || w(), (E = b) == null || E.disconnect(), b = null, p && cancelAnimationFrame(y);
};
}
const Qw = Tw, Wc = Fw, qc = Ew, Gc = Pw, e1 = kw, t1 = Aw, n1 = $w, r1 = (a, r, n) => {
const o = /* @__PURE__ */ new Map(), l = {
platform: Yw,
...n
}, s = {
...l.platform,
_c: o
};
return Bw(a, r, {
...l,
platform: s
});
};
function a1(a) {
return a != null && typeof a == "object" && "$el" in a;
}
function Yl(a) {
if (a1(a)) {
const r = a.$el;
return ms(r) && Tn(r) === "#comment" ? null : r;
}
return a;
}
function o1(a) {
return {
name: "arrow",
options: a,
fn(r) {
const n = Yl(K(a.element));
return n == null ? {} : t1({
element: n,
padding: a.padding
}).fn(r);
}
};
}
function jc(a) {
return typeof window > "u" ? 1 : (a.ownerDocument.defaultView || window).devicePixelRatio || 1;
}
function _d(a, r) {
const n = jc(a);
return Math.round(r * n) / n;
}
function Kc(a, r, n) {
n === void 0 && (n = {});
const o = n.whileElementsMounted, l = I(() => {
var H;
return (H = K(n.open)) != null ? H : !0;
}), s = I(() => K(n.middleware)), f = I(() => {
var H;
return (H = K(n.placement)) != null ? H : "bottom";
}), d = I(() => {
var H;
return (H = K(n.strategy)) != null ? H : "absolute";
}), p = I(() => {
var H;
return (H = K(n.transform)) != null ? H : !0;
}), g = I(() => Yl(a.value)), m = I(() => Yl(r.value)), w = te(0), S = te(0), b = te(d.value), y = te(f.value), x = Ac({}), B = te(!1), E = I(() => {
const H = {
position: b.value,
left: "0",
top: "0"
};
if (!m.value)
return H;
const ie = _d(m.value, w.value), se = _d(m.value, S.value);
return p.value ? {
...H,
transform: "translate(" + ie + "px, " + se + "px)",
...jc(m.value) >= 1.5 && {
willChange: "transform"
}
} : {
position: b.value,
left: ie + "px",
top: se + "px"
};
});
let F;
function L() {
g.value == null || m.value == null || r1(g.value, m.value, {
middleware: s.value,
placement: f.value,
strategy: d.value
}).then((H) => {
w.value = H.x, S.value = H.y, b.value = H.strategy, y.value = H.placement, x.value = H.middlewareData, B.value = !0;
});
}
function $() {
typeof F == "function" && (F(), F = void 0);
}
function k() {
if ($(), o === void 0) {
L();
return;
}
if (g.value != null && m.value != null) {
F = o(g.value, m.value, L);
return;
}
}
function z() {
l.value || (B.value = !1);
}
return Ue([s, f, d], L, {
flush: "sync"
}), Ue([g, m], k, {
flush: "sync"
}), Ue(l, z, {
flush: "sync"
}), Tc() && Ec($), {
x: Tr(w),
y: Tr(S),
strategy: Tr(b),
placement: Tr(y),
middlewareData: Tr(x),
isPositioned: Tr(B),
floatingStyles: E,
update: L
};
}
const i1 = /* @__PURE__ */ new Set([
"background",
"cite",
"href",
"itemtype",
"longdesc",
"poster",
"src",
"xlink:href"
]), l1 = /^aria-[\w-]*$/i, s1 = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i, u1 = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i, f1 = (a, r) => {
const n = a.nodeName.toLowerCase();
return r.includes(n) ? i1.has(n) ? !!(s1.test(a.nodeValue || "") || u1.test(a.nodeValue || "")) : !0 : r.filter((o) => o instanceof RegExp).some((o) => o.test(n));
}, Fr = {
// Global attributes allowed on any supplied element below.
"*": ["class", "dir", "id", "lang", "role", l1],
a: ["target", "href", "title", "rel"],
area: [],
b: [],
br: [],
col: [],
code: [],
div: [],
em: [],
hr: [],
h1: [],
h2: [],
h3: [],
h4: [],
h5: [],
h6: [],
i: [],
img: ["src", "srcset", "alt", "title", "width", "height"],
li: [],
ol: [],
p: [],
pre: [],
s: [],
small: [],
span: [],
sub: [],
sup: [],
strong: [],
u: [],
ul: []
}, Pr = (a, r, n) => {
if (!a.length)
return a;
const o = new window.DOMParser().parseFromString(a, "text/html"), l = o.body.querySelectorAll("*");
for (const s of l) {
const f = s.nodeName.toLowerCase();
if (!Object.keys(r).includes(f)) {
s.remove();
continue;
}
const d = s.attributes, p = [...r["*"] || [], ...r[f] || []];
for (const g of d)
f1(g, p) || s.removeAttribute(g.nodeName);
}
return o.body.innerHTML;
};
function Zo(a) {
return Tc() ? (Ec(a), !0) : !1;
}
function d1(a, r) {
if (typeof Symbol < "u") {
const n = { ...a };
return Object.defineProperty(n, Symbol.iterator, {
enumerable: !1,
value() {
let o = 0;
return {
next: () => ({
value: r[o++],
done: o > r.length
})
};
}
}), n;
} else
return Object.assign([...r], a);
}
function Cn(a) {
return typeof a == "function" ? a() : K(a);
}
const Jc = typeof window < "u" && typeof document < "u";
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
const c1 = (a) => typeof a < "u", p1 = Object.prototype.toString, v1 = (a) => p1.call(a) === "[object Object]", ar = () => {
}, Zl = /* @__PURE__ */ g1();
function g1() {
var a, r;
return Jc && ((a = window == null ? void 0 : window.navigator) == null ? void 0 : a.userAgent) && (/iP(ad|hone|od)/.test(window.navigator.userAgent) || ((r = window == null ? void 0 : window.navigator) == null ? void 0 : r.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
}
function h1(a, r) {
function n(...o) {
return new Promise((l, s) => {
Promise.resolve(a(() => r.apply(this, o), { fn: r, thisArg: this, args: o })).then(l).catch(s);
});
}
return n;
}
function m1(a, r = {}) {
let n, o, l = ar;
const s = (f) => {
clearTimeout(f), l(), l = ar;
};
return (f) => {
const d = Cn(a), p = Cn(r.maxWait);
return n && s(n), d <= 0 || p !== void 0 && p <= 0 ? (o && (s(o), o = null), Promise.resolve(f())) : new Promise((g, m) => {
l = r.rejectOnCancel ? m : g, p && !o && (o = setTimeout(() => {
n && s(n), o = null, g(f());
}, p)), n = setTimeout(() => {
o && s(o), o = null, g(f());
}, d);
});
};
}
function y1(a) {
const r = /* @__PURE__ */ Object.create(null);
return (n) => r[n] || (r[n] = a(n));
}
const b1 = /-(\w)/g, _1 = y1((a) => a.replace(b1, (r, n) => n ? n.toUpperCase() : ""));
function w1(...a) {
if (a.length !== 1)
return U(...a);
const r = a[0];
return typeof r == "function" ? Jl(sw(() => ({ get: r, set: ar }))) : te(r);
}
function x1(a, r = 200, n = {}) {
return h1(
m1(r, n),
a
);
}
function Ot(a, r = {}) {
const {
method: n = "parseFloat",
radix: o,
nanToZero: l
} = r;
return I(() => {
let s = Cn(a);
return typeof s == "string" && (s = Number[n](s, o)), l && Number.isNaN(s) && (s = 0), s;
});
}
function Xc(a = {}) {
const {
inheritAttrs: r = !0
} = a, n = Ac(), o = /* @__PURE__ */ ne({
setup(s, { slots: f }) {
return () => {
n.value = f.default;
};
}
}), l = /* @__PURE__ */ ne({
inheritAttrs: r,
setup(s, { attrs: f, slots: d }) {
return () => {
var p;
if (!n.value && cw.NODE_ENV !== "production")
throw new Error("[VueUse] Failed to find the definition of reusable template");
const g = (p = n.value) == null ? void 0 : p.call(n, { ...S1(f), $slots: d });
return r && (g == null ? void 0 : g.length) === 1 ? g[0] : g;
};
}
});
return d1(
{ define: o, reuse: l },
[o, l]
);
}
function S1(a) {
const r = {};
for (const n in a)
r[_1(n)] = a[n];
return r;
}
function zn(a) {
var r;
const n = Cn(a);
return (r = n == null ? void 0 : n.$el) != null ? r : n;
}
const Aa = Jc ? window : void 0;
function $t(...a) {
let r, n, o, l;
if (typeof a[0] == "string" || Array.isArray(a[0]) ? ([n, o, l] = a, r = Aa) : [r, n, o, l] = a, !r)
return ar;
Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
const s = [], f = () => {
s.forEach((m) => m()), s.length = 0;
}, d = (m, w, S, b) => (m.addEventListener(w, S, b), () => m.removeEventListener(w, S, b)), p = Ue(
() => [zn(r), Cn(l)],
([m, w]) => {
if (f(), !m)
return;
const S = v1(w) ? { ...w } : w;
s.push(
...n.flatMap((b) => o.map((y) => d(m, b, y, S)))
);
},
{ immediate: !0, flush: "post" }
), g = () => {
p(), f();
};
return Zo(g), g;
}
let wd = !1;
function Yc(a, r, n = {}) {
const { window: o = Aa, ignore: l = [], capture: s = !0, detectIframe: f = !1 } = n;
if (!o)
return ar;
Zl && !wd && (wd = !0, Array.from(o.document.body.children).forEach((m) => m.addEventListener("click", ar)), o.document.documentElement.addEventListener("click", ar));
let d = !0;
const p = (m) => l.some((w) => {
if (typeof w == "string")
return Array.from(o.document.querySelectorAll(w)).some((S) => S === m.target || m.composedPath().includes(S));
{
const S = zn(w);
return S && (m.target === S || m.composedPath().includes(S));
}
}), g = [
$t(o, "click", (m) => {
const w = zn(a);
if (!(!w || w === m.target || m.composedPath().includes(w))) {
if (m.detail === 0 && (d = !p(m)), !d) {
d = !0;
return;
}
r(m);
}
}, { passive: !0, capture: s }),
$t(o, "pointerdown", (m) => {
const w = zn(a);
d = !p(m) && !!(w && !m.composedPath().includes(w));
}, { passive: !0 }),
f && $t(o, "blur", (m) => {
setTimeout(() => {
var w;
const S = zn(a);
((w = o.document.activeElement) == null ? void 0 : w.tagName) === "IFRAME" && !(S != null && S.contains(o.document.activeElement)) && r(m);
}, 0);
})
].filter(Boolean);
return () => g.forEach((m) => m());
}
function B1(a) {
return typeof a == "function" ? a : typeof a == "string" ? (r) => r.key === a : Array.isArray(a) ? (r) => a.includes(r.key) : () => !0;
}
function tr(...a) {
let r, n, o = {};
a.length === 3 ? (r = a[0], n = a[1], o = a[2]) : a.length === 2 ? typeof a[1] == "object" ? (r = !0, n = a[0], o = a[1]) : (r = a[0], n = a[1]) : (r = !0, n = a[0]);
const {
target: l = Aa,
eventName: s = "keydown",
passive: f = !1,
dedupe: d = !1
} = o, p = B1(r);
return $t(l, s, (g) => {
g.repeat && Cn(d) || p(g) && n(g);
}, f);
}
function A1(a) {
return JSON.parse(JSON.stringify(a));
}
const Co = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, To = "__vueuse_ssr_handlers__", C1 = /* @__PURE__ */ T1();
function T1() {
return To in Co || (Co[To] = Co[To] || {}), Co[To];
}
function E1(a, r) {
return C1[a] || r;
}
function fn(a, r = {}) {
const { initialValue: n = !1, focusVisible: o = !1 } = r, l = te(!1), s = I(() => zn(a));
$t(s, "focus", (d) => {
var p, g;
(!o || (g = (p = d.target).matches) != null && g.call(p, ":focus-visible")) && (l.value = !0);
}), $t(s, "blur", () => l.value = !1);
const f = I({
get: () => l.value,
set(d) {
var p, g;
!d && l.value ? (p = s.value) == null || p.blur() : d && !l.value && ((g = s.value) == null || g.focus());
}
});
return Ue(
s,
() => {
f.value = n;
},
{ immediate: !0, flush: "post" }
), { focused: f };
}
function kl(a) {
return typeof Window < "u" && a instanceof Window ? a.document.documentElement : typeof Document < "u" && a instanceof Document ? a.documentElement : a;
}
const k1 = {
page: (a) => [a.pageX, a.pageY],
client: (a) => [a.clientX, a.clientY],
screen: (a) => [a.screenX, a.screenY],
movement: (a) => a instanceof Touch ? null : [a.movementX, a.movementY]
};
function O1(a = {}) {
const {
type: r = "page",
touch: n = !0,
resetOnTouchEnds: o = !1,
initialValue: l = { x: 0, y: 0 },
window: s = Aa,
target: f = s,
scroll: d = !0,
eventFilter: p
} = a;
let g = null;
const m = te(l.x), w = te(l.y), S = te(null), b = typeof r == "function" ? r : k1[r], y = (k) => {
const z = b(k);
g = k, z && ([m.value, w.value] = z, S.value = "mouse");
}, x = (k) => {
if (k.touches.length > 0) {
const z = b(k.touches[0]);
z && ([m.value, w.value] = z, S.value = "touch");
}
}, B = () => {
if (!g || !s)
return;
const k = b(g);
g instanceof MouseEvent && k && (m.value = k[0] + s.scrollX, w.value = k[1] + s.scrollY);
}, E = () => {
m.value = l.x, w.value = l.y;
}, F = p ? (k) => p(() => y(k), {}) : (k) => y(k), L = p ? (k) => p(() => x(k), {}) : (k) => x(k), $ = p ? () => p(() => B(), {}) : () => B();
if (f) {
const k = { passive: !0 };
$t(f, ["mousemove", "dragover"], F, k), n && r !== "movement" && ($t(f, ["touchstart", "touchmove"], L, k), o && $t(f, "touchend", E, k)), d && r === "page" && $t(s, "scroll", $, { passive: !0 });
}
return {
x: m,
y: w,
sourceType: S
};
}
function xd(a, r = {}) {
const {
handleOutside: n = !0,
window: o = Aa
} = r, l = r.type || "page", { x: s, y: f, sourceType: d } = O1(r), p = te(a ?? (o == null ? void 0 : o.document.body)), g = te(0), m = te(0), w = te(0), S = te(0), b = te(0), y = te(0), x = te(!0);
let B = () => {
};
return o && (B = Ue(
[p, s, f],
() => {
const E = zn(p);
if (!E)
return;
const {
left: F,
top: L,
width: $,
height: k
} = E.getBoundingClientRect();
w.value = F + (l === "page" ? o.pageXOffset : 0), S.value = L + (l === "page" ? o.pageYOffset : 0), b.value = k, y.value = $;
const z = s.value - w.value, H = f.value - S.value;
x.value = $ === 0 || k === 0 || z < 0 || H < 0 || z > $ || H > k, (n || !x.value) && (g.value = z, m.value = H);
},
{ immediate: !0 }
), $t(document, "mouseleave", () => {
x.value = !0;
})), {
x: s,
y: f,
sourceType: d,
elementX: g,
elementY: m,
elementPositionX: w,
elementPositionY: S,
elementHeight: b,
elementWidth: y,
isOutside: x,
stop: B
};
}
function Zc(a) {
const r = window.getComputedStyle(a);
if (r.overflowX === "scroll" || r.overflowY === "scroll" || r.overflowX === "auto" && a.clientWidth < a.scrollWidth || r.overflowY === "auto" && a.clientHeight < a.scrollHeight)
return !0;
{
const n = a.parentNode;
return !n || n.tagName === "BODY" ? !1 : Zc(n);
}
}
function $1(a) {
const r = a || window.event, n = r.target;
return Zc(n) ? !1 : r.touches.length > 1 ? !0 : (r.preventDefault && r.preventDefault(), !1);
}
const Eo = /* @__PURE__ */ new WeakMap();
function R1(a, r = !1) {
const n = te(r);
let o = null;
Ue(w1(a), (f) => {
const d = kl(Cn(f));
if (d) {
const p = d;
Eo.get(p) || Eo.set(p, p.style.overflow), n.value && (p.style.overflow = "hidden");
}
}, {
immediate: !0
});
const l = () => {
const f = kl(Cn(a));
!f || n.value || (Zl && (o = $t(
f,
"touchmove",