UNPKG

@visitscotland/component-library

Version:
1,757 lines (1,756 loc) 479 kB
import { defineComponent as ce, computed as z, h as St, Teleport as wo, ref as ue, watch as tt, onMounted as Xa, nextTick as pr, toRef as X, createBlock as re, openBlock as U, resolveDynamicComponent as Ge, normalizeClass as oe, withCtx as se, renderSlot as Y, createTextVNode as Le, toDisplayString as Pe, toValue as Qt, inject as pn, mergeModels as Tt, useModel as en, withDirectives as ba, createElementBlock as ee, unref as te, Fragment as mt, renderList as Dr, vModelSelect as Bw, mergeProps as ke, createCommentVNode as Me, createVNode as Yt, useAttrs as Ds, getCurrentInstance as Vs, useSlots as Vr, onActivated as Sw, normalizeProps as cn, createElementVNode as at, vModelRadio as Aw, provide as Ya, normalizeStyle as In, vModelCheckbox as Ew, vShow as Us, guardReactiveProps as jn, watchEffect as Tw, onBeforeUnmount as Cw, withModifiers as za, withKeys as la, onUnmounted as kw, shallowRef as Kd, render as Jd, shallowReadonly as ta, getCurrentScope as Xd, onScopeDispose as Yd, readonly as ys, Transition as Rw, customRef as Fw, resolveComponent as dn, createStaticVNode as Ow } from "vue"; import { defineStore as Iw, mapState as $w } from "pinia"; const Bn = (n, r) => { const a = n.__vccOpts || n; for (const [i, l] of r) a[i] = l; return a; }, bs = globalThis || void 0 || self; var Lw = {}, Pw = Object.defineProperty, Nw = (n, r, a) => r in n ? Pw(n, r, { enumerable: !0, configurable: !0, writable: !0, value: a }) : n[r] = a, Gn = (n, r, a) => (Nw(n, typeof r != "symbol" ? r + "" : r, a), a); const Zd = (n) => z(() => { const r = Qt(n); return r ? `justify-content-${r}` : ""; }), xo = (n, r) => z(() => { const a = Qt(n), i = Qt(r); return a === !0 ? "true" : typeof a == "string" ? a : i === !1 ? "true" : a === !1 ? "false" : void 0; }); class Ga { constructor(r, a = {}) { if (Gn(this, "cancelable", !0), Gn(this, "componentId", null), Gn(this, "_defaultPrevented", !1), Gn(this, "eventType", ""), Gn(this, "nativeEvent", null), Gn(this, "_preventDefault"), Gn(this, "relatedTarget", null), Gn(this, "target", null), !r) throw new TypeError( `Failed to construct '${this.constructor.name}'. 1 argument required, ${arguments.length} given.` ); Object.assign(this, Ga.Defaults, a, { 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 Ms extends Ga { constructor(r, a = {}) { super(r, a), Gn(this, "trigger", null), Object.assign(this, Ga.Defaults, a, { eventType: r }); } static get Defaults() { return { ...super.Defaults, trigger: null }; } } const Dw = (n, r = {}) => { const a = (l = []) => { const { activeElement: s } = document; return s && !l.some((u) => u === s) ? s : null; }, i = (l) => l === a(); try { n.focus(r); } catch (l) { console.error(l); } return i(n); }, hr = (n) => ((n == null ? void 0 : n()) ?? []).length === 0, Vw = (n) => { if (n.getAttribute("display") === "none") return !1; const r = n.getBoundingClientRect(); return !!(r && r.height > 0 && r.width > 0); }, Uw = (n) => { const r = window.getComputedStyle(n), a = r.transitionDelay.split(",")[0] || "", i = r.transitionDuration.split(",")[0] || "", l = Number(a.slice(0, -1)) * 1e3, s = Number(i.slice(0, -1)) * 1e3; return l + s; }, Qd = typeof window < "u" && typeof document < "u" && typeof navigator < "u", ep = ["top", "right", "bottom", "left"], Nc = ["start", "end"], Dc = /* @__PURE__ */ ep.reduce((n, r) => n.concat(r, r + "-" + Nc[0], r + "-" + Nc[1]), []), xn = Math.min, At = Math.max, fo = Math.round, Xi = Math.floor, gr = (n) => ({ x: n, y: n }), Mw = { left: "right", right: "left", bottom: "top", top: "bottom" }, zw = { start: "end", end: "start" }; function _s(n, r, a) { return At(n, xn(r, a)); } function Zn(n, r) { return typeof n == "function" ? n(r) : n; } function vn(n) { return n.split("-")[0]; } function wn(n) { return n.split("-")[1]; } function tp(n) { return n === "x" ? "y" : "x"; } function zs(n) { return n === "y" ? "height" : "width"; } function _a(n) { return ["top", "bottom"].includes(vn(n)) ? "y" : "x"; } function Hs(n) { return tp(_a(n)); } function np(n, r, a) { a === void 0 && (a = !1); const i = wn(n), l = Hs(n), s = zs(l); let u = l === "x" ? i === (a ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top"; return r.reference[s] > r.floating[s] && (u = po(u)), [u, po(u)]; } function Hw(n) { const r = po(n); return [co(n), r, co(r)]; } function co(n) { return n.replace(/start|end/g, (r) => zw[r]); } function Ww(n, r, a) { const i = ["left", "right"], l = ["right", "left"], s = ["top", "bottom"], u = ["bottom", "top"]; switch (n) { case "top": case "bottom": return a ? r ? l : i : r ? i : l; case "left": case "right": return r ? s : u; default: return []; } } function qw(n, r, a, i) { const l = wn(n); let s = Ww(vn(n), a === "start", i); return l && (s = s.map((u) => u + "-" + l), r && (s = s.concat(s.map(co)))), s; } function po(n) { return n.replace(/left|right|bottom|top/g, (r) => Mw[r]); } function Gw(n) { return { top: 0, right: 0, bottom: 0, left: 0, ...n }; } function Ws(n) { return typeof n != "number" ? Gw(n) : { top: n, right: n, bottom: n, left: n }; } function ha(n) { return { ...n, top: n.y, left: n.x, right: n.x + n.width, bottom: n.y + n.height }; } function Vc(n, r, a) { let { reference: i, floating: l } = n; const s = _a(r), u = Hs(r), p = zs(u), g = vn(r), y = s === "y", v = i.x + i.width / 2 - l.width / 2, B = i.y + i.height / 2 - l.height / 2, E = i[p] / 2 - l[p] / 2; let x; switch (g) { case "top": x = { x: v, y: i.y - l.height }; break; case "bottom": x = { x: v, y: i.y + i.height }; break; case "right": x = { x: i.x + i.width, y: B }; break; case "left": x = { x: i.x - l.width, y: B }; break; default: x = { x: i.x, y: i.y }; } switch (wn(r)) { case "start": x[u] -= E * (a && y ? -1 : 1); break; case "end": x[u] += E * (a && y ? -1 : 1); break; } return x; } const jw = async (n, r, a) => { const { placement: i = "bottom", strategy: l = "absolute", middleware: s = [], platform: u } = a, p = s.filter(Boolean), g = await (u.isRTL == null ? void 0 : u.isRTL(r)); let y = await u.getElementRects({ reference: n, floating: r, strategy: l }), { x: v, y: B } = Vc(y, i, g), E = i, x = {}, A = 0; for (let T = 0; T < p.length; T++) { const { name: C, fn: I } = p[T], { x: L, y: M, data: D, reset: $ } = await I({ x: v, y: B, initialPlacement: i, placement: E, strategy: l, middlewareData: x, rects: y, platform: u, elements: { reference: n, floating: r } }); v = L ?? v, B = M ?? B, x = { ...x, [C]: { ...x[C], ...D } }, $ && A <= 50 && (A++, typeof $ == "object" && ($.placement && (E = $.placement), $.rects && (y = $.rects === !0 ? await u.getElementRects({ reference: n, floating: r, strategy: l }) : $.rects), { x: v, y: B } = Vc(y, E, g)), T = -1); } return { x: v, y: B, placement: E, strategy: l, middlewareData: x }; }; async function ga(n, r) { var a; r === void 0 && (r = {}); const { x: i, y: l, platform: s, rects: u, elements: p, strategy: g } = n, { boundary: y = "clippingAncestors", rootBoundary: v = "viewport", elementContext: B = "floating", altBoundary: E = !1, padding: x = 0 } = Zn(r, n), A = Ws(x), T = p[E ? B === "floating" ? "reference" : "floating" : B], C = ha(await s.getClippingRect({ element: (a = await (s.isElement == null ? void 0 : s.isElement(T))) == null || a ? T : T.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(p.floating)), boundary: y, rootBoundary: v, strategy: g })), I = B === "floating" ? { ...u.floating, x: i, y: l } : u.reference, L = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(p.floating)), M = await (s.isElement == null ? void 0 : s.isElement(L)) ? await (s.getScale == null ? void 0 : s.getScale(L)) || { x: 1, y: 1 } : { x: 1, y: 1 }, D = ha(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({ elements: p, rect: I, offsetParent: L, strategy: g }) : I); return { top: (C.top - D.top + A.top) / M.y, bottom: (D.bottom - C.bottom + A.bottom) / M.y, left: (C.left - D.left + A.left) / M.x, right: (D.right - C.right + A.right) / M.x }; } const Kw = (n) => ({ name: "arrow", options: n, async fn(r) { const { x: a, y: i, placement: l, rects: s, platform: u, elements: p, middlewareData: g } = r, { element: y, padding: v = 0 } = Zn(n, r) || {}; if (y == null) return {}; const B = Ws(v), E = { x: a, y: i }, x = Hs(l), A = zs(x), T = await u.getDimensions(y), C = x === "y", I = C ? "top" : "left", L = C ? "bottom" : "right", M = C ? "clientHeight" : "clientWidth", D = s.reference[A] + s.reference[x] - E[x] - s.floating[A], $ = E[x] - s.reference[x], G = await (u.getOffsetParent == null ? void 0 : u.getOffsetParent(y)); let J = G ? G[M] : 0; (!J || !await (u.isElement == null ? void 0 : u.isElement(G))) && (J = p.floating[M] || s.floating[A]); const le = D / 2 - $ / 2, ge = J / 2 - T[A] / 2 - 1, Ie = xn(B[I], ge), je = xn(B[L], ge), De = Ie, Ke = J - T[A] - je, Q = J / 2 - T[A] / 2 + le, Be = _s(De, Q, Ke), $e = !g.arrow && wn(l) != null && Q !== Be && s.reference[A] / 2 - (Q < De ? Ie : je) - T[A] / 2 < 0, Re = $e ? Q < De ? Q - De : Q - Ke : 0; return { [x]: E[x] + Re, data: { [x]: Be, centerOffset: Q - Be - Re, ...$e && { alignmentOffset: Re } }, reset: $e }; } }); function Jw(n, r, a) { return (n ? [...a.filter((i) => wn(i) === n), ...a.filter((i) => wn(i) !== n)] : a.filter((i) => vn(i) === i)).filter((i) => n ? wn(i) === n || (r ? co(i) !== i : !1) : !0); } const Xw = function(n) { return n === void 0 && (n = {}), { name: "autoPlacement", options: n, async fn(r) { var a, i, l; const { rects: s, middlewareData: u, placement: p, platform: g, elements: y } = r, { crossAxis: v = !1, alignment: B, allowedPlacements: E = Dc, autoAlignment: x = !0, ...A } = Zn(n, r), T = B !== void 0 || E === Dc ? Jw(B || null, x, E) : E, C = await ga(r, A), I = ((a = u.autoPlacement) == null ? void 0 : a.index) || 0, L = T[I]; if (L == null) return {}; const M = np(L, s, await (g.isRTL == null ? void 0 : g.isRTL(y.floating))); if (p !== L) return { reset: { placement: T[0] } }; const D = [C[vn(L)], C[M[0]], C[M[1]]], $ = [...((i = u.autoPlacement) == null ? void 0 : i.overflows) || [], { placement: L, overflows: D }], G = T[I + 1]; if (G) return { data: { index: I + 1, overflows: $ }, reset: { placement: G } }; const J = $.map((ge) => { const Ie = wn(ge.placement); return [ge.placement, Ie && v ? ( // Check along the mainAxis and main crossAxis side. ge.overflows.slice(0, 2).reduce((je, De) => je + De, 0) ) : ( // Check only the mainAxis. ge.overflows[0] ), ge.overflows]; }).sort((ge, Ie) => ge[1] - Ie[1]), le = ((l = J.filter((ge) => ge[2].slice( 0, // Aligned placements should not check their opposite crossAxis // side. wn(ge[0]) ? 2 : 3 ).every((Ie) => Ie <= 0))[0]) == null ? void 0 : l[0]) || J[0][0]; return le !== p ? { data: { index: I + 1, overflows: $ }, reset: { placement: le } } : {}; } }; }, Yw = function(n) { return n === void 0 && (n = {}), { name: "flip", options: n, async fn(r) { var a, i; const { placement: l, middlewareData: s, rects: u, initialPlacement: p, platform: g, elements: y } = r, { mainAxis: v = !0, crossAxis: B = !0, fallbackPlacements: E, fallbackStrategy: x = "bestFit", fallbackAxisSideDirection: A = "none", flipAlignment: T = !0, ...C } = Zn(n, r); if ((a = s.arrow) != null && a.alignmentOffset) return {}; const I = vn(l), L = vn(p) === p, M = await (g.isRTL == null ? void 0 : g.isRTL(y.floating)), D = E || (L || !T ? [po(p)] : Hw(p)); !E && A !== "none" && D.push(...qw(p, T, A, M)); const $ = [p, ...D], G = await ga(r, C), J = []; let le = ((i = s.flip) == null ? void 0 : i.overflows) || []; if (v && J.push(G[I]), B) { const De = np(l, u, M); J.push(G[De[0]], G[De[1]]); } if (le = [...le, { placement: l, overflows: J }], !J.every((De) => De <= 0)) { var ge, Ie; const De = (((ge = s.flip) == null ? void 0 : ge.index) || 0) + 1, Ke = $[De]; if (Ke) return { data: { index: De, overflows: le }, reset: { placement: Ke } }; let Q = (Ie = le.filter((Be) => Be.overflows[0] <= 0).sort((Be, $e) => Be.overflows[1] - $e.overflows[1])[0]) == null ? void 0 : Ie.placement; if (!Q) switch (x) { case "bestFit": { var je; const Be = (je = le.map(($e) => [$e.placement, $e.overflows.filter((Re) => Re > 0).reduce((Re, Fe) => Re + Fe, 0)]).sort(($e, Re) => $e[1] - Re[1])[0]) == null ? void 0 : je[0]; Be && (Q = Be); break; } case "initialPlacement": Q = p; break; } if (l !== Q) return { reset: { placement: Q } }; } return {}; } }; }; function Uc(n, r) { return { top: n.top - r.height, right: n.right - r.width, bottom: n.bottom - r.height, left: n.left - r.width }; } function Mc(n) { return ep.some((r) => n[r] >= 0); } const Zw = function(n) { return n === void 0 && (n = {}), { name: "hide", options: n, async fn(r) { const { rects: a } = r, { strategy: i = "referenceHidden", ...l } = Zn(n, r); switch (i) { case "referenceHidden": { const s = await ga(r, { ...l, elementContext: "reference" }), u = Uc(s, a.reference); return { data: { referenceHiddenOffsets: u, referenceHidden: Mc(u) } }; } case "escaped": { const s = await ga(r, { ...l, altBoundary: !0 }), u = Uc(s, a.floating); return { data: { escapedOffsets: u, escaped: Mc(u) } }; } default: return {}; } } }; }; function rp(n) { const r = xn(...n.map((s) => s.left)), a = xn(...n.map((s) => s.top)), i = At(...n.map((s) => s.right)), l = At(...n.map((s) => s.bottom)); return { x: r, y: a, width: i - r, height: l - a }; } function Qw(n) { const r = n.slice().sort((l, s) => l.y - s.y), a = []; let i = null; for (let l = 0; l < r.length; l++) { const s = r[l]; !i || s.y - i.y > i.height / 2 ? a.push([s]) : a[a.length - 1].push(s), i = s; } return a.map((l) => ha(rp(l))); } const e1 = function(n) { return n === void 0 && (n = {}), { name: "inline", options: n, async fn(r) { const { placement: a, elements: i, rects: l, platform: s, strategy: u } = r, { padding: p = 2, x: g, y } = Zn(n, r), v = Array.from(await (s.getClientRects == null ? void 0 : s.getClientRects(i.reference)) || []), B = Qw(v), E = ha(rp(v)), x = Ws(p); function A() { if (B.length === 2 && B[0].left > B[1].right && g != null && y != null) return B.find((C) => g > C.left - x.left && g < C.right + x.right && y > C.top - x.top && y < C.bottom + x.bottom) || E; if (B.length >= 2) { if (_a(a) === "y") { const Ie = B[0], je = B[B.length - 1], De = vn(a) === "top", Ke = Ie.top, Q = je.bottom, Be = De ? Ie.left : je.left, $e = De ? Ie.right : je.right, Re = $e - Be, Fe = Q - Ke; return { top: Ke, bottom: Q, left: Be, right: $e, width: Re, height: Fe, x: Be, y: Ke }; } const C = vn(a) === "left", I = At(...B.map((Ie) => Ie.right)), L = xn(...B.map((Ie) => Ie.left)), M = B.filter((Ie) => C ? Ie.left === L : Ie.right === I), D = M[0].top, $ = M[M.length - 1].bottom, G = L, J = I, le = J - G, ge = $ - D; return { top: D, bottom: $, left: G, right: J, width: le, height: ge, x: G, y: D }; } return E; } const T = await s.getElementRects({ reference: { getBoundingClientRect: A }, floating: i.floating, strategy: u }); return l.reference.x !== T.reference.x || l.reference.y !== T.reference.y || l.reference.width !== T.reference.width || l.reference.height !== T.reference.height ? { reset: { rects: T } } : {}; } }; }; async function t1(n, r) { const { placement: a, platform: i, elements: l } = n, s = await (i.isRTL == null ? void 0 : i.isRTL(l.floating)), u = vn(a), p = wn(a), g = _a(a) === "y", y = ["left", "top"].includes(u) ? -1 : 1, v = s && g ? -1 : 1, B = Zn(r, n); let { mainAxis: E, crossAxis: x, alignmentAxis: A } = typeof B == "number" ? { mainAxis: B, crossAxis: 0, alignmentAxis: null } : { mainAxis: 0, crossAxis: 0, alignmentAxis: null, ...B }; return p && typeof A == "number" && (x = p === "end" ? A * -1 : A), g ? { x: x * v, y: E * y } : { x: E * y, y: x * v }; } const ap = function(n) { return n === void 0 && (n = 0), { name: "offset", options: n, async fn(r) { var a, i; const { x: l, y: s, placement: u, middlewareData: p } = r, g = await t1(r, n); return u === ((a = p.offset) == null ? void 0 : a.placement) && (i = p.arrow) != null && i.alignmentOffset ? {} : { x: l + g.x, y: s + g.y, data: { ...g, placement: u } }; } }; }, n1 = function(n) { return n === void 0 && (n = {}), { name: "shift", options: n, async fn(r) { const { x: a, y: i, placement: l } = r, { mainAxis: s = !0, crossAxis: u = !1, limiter: p = { fn: (C) => { let { x: I, y: L } = C; return { x: I, y: L }; } }, ...g } = Zn(n, r), y = { x: a, y: i }, v = await ga(r, g), B = _a(vn(l)), E = tp(B); let x = y[E], A = y[B]; if (s) { const C = E === "y" ? "top" : "left", I = E === "y" ? "bottom" : "right", L = x + v[C], M = x - v[I]; x = _s(L, x, M); } if (u) { const C = B === "y" ? "top" : "left", I = B === "y" ? "bottom" : "right", L = A + v[C], M = A - v[I]; A = _s(L, A, M); } const T = p.fn({ ...r, [E]: x, [B]: A }); return { ...T, data: { x: T.x - a, y: T.y - i } }; } }; }, r1 = function(n) { return n === void 0 && (n = {}), { name: "size", options: n, async fn(r) { const { placement: a, rects: i, platform: l, elements: s } = r, { apply: u = () => { }, ...p } = Zn(n, r), g = await ga(r, p), y = vn(a), v = wn(a), B = _a(a) === "y", { width: E, height: x } = i.floating; let A, T; y === "top" || y === "bottom" ? (A = y, T = v === (await (l.isRTL == null ? void 0 : l.isRTL(s.floating)) ? "start" : "end") ? "left" : "right") : (T = y, A = v === "end" ? "top" : "bottom"); const C = x - g[A], I = E - g[T], L = !r.middlewareData.shift; let M = C, D = I; if (B) { const G = E - g.left - g.right; D = v || L ? xn(I, G) : G; } else { const G = x - g.top - g.bottom; M = v || L ? xn(C, G) : G; } if (L && !v) { const G = At(g.left, 0), J = At(g.right, 0), le = At(g.top, 0), ge = At(g.bottom, 0); B ? D = E - 2 * (G !== 0 || J !== 0 ? G + J : At(g.left, g.right)) : M = x - 2 * (le !== 0 || ge !== 0 ? le + ge : At(g.top, g.bottom)); } await u({ ...r, availableWidth: D, availableHeight: M }); const $ = await l.getDimensions(s.floating); return E !== $.width || x !== $.height ? { reset: { rects: !0 } } : {}; } }; }; function Xn(n) { return qs(n) ? (n.nodeName || "").toLowerCase() : "#document"; } function Zt(n) { var r; return (n == null || (r = n.ownerDocument) == null ? void 0 : r.defaultView) || window; } function Qn(n) { var r; return (r = (qs(n) ? n.ownerDocument : n.document) || window.document) == null ? void 0 : r.documentElement; } function qs(n) { return n instanceof Node || n instanceof Zt(n).Node; } function Yn(n) { return n instanceof Element || n instanceof Zt(n).Element; } function $n(n) { return n instanceof HTMLElement || n instanceof Zt(n).HTMLElement; } function zc(n) { return typeof ShadowRoot > "u" ? !1 : n instanceof ShadowRoot || n instanceof Zt(n).ShadowRoot; } function Za(n) { const { overflow: r, overflowX: a, overflowY: i, display: l } = hn(n); return /auto|scroll|overlay|hidden|clip/.test(r + i + a) && !["inline", "contents"].includes(l); } function a1(n) { return ["table", "td", "th"].includes(Xn(n)); } function Gs(n) { const r = js(), a = hn(n); return a.transform !== "none" || a.perspective !== "none" || (a.containerType ? a.containerType !== "normal" : !1) || !r && (a.backdropFilter ? a.backdropFilter !== "none" : !1) || !r && (a.filter ? a.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((i) => (a.willChange || "").includes(i)) || ["paint", "layout", "strict", "content"].some((i) => (a.contain || "").includes(i)); } function i1(n) { let r = ma(n); for (; $n(r) && !Bo(r); ) { if (Gs(r)) return r; r = ma(r); } return null; } function js() { return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none"); } function Bo(n) { return ["html", "body", "#document"].includes(Xn(n)); } function hn(n) { return Zt(n).getComputedStyle(n); } function So(n) { return Yn(n) ? { scrollLeft: n.scrollLeft, scrollTop: n.scrollTop } : { scrollLeft: n.pageXOffset, scrollTop: n.pageYOffset }; } function ma(n) { if (Xn(n) === "html") return n; const r = ( // Step into the shadow DOM of the parent of a slotted node. n.assignedSlot || // DOM Element detected. n.parentNode || // ShadowRoot detected. zc(n) && n.host || // Fallback. Qn(n) ); return zc(r) ? r.host : r; } function ip(n) { const r = ma(n); return Bo(r) ? n.ownerDocument ? n.ownerDocument.body : n.body : $n(r) && Za(r) ? r : ip(r); } function ja(n, r, a) { var i; r === void 0 && (r = []), a === void 0 && (a = !0); const l = ip(n), s = l === ((i = n.ownerDocument) == null ? void 0 : i.body), u = Zt(l); return s ? r.concat(u, u.visualViewport || [], Za(l) ? l : [], u.frameElement && a ? ja(u.frameElement) : []) : r.concat(l, ja(l, [], a)); } function op(n) { const r = hn(n); let a = parseFloat(r.width) || 0, i = parseFloat(r.height) || 0; const l = $n(n), s = l ? n.offsetWidth : a, u = l ? n.offsetHeight : i, p = fo(a) !== s || fo(i) !== u; return p && (a = s, i = u), { width: a, height: i, $: p }; } function Ks(n) { return Yn(n) ? n : n.contextElement; } function ca(n) { const r = Ks(n); if (!$n(r)) return gr(1); const a = r.getBoundingClientRect(), { width: i, height: l, $: s } = op(r); let u = (s ? fo(a.width) : a.width) / i, p = (s ? fo(a.height) : a.height) / l; return (!u || !Number.isFinite(u)) && (u = 1), (!p || !Number.isFinite(p)) && (p = 1), { x: u, y: p }; } const o1 = /* @__PURE__ */ gr(0); function lp(n) { const r = Zt(n); return !js() || !r.visualViewport ? o1 : { x: r.visualViewport.offsetLeft, y: r.visualViewport.offsetTop }; } function l1(n, r, a) { return r === void 0 && (r = !1), !a || r && a !== Zt(n) ? !1 : r; } function Pr(n, r, a, i) { r === void 0 && (r = !1), a === void 0 && (a = !1); const l = n.getBoundingClientRect(), s = Ks(n); let u = gr(1); r && (i ? Yn(i) && (u = ca(i)) : u = ca(n)); const p = l1(s, a, i) ? lp(s) : gr(0); let g = (l.left + p.x) / u.x, y = (l.top + p.y) / u.y, v = l.width / u.x, B = l.height / u.y; if (s) { const E = Zt(s), x = i && Yn(i) ? Zt(i) : i; let A = E, T = A.frameElement; for (; T && i && x !== A; ) { const C = ca(T), I = T.getBoundingClientRect(), L = hn(T), M = I.left + (T.clientLeft + parseFloat(L.paddingLeft)) * C.x, D = I.top + (T.clientTop + parseFloat(L.paddingTop)) * C.y; g *= C.x, y *= C.y, v *= C.x, B *= C.y, g += M, y += D, A = Zt(T), T = A.frameElement; } } return ha({ width: v, height: B, x: g, y }); } const s1 = [":popover-open", ":modal"]; function sp(n) { return s1.some((r) => { try { return n.matches(r); } catch { return !1; } }); } function u1(n) { let { elements: r, rect: a, offsetParent: i, strategy: l } = n; const s = l === "fixed", u = Qn(i), p = r ? sp(r.floating) : !1; if (i === u || p && s) return a; let g = { scrollLeft: 0, scrollTop: 0 }, y = gr(1); const v = gr(0), B = $n(i); if ((B || !B && !s) && ((Xn(i) !== "body" || Za(u)) && (g = So(i)), $n(i))) { const E = Pr(i); y = ca(i), v.x = E.x + i.clientLeft, v.y = E.y + i.clientTop; } return { width: a.width * y.x, height: a.height * y.y, x: a.x * y.x - g.scrollLeft * y.x + v.x, y: a.y * y.y - g.scrollTop * y.y + v.y }; } function f1(n) { return Array.from(n.getClientRects()); } function up(n) { return Pr(Qn(n)).left + So(n).scrollLeft; } function c1(n) { const r = Qn(n), a = So(n), i = n.ownerDocument.body, l = At(r.scrollWidth, r.clientWidth, i.scrollWidth, i.clientWidth), s = At(r.scrollHeight, r.clientHeight, i.scrollHeight, i.clientHeight); let u = -a.scrollLeft + up(n); const p = -a.scrollTop; return hn(i).direction === "rtl" && (u += At(r.clientWidth, i.clientWidth) - l), { width: l, height: s, x: u, y: p }; } function d1(n, r) { const a = Zt(n), i = Qn(n), l = a.visualViewport; let s = i.clientWidth, u = i.clientHeight, p = 0, g = 0; if (l) { s = l.width, u = l.height; const y = js(); (!y || y && r === "fixed") && (p = l.offsetLeft, g = l.offsetTop); } return { width: s, height: u, x: p, y: g }; } function p1(n, r) { const a = Pr(n, !0, r === "fixed"), i = a.top + n.clientTop, l = a.left + n.clientLeft, s = $n(n) ? ca(n) : gr(1), u = n.clientWidth * s.x, p = n.clientHeight * s.y, g = l * s.x, y = i * s.y; return { width: u, height: p, x: g, y }; } function Hc(n, r, a) { let i; if (r === "viewport") i = d1(n, a); else if (r === "document") i = c1(Qn(n)); else if (Yn(r)) i = p1(r, a); else { const l = lp(n); i = { ...r, x: r.x - l.x, y: r.y - l.y }; } return ha(i); } function fp(n, r) { const a = ma(n); return a === r || !Yn(a) || Bo(a) ? !1 : hn(a).position === "fixed" || fp(a, r); } function v1(n, r) { const a = r.get(n); if (a) return a; let i = ja(n, [], !1).filter((p) => Yn(p) && Xn(p) !== "body"), l = null; const s = hn(n).position === "fixed"; let u = s ? ma(n) : n; for (; Yn(u) && !Bo(u); ) { const p = hn(u), g = Gs(u); !g && p.position === "fixed" && (l = null), (s ? !g && !l : !g && p.position === "static" && l && ["absolute", "fixed"].includes(l.position) || Za(u) && !g && fp(n, u)) ? i = i.filter((y) => y !== u) : l = p, u = ma(u); } return r.set(n, i), i; } function h1(n) { let { element: r, boundary: a, rootBoundary: i, strategy: l } = n; const s = [...a === "clippingAncestors" ? v1(r, this._c) : [].concat(a), i], u = s[0], p = s.reduce((g, y) => { const v = Hc(r, y, l); return g.top = At(v.top, g.top), g.right = xn(v.right, g.right), g.bottom = xn(v.bottom, g.bottom), g.left = At(v.left, g.left), g; }, Hc(r, u, l)); return { width: p.right - p.left, height: p.bottom - p.top, x: p.left, y: p.top }; } function g1(n) { const { width: r, height: a } = op(n); return { width: r, height: a }; } function m1(n, r, a) { const i = $n(r), l = Qn(r), s = a === "fixed", u = Pr(n, !0, s, r); let p = { scrollLeft: 0, scrollTop: 0 }; const g = gr(0); if (i || !i && !s) if ((Xn(r) !== "body" || Za(l)) && (p = So(r)), i) { const B = Pr(r, !0, s, r); g.x = B.x + r.clientLeft, g.y = B.y + r.clientTop; } else l && (g.x = up(l)); const y = u.left + p.scrollLeft - g.x, v = u.top + p.scrollTop - g.y; return { x: y, y: v, width: u.width, height: u.height }; } function Wc(n, r) { return !$n(n) || hn(n).position === "fixed" ? null : r ? r(n) : n.offsetParent; } function cp(n, r) { const a = Zt(n); if (!$n(n) || sp(n)) return a; let i = Wc(n, r); for (; i && a1(i) && hn(i).position === "static"; ) i = Wc(i, r); return i && (Xn(i) === "html" || Xn(i) === "body" && hn(i).position === "static" && !Gs(i)) ? a : i || i1(n) || a; } const y1 = async function(n) { const r = this.getOffsetParent || cp, a = this.getDimensions; return { reference: m1(n.reference, await r(n.floating), n.strategy), floating: { x: 0, y: 0, ...await a(n.floating) } }; }; function b1(n) { return hn(n).direction === "rtl"; } const _1 = { convertOffsetParentRelativeRectToViewportRelativeRect: u1, getDocumentElement: Qn, getClippingRect: h1, getOffsetParent: cp, getElementRects: y1, getClientRects: f1, getDimensions: g1, getScale: ca, isElement: Yn, isRTL: b1 }; function w1(n, r) { let a = null, i; const l = Qn(n); function s() { var p; clearTimeout(i), (p = a) == null || p.disconnect(), a = null; } function u(p, g) { p === void 0 && (p = !1), g === void 0 && (g = 1), s(); const { left: y, top: v, width: B, height: E } = n.getBoundingClientRect(); if (p || r(), !B || !E) return; const x = Xi(v), A = Xi(l.clientWidth - (y + B)), T = Xi(l.clientHeight - (v + E)), C = Xi(y), I = { rootMargin: -x + "px " + -A + "px " + -T + "px " + -C + "px", threshold: At(0, xn(1, g)) || 1 }; let L = !0; function M(D) { const $ = D[0].intersectionRatio; if ($ !== g) { if (!L) return u(); $ ? u(!1, $) : i = setTimeout(() => { u(!1, 1e-7); }, 100); } L = !1; } try { a = new IntersectionObserver(M, { ...I, // Handle <iframe>s root: l.ownerDocument }); } catch { a = new IntersectionObserver(M, I); } a.observe(n); } return u(!0), s; } function dp(n, r, a, i) { i === void 0 && (i = {}); const { ancestorScroll: l = !0, ancestorResize: s = !0, elementResize: u = typeof ResizeObserver == "function", layoutShift: p = typeof IntersectionObserver == "function", animationFrame: g = !1 } = i, y = Ks(n), v = l || s ? [...y ? ja(y) : [], ...ja(r)] : []; v.forEach((I) => { l && I.addEventListener("scroll", a, { passive: !0 }), s && I.addEventListener("resize", a); }); const B = y && p ? w1(y, a) : null; let E = -1, x = null; u && (x = new ResizeObserver((I) => { let [L] = I; L && L.target === y && x && (x.unobserve(r), cancelAnimationFrame(E), E = requestAnimationFrame(() => { var M; (M = x) == null || M.observe(r); })), a(); }), y && !g && x.observe(y), x.observe(r)); let A, T = g ? Pr(n) : null; g && C(); function C() { const I = Pr(n); T && (I.x !== T.x || I.y !== T.y || I.width !== T.width || I.height !== T.height) && a(), T = I, A = requestAnimationFrame(C); } return a(), () => { var I; v.forEach((L) => { l && L.removeEventListener("scroll", a), s && L.removeEventListener("resize", a); }), B == null || B(), (I = x) == null || I.disconnect(), x = null, g && cancelAnimationFrame(A); }; } const x1 = Xw, pp = n1, vp = Yw, hp = r1, B1 = Zw, S1 = Kw, A1 = e1, E1 = (n, r, a) => { const i = /* @__PURE__ */ new Map(), l = { platform: _1, ...a }, s = { ...l.platform, _c: i }; return jw(n, r, { ...l, platform: s }); }; function T1(n) { return n != null && typeof n == "object" && "$el" in n; } function ws(n) { if (T1(n)) { const r = n.$el; return qs(r) && Xn(r) === "#comment" ? null : r; } return n; } function C1(n) { return { name: "arrow", options: n, fn(r) { const a = ws(te(n.element)); return a == null ? {} : S1({ element: a, padding: n.padding }).fn(r); } }; } function gp(n) { return typeof window > "u" ? 1 : (n.ownerDocument.defaultView || window).devicePixelRatio || 1; } function qc(n, r) { const a = gp(n); return Math.round(r * a) / a; } function mp(n, r, a) { a === void 0 && (a = {}); const i = a.whileElementsMounted, l = z(() => { var J; return (J = te(a.open)) != null ? J : !0; }), s = z(() => te(a.middleware)), u = z(() => { var J; return (J = te(a.placement)) != null ? J : "bottom"; }), p = z(() => { var J; return (J = te(a.strategy)) != null ? J : "absolute"; }), g = z(() => { var J; return (J = te(a.transform)) != null ? J : !0; }), y = z(() => ws(n.value)), v = z(() => ws(r.value)), B = ue(0), E = ue(0), x = ue(p.value), A = ue(u.value), T = Kd({}), C = ue(!1), I = z(() => { const J = { position: x.value, left: "0", top: "0" }; if (!v.value) return J; const le = qc(v.value, B.value), ge = qc(v.value, E.value); return g.value ? { ...J, transform: "translate(" + le + "px, " + ge + "px)", ...gp(v.value) >= 1.5 && { willChange: "transform" } } : { position: x.value, left: le + "px", top: ge + "px" }; }); let L; function M() { y.value == null || v.value == null || E1(y.value, v.value, { middleware: s.value, placement: u.value, strategy: p.value }).then((J) => { B.value = J.x, E.value = J.y, x.value = J.strategy, A.value = J.placement, T.value = J.middlewareData, C.value = !0; }); } function D() { typeof L == "function" && (L(), L = void 0); } function $() { if (D(), i === void 0) { M(); return; } if (y.value != null && v.value != null) { L = i(y.value, v.value, M); return; } } function G() { l.value || (C.value = !1); } return tt([s, u, p], M, { flush: "sync" }), tt([y, v], $, { flush: "sync" }), tt(l, G, { flush: "sync" }), Xd() && Yd(D), { x: ta(B), y: ta(E), strategy: ta(x), placement: ta(A), middlewareData: ta(T), isPositioned: ta(C), floatingStyles: I, update: M }; } const k1 = /* @__PURE__ */ new Set([ "background", "cite", "href", "itemtype", "longdesc", "poster", "src", "xlink:href" ]), R1 = /^aria-[\w-]*$/i, F1 = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i, O1 = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i, I1 = (n, r) => { const a = n.nodeName.toLowerCase(); return r.includes(a) ? k1.has(a) ? !!(F1.test(n.nodeValue || "") || O1.test(n.nodeValue || "")) : !0 : r.filter((i) => i instanceof RegExp).some((i) => i.test(a)); }, sa = { // Global attributes allowed on any supplied element below. "*": ["class", "dir", "id", "lang", "role", R1], 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: [] }, ua = (n, r, a) => { if (!n.length) return n; const i = new window.DOMParser().parseFromString(n, "text/html"), l = i.body.querySelectorAll("*"); for (const s of l) { const u = s.nodeName.toLowerCase(); if (!Object.keys(r).includes(u)) { s.remove(); continue; } const p = s.attributes, g = [...r["*"] || [], ...r[u] || []]; for (const y of p) I1(y, g) || s.removeAttribute(y.nodeName); } return i.body.innerHTML; }; function Ao(n) { return Xd() ? (Yd(n), !0) : !1; } function $1(n, r) { if (typeof Symbol < "u") { const a = { ...n }; return Object.defineProperty(a, Symbol.iterator, { enumerable: !1, value() { let i = 0; return { next: () => ({ value: r[i++], done: i > r.length }) }; } }), a; } else return Object.assign([...r], n); } function Jn(n) { return typeof n == "function" ? n() : te(n); } const yp = typeof window < "u" && typeof document < "u"; typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope; const L1 = (n) => typeof n < "u", P1 = Object.prototype.toString, N1 = (n) => P1.call(n) === "[object Object]", Ir = () => { }, xs = /* @__PURE__ */ D1(); function D1() { var n, r; return yp && ((n = window == null ? void 0 : window.navigator) == null ? void 0 : n.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 V1(n, r) { function a(...i) { return new Promise((l, s) => { Promise.resolve(n(() => r.apply(this, i), { fn: r, thisArg: this, args: i })).then(l).catch(s); }); } return a; } function U1(n, r = {}) { let a, i, l = Ir; const s = (u) => { clearTimeout(u), l(), l = Ir; }; return (u) => { const p = Jn(n), g = Jn(r.maxWait); return a && s(a), p <= 0 || g !== void 0 && g <= 0 ? (i && (s(i), i = null), Promise.resolve(u())) : new Promise((y, v) => { l = r.rejectOnCancel ? v : y, g && !i && (i = setTimeout(() => { a && s(a), i = null, y(u()); }, g)), a = setTimeout(() => { i && s(i), i = null, y(u()); }, p); }); }; } function M1(n) { const r = /* @__PURE__ */ Object.create(null); return (a) => r[a] || (r[a] = n(a)); } const z1 = /-(\w)/g, H1 = M1((n) => n.replace(z1, (r, a) => a ? a.toUpperCase() : "")); function W1(...n) { if (n.length !== 1) return X(...n); const r = n[0]; return typeof r == "function" ? ys(Fw(() => ({ get: r, set: Ir }))) : ue(r); } function q1(n, r = 200, a = {}) { return V1( U1(r, a), n ); } function Jt(n, r = {}) { const { method: a = "parseFloat", radix: i, nanToZero: l } = r; return z(() => { let s = Jn(n); return typeof s == "string" && (s = Number[a](s, i)), l && Number.isNaN(s) && (s = 0), s; }); } function bp(n = {}) { const { inheritAttrs: r = !0 } = n, a = Kd(), i = /* @__PURE__ */ ce({ setup(s, { slots: u }) { return () => { a.value = u.default; }; } }), l = /* @__PURE__ */ ce({ inheritAttrs: r, setup(s, { attrs: u, slots: p }) { return () => { var g; if (!a.value && Lw.NODE_ENV !== "production") throw new Error("[VueUse] Failed to find the definition of reusable template"); const y = (g = a.value) == null ? void 0 : g.call(a, { ...G1(u), $slots: p }); return r && (y == null ? void 0 : y.length) === 1 ? y[0] : y; }; } }); return $1( { define: i, reuse: l }, [i, l] ); } function G1(n) { const r = {}; for (const a in n) r[H1(a)] = n[a]; return r; } function dr(n) { var r; const a = Jn(n); return (r = a == null ? void 0 : a.$el) != null ? r : a; } const Qa = yp ? window : void 0; function Xt(...n) { let r, a, i, l; if (typeof n[0] == "string" || Array.isArray(n[0]) ? ([a, i, l] = n, r = Qa) : [r, a, i, l] = n, !r) return Ir; Array.isArray(a) || (a = [a]), Array.isArray(i) || (i = [i]); const s = [], u = () => { s.forEach((v) => v()), s.length = 0; }, p = (v, B, E, x) => (v.addEventListener(B, E, x), () => v.removeEventListener(B, E, x)), g = tt( () => [dr(r), Jn(l)], ([v, B]) => { if (u(), !v) return; const E = N1(B) ? { ...B } : B; s.push( ...a.flatMap((x) => i.map((A) => p(v, x, A, E))) ); }, { immediate: !0, flush: "post" } ), y = () => { g(), u(); }; return Ao(y), y; } let Gc = !1; function _p(n, r, a = {}) { const { window: i = Qa, ignore: l = [], capture: s = !0, detectIframe: u = !1 } = a; if (!i) return Ir; xs && !Gc && (Gc = !0, Array.from(i.document.body.children).forEach((v) => v.addEventListener("click", Ir)), i.document.documentElement.addEventListener("click", Ir)); let p = !0; const g = (v) => l.some((B) => { if (typeof B == "string") return Array.from(i.document.querySelectorAll(B)).some((E) => E === v.target || v.composedPath().includes(E)); { const E = dr(B); return E && (v.target === E || v.composedPath().includes(E)); } }), y = [ Xt(i, "click", (v) => { const B = dr(n); if (!(!B || B === v.target || v.composedPath().includes(B))) { if (v.detail === 0 && (p = !g(v)), !p) { p = !0; return; } r(v); } }, { passive: !0, capture: s }), Xt(i, "pointerdown", (v) => { const B = dr(n); p = !g(v) && !!(B && !v.composedPath().includes(B)); }, { passive: !0 }), u && Xt(i, "blur", (v) => { setTimeout(() => { var B; const E = dr(n); ((B = i.document.activeElement) == null ? void 0 : B.tagName) === "IFRAME" && !(E != null && E.contains(i.document.activeElement)) && r(v); }, 0); }) ].filter(Boolean); return () => y.forEach((v) => v()); } function j1(n) { return typeof n == "function" ? n : typeof n == "string" ? (r) => r.key === n : Array.isArray(n) ? (r) => n.includes(r.key) : () => !0; } function kr(...n) { let r, a, i = {}; n.length === 3 ? (r = n[0], a = n[1], i = n[2]) : n.length === 2 ? typeof n[1] == "object" ? (r = !0, a = n[0], i = n[1]) : (r = n[0], a = n[1]) : (r = !0, a = n[0]); const { target: l = Qa, eventName: s = "keydown", passive: u = !1, dedupe: p = !1 } = i, g = j1(r); return Xt(l, s, (y) => { y.repeat && Jn(p) || g(y) && a(y); }, u); } function K1(n) { return JSON.parse(JSON.stringify(n)); } const Yi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof bs < "u" ? bs : typeof self < "u" ? self : {}, Zi = "__vueuse_ssr_handlers__", J1 = /* @__PURE__ */ X1(); function X1() { return Zi in Yi || (Yi[Zi] = Yi[Zi] || {}), Yi[Zi]; } function Y1(n, r) { return J1[n] || r; } function On(n, r = {}) { const { initialValue: a = !1, focusVisible: i = !1 } = r, l = ue(!1), s = z(() => dr(n)); Xt(s, "focus", (p) => { var g, y; (!i || (y = (g = p.target).matches) != null && y.call(g, ":focus-visible")) && (l.value = !0); }), Xt(s, "blur", () => l.value = !1); const u = z({ get: () => l.value, set(p) { var g, y; !p && l.value ? (g = s.value) == null || g.blur() : p && !l.value && ((y = s.value) == null || y.focus()); } }); return tt( s, () => { u.value = a; }, { immediate: !0, flush: "post" } ), { focused: u }; } function Yl(n) { return typeof Window < "u" && n instanceof Window ? n.document.documentElement : typeof Document < "u" && n instanceof Document ? n.documentElement : n; } const Z1 = { page: (n) => [n.pageX, n.pageY], client: (n) => [n.clientX, n.clientY], screen: (n) => [n.screenX, n.screenY], movement: (n) => n instanceof Touch ? null : [n.movementX, n.movementY] }; function Q1(n = {}) { const { type: r = "page", touch: a = !0, resetOnTouchEnds: i = !1, initialValue: l = { x: 0, y: 0 }, window: s = Qa, target: u = s, scroll: p = !0, eventFilter: g } = n; let y = null; const v = ue(l.x), B = ue(l.y), E = ue(null), x = typeof r == "function" ? r : Z1[r], A = ($) => { const G = x($); y = $, G && ([v.value, B.value] = G, E.value = "mouse"); }, T = ($) => { if ($.touches.length > 0) { const G = x($.touches[0]); G && ([v.value, B.value] = G, E.value = "touch"); } }, C = () => { if (!y || !s) return; const $ = x(y); y instanceof MouseEvent && $ && (v.value = $[0] + s.scrollX, B.value = $[1] + s.scrollY); }, I = () => { v.value = l.x, B.value = l.y; }, L = g ? ($) => g(() => A($), {}) : ($) => A($), M = g ? ($) => g(() => T($), {}) : ($) => T($), D = g ? () => g(() => C(), {}) : () => C(); if (u) { const $ = { passive: !0 }; Xt(u, ["mousemove", "dragover"], L, $), a && r !== "movement" && (Xt(u, ["touchstart", "touchmove"], M, $), i && Xt(u, "touchend", I, $)), p && r === "page" && Xt(s, "scroll", D, { passive: !0 }); } return { x: v, y: B, sourceType: E }; } function jc(n, r = {}) { const { handleOutside: a = !0, window: i = Qa } = r, l = r.type || "page", { x: s, y: u, sourceType: p } = Q1(r), g = ue(n ?? (i == null ? void 0 : i.document.body)), y = ue(0), v = ue(0), B = ue(0), E = ue(0), x = ue(0), A = ue(0), T = ue(!0); let C = () => { }; return i && (C = tt( [g, s, u], () => { const I = dr(g); if (!I) return; const { left: L, top: M, width: D, height: $ } = I.getBoundingClientRect(); B.value = L + (l === "page" ? i.pageXOffset : 0), E.value = M + (l === "page" ? i.pageYOffset : 0), x.value = $, A.value = D; const G = s.value - B.value, J = u.value - E.value; T.value = D === 0 || $ === 0 || G < 0 || J < 0 || G > D || J > $, (a || !T.value) && (y.value = G, v.value = J); }, { immediate: !0 } ), Xt(document, "mouseleave", () => { T.value = !0; })), { x: s, y: u, sourceType: p, elementX: y, elementY: v, elementPositionX: B, elementPositionY: E, elementHeight: x, elementWidth: A, isOutside: T, stop: C }; } function wp(n) { const r = window.getComputedStyle(n); if (r.overflowX === "scroll" || r.overflowY === "scroll" || r.overflowX === "auto" && n.clientWidth < n.scrollWidth || r.overflowY === "auto" && n.clientHeight < n.scrollHeight) return !0; { const a = n.parentNode; return !a || a.tagName === "BODY" ? !1 : wp(a); } } function ex(n) { const r = n || window.event, a = r.target; return wp(a) ? !1 : r.touches.length > 1 ? !0 : (r.preventDefault && r.preventDefault(), !1); } const Qi = /* @__PURE__ */ new WeakMap(); function tx(n, r = !1) { const a = ue(r); let i = null; tt(W1(n), (u) => { const p = Yl(Jn(u)); if (p) { const g = p; Qi.get(g) || Qi.set(g, g.style.overflow), a.value && (g.style.overflow = "hidden"); } }, { immediate: !0 }); const l = () => { const u = Yl(Jn(n)); !u || a.value || (xs && (i = Xt(