import { pushScopeId as dt, popScopeId as pt, defineComponent as le, nextTick as Ot, openBlock as D, createBlock as Me, withScopeId as Nt, resolveComponent as Ce, createElementBlock as K, createBaseVNode as P, Fragment as ct, renderSlot as fe, createCommentVNode as ke, normalizeStyle as Te, normalizeClass as ht, withKeys as Oe, withCtx as me, createVNode as Ne, mergeProps as zt, normalizeProps as Rt, guardReactiveProps as Bt, useUser as Ht, ref as Se, watch as Lt, unref as pe, createTextVNode as Dt, toDisplayString as qe, withDirectives as Mt, vModelText as Et, setPetname as Ft, renderList as It } from "./composables-Ci32s3jE.js";
import { AccountAvatar as Wt } from "./components.js";
import { _export_sfc as jt } from "./_plugin-vue_export-helper-DueaC3du.js";
const Vt = ["top", "right", "bottom", "left"], Ge = ["start", "end"], Ye = /* @__PURE__ */ Vt.reduce((e, t) => e.concat(t, t + "-" + Ge[0], t + "-" + Ge[1]), []), ne = Math.min, X = Math.max, qt = {
  left: "right",
  right: "left",
  bottom: "top",
  top: "bottom"
}, Gt = {
  start: "end",
  end: "start"
};
function ze(e, t, i) {
  return X(e, ne(t, i));
}
function Q(e, t) {
  return typeof e == "function" ? e(t) : e;
}
function F(e) {
  return e.split("-")[0];
}
function B(e) {
  return e.split("-")[1];
}
function ut(e) {
  return e === "x" ? "y" : "x";
}
function Ee(e) {
  return e === "y" ? "height" : "width";
}
function de(e) {
  return ["top", "bottom"].includes(F(e)) ? "y" : "x";
}
function Fe(e) {
  return ut(de(e));
}
function ft(e, t, i) {
  i === void 0 && (i = !1);
  const o = B(e), n = Fe(e), s = Ee(n);
  let r = n === "x" ? o === (i ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
  return t.reference[s] > t.floating[s] && (r = we(r)), [r, we(r)];
}
function Yt(e) {
  const t = we(e);
  return [ge(e), t, ge(t)];
}
function ge(e) {
  return e.replace(/start|end/g, (t) => Gt[t]);
}
function Ut(e, t, i) {
  const o = ["left", "right"], n = ["right", "left"], s = ["top", "bottom"], r = ["bottom", "top"];
  switch (e) {
    case "top":
    case "bottom":
      return i ? t ? n : o : t ? o : n;
    case "left":
    case "right":
      return t ? s : r;
    default:
      return [];
  }
}
function Xt(e, t, i, o) {
  const n = B(e);
  let s = Ut(F(e), i === "start", o);
  return n && (s = s.map((r) => r + "-" + n), t && (s = s.concat(s.map(ge)))), s;
}
function we(e) {
  return e.replace(/left|right|bottom|top/g, (t) => qt[t]);
}
function Kt(e) {
  return {
    top: 0,
    right: 0,
    bottom: 0,
    left: 0,
    ...e
  };
}
function mt(e) {
  return typeof e != "number" ? Kt(e) : {
    top: e,
    right: e,
    bottom: e,
    left: e
  };
}
function ee(e) {
  return {
    ...e,
    top: e.y,
    left: e.x,
    right: e.x + e.width,
    bottom: e.y + e.height
  };
}
function Ue(e, t, i) {
  let {
    reference: o,
    floating: n
  } = e;
  const s = de(t), r = Fe(t), a = Ee(r), l = F(t), d = s === "y", u = o.x + o.width / 2 - n.width / 2, c = o.y + o.height / 2 - n.height / 2, h = o[a] / 2 - n[a] / 2;
  let p;
  switch (l) {
    case "top":
      p = {
        x: u,
        y: o.y - n.height
      };
      break;
    case "bottom":
      p = {
        x: u,
        y: o.y + o.height
      };
      break;
    case "right":
      p = {
        x: o.x + o.width,
        y: c
      };
      break;
    case "left":
      p = {
        x: o.x - n.width,
        y: c
      };
      break;
    default:
      p = {
        x: o.x,
        y: o.y
      };
  }
  switch (B(t)) {
    case "start":
      p[r] -= h * (i && d ? -1 : 1);
      break;
    case "end":
      p[r] += h * (i && d ? -1 : 1);
      break;
  }
  return p;
}
const Zt = async (e, t, i) => {
  const {
    placement: o = "bottom",
    strategy: n = "absolute",
    middleware: s = [],
    platform: r
  } = i, a = s.filter(Boolean), l = await (r.isRTL == null ? void 0 : r.isRTL(t));
  let d = await r.getElementRects({
    reference: e,
    floating: t,
    strategy: n
  }), {
    x: u,
    y: c
  } = Ue(d, o, l), h = o, p = {}, f = 0;
  for (let m = 0; m < a.length; m++) {
    const {
      name: y,
      fn: g
    } = a[m], {
      x: w,
      y: x,
      data: $,
      reset: _
    } = await g({
      x: u,
      y: c,
      initialPlacement: o,
      placement: h,
      strategy: n,
      middlewareData: p,
      rects: d,
      platform: r,
      elements: {
        reference: e,
        floating: t
      }
    });
    u = w ?? u, c = x ?? c, p = {
      ...p,
      [y]: {
        ...p[y],
        ...$
      }
    }, _ && f <= 50 && (f++, typeof _ == "object" && (_.placement && (h = _.placement), _.rects && (d = _.rects === !0 ? await r.getElementRects({
      reference: e,
      floating: t,
      strategy: n
    }) : _.rects), {
      x: u,
      y: c
    } = Ue(d, h, l)), m = -1);
  }
  return {
    x: u,
    y: c,
    placement: h,
    strategy: n,
    middlewareData: p
  };
};
async function xe(e, t) {
  var i;
  t === void 0 && (t = {});
  const {
    x: o,
    y: n,
    platform: s,
    rects: r,
    elements: a,
    strategy: l
  } = e, {
    boundary: d = "clippingAncestors",
    rootBoundary: u = "viewport",
    elementContext: c = "floating",
    altBoundary: h = !1,
    padding: p = 0
  } = Q(t, e), f = mt(p), y = a[h ? c === "floating" ? "reference" : "floating" : c], g = ee(await s.getClippingRect({
    element: (i = await (s.isElement == null ? void 0 : s.isElement(y))) == null || i ? y : y.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(a.floating)),
    boundary: d,
    rootBoundary: u,
    strategy: l
  })), w = c === "floating" ? {
    ...r.floating,
    x: o,
    y: n
  } : r.reference, x = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(a.floating)), $ = await (s.isElement == null ? void 0 : s.isElement(x)) ? await (s.getScale == null ? void 0 : s.getScale(x)) || {
    x: 1,
    y: 1
  } : {
    x: 1,
    y: 1
  }, _ = ee(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
    elements: a,
    rect: w,
    offsetParent: x,
    strategy: l
  }) : w);
  return {
    top: (g.top - _.top + f.top) / $.y,
    bottom: (_.bottom - g.bottom + f.bottom) / $.y,
    left: (g.left - _.left + f.left) / $.x,
    right: (_.right - g.right + f.right) / $.x
  };
}
const Qt = (e) => ({
  name: "arrow",
  options: e,
  async fn(t) {
    const {
      x: i,
      y: o,
      placement: n,
      rects: s,
      platform: r,
      elements: a,
      middlewareData: l
    } = t, {
      element: d,
      padding: u = 0
    } = Q(e, t) || {};
    if (d == null)
      return {};
    const c = mt(u), h = {
      x: i,
      y: o
    }, p = Fe(n), f = Ee(p), m = await r.getDimensions(d), y = p === "y", g = y ? "top" : "left", w = y ? "bottom" : "right", x = y ? "clientHeight" : "clientWidth", $ = s.reference[f] + s.reference[p] - h[p] - s.floating[f], _ = h[p] - s.reference[p], b = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(d));
    let T = b ? b[x] : 0;
    (!T || !await (r.isElement == null ? void 0 : r.isElement(b))) && (T = a.floating[x] || s.floating[f]);
    const O = $ / 2 - _ / 2, N = T / 2 - m[f] / 2 - 1, S = ne(c[g], N), z = ne(c[w], N), A = S, Y = T - m[f] - z, C = T / 2 - m[f] / 2 + O, H = ze(A, C, Y), L = !l.arrow && B(n) != null && C !== H && s.reference[f] / 2 - (C < A ? S : z) - m[f] / 2 < 0, I = L ? C < A ? C - A : C - Y : 0;
    return {
      [p]: h[p] + I,
      data: {
        [p]: H,
        centerOffset: C - H - I,
        ...L && {
          alignmentOffset: I
        }
      },
      reset: L
    };
  }
});
function Jt(e, t, i) {
  return (e ? [...i.filter((n) => B(n) === e), ...i.filter((n) => B(n) !== e)] : i.filter((n) => F(n) === n)).filter((n) => e ? B(n) === e || (t ? ge(n) !== n : !1) : !0);
}
const ei = function(e) {
  return e === void 0 && (e = {}), {
    name: "autoPlacement",
    options: e,
    async fn(t) {
      var i, o, n;
      const {
        rects: s,
        middlewareData: r,
        placement: a,
        platform: l,
        elements: d
      } = t, {
        crossAxis: u = !1,
        alignment: c,
        allowedPlacements: h = Ye,
        autoAlignment: p = !0,
        ...f
      } = Q(e, t), m = c !== void 0 || h === Ye ? Jt(c || null, p, h) : h, y = await xe(t, f), g = ((i = r.autoPlacement) == null ? void 0 : i.index) || 0, w = m[g];
      if (w == null)
        return {};
      const x = ft(w, s, await (l.isRTL == null ? void 0 : l.isRTL(d.floating)));
      if (a !== w)
        return {
          reset: {
            placement: m[0]
          }
        };
      const $ = [y[F(w)], y[x[0]], y[x[1]]], _ = [...((o = r.autoPlacement) == null ? void 0 : o.overflows) || [], {
        placement: w,
        overflows: $
      }], b = m[g + 1];
      if (b)
        return {
          data: {
            index: g + 1,
            overflows: _
          },
          reset: {
            placement: b
          }
        };
      const T = _.map((S) => {
        const z = B(S.placement);
        return [S.placement, z && u ? (
          // Check along the mainAxis and main crossAxis side.
          S.overflows.slice(0, 2).reduce((A, Y) => A + Y, 0)
        ) : (
          // Check only the mainAxis.
          S.overflows[0]
        ), S.overflows];
      }).sort((S, z) => S[1] - z[1]), N = ((n = T.filter((S) => S[2].slice(
        0,
        // Aligned placements should not check their opposite crossAxis
        // side.
        B(S[0]) ? 2 : 3
      ).every((z) => z <= 0))[0]) == null ? void 0 : n[0]) || T[0][0];
      return N !== a ? {
        data: {
          index: g + 1,
          overflows: _
        },
        reset: {
          placement: N
        }
      } : {};
    }
  };
}, ti = function(e) {
  return e === void 0 && (e = {}), {
    name: "flip",
    options: e,
    async fn(t) {
      var i, o;
      const {
        placement: n,
        middlewareData: s,
        rects: r,
        initialPlacement: a,
        platform: l,
        elements: d
      } = t, {
        mainAxis: u = !0,
        crossAxis: c = !0,
        fallbackPlacements: h,
        fallbackStrategy: p = "bestFit",
        fallbackAxisSideDirection: f = "none",
        flipAlignment: m = !0,
        ...y
      } = Q(e, t);
      if ((i = s.arrow) != null && i.alignmentOffset)
        return {};
      const g = F(n), w = F(a) === a, x = await (l.isRTL == null ? void 0 : l.isRTL(d.floating)), $ = h || (w || !m ? [we(a)] : Yt(a));
      !h && f !== "none" && $.push(...Xt(a, m, f, x));
      const _ = [a, ...$], b = await xe(t, y), T = [];
      let O = ((o = s.flip) == null ? void 0 : o.overflows) || [];
      if (u && T.push(b[g]), c) {
        const A = ft(n, r, x);
        T.push(b[A[0]], b[A[1]]);
      }
      if (O = [...O, {
        placement: n,
        overflows: T
      }], !T.every((A) => A <= 0)) {
        var N, S;
        const A = (((N = s.flip) == null ? void 0 : N.index) || 0) + 1, Y = _[A];
        if (Y)
          return {
            data: {
              index: A,
              overflows: O
            },
            reset: {
              placement: Y
            }
          };
        let C = (S = O.filter((H) => H.overflows[0] <= 0).sort((H, L) => H.overflows[1] - L.overflows[1])[0]) == null ? void 0 : S.placement;
        if (!C)
          switch (p) {
            case "bestFit": {
              var z;
              const H = (z = O.map((L) => [L.placement, L.overflows.filter((I) => I > 0).reduce((I, kt) => I + kt, 0)]).sort((L, I) => L[1] - I[1])[0]) == null ? void 0 : z[0];
              H && (C = H);
              break;
            }
            case "initialPlacement":
              C = a;
              break;
          }
        if (n !== C)
          return {
            reset: {
              placement: C
            }
          };
      }
      return {};
    }
  };
};
async function ii(e, t) {
  const {
    placement: i,
    platform: o,
    elements: n
  } = e, s = await (o.isRTL == null ? void 0 : o.isRTL(n.floating)), r = F(i), a = B(i), l = de(i) === "y", d = ["left", "top"].includes(r) ? -1 : 1, u = s && l ? -1 : 1, c = Q(t, e);
  let {
    mainAxis: h,
    crossAxis: p,
    alignmentAxis: f
  } = typeof c == "number" ? {
    mainAxis: c,
    crossAxis: 0,
    alignmentAxis: null
  } : {
    mainAxis: 0,
    crossAxis: 0,
    alignmentAxis: null,
    ...c
  };
  return a && typeof f == "number" && (p = a === "end" ? f * -1 : f), l ? {
    x: p * u,
    y: h * d
  } : {
    x: h * d,
    y: p * u
  };
}
const oi = function(e) {
  return e === void 0 && (e = 0), {
    name: "offset",
    options: e,
    async fn(t) {
      var i, o;
      const {
        x: n,
        y: s,
        placement: r,
        middlewareData: a
      } = t, l = await ii(t, e);
      return r === ((i = a.offset) == null ? void 0 : i.placement) && (o = a.arrow) != null && o.alignmentOffset ? {} : {
        x: n + l.x,
        y: s + l.y,
        data: {
          ...l,
          placement: r
        }
      };
    }
  };
}, ni = function(e) {
  return e === void 0 && (e = {}), {
    name: "shift",
    options: e,
    async fn(t) {
      const {
        x: i,
        y: o,
        placement: n
      } = t, {
        mainAxis: s = !0,
        crossAxis: r = !1,
        limiter: a = {
          fn: (y) => {
            let {
              x: g,
              y: w
            } = y;
            return {
              x: g,
              y: w
            };
          }
        },
        ...l
      } = Q(e, t), d = {
        x: i,
        y: o
      }, u = await xe(t, l), c = de(F(n)), h = ut(c);
      let p = d[h], f = d[c];
      if (s) {
        const y = h === "y" ? "top" : "left", g = h === "y" ? "bottom" : "right", w = p + u[y], x = p - u[g];
        p = ze(w, p, x);
      }
      if (r) {
        const y = c === "y" ? "top" : "left", g = c === "y" ? "bottom" : "right", w = f + u[y], x = f - u[g];
        f = ze(w, f, x);
      }
      const m = a.fn({
        ...t,
        [h]: p,
        [c]: f
      });
      return {
        ...m,
        data: {
          x: m.x - i,
          y: m.y - o
        }
      };
    }
  };
}, si = function(e) {
  return e === void 0 && (e = {}), {
    name: "size",
    options: e,
    async fn(t) {
      const {
        placement: i,
        rects: o,
        platform: n,
        elements: s
      } = t, {
        apply: r = () => {
        },
        ...a
      } = Q(e, t), l = await xe(t, a), d = F(i), u = B(i), c = de(i) === "y", {
        width: h,
        height: p
      } = o.floating;
      let f, m;
      d === "top" || d === "bottom" ? (f = d, m = u === (await (n.isRTL == null ? void 0 : n.isRTL(s.floating)) ? "start" : "end") ? "left" : "right") : (m = d, f = u === "end" ? "top" : "bottom");
      const y = p - l[f], g = h - l[m], w = !t.middlewareData.shift;
      let x = y, $ = g;
      if (c) {
        const b = h - l.left - l.right;
        $ = u || w ? ne(g, b) : b;
      } else {
        const b = p - l.top - l.bottom;
        x = u || w ? ne(y, b) : b;
      }
      if (w && !u) {
        const b = X(l.left, 0), T = X(l.right, 0), O = X(l.top, 0), N = X(l.bottom, 0);
        c ? $ = h - 2 * (b !== 0 || T !== 0 ? b + T : X(l.left, l.right)) : x = p - 2 * (O !== 0 || N !== 0 ? O + N : X(l.top, l.bottom));
      }
      await r({
        ...t,
        availableWidth: $,
        availableHeight: x
      });
      const _ = await n.getDimensions(s.floating);
      return h !== _.width || p !== _.height ? {
        reset: {
          rects: !0
        }
      } : {};
    }
  };
};
function k(e) {
  var t;
  return ((t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
}
function M(e) {
  return k(e).getComputedStyle(e);
}
const Xe = Math.min, te = Math.max, ye = Math.round;
function gt(e) {
  const t = M(e);
  let i = parseFloat(t.width), o = parseFloat(t.height);
  const n = e.offsetWidth, s = e.offsetHeight, r = ye(i) !== n || ye(o) !== s;
  return r && (i = n, o = s), { width: i, height: o, fallback: r };
}
function G(e) {
  return yt(e) ? (e.nodeName || "").toLowerCase() : "";
}
let ce;
function wt() {
  if (ce) return ce;
  const e = navigator.userAgentData;
  return e && Array.isArray(e.brands) ? (ce = e.brands.map((t) => t.brand + "/" + t.version).join(" "), ce) : navigator.userAgent;
}
function E(e) {
  return e instanceof k(e).HTMLElement;
}
function V(e) {
  return e instanceof k(e).Element;
}
function yt(e) {
  return e instanceof k(e).Node;
}
function Ke(e) {
  return typeof ShadowRoot > "u" ? !1 : e instanceof k(e).ShadowRoot || e instanceof ShadowRoot;
}
function _e(e) {
  const { overflow: t, overflowX: i, overflowY: o, display: n } = M(e);
  return /auto|scroll|overlay|hidden|clip/.test(t + o + i) && !["inline", "contents"].includes(n);
}
function ri(e) {
  return ["table", "td", "th"].includes(G(e));
}
function Re(e) {
  const t = /firefox/i.test(wt()), i = M(e), o = i.backdropFilter || i.WebkitBackdropFilter;
  return i.transform !== "none" || i.perspective !== "none" || !!o && o !== "none" || t && i.willChange === "filter" || t && !!i.filter && i.filter !== "none" || ["transform", "perspective"].some((n) => i.willChange.includes(n)) || ["paint", "layout", "strict", "content"].some((n) => {
    const s = i.contain;
    return s != null && s.includes(n);
  });
}
function vt() {
  return !/^((?!chrome|android).)*safari/i.test(wt());
}
function Ie(e) {
  return ["html", "body", "#document"].includes(G(e));
}
function xt(e) {
  return V(e) ? e : e.contextElement;
}
const _t = { x: 1, y: 1 };
function J(e) {
  const t = xt(e);
  if (!E(t)) return _t;
  const i = t.getBoundingClientRect(), { width: o, height: n, fallback: s } = gt(t);
  let r = (s ? ye(i.width) : i.width) / o, a = (s ? ye(i.height) : i.height) / n;
  return r && Number.isFinite(r) || (r = 1), a && Number.isFinite(a) || (a = 1), { x: r, y: a };
}
function se(e, t, i, o) {
  var n, s;
  t === void 0 && (t = !1), i === void 0 && (i = !1);
  const r = e.getBoundingClientRect(), a = xt(e);
  let l = _t;
  t && (o ? V(o) && (l = J(o)) : l = J(e));
  const d = a ? k(a) : window, u = !vt() && i;
  let c = (r.left + (u && ((n = d.visualViewport) == null ? void 0 : n.offsetLeft) || 0)) / l.x, h = (r.top + (u && ((s = d.visualViewport) == null ? void 0 : s.offsetTop) || 0)) / l.y, p = r.width / l.x, f = r.height / l.y;
  if (a) {
    const m = k(a), y = o && V(o) ? k(o) : o;
    let g = m.frameElement;
    for (; g && o && y !== m; ) {
      const w = J(g), x = g.getBoundingClientRect(), $ = getComputedStyle(g);
      x.x += (g.clientLeft + parseFloat($.paddingLeft)) * w.x, x.y += (g.clientTop + parseFloat($.paddingTop)) * w.y, c *= w.x, h *= w.y, p *= w.x, f *= w.y, c += x.x, h += x.y, g = k(g).frameElement;
    }
  }
  return { width: p, height: f, top: h, right: c + p, bottom: h + f, left: c, x: c, y: h };
}
function q(e) {
  return ((yt(e) ? e.ownerDocument : e.document) || window.document).documentElement;
}
function $e(e) {
  return V(e) ? { scrollLeft: e.scrollLeft, scrollTop: e.scrollTop } : { scrollLeft: e.pageXOffset, scrollTop: e.pageYOffset };
}
function $t(e) {
  return se(q(e)).left + $e(e).scrollLeft;
}
function re(e) {
  if (G(e) === "html") return e;
  const t = e.assignedSlot || e.parentNode || Ke(e) && e.host || q(e);
  return Ke(t) ? t.host : t;
}
function bt(e) {
  const t = re(e);
  return Ie(t) ? t.ownerDocument.body : E(t) && _e(t) ? t : bt(t);
}
function ve(e, t) {
  var i;
  t === void 0 && (t = []);
  const o = bt(e), n = o === ((i = e.ownerDocument) == null ? void 0 : i.body), s = k(o);
  return n ? t.concat(s, s.visualViewport || [], _e(o) ? o : []) : t.concat(o, ve(o));
}
function Ze(e, t, i) {
  return t === "viewport" ? ee(function(o, n) {
    const s = k(o), r = q(o), a = s.visualViewport;
    let l = r.clientWidth, d = r.clientHeight, u = 0, c = 0;
    if (a) {
      l = a.width, d = a.height;
      const h = vt();
      (h || !h && n === "fixed") && (u = a.offsetLeft, c = a.offsetTop);
    }
    return { width: l, height: d, x: u, y: c };
  }(e, i)) : V(t) ? ee(function(o, n) {
    const s = se(o, !0, n === "fixed"), r = s.top + o.clientTop, a = s.left + o.clientLeft, l = E(o) ? J(o) : { x: 1, y: 1 };
    return { width: o.clientWidth * l.x, height: o.clientHeight * l.y, x: a * l.x, y: r * l.y };
  }(t, i)) : ee(function(o) {
    const n = q(o), s = $e(o), r = o.ownerDocument.body, a = te(n.scrollWidth, n.clientWidth, r.scrollWidth, r.clientWidth), l = te(n.scrollHeight, n.clientHeight, r.scrollHeight, r.clientHeight);
    let d = -s.scrollLeft + $t(o);
    const u = -s.scrollTop;
    return M(r).direction === "rtl" && (d += te(n.clientWidth, r.clientWidth) - a), { width: a, height: l, x: d, y: u };
  }(q(e)));
}
function Qe(e) {
  return E(e) && M(e).position !== "fixed" ? e.offsetParent : null;
}
function Je(e) {
  const t = k(e);
  let i = Qe(e);
  for (; i && ri(i) && M(i).position === "static"; ) i = Qe(i);
  return i && (G(i) === "html" || G(i) === "body" && M(i).position === "static" && !Re(i)) ? t : i || function(o) {
    let n = re(o);
    for (; E(n) && !Ie(n); ) {
      if (Re(n)) return n;
      n = re(n);
    }
    return null;
  }(e) || t;
}
function ai(e, t, i) {
  const o = E(t), n = q(t), s = se(e, !0, i === "fixed", t);
  let r = { scrollLeft: 0, scrollTop: 0 };
  const a = { x: 0, y: 0 };
  if (o || !o && i !== "fixed") if ((G(t) !== "body" || _e(n)) && (r = $e(t)), E(t)) {
    const l = se(t, !0);
    a.x = l.x + t.clientLeft, a.y = l.y + t.clientTop;
  } else n && (a.x = $t(n));
  return { x: s.left + r.scrollLeft - a.x, y: s.top + r.scrollTop - a.y, width: s.width, height: s.height };
}
const li = { getClippingRect: function(e) {
  let { element: t, boundary: i, rootBoundary: o, strategy: n } = e;
  const s = i === "clippingAncestors" ? function(d, u) {
    const c = u.get(d);
    if (c) return c;
    let h = ve(d).filter((y) => V(y) && G(y) !== "body"), p = null;
    const f = M(d).position === "fixed";
    let m = f ? re(d) : d;
    for (; V(m) && !Ie(m); ) {
      const y = M(m), g = Re(m);
      (f ? g || p : g || y.position !== "static" || !p || !["absolute", "fixed"].includes(p.position)) ? p = y : h = h.filter((w) => w !== m), m = re(m);
    }
    return u.set(d, h), h;
  }(t, this._c) : [].concat(i), r = [...s, o], a = r[0], l = r.reduce((d, u) => {
    const c = Ze(t, u, n);
    return d.top = te(c.top, d.top), d.right = Xe(c.right, d.right), d.bottom = Xe(c.bottom, d.bottom), d.left = te(c.left, d.left), d;
  }, Ze(t, a, n));
  return { width: l.right - l.left, height: l.bottom - l.top, x: l.left, y: l.top };
}, convertOffsetParentRelativeRectToViewportRelativeRect: function(e) {
  let { rect: t, offsetParent: i, strategy: o } = e;
  const n = E(i), s = q(i);
  if (i === s) return t;
  let r = { scrollLeft: 0, scrollTop: 0 }, a = { x: 1, y: 1 };
  const l = { x: 0, y: 0 };
  if ((n || !n && o !== "fixed") && ((G(i) !== "body" || _e(s)) && (r = $e(i)), E(i))) {
    const d = se(i);
    a = J(i), l.x = d.x + i.clientLeft, l.y = d.y + i.clientTop;
  }
  return { width: t.width * a.x, height: t.height * a.y, x: t.x * a.x - r.scrollLeft * a.x + l.x, y: t.y * a.y - r.scrollTop * a.y + l.y };
}, isElement: V, getDimensions: function(e) {
  return E(e) ? gt(e) : e.getBoundingClientRect();
}, getOffsetParent: Je, getDocumentElement: q, getScale: J, async getElementRects(e) {
  let { reference: t, floating: i, strategy: o } = e;
  const n = this.getOffsetParent || Je, s = this.getDimensions;
  return { reference: ai(t, await n(i), o), floating: { x: 0, y: 0, ...await s(i) } };
}, getClientRects: (e) => Array.from(e.getClientRects()), isRTL: (e) => M(e).direction === "rtl" }, di = (e, t, i) => {
  const o = /* @__PURE__ */ new Map(), n = { platform: li, ...i }, s = { ...n.platform, _c: o };
  return Zt(e, t, { ...n, platform: s });
}, Z = {
  // Disable popper components
  disabled: !1,
  // Default position offset along main axis (px)
  distance: 5,
  // Default position offset along cross axis (px)
  skidding: 0,
  // Default container where the tooltip will be appended
  container: "body",
  // Element used to compute position and size boundaries
  boundary: void 0,
  // Skip delay & CSS transitions when another popper is shown, so that the popper appear to instanly move to the new position.
  instantMove: !1,
  // Auto destroy tooltip DOM nodes (ms)
  disposeTimeout: 150,
  // Triggers on the popper itself
  popperTriggers: [],
  // Positioning strategy
  strategy: "absolute",
  // Prevent overflow
  preventOverflow: !0,
  // Flip to the opposite placement if needed
  flip: !0,
  // Shift on the cross axis to prevent the popper from overflowing
  shift: !0,
  // Overflow padding (px)
  overflowPadding: 0,
  // Arrow padding (px)
  arrowPadding: 0,
  // Compute arrow overflow (useful to hide it)
  arrowOverflow: !0,
  /**
   * By default, compute autohide on 'click'.
   */
  autoHideOnMousedown: !1,
  // Themes
  themes: {
    tooltip: {
      // Default tooltip placement relative to target element
      placement: "top",
      // Default events that trigger the tooltip
      triggers: ["hover", "focus", "touch"],
      // Close tooltip on click on tooltip target
      hideTriggers: (e) => [...e, "click"],
      // Delay (ms)
      delay: {
        show: 200,
        hide: 0
      },
      // Update popper on content resize
      handleResize: !1,
      // Enable HTML content in directive
      html: !1,
      // Displayed when tooltip content is loading
      loadingContent: "..."
    },
    dropdown: {
      // Default dropdown placement relative to target element
      placement: "bottom",
      // Default events that trigger the dropdown
      triggers: ["click"],
      // Delay (ms)
      delay: 0,
      // Update popper on content resize
      handleResize: !0,
      // Hide on clock outside
      autoHide: !0
    },
    menu: {
      $extend: "dropdown",
      triggers: ["hover", "focus"],
      popperTriggers: ["hover"],
      delay: {
        show: 0,
        hide: 400
      }
    }
  }
};
function Be(e, t) {
  let i = Z.themes[e] || {}, o;
  do
    o = i[t], typeof o > "u" ? i.$extend ? i = Z.themes[i.$extend] || {} : (i = null, o = Z[t]) : i = null;
  while (i);
  return o;
}
function pi(e) {
  const t = [e];
  let i = Z.themes[e] || {};
  do
    i.$extend && !i.$resetCss ? (t.push(i.$extend), i = Z.themes[i.$extend] || {}) : i = null;
  while (i);
  return t.map((o) => `v-popper--theme-${o}`);
}
function et(e) {
  const t = [e];
  let i = Z.themes[e] || {};
  do
    i.$extend ? (t.push(i.$extend), i = Z.themes[i.$extend] || {}) : i = null;
  while (i);
  return t;
}
let ae = !1;
if (typeof window < "u") {
  ae = !1;
  try {
    const e = Object.defineProperty({}, "passive", {
      get() {
        ae = !0;
      }
    });
    window.addEventListener("test", null, e);
  } catch {
  }
}
let Tt = !1;
typeof window < "u" && typeof navigator < "u" && (Tt = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream);
const ci = ["auto", "top", "bottom", "left", "right"].reduce((e, t) => e.concat([
  t,
  `${t}-start`,
  `${t}-end`
]), []), tt = {
  hover: "mouseenter",
  focus: "focus",
  click: "click",
  touch: "touchstart",
  pointer: "pointerdown"
}, it = {
  hover: "mouseleave",
  focus: "blur",
  click: "click",
  touch: "touchend",
  pointer: "pointerup"
};
function ot(e, t) {
  const i = e.indexOf(t);
  i !== -1 && e.splice(i, 1);
}
function Pe() {
  return new Promise((e) => requestAnimationFrame(() => {
    requestAnimationFrame(e);
  }));
}
const R = [];
let U = null;
const nt = {};
function st(e) {
  let t = nt[e];
  return t || (t = nt[e] = []), t;
}
let He = function() {
};
typeof window < "u" && (He = window.Element);
function v(e) {
  return function(t) {
    return Be(t.theme, e);
  };
}
const Ae = "__floating-vue__popper", St = () => le({
  name: "VPopper",
  provide() {
    return {
      [Ae]: {
        parentPopper: this
      }
    };
  },
  inject: {
    [Ae]: { default: null }
  },
  props: {
    theme: {
      type: String,
      required: !0
    },
    targetNodes: {
      type: Function,
      required: !0
    },
    referenceNode: {
      type: Function,
      default: null
    },
    popperNode: {
      type: Function,
      required: !0
    },
    shown: {
      type: Boolean,
      default: !1
    },
    showGroup: {
      type: String,
      default: null
    },
    // eslint-disable-next-line vue/require-prop-types
    ariaId: {
      default: null
    },
    disabled: {
      type: Boolean,
      default: v("disabled")
    },
    positioningDisabled: {
      type: Boolean,
      default: v("positioningDisabled")
    },
    placement: {
      type: String,
      default: v("placement"),
      validator: (e) => ci.includes(e)
    },
    delay: {
      type: [String, Number, Object],
      default: v("delay")
    },
    distance: {
      type: [Number, String],
      default: v("distance")
    },
    skidding: {
      type: [Number, String],
      default: v("skidding")
    },
    triggers: {
      type: Array,
      default: v("triggers")
    },
    showTriggers: {
      type: [Array, Function],
      default: v("showTriggers")
    },
    hideTriggers: {
      type: [Array, Function],
      default: v("hideTriggers")
    },
    popperTriggers: {
      type: Array,
      default: v("popperTriggers")
    },
    popperShowTriggers: {
      type: [Array, Function],
      default: v("popperShowTriggers")
    },
    popperHideTriggers: {
      type: [Array, Function],
      default: v("popperHideTriggers")
    },
    container: {
      type: [String, Object, He, Boolean],
      default: v("container")
    },
    boundary: {
      type: [String, He],
      default: v("boundary")
    },
    strategy: {
      type: String,
      validator: (e) => ["absolute", "fixed"].includes(e),
      default: v("strategy")
    },
    autoHide: {
      type: [Boolean, Function],
      default: v("autoHide")
    },
    handleResize: {
      type: Boolean,
      default: v("handleResize")
    },
    instantMove: {
      type: Boolean,
      default: v("instantMove")
    },
    eagerMount: {
      type: Boolean,
      default: v("eagerMount")
    },
    popperClass: {
      type: [String, Array, Object],
      default: v("popperClass")
    },
    computeTransformOrigin: {
      type: Boolean,
      default: v("computeTransformOrigin")
    },
    /**
     * @deprecated
     */
    autoMinSize: {
      type: Boolean,
      default: v("autoMinSize")
    },
    autoSize: {
      type: [Boolean, String],
      default: v("autoSize")
    },
    /**
     * @deprecated
     */
    autoMaxSize: {
      type: Boolean,
      default: v("autoMaxSize")
    },
    autoBoundaryMaxSize: {
      type: Boolean,
      default: v("autoBoundaryMaxSize")
    },
    preventOverflow: {
      type: Boolean,
      default: v("preventOverflow")
    },
    overflowPadding: {
      type: [Number, String],
      default: v("overflowPadding")
    },
    arrowPadding: {
      type: [Number, String],
      default: v("arrowPadding")
    },
    arrowOverflow: {
      type: Boolean,
      default: v("arrowOverflow")
    },
    flip: {
      type: Boolean,
      default: v("flip")
    },
    shift: {
      type: Boolean,
      default: v("shift")
    },
    shiftCrossAxis: {
      type: Boolean,
      default: v("shiftCrossAxis")
    },
    noAutoFocus: {
      type: Boolean,
      default: v("noAutoFocus")
    },
    disposeTimeout: {
      type: Number,
      default: v("disposeTimeout")
    }
  },
  emits: {
    show: () => !0,
    hide: () => !0,
    "update:shown": (e) => !0,
    "apply-show": () => !0,
    "apply-hide": () => !0,
    "close-group": () => !0,
    "close-directive": () => !0,
    "auto-hide": () => !0,
    resize: () => !0
  },
  data() {
    return {
      isShown: !1,
      isMounted: !1,
      skipTransition: !1,
      classes: {
        showFrom: !1,
        showTo: !1,
        hideFrom: !1,
        hideTo: !0
      },
      result: {
        x: 0,
        y: 0,
        placement: "",
        strategy: this.strategy,
        arrow: {
          x: 0,
          y: 0,
          centerOffset: 0
        },
        transformOrigin: null
      },
      randomId: `popper_${[Math.random(), Date.now()].map((e) => e.toString(36).substring(2, 10)).join("_")}`,
      shownChildren: /* @__PURE__ */ new Set(),
      lastAutoHide: !0,
      pendingHide: !1,
      containsGlobalTarget: !1,
      isDisposed: !0,
      mouseDownContains: !1
    };
  },
  computed: {
    popperId() {
      return this.ariaId != null ? this.ariaId : this.randomId;
    },
    shouldMountContent() {
      return this.eagerMount || this.isMounted;
    },
    slotData() {
      return {
        popperId: this.popperId,
        isShown: this.isShown,
        shouldMountContent: this.shouldMountContent,
        skipTransition: this.skipTransition,
        autoHide: typeof this.autoHide == "function" ? this.lastAutoHide : this.autoHide,
        show: this.show,
        hide: this.hide,
        handleResize: this.handleResize,
        onResize: this.onResize,
        classes: {
          ...this.classes,
          popperClass: this.popperClass
        },
        result: this.positioningDisabled ? null : this.result,
        attrs: this.$attrs
      };
    },
    parentPopper() {
      var e;
      return (e = this[Ae]) == null ? void 0 : e.parentPopper;
    },
    hasPopperShowTriggerHover() {
      var e, t;
      return ((e = this.popperTriggers) == null ? void 0 : e.includes("hover")) || ((t = this.popperShowTriggers) == null ? void 0 : t.includes("hover"));
    }
  },
  watch: {
    shown: "$_autoShowHide",
    disabled(e) {
      e ? this.dispose() : this.init();
    },
    async container() {
      this.isShown && (this.$_ensureTeleport(), await this.$_computePosition());
    },
    triggers: {
      handler: "$_refreshListeners",
      deep: !0
    },
    positioningDisabled: "$_refreshListeners",
    ...[
      "placement",
      "distance",
      "skidding",
      "boundary",
      "strategy",
      "overflowPadding",
      "arrowPadding",
      "preventOverflow",
      "shift",
      "shiftCrossAxis",
      "flip"
    ].reduce((e, t) => (e[t] = "$_computePosition", e), {})
  },
  created() {
    this.autoMinSize && console.warn('[floating-vue] `autoMinSize` option is deprecated. Use `autoSize="min"` instead.'), this.autoMaxSize && console.warn("[floating-vue] `autoMaxSize` option is deprecated. Use `autoBoundaryMaxSize` instead.");
  },
  mounted() {
    this.init(), this.$_detachPopperNode();
  },
  activated() {
    this.$_autoShowHide();
  },
  deactivated() {
    this.hide();
  },
  beforeUnmount() {
    this.dispose();
  },
  methods: {
    show({ event: e = null, skipDelay: t = !1, force: i = !1 } = {}) {
      var o, n;
      (o = this.parentPopper) != null && o.lockedChild && this.parentPopper.lockedChild !== this || (this.pendingHide = !1, (i || !this.disabled) && (((n = this.parentPopper) == null ? void 0 : n.lockedChild) === this && (this.parentPopper.lockedChild = null), this.$_scheduleShow(e, t), this.$emit("show"), this.$_showFrameLocked = !0, requestAnimationFrame(() => {
        this.$_showFrameLocked = !1;
      })), this.$emit("update:shown", !0));
    },
    hide({ event: e = null, skipDelay: t = !1 } = {}) {
      var i;
      if (!this.$_hideInProgress) {
        if (this.shownChildren.size > 0) {
          this.pendingHide = !0;
          return;
        }
        if (this.hasPopperShowTriggerHover && this.$_isAimingPopper()) {
          this.parentPopper && (this.parentPopper.lockedChild = this, clearTimeout(this.parentPopper.lockedChildTimer), this.parentPopper.lockedChildTimer = setTimeout(() => {
            this.parentPopper.lockedChild === this && (this.parentPopper.lockedChild.hide({ skipDelay: t }), this.parentPopper.lockedChild = null);
          }, 1e3));
          return;
        }
        ((i = this.parentPopper) == null ? void 0 : i.lockedChild) === this && (this.parentPopper.lockedChild = null), this.pendingHide = !1, this.$_scheduleHide(e, t), this.$emit("hide"), this.$emit("update:shown", !1);
      }
    },
    init() {
      var e;
      this.isDisposed && (this.isDisposed = !1, this.isMounted = !1, this.$_events = [], this.$_preventShow = !1, this.$_referenceNode = ((e = this.referenceNode) == null ? void 0 : e.call(this)) ?? this.$el, this.$_targetNodes = this.targetNodes().filter((t) => t.nodeType === t.ELEMENT_NODE), this.$_popperNode = this.popperNode(), this.$_innerNode = this.$_popperNode.querySelector(".v-popper__inner"), this.$_arrowNode = this.$_popperNode.querySelector(".v-popper__arrow-container"), this.$_swapTargetAttrs("title", "data-original-title"), this.$_detachPopperNode(), this.triggers.length && this.$_addEventListeners(), this.shown && this.show());
    },
    dispose() {
      this.isDisposed || (this.isDisposed = !0, this.$_removeEventListeners(), this.hide({ skipDelay: !0 }), this.$_detachPopperNode(), this.isMounted = !1, this.isShown = !1, this.$_updateParentShownChildren(!1), this.$_swapTargetAttrs("data-original-title", "title"));
    },
    async onResize() {
      this.isShown && (await this.$_computePosition(), this.$emit("resize"));
    },
    async $_computePosition() {
      if (this.isDisposed || this.positioningDisabled)
        return;
      const e = {
        strategy: this.strategy,
        middleware: []
      };
      (this.distance || this.skidding) && e.middleware.push(oi({
        mainAxis: this.distance,
        crossAxis: this.skidding
      }));
      const t = this.placement.startsWith("auto");
      if (t ? e.middleware.push(ei({
        alignment: this.placement.split("-")[1] ?? ""
      })) : e.placement = this.placement, this.preventOverflow && (this.shift && e.middleware.push(ni({
        padding: this.overflowPadding,
        boundary: this.boundary,
        crossAxis: this.shiftCrossAxis
      })), !t && this.flip && e.middleware.push(ti({
        padding: this.overflowPadding,
        boundary: this.boundary
      }))), e.middleware.push(Qt({
        element: this.$_arrowNode,
        padding: this.arrowPadding
      })), this.arrowOverflow && e.middleware.push({
        name: "arrowOverflow",
        fn: ({ placement: o, rects: n, middlewareData: s }) => {
          let r;
          const { centerOffset: a } = s.arrow;
          return o.startsWith("top") || o.startsWith("bottom") ? r = Math.abs(a) > n.reference.width / 2 : r = Math.abs(a) > n.reference.height / 2, {
            data: {
              overflow: r
            }
          };
        }
      }), this.autoMinSize || this.autoSize) {
        const o = this.autoSize ? this.autoSize : this.autoMinSize ? "min" : null;
        e.middleware.push({
          name: "autoSize",
          fn: ({ rects: n, placement: s, middlewareData: r }) => {
            var a;
            if ((a = r.autoSize) != null && a.skip)
              return {};
            let l, d;
            return s.startsWith("top") || s.startsWith("bottom") ? l = n.reference.width : d = n.reference.height, this.$_innerNode.style[o === "min" ? "minWidth" : o === "max" ? "maxWidth" : "width"] = l != null ? `${l}px` : null, this.$_innerNode.style[o === "min" ? "minHeight" : o === "max" ? "maxHeight" : "height"] = d != null ? `${d}px` : null, {
              data: {
                skip: !0
              },
              reset: {
                rects: !0
              }
            };
          }
        });
      }
      (this.autoMaxSize || this.autoBoundaryMaxSize) && (this.$_innerNode.style.maxWidth = null, this.$_innerNode.style.maxHeight = null, e.middleware.push(si({
        boundary: this.boundary,
        padding: this.overflowPadding,
        apply: ({ availableWidth: o, availableHeight: n }) => {
          this.$_innerNode.style.maxWidth = o != null ? `${o}px` : null, this.$_innerNode.style.maxHeight = n != null ? `${n}px` : null;
        }
      })));
      const i = await di(this.$_referenceNode, this.$_popperNode, e);
      Object.assign(this.result, {
        x: i.x,
        y: i.y,
        placement: i.placement,
        strategy: i.strategy,
        arrow: {
          ...i.middlewareData.arrow,
          ...i.middlewareData.arrowOverflow
        }
      });
    },
    $_scheduleShow(e, t = !1) {
      if (this.$_updateParentShownChildren(!0), this.$_hideInProgress = !1, clearTimeout(this.$_scheduleTimer), U && this.instantMove && U.instantMove && U !== this.parentPopper) {
        U.$_applyHide(!0), this.$_applyShow(!0);
        return;
      }
      t ? this.$_applyShow() : this.$_scheduleTimer = setTimeout(this.$_applyShow.bind(this), this.$_computeDelay("show"));
    },
    $_scheduleHide(e, t = !1) {
      if (this.shownChildren.size > 0) {
        this.pendingHide = !0;
        return;
      }
      this.$_updateParentShownChildren(!1), this.$_hideInProgress = !0, clearTimeout(this.$_scheduleTimer), this.isShown && (U = this), t ? this.$_applyHide() : this.$_scheduleTimer = setTimeout(this.$_applyHide.bind(this), this.$_computeDelay("hide"));
    },
    $_computeDelay(e) {
      const t = this.delay;
      return parseInt(t && t[e] || t || 0);
    },
    async $_applyShow(e = !1) {
      clearTimeout(this.$_disposeTimer), clearTimeout(this.$_scheduleTimer), this.skipTransition = e, !this.isShown && (this.$_ensureTeleport(), await Pe(), await this.$_computePosition(), await this.$_applyShowEffect(), this.positioningDisabled || this.$_registerEventListeners([
        ...ve(this.$_referenceNode),
        ...ve(this.$_popperNode)
      ], "scroll", () => {
        this.$_computePosition();
      }));
    },
    async $_applyShowEffect() {
      if (this.$_hideInProgress)
        return;
      if (this.computeTransformOrigin) {
        const t = this.$_referenceNode.getBoundingClientRect(), i = this.$_popperNode.querySelector(".v-popper__wrapper"), o = i.parentNode.getBoundingClientRect(), n = t.x + t.width / 2 - (o.left + i.offsetLeft), s = t.y + t.height / 2 - (o.top + i.offsetTop);
        this.result.transformOrigin = `${n}px ${s}px`;
      }
      this.isShown = !0, this.$_applyAttrsToTarget({
        "aria-describedby": this.popperId,
        "data-popper-shown": ""
      });
      const e = this.showGroup;
      if (e) {
        let t;
        for (let i = 0; i < R.length; i++)
          t = R[i], t.showGroup !== e && (t.hide(), t.$emit("close-group"));
      }
      R.push(this), document.body.classList.add("v-popper--some-open");
      for (const t of et(this.theme))
        st(t).push(this), document.body.classList.add(`v-popper--some-open--${t}`);
      this.$emit("apply-show"), this.classes.showFrom = !0, this.classes.showTo = !1, this.classes.hideFrom = !1, this.classes.hideTo = !1, await Pe(), this.classes.showFrom = !1, this.classes.showTo = !0, this.noAutoFocus || this.$_popperNode.focus();
    },
    async $_applyHide(e = !1) {
      if (this.shownChildren.size > 0) {
        this.pendingHide = !0, this.$_hideInProgress = !1;
        return;
      }
      if (clearTimeout(this.$_scheduleTimer), !this.isShown)
        return;
      this.skipTransition = e, ot(R, this), R.length === 0 && document.body.classList.remove("v-popper--some-open");
      for (const i of et(this.theme)) {
        const o = st(i);
        ot(o, this), o.length === 0 && document.body.classList.remove(`v-popper--some-open--${i}`);
      }
      U === this && (U = null), this.isShown = !1, this.$_applyAttrsToTarget({
        "aria-describedby": void 0,
        "data-popper-shown": void 0
      }), clearTimeout(this.$_disposeTimer);
      const t = this.disposeTimeout;
      t !== null && (this.$_disposeTimer = setTimeout(() => {
        this.$_popperNode && (this.$_detachPopperNode(), this.isMounted = !1);
      }, t)), this.$_removeEventListeners("scroll"), this.$emit("apply-hide"), this.classes.showFrom = !1, this.classes.showTo = !1, this.classes.hideFrom = !0, this.classes.hideTo = !1, await Pe(), this.classes.hideFrom = !1, this.classes.hideTo = !0;
    },
    $_autoShowHide() {
      this.shown ? this.show() : this.hide();
    },
    $_ensureTeleport() {
      if (this.isDisposed)
        return;
      let e = this.container;
      if (typeof e == "string" ? e = window.document.querySelector(e) : e === !1 && (e = this.$_targetNodes[0].parentNode), !e)
        throw new Error("No container for popover: " + this.container);
      e.appendChild(this.$_popperNode), this.isMounted = !0;
    },
    $_addEventListeners() {
      const e = (i) => {
        this.isShown && !this.$_hideInProgress || (i.usedByTooltip = !0, !this.$_preventShow && this.show({ event: i }));
      };
      this.$_registerTriggerListeners(this.$_targetNodes, tt, this.triggers, this.showTriggers, e), this.$_registerTriggerListeners([this.$_popperNode], tt, this.popperTriggers, this.popperShowTriggers, e);
      const t = (i) => {
        i.usedByTooltip || this.hide({ event: i });
      };
      this.$_registerTriggerListeners(this.$_targetNodes, it, this.triggers, this.hideTriggers, t), this.$_registerTriggerListeners([this.$_popperNode], it, this.popperTriggers, this.popperHideTriggers, t);
    },
    $_registerEventListeners(e, t, i) {
      this.$_events.push({ targetNodes: e, eventType: t, handler: i }), e.forEach((o) => o.addEventListener(t, i, ae ? {
        passive: !0
      } : void 0));
    },
    $_registerTriggerListeners(e, t, i, o, n) {
      let s = i;
      o != null && (s = typeof o == "function" ? o(s) : o), s.forEach((r) => {
        const a = t[r];
        a && this.$_registerEventListeners(e, a, n);
      });
    },
    $_removeEventListeners(e) {
      const t = [];
      this.$_events.forEach((i) => {
        const { targetNodes: o, eventType: n, handler: s } = i;
        !e || e === n ? o.forEach((r) => r.removeEventListener(n, s)) : t.push(i);
      }), this.$_events = t;
    },
    $_refreshListeners() {
      this.isDisposed || (this.$_removeEventListeners(), this.$_addEventListeners());
    },
    $_handleGlobalClose(e, t = !1) {
      this.$_showFrameLocked || (this.hide({ event: e }), e.closePopover ? this.$emit("close-directive") : this.$emit("auto-hide"), t && (this.$_preventShow = !0, setTimeout(() => {
        this.$_preventShow = !1;
      }, 300)));
    },
    $_detachPopperNode() {
      this.$_popperNode.parentNode && this.$_popperNode.parentNode.removeChild(this.$_popperNode);
    },
    $_swapTargetAttrs(e, t) {
      for (const i of this.$_targetNodes) {
        const o = i.getAttribute(e);
        o && (i.removeAttribute(e), i.setAttribute(t, o));
      }
    },
    $_applyAttrsToTarget(e) {
      for (const t of this.$_targetNodes)
        for (const i in e) {
          const o = e[i];
          o == null ? t.removeAttribute(i) : t.setAttribute(i, o);
        }
    },
    $_updateParentShownChildren(e) {
      let t = this.parentPopper;
      for (; t; )
        e ? t.shownChildren.add(this.randomId) : (t.shownChildren.delete(this.randomId), t.pendingHide && t.hide()), t = t.parentPopper;
    },
    $_isAimingPopper() {
      const e = this.$_referenceNode.getBoundingClientRect();
      if (ie >= e.left && ie <= e.right && oe >= e.top && oe <= e.bottom) {
        const t = this.$_popperNode.getBoundingClientRect(), i = ie - W, o = oe - j, n = t.left + t.width / 2 - W + (t.top + t.height / 2) - j + t.width + t.height, s = W + i * n, r = j + o * n;
        return he(W, j, s, r, t.left, t.top, t.left, t.bottom) || // Left edge
        he(W, j, s, r, t.left, t.top, t.right, t.top) || // Top edge
        he(W, j, s, r, t.right, t.top, t.right, t.bottom) || // Right edge
        he(W, j, s, r, t.left, t.bottom, t.right, t.bottom);
      }
      return !1;
    }
  },
  render() {
    return this.$slots.default(this.slotData);
  }
});
if (typeof document < "u" && typeof window < "u") {
  if (Tt) {
    const e = ae ? {
      passive: !0,
      capture: !0
    } : !0;
    document.addEventListener("touchstart", (t) => rt(t), e), document.addEventListener("touchend", (t) => at(t, !0), e);
  } else
    window.addEventListener("mousedown", (e) => rt(e), !0), window.addEventListener("click", (e) => at(e, !1), !0);
  window.addEventListener("resize", fi);
}
function rt(e, t) {
  for (let i = 0; i < R.length; i++) {
    const o = R[i];
    try {
      o.mouseDownContains = o.popperNode().contains(e.target);
    } catch {
    }
  }
}
function at(e, t) {
  hi(e, t);
}
function hi(e, t) {
  const i = {};
  for (let o = R.length - 1; o >= 0; o--) {
    const n = R[o];
    try {
      const s = n.containsGlobalTarget = n.mouseDownContains || n.popperNode().contains(e.target);
      n.pendingHide = !1, requestAnimationFrame(() => {
        if (n.pendingHide = !1, !i[n.randomId] && lt(n, s, e)) {
          if (n.$_handleGlobalClose(e, t), !e.closeAllPopover && e.closePopover && s) {
            let a = n.parentPopper;
            for (; a; )
              i[a.randomId] = !0, a = a.parentPopper;
            return;
          }
          let r = n.parentPopper;
          for (; r && lt(r, r.containsGlobalTarget, e); )
            r.$_handleGlobalClose(e, t), r = r.parentPopper;
        }
      });
    } catch {
    }
  }
}
function lt(e, t, i) {
  return i.closeAllPopover || i.closePopover && t || ui(e, i) && !t;
}
function ui(e, t) {
  if (typeof e.autoHide == "function") {
    const i = e.autoHide(t);
    return e.lastAutoHide = i, i;
  }
  return e.autoHide;
}
function fi() {
  for (let e = 0; e < R.length; e++)
    R[e].$_computePosition();
}
let W = 0, j = 0, ie = 0, oe = 0;
typeof window < "u" && window.addEventListener("mousemove", (e) => {
  W = ie, j = oe, ie = e.clientX, oe = e.clientY;
}, ae ? {
  passive: !0
} : void 0);
function he(e, t, i, o, n, s, r, a) {
  const l = ((r - n) * (t - s) - (a - s) * (e - n)) / ((a - s) * (i - e) - (r - n) * (o - t)), d = ((i - e) * (t - s) - (o - t) * (e - n)) / ((a - s) * (i - e) - (r - n) * (o - t));
  return l >= 0 && l <= 1 && d >= 0 && d <= 1;
}
const mi = {
  extends: St()
}, We = (e, t) => {
  const i = e.__vccOpts || e;
  for (const [o, n] of t)
    i[o] = n;
  return i;
};
function gi(e, t, i, o, n, s) {
  return D(), K("div", {
    ref: "reference",
    class: ht(["v-popper", {
      "v-popper--shown": e.slotData.isShown
    }])
  }, [
    fe(e.$slots, "default", Rt(Bt(e.slotData)))
  ], 2);
}
const wi = /* @__PURE__ */ We(mi, [["render", gi]]);
function yi() {
  var e = window.navigator.userAgent, t = e.indexOf("MSIE ");
  if (t > 0)
    return parseInt(e.substring(t + 5, e.indexOf(".", t)), 10);
  var i = e.indexOf("Trident/");
  if (i > 0) {
    var o = e.indexOf("rv:");
    return parseInt(e.substring(o + 3, e.indexOf(".", o)), 10);
  }
  var n = e.indexOf("Edge/");
  return n > 0 ? parseInt(e.substring(n + 5, e.indexOf(".", n)), 10) : -1;
}
let ue;
function Le() {
  Le.init || (Le.init = !0, ue = yi() !== -1);
}
var be = {
  name: "ResizeObserver",
  props: {
    emitOnMount: {
      type: Boolean,
      default: !1
    },
    ignoreWidth: {
      type: Boolean,
      default: !1
    },
    ignoreHeight: {
      type: Boolean,
      default: !1
    }
  },
  emits: [
    "notify"
  ],
  mounted() {
    Le(), Ot(() => {
      this._w = this.$el.offsetWidth, this._h = this.$el.offsetHeight, this.emitOnMount && this.emitSize();
    });
    const e = document.createElement("object");
    this._resizeObject = e, e.setAttribute("aria-hidden", "true"), e.setAttribute("tabindex", -1), e.onload = this.addResizeHandlers, e.type = "text/html", ue && this.$el.appendChild(e), e.data = "about:blank", ue || this.$el.appendChild(e);
  },
  beforeUnmount() {
    this.removeResizeHandlers();
  },
  methods: {
    compareAndNotify() {
      (!this.ignoreWidth && this._w !== this.$el.offsetWidth || !this.ignoreHeight && this._h !== this.$el.offsetHeight) && (this._w = this.$el.offsetWidth, this._h = this.$el.offsetHeight, this.emitSize());
    },
    emitSize() {
      this.$emit("notify", {
        width: this._w,
        height: this._h
      });
    },
    addResizeHandlers() {
      this._resizeObject.contentDocument.defaultView.addEventListener("resize", this.compareAndNotify), this.compareAndNotify();
    },
    removeResizeHandlers() {
      this._resizeObject && this._resizeObject.onload && (!ue && this._resizeObject.contentDocument && this._resizeObject.contentDocument.defaultView.removeEventListener("resize", this.compareAndNotify), this.$el.removeChild(this._resizeObject), this._resizeObject.onload = null, this._resizeObject = null);
    }
  }
};
const vi = /* @__PURE__ */ Nt();
dt("data-v-b329ee4c");
const xi = {
  class: "resize-observer",
  tabindex: "-1"
};
pt();
const _i = /* @__PURE__ */ vi((e, t, i, o, n, s) => (D(), Me("div", xi)));
be.render = _i;
be.__scopeId = "data-v-b329ee4c";
be.__file = "src/components/ResizeObserver.vue";
const Pt = (e = "theme") => ({
  computed: {
    themeClass() {
      return pi(this[e]);
    }
  }
}), $i = le({
  name: "VPopperContent",
  components: {
    ResizeObserver: be
  },
  mixins: [
    Pt()
  ],
  props: {
    popperId: String,
    theme: String,
    shown: Boolean,
    mounted: Boolean,
    skipTransition: Boolean,
    autoHide: Boolean,
    handleResize: Boolean,
    classes: Object,
    result: Object
  },
  emits: [
    "hide",
    "resize"
  ],
  methods: {
    toPx(e) {
      return e != null && !isNaN(e) ? `${e}px` : null;
    }
  }
}), bi = ["id", "aria-hidden", "tabindex", "data-popper-placement"], Ti = {
  ref: "inner",
  class: "v-popper__inner"
}, Si = /* @__PURE__ */ P("div", { class: "v-popper__arrow-outer" }, null, -1), Pi = /* @__PURE__ */ P("div", { class: "v-popper__arrow-inner" }, null, -1), Ai = [
  Si,
  Pi
];
function Ci(e, t, i, o, n, s) {
  const r = Ce("ResizeObserver");
  return D(), K("div", {
    id: e.popperId,
    ref: "popover",
    class: ht(["v-popper__popper", [
      e.themeClass,
      e.classes.popperClass,
      {
        "v-popper__popper--shown": e.shown,
        "v-popper__popper--hidden": !e.shown,
        "v-popper__popper--show-from": e.classes.showFrom,
        "v-popper__popper--show-to": e.classes.showTo,
        "v-popper__popper--hide-from": e.classes.hideFrom,
        "v-popper__popper--hide-to": e.classes.hideTo,
        "v-popper__popper--skip-transition": e.skipTransition,
        "v-popper__popper--arrow-overflow": e.result && e.result.arrow.overflow,
        "v-popper__popper--no-positioning": !e.result
      }
    ]]),
    style: Te(e.result ? {
      position: e.result.strategy,
      transform: `translate3d(${Math.round(e.result.x)}px,${Math.round(e.result.y)}px,0)`
    } : void 0),
    "aria-hidden": e.shown ? "false" : "true",
    tabindex: e.autoHide ? 0 : void 0,
    "data-popper-placement": e.result ? e.result.placement : void 0,
    onKeyup: t[2] || (t[2] = Oe((a) => e.autoHide && e.$emit("hide"), ["esc"]))
  }, [
    P("div", {
      class: "v-popper__backdrop",
      onClick: t[0] || (t[0] = (a) => e.autoHide && e.$emit("hide"))
    }),
    P("div", {
      class: "v-popper__wrapper",
      style: Te(e.result ? {
        transformOrigin: e.result.transformOrigin
      } : void 0)
    }, [
      P("div", Ti, [
        e.mounted ? (D(), K(ct, { key: 0 }, [
          P("div", null, [
            fe(e.$slots, "default")
          ]),
          e.handleResize ? (D(), Me(r, {
            key: 0,
            onNotify: t[1] || (t[1] = (a) => e.$emit("resize", a))
          })) : ke("", !0)
        ], 64)) : ke("", !0)
      ], 512),
      P("div", {
        ref: "arrow",
        class: "v-popper__arrow-container",
        style: Te(e.result ? {
          left: e.toPx(e.result.arrow.x),
          top: e.toPx(e.result.arrow.y)
        } : void 0)
      }, Ai, 4)
    ], 4)
  ], 46, bi);
}
const At = /* @__PURE__ */ We($i, [["render", Ci]]), Ct = {
  methods: {
    show(...e) {
      return this.$refs.popper.show(...e);
    },
    hide(...e) {
      return this.$refs.popper.hide(...e);
    },
    dispose(...e) {
      return this.$refs.popper.dispose(...e);
    },
    onResize(...e) {
      return this.$refs.popper.onResize(...e);
    }
  }
};
let De = function() {
};
typeof window < "u" && (De = window.Element);
const ki = le({
  name: "VPopperWrapper",
  components: {
    Popper: wi,
    PopperContent: At
  },
  mixins: [
    Ct,
    Pt("finalTheme")
  ],
  props: {
    theme: {
      type: String,
      default: null
    },
    referenceNode: {
      type: Function,
      default: null
    },
    shown: {
      type: Boolean,
      default: !1
    },
    showGroup: {
      type: String,
      default: null
    },
    // eslint-disable-next-line vue/require-prop-types
    ariaId: {
      default: null
    },
    disabled: {
      type: Boolean,
      default: void 0
    },
    positioningDisabled: {
      type: Boolean,
      default: void 0
    },
    placement: {
      type: String,
      default: void 0
    },
    delay: {
      type: [String, Number, Object],
      default: void 0
    },
    distance: {
      type: [Number, String],
      default: void 0
    },
    skidding: {
      type: [Number, String],
      default: void 0
    },
    triggers: {
      type: Array,
      default: void 0
    },
    showTriggers: {
      type: [Array, Function],
      default: void 0
    },
    hideTriggers: {
      type: [Array, Function],
      default: void 0
    },
    popperTriggers: {
      type: Array,
      default: void 0
    },
    popperShowTriggers: {
      type: [Array, Function],
      default: void 0
    },
    popperHideTriggers: {
      type: [Array, Function],
      default: void 0
    },
    container: {
      type: [String, Object, De, Boolean],
      default: void 0
    },
    boundary: {
      type: [String, De],
      default: void 0
    },
    strategy: {
      type: String,
      default: void 0
    },
    autoHide: {
      type: [Boolean, Function],
      default: void 0
    },
    handleResize: {
      type: Boolean,
      default: void 0
    },
    instantMove: {
      type: Boolean,
      default: void 0
    },
    eagerMount: {
      type: Boolean,
      default: void 0
    },
    popperClass: {
      type: [String, Array, Object],
      default: void 0
    },
    computeTransformOrigin: {
      type: Boolean,
      default: void 0
    },
    /**
     * @deprecated
     */
    autoMinSize: {
      type: Boolean,
      default: void 0
    },
    autoSize: {
      type: [Boolean, String],
      default: void 0
    },
    /**
     * @deprecated
     */
    autoMaxSize: {
      type: Boolean,
      default: void 0
    },
    autoBoundaryMaxSize: {
      type: Boolean,
      default: void 0
    },
    preventOverflow: {
      type: Boolean,
      default: void 0
    },
    overflowPadding: {
      type: [Number, String],
      default: void 0
    },
    arrowPadding: {
      type: [Number, String],
      default: void 0
    },
    arrowOverflow: {
      type: Boolean,
      default: void 0
    },
    flip: {
      type: Boolean,
      default: void 0
    },
    shift: {
      type: Boolean,
      default: void 0
    },
    shiftCrossAxis: {
      type: Boolean,
      default: void 0
    },
    noAutoFocus: {
      type: Boolean,
      default: void 0
    },
    disposeTimeout: {
      type: Number,
      default: void 0
    }
  },
  emits: {
    show: () => !0,
    hide: () => !0,
    "update:shown": (e) => !0,
    "apply-show": () => !0,
    "apply-hide": () => !0,
    "close-group": () => !0,
    "close-directive": () => !0,
    "auto-hide": () => !0,
    resize: () => !0
  },
  computed: {
    finalTheme() {
      return this.theme ?? this.$options.vPopperTheme;
    }
  },
  methods: {
    getTargetNodes() {
      return Array.from(this.$el.children).filter((e) => e !== this.$refs.popperContent.$el);
    }
  }
});
function Oi(e, t, i, o, n, s) {
  const r = Ce("PopperContent"), a = Ce("Popper");
  return D(), Me(a, zt({ ref: "popper" }, e.$props, {
    theme: e.finalTheme,
    "target-nodes": e.getTargetNodes,
    "popper-node": () => e.$refs.popperContent.$el,
    class: [
      e.themeClass
    ],
    onShow: t[0] || (t[0] = () => e.$emit("show")),
    onHide: t[1] || (t[1] = () => e.$emit("hide")),
    "onUpdate:shown": t[2] || (t[2] = (l) => e.$emit("update:shown", l)),
    onApplyShow: t[3] || (t[3] = () => e.$emit("apply-show")),
    onApplyHide: t[4] || (t[4] = () => e.$emit("apply-hide")),
    onCloseGroup: t[5] || (t[5] = () => e.$emit("close-group")),
    onCloseDirective: t[6] || (t[6] = () => e.$emit("close-directive")),
    onAutoHide: t[7] || (t[7] = () => e.$emit("auto-hide")),
    onResize: t[8] || (t[8] = () => e.$emit("resize"))
  }), {
    default: me(({
      popperId: l,
      isShown: d,
      shouldMountContent: u,
      skipTransition: c,
      autoHide: h,
      show: p,
      hide: f,
      handleResize: m,
      onResize: y,
      classes: g,
      result: w
    }) => [
      fe(e.$slots, "default", {
        shown: d,
        show: p,
        hide: f
      }),
      Ne(r, {
        ref: "popperContent",
        "popper-id": l,
        theme: e.finalTheme,
        shown: d,
        mounted: u,
        "skip-transition": c,
        "auto-hide": h,
        "handle-resize": m,
        classes: g,
        result: w,
        onHide: f,
        onResize: y
      }, {
        default: me(() => [
          fe(e.$slots, "popper", {
            shown: d,
            hide: f
          })
        ]),
        _: 2
      }, 1032, ["popper-id", "theme", "shown", "mounted", "skip-transition", "auto-hide", "handle-resize", "classes", "result", "onHide", "onResize"])
    ]),
    _: 3
  }, 16, ["theme", "target-nodes", "popper-node", "class"]);
}
const je = /* @__PURE__ */ We(ki, [["render", Oi]]), Ni = {
  ...je,
  name: "VDropdown",
  vPopperTheme: "dropdown"
};
({
  ...je
});
({
  ...je
});
le({
  name: "VTooltipDirective",
  components: {
    Popper: St(),
    PopperContent: At
  },
  mixins: [
    Ct
  ],
  inheritAttrs: !1,
  props: {
    theme: {
      type: String,
      default: "tooltip"
    },
    html: {
      type: Boolean,
      default: (e) => Be(e.theme, "html")
    },
    content: {
      type: [String, Number, Function],
      default: null
    },
    loadingContent: {
      type: String,
      default: (e) => Be(e.theme, "loadingContent")
    },
    targetNodes: {
      type: Function,
      required: !0
    }
  },
  data() {
    return {
      asyncContent: null
    };
  },
  computed: {
    isContentAsync() {
      return typeof this.content == "function";
    },
    loading() {
      return this.isContentAsync && this.asyncContent == null;
    },
    finalContent() {
      return this.isContentAsync ? this.loading ? this.loadingContent : this.asyncContent : this.content;
    }
  },
  watch: {
    content: {
      handler() {
        this.fetchContent(!0);
      },
      immediate: !0
    },
    async finalContent() {
      await this.$nextTick(), this.$refs.popper.onResize();
    }
  },
  created() {
    this.$_fetchId = 0;
  },
  methods: {
    fetchContent(e) {
      if (typeof this.content == "function" && this.$_isShown && (e || !this.$_loading && this.asyncContent == null)) {
        this.asyncContent = null, this.$_loading = !0;
        const t = ++this.$_fetchId, i = this.content(this);
        i.then ? i.then((o) => this.onResult(t, o)) : this.onResult(t, i);
      }
    },
    onResult(e, t) {
      e === this.$_fetchId && (this.$_loading = !1, this.asyncContent = t);
    },
    onShow() {
      this.$_isShown = !0, this.fetchContent();
    },
    onHide() {
      this.$_isShown = !1;
    }
  }
});
const zi = Ni, Ve = (e) => (dt("data-v-6fbe4bf8"), e = e(), pt(), e), Ri = {
  key: 0,
  class: "flex items-center gap-2 px-2"
}, Bi = {
  key: 0,
  class: "text-lg flex items-center gap-2"
}, Hi = /* @__PURE__ */ Ve(() => /* @__PURE__ */ P("div", { class: "flex-1" }, null, -1)), Li = /* @__PURE__ */ Ve(() => /* @__PURE__ */ P("div", { class: "i-la-info-circle cursor-pointer" }, null, -1)), Di = { class: "text-xs px-4 py-2 leading-5" }, Mi = { class: "max-w-120" }, Ei = ["checked"], Fi = { class: "p-0" }, Ii = /* @__PURE__ */ Ve(() => /* @__PURE__ */ P("a", {
  class: "font-bold underline",
  href: "http://www.skyhunter.com/marcs/petnames/IntroPetNames.html",
  target: "_blank"
}, "Stiegler, 2005", -1)), Wi = /* @__PURE__ */ le({
  __name: "AccountPetname",
  props: {
    pub: { type: String, default: "" }
  },
  setup(e) {
    const t = e, { user: i } = Ht(), o = Se(""), n = Se(""), s = Se(!1);
    Lt(() => t.pub, (a) => {
      i.db.get("petnames").get(a).on(async (l) => {
        o.value = await i.decrypt(l);
      });
    }, { immediate: !0 });
    const r = {
      "The key must be resistant enough to forgery to survive in the context of the application threat model": !0,
      "There can be at most one petname per key per user per application": !0,
      "There can be at most one key per petname (per user per application)": !0,
      "In the application user interface, all references to the key are represented by the petname": !1,
      "The user must be able to assign a private petname to any key": !0,
      "The petname must be assigned to the key only by explicit user action": !0,
      "The user must be able to repeatedly edit the petname of any key": !0,
      "The user interface shall assist the user in assuring that two petnames are not similar enough to enable mimicry": !1,
      "Nicknames and alleged names must be unambiguously visually distinct from petnames": !1
    };
    return (a, l) => pe(i).is ? (D(), K("div", Ri, [
      Ne(pe(Wt), {
        pub: e.pub,
        size: 40
      }, null, 8, ["pub"]),
      o.value && !s.value ? (D(), K("div", Bi, [
        Dt(qe(o.value), 1),
        P("div", {
          class: "i-la-pen",
          onClick: l[0] || (l[0] = (d) => s.value = !s.value)
        })
      ])) : Mt((D(), K("input", {
        key: 1,
        class: "m-1 p-2 rounded-lg dark-bg-dark-100",
        "onUpdate:modelValue": l[1] || (l[1] = (d) => n.value = d),
        placeholder: "Set private petname",
        onKeydown: [
          l[2] || (l[2] = Oe((d) => {
            pe(Ft)(e.pub, n.value), s.value = !1;
          }, ["enter"])),
          l[3] || (l[3] = Oe((d) => s.value = !1, ["escape"]))
        ]
      }, null, 544)), [
        [Et, n.value]
      ]),
      Hi,
      Ne(pe(zi), null, {
        popper: me(() => [
          P("div", Di, [
            P("ul", Mi, [
              (D(), K(ct, null, It(r, (d, u) => P("li", {
                class: "flex gap-2 items-start",
                key: u
              }, [
                P("input", {
                  class: "my-2",
                  type: "checkbox",
                  checked: d,
                  disabled: ""
                }, null, 8, Ei),
                P("div", Fi, qe(u), 1)
              ])), 64))
            ]),
            Ii
          ])
        ]),
        default: me(() => [
          Li
        ]),
        _: 1
      })
    ])) : ke("", !0);
  }
}), Gi = /* @__PURE__ */ jt(Wi, [["__scopeId", "data-v-6fbe4bf8"]]);
export {
  Gi as default
};
//# sourceMappingURL=AccountPetname-lgNahEiT.js.map
