import '@das-fed/ui/packages/components/scrollbar/style.css';
import "@das-fed/ui/packages/global/theme";
import { withInstall as Cs } from "@das-fed/utils/with-install/index";
import { onUnmounted as Nn, defineComponent as $s, ref as Ie, computed as Es, onMounted as Ts, createBlock as As, openBlock as Hs, unref as ks, mergeProps as Ls, withCtx as _s, renderSlot as Ds } from "vue";
import { createStyle as Is } from "@das-fed/utils/style";
import { ElScrollbar as Ps } from "element-plus";
import "element-plus/es/components/scrollbar/style/css";
import { useZIndex as Rs } from "@das-fed/utils/hooks/popup-manager/use-zindex";
/*!
 * OverlayScrollbars
 * Version: 2.6.1
 *
 * Copyright (c) Rene Haas | KingSora.
 * https://github.com/KingSora
 *
 * Released under the MIT license.
 */
const wt = (t, e) => {
  const { o: n, u: s, _: o } = t;
  let c = n, r;
  const l = (a, d) => {
    const b = c, C = a, A = d || (s ? !s(b, C) : b !== C);
    return (A || o) && (c = C, r = b), [c, A, r];
  };
  return [e ? (a) => l(e(c, r), a) : l, (a) => [c, !!a, r]];
}, en = typeof window < "u", mt = en ? window : {}, ve = Math.max, Ms = Math.min, ze = Math.round, Vn = mt.cancelAnimationFrame, zn = mt.requestAnimationFrame, Fe = mt.setTimeout, Ue = mt.clearTimeout, Se = (t) => typeof mt[t] < "u" ? mt[t] : void 0, Ns = Se("MutationObserver"), mn = Se("IntersectionObserver"), me = Se("ResizeObserver"), Be = Se("ScrollTimeline"), Fn = en && Node.ELEMENT_NODE, { toString: Vs, hasOwnProperty: Pe } = Object.prototype, zs = /^\[object (.+)\]$/, ae = (t) => t === void 0, xe = (t) => t === null, Fs = (t) => ae(t) || xe(t) ? `${t}` : Vs.call(t).replace(zs, "$1").toLowerCase(), $t = (t) => typeof t == "number", Oe = (t) => typeof t == "string", Un = (t) => typeof t == "boolean", Et = (t) => typeof t == "function", xt = (t) => Array.isArray(t), le = (t) => typeof t == "object" && !xt(t) && !xe(t), Ce = (t) => {
  const e = !!t && t.length, n = $t(e) && e > -1 && e % 1 == 0;
  return xt(t) || !Et(t) && n ? e > 0 && le(t) ? e - 1 in t : !0 : !1;
}, he = (t) => {
  if (!t || !le(t) || Fs(t) !== "object")
    return !1;
  let e;
  const n = "constructor", s = t[n], o = s && s.prototype, c = Pe.call(t, n), r = o && Pe.call(o, "isPrototypeOf");
  if (s && !c && !r)
    return !1;
  for (e in t)
    ;
  return ae(e) || Pe.call(t, e);
}, ce = (t) => {
  const e = HTMLElement;
  return t ? e ? t instanceof e : t.nodeType === Fn : !1;
}, $e = (t) => {
  const e = Element;
  return t ? e ? t instanceof e : t.nodeType === Fn : !1;
};
function W(t, e) {
  if (Ce(t))
    for (let n = 0; n < t.length && e(t[n], n, t) !== !1; n++)
      ;
  else t && W(Object.keys(t), (n) => e(t[n], n, t));
  return t;
}
const Ee = (t, e) => t.indexOf(e) >= 0, Tt = (t, e) => t.concat(e), K = (t, e, n) => (!Oe(e) && Ce(e) ? Array.prototype.push.apply(t, e) : t.push(e), t), Ft = (t) => Array.from(t || []), Bn = (t) => xt(t) ? t : [t], je = (t) => !!t && !t.length, hn = (t) => Ft(new Set(t)), ht = (t, e, n) => {
  W(t, (o) => o && o.apply(void 0, e || [])), !n && (t.length = 0);
}, jn = "paddingTop", Gn = "paddingRight", Wn = "paddingLeft", Xn = "paddingBottom", Yn = "marginLeft", Zn = "marginRight", qn = "marginBottom", Te = "overflowX", Ae = "overflowY", Yt = "width", Zt = "height", qt = "hidden", Kn = "visible", nn = (t, e, n, s) => {
  if (t && e) {
    let o = !0;
    return W(n, (c) => {
      const r = t[c], l = e[c];
      r !== l && (o = !1);
    }), o;
  }
  return !1;
}, Jn = (t, e) => nn(t, e, ["w", "h"]), Qn = (t, e) => nn(t, e, ["x", "y"]), Us = (t, e) => nn(t, e, ["t", "r", "b", "l"]), St = () => {
}, R = (t, ...e) => t.bind(0, ...e), Lt = (t) => {
  let e;
  const n = t ? Fe : zn, s = t ? Ue : Vn;
  return [(o) => {
    s(e), e = n(o, Et(t) ? t() : t);
  }, () => s(e)];
}, ts = (t, e) => {
  let n, s, o, c = St;
  const { v: r, p: l, S: i } = e || {}, u = function(A) {
    c(), Ue(n), n = s = void 0, c = St, t.apply(this, A);
  }, a = (C) => i && s ? i(s, C) : C, d = () => {
    c !== St && u(a(o) || o);
  }, b = function() {
    const A = Ft(arguments), H = Et(r) ? r() : r;
    if ($t(H) && H >= 0) {
      const k = Et(l) ? l() : l, S = $t(k) && k >= 0, h = H > 0 ? Fe : zn, O = H > 0 ? Ue : Vn, _ = a(A) || A, z = u.bind(0, _);
      c();
      const F = h(z, H);
      c = () => O(F), S && !n && (n = Fe(d, k)), s = o = _;
    } else
      u(A);
  };
  return b.m = d, b;
}, es = (t, e) => Object.prototype.hasOwnProperty.call(t, e), At = (t) => t ? Object.keys(t) : [], G = (t, e, n, s, o, c, r) => {
  const l = [e, n, s, o, c, r];
  return (typeof t != "object" || xe(t)) && !Et(t) && (t = {}), W(l, (i) => {
    W(i, (u, a) => {
      const d = i[a];
      if (t === d)
        return !0;
      const b = xt(d);
      if (d && he(d)) {
        const C = t[a];
        let A = C;
        b && !xt(C) ? A = [] : !b && !he(C) && (A = {}), t[a] = G(A, d);
      } else
        t[a] = b ? d.slice() : d;
    });
  }), t;
}, ns = (t, e) => W(G({}, t), (n, s, o) => {
  n === void 0 ? delete o[s] : n && he(n) && (o[s] = ns(n));
}), sn = (t) => {
  for (const e in t)
    return !1;
  return !0;
}, Ge = (t, e, n) => ve(t, Ms(e, n)), Vt = (t) => Ft(new Set((xt(t) ? t : (t || "").split(" ")).filter((e) => e))), He = (t, e) => t && t.getAttribute(e), gt = (t, e, n) => {
  W(Vt(e), (s) => {
    t && t.setAttribute(s, n || "");
  });
}, Ct = (t, e) => {
  W(Vt(e), (n) => t && t.removeAttribute(n));
}, ke = (t, e) => {
  const n = Vt(He(t, e)), s = R(gt, t, e), o = (c, r) => {
    const l = new Set(n);
    return W(Vt(c), (i) => l[r](i)), Ft(l).join(" ");
  };
  return {
    O: (c) => s(o(c, "delete")),
    $: (c) => s(o(c, "add")),
    C: (c) => {
      const r = Vt(c);
      return r.reduce((l, i) => l && n.includes(i), r.length > 0);
    }
  };
}, ss = (t, e, n) => {
  ke(t, e).O(n);
}, ie = (t, e, n) => (ke(t, e).$(n), R(ss, t, e, n)), be = (t, e, n, s) => {
  (s ? ie : ss)(t, e, n);
}, Bs = (t, e, n) => ke(t, e).C(n), os = (t) => ke(t, "class"), on = (t, e) => {
  os(t).O(e);
}, ye = (t, e) => (os(t).$(e), R(on, t, e)), yn = en && Element.prototype, cs = (t, e) => {
  const n = [], s = e ? $e(e) && e : document;
  return s ? K(n, s.querySelectorAll(t)) : n;
}, js = (t, e) => {
  const n = e ? $e(e) && e : document;
  return n ? n.querySelector(t) : null;
}, We = (t, e) => $e(t) ? (yn.matches || yn.msMatchesSelector).call(t, e) : !1, Xe = (t) => t ? Ft(t.childNodes) : [], Kt = (t) => t && t.parentElement, jt = (t, e) => $e(t) && t.closest(e), Gs = (t, e, n) => {
  const s = jt(t, e), o = t && js(n, s), c = jt(o, e) === s;
  return s && o ? s === t || o === t || c && jt(jt(t, n), e) !== s : !1;
}, It = (t) => {
  if (Ce(t))
    W(Ft(t), (e) => It(e));
  else if (t) {
    const e = Kt(t);
    e && e.removeChild(t);
  }
}, rs = (t, e, n) => {
  if (n && t) {
    let s = e, o;
    return Ce(n) ? (o = document.createDocumentFragment(), W(n, (c) => {
      c === s && (s = c.previousSibling), o.appendChild(c);
    })) : o = n, e && (s ? s !== e && (s = s.nextSibling) : s = t.firstChild), t.insertBefore(o, s || null), () => It(n);
  }
  return St;
}, bt = (t, e) => rs(t, null, e), gn = (t, e) => rs(Kt(t), t && t.nextSibling, e), Gt = (t) => {
  const e = document.createElement("div");
  return gt(e, "class", t), e;
}, ls = (t) => {
  const e = Gt();
  return e.innerHTML = t.trim(), W(Xe(e), (n) => It(n));
}, Ws = /^--/, wn = (t, e) => t.getPropertyValue(e) || t[e] || "", cn = (t) => {
  const e = t || 0;
  return isFinite(e) ? e : 0;
}, pe = (t) => cn(parseFloat(t || "")), Sn = (t) => `${(cn(t) * 100).toFixed(3)}%`, Ye = (t) => `${cn(t)}px`;
function Jt(t, e) {
  t && W(e, (n, s) => {
    try {
      const o = t.style, c = $t(n) ? Ye(n) : (n || "") + "";
      Ws.test(s) ? o.setProperty(s, c) : o[s] = c;
    } catch {
    }
  });
}
function zt(t, e, n) {
  const s = Oe(e);
  let o = s ? "" : {};
  if (t) {
    const c = mt.getComputedStyle(t, n) || t.style;
    o = s ? wn(c, e) : e.reduce((r, l) => (r[l] = wn(c, l), r), o);
  }
  return o;
}
const Dt = (t) => zt(t, "direction") === "rtl", xn = (t, e, n) => {
  const s = e ? `${e}-` : "", o = n ? `-${n}` : "", c = `${s}top${o}`, r = `${s}right${o}`, l = `${s}bottom${o}`, i = `${s}left${o}`, u = zt(t, [c, r, l, i]);
  return {
    t: pe(u[c]),
    r: pe(u[r]),
    b: pe(u[l]),
    l: pe(u[i])
  };
}, Re = (t, e) => `translate${le(t) ? `(${t.x},${t.y})` : `${e ? "X" : "Y"}(${t})`}`, Xs = {
  w: 0,
  h: 0
}, Le = (t, e) => e ? {
  w: e[`${t}Width`],
  h: e[`${t}Height`]
} : Xs, Ys = (t) => Le("inner", t || mt), re = R(Le, "offset"), is = R(Le, "client"), Ze = R(Le, "scroll"), rn = (t) => {
  const e = parseFloat(zt(t, Yt)) || 0, n = parseFloat(zt(t, Zt)) || 0;
  return {
    w: e - ze(e),
    h: n - ze(n)
  };
}, Wt = (t) => t.getBoundingClientRect(), qe = (t) => !!(t && (t[Zt] || t[Yt])), as = (t, e) => {
  const n = qe(t);
  return !qe(e) && n;
}, On = (t, e, n, s) => {
  W(Vt(e), (o) => {
    t.removeEventListener(o, n, s);
  });
}, nt = (t, e, n, s) => {
  var o;
  const c = (o = s && s.H) != null ? o : !0, r = s && s.I || !1, l = s && s.A || !1, i = {
    passive: c,
    capture: r
  };
  return R(ht, Vt(e).map((u) => {
    const a = l ? (d) => {
      On(t, u, a, r), n(d);
    } : n;
    return t.addEventListener(u, a, i), R(On, t, u, a, r);
  }));
}, ln = (t) => t.stopPropagation(), Cn = (t) => t.preventDefault(), Zs = {
  x: 0,
  y: 0
}, Me = (t) => {
  const e = t && Wt(t);
  return e ? {
    x: e.left + mt.scrollX,
    y: e.top + mt.scrollY
  } : Zs;
}, ge = (t, e, n) => n ? n.n ? -t + 0 : n.i ? e - t : t : t, $n = (t, e) => [ge(0, t, e), ge(t, t, e)], En = (t, e, n) => Ge(0, 1, ge(t, e, n) / e || 0), Pt = (t, e) => {
  const { x: n, y: s } = $t(e) ? {
    x: e,
    y: e
  } : e || {};
  $t(n) && (t.scrollLeft = n), $t(s) && (t.scrollTop = s);
}, Qt = (t) => ({
  x: t.scrollLeft,
  y: t.scrollTop
}), Tn = (t, e) => {
  W(Bn(e), t);
}, Ke = (t) => {
  const e = /* @__PURE__ */ new Map(), n = (c, r) => {
    if (c) {
      const l = e.get(c);
      Tn((i) => {
        l && l[i ? "delete" : "clear"](i);
      }, r);
    } else
      e.forEach((l) => {
        l.clear();
      }), e.clear();
  }, s = (c, r) => {
    if (Oe(c)) {
      const u = e.get(c) || /* @__PURE__ */ new Set();
      return e.set(c, u), Tn((a) => {
        Et(a) && u.add(a);
      }, r), R(n, c, r);
    }
    Un(r) && r && n();
    const l = At(c), i = [];
    return W(l, (u) => {
      const a = c[u];
      a && K(i, s(u, a));
    }), R(ht, i);
  }, o = (c, r) => {
    W(Ft(e.get(c)), (l) => {
      r && !je(r) ? l.apply(0, r) : l();
    });
  };
  return s(t || {}), [s, n, o];
}, An = (t) => JSON.stringify(t, (e, n) => {
  if (Et(n))
    throw 0;
  return n;
}), Hn = (t, e) => t ? `${e}`.split(".").reduce((n, s) => n && es(n, s) ? n[s] : void 0, t) : void 0, qs = {
  paddingAbsolute: !1,
  showNativeOverlaidScrollbars: !1,
  update: {
    elementEvents: [["img", "load"]],
    debounce: [0, 33],
    attributes: null,
    ignoreMutation: null
  },
  overflow: {
    x: "scroll",
    y: "scroll"
  },
  scrollbars: {
    theme: "os-theme-dark",
    visibility: "auto",
    autoHide: "never",
    autoHideDelay: 1300,
    autoHideSuspend: !1,
    dragScroll: !0,
    clickScroll: !1,
    pointers: ["mouse", "touch", "pen"]
  }
}, us = (t, e) => {
  const n = {}, s = Tt(At(e), At(t));
  return W(s, (o) => {
    const c = t[o], r = e[o];
    if (le(c) && le(r))
      G(n[o] = {}, us(c, r)), sn(n[o]) && delete n[o];
    else if (es(e, o) && r !== c) {
      let l = !0;
      if (xt(c) || xt(r))
        try {
          An(c) === An(r) && (l = !1);
        } catch {
        }
      l && (n[o] = r);
    }
  }), n;
}, kn = (t, e, n) => (s) => [Hn(t, s), n || Hn(e, s) !== void 0], ue = "data-overlayscrollbars", fs = "os-environment", Ks = `${fs}-scrollbar-hidden`, Ne = `${ue}-initialize`, vt = ue, ds = `${vt}-overflow-x`, ps = `${vt}-overflow-y`, vs = "overflowVisible", Js = "scrollbarPressed", Je = "updating", Qs = "body", _t = `${ue}-viewport`, to = "arrange", bs = "scrollbarHidden", Xt = vs, Qe = `${ue}-padding`, eo = Xt, Ln = `${ue}-content`, an = "os-size-observer", no = `${an}-appear`, so = `${an}-listener`, oo = "os-trinsic-observer", co = "os-theme-none", dt = "os-scrollbar", ro = `${dt}-rtl`, lo = `${dt}-horizontal`, io = `${dt}-vertical`, ms = `${dt}-track`, un = `${dt}-handle`, ao = `${dt}-visible`, uo = `${dt}-cornerless`, _n = `${dt}-interaction`, Dn = `${dt}-unusable`, tn = `${dt}-auto-hide`, In = `${tn}-hidden`, Pn = `${dt}-wheel`, fo = `${ms}-interactive`, po = `${un}-interactive`, hs = {}, ys = {}, vo = (t) => {
  W(t, (e) => W(e, (n, s) => {
    hs[s] = e[s];
  }));
}, gs = (t, e, n) => At(t).map((s) => {
  const { static: o, instance: c } = t[s], [r, l, i] = n || [], u = n ? c : o;
  if (u) {
    const a = n ? u(r, l, e) : u(e);
    return (i || ys)[s] = a;
  }
}), ee = (t) => ys[t], bo = "__osOptionsValidationPlugin", mo = "__osSizeObserverPlugin", ho = (t, e) => {
  const { T: n } = e, [s, o] = t("showNativeOverlaidScrollbars");
  return [s && n.x && n.y, o];
}, we = (t) => t.indexOf(Kn) === 0, ws = (t, e) => {
  const { D: n } = t, s = (i) => {
    const u = zt(n, i), d = (e ? e[i] : u) === "scroll";
    return [u, d];
  }, [o, c] = s(Te), [r, l] = s(Ae);
  return {
    k: {
      x: o,
      y: r
    },
    R: {
      x: c,
      y: l
    }
  };
}, yo = (t, e, n, s) => {
  const o = e.x || e.y, c = (a, d) => {
    const b = we(a), C = b && o ? "hidden" : "", A = d && b && a.replace(`${Kn}-`, "") || C;
    return [d && !b ? a : "", we(A) ? "hidden" : A];
  }, [r, l] = c(n.x, e.x), [i, u] = c(n.y, e.y);
  return s[Te] = l && i ? l : r, s[Ae] = u && r ? u : i, ws(t, s);
}, fn = "__osScrollbarsHidingPlugin", go = "__osClickScrollPlugin";
let Ve;
const wo = () => {
  const t = (h, O, P, _) => {
    bt(h, O);
    const z = is(O), F = re(O), M = rn(P);
    return _ && It(O), {
      x: F.h - z.h + M.h,
      y: F.w - z.w + M.w
    };
  }, e = (h) => {
    let O = !1;
    const P = ye(h, Ks);
    try {
      O = zt(h, "scrollbar-width") === "none" || zt(h, "display", "::-webkit-scrollbar") === "none";
    } catch {
    }
    return P(), O;
  }, n = (h, O) => {
    Jt(h, {
      [Te]: qt,
      [Ae]: qt,
      direction: "rtl"
    }), Pt(h, {
      x: 0
    });
    const P = Me(h), _ = Me(O);
    Pt(h, {
      x: -999
    });
    const z = Me(O);
    return {
      i: P.x === _.x,
      n: _.x !== z.x
    };
  }, { body: s } = document, c = ls(`<div class="${fs}"><div></div></div>`)[0], r = c.firstChild, [l, , i] = Ke(), [u, a] = wt({
    o: t(s, c, r),
    u: Qn
  }, R(t, s, c, r, !0)), [d] = a(), b = e(c), C = {
    x: d.x === 0,
    y: d.y === 0
  }, A = {
    elements: {
      host: null,
      padding: !b,
      viewport: (h) => b && h === h.ownerDocument.body && h,
      content: !1
    },
    scrollbars: {
      slot: !0
    },
    cancel: {
      nativeScrollbarsOverlaid: !1,
      body: null
    }
  }, H = G({}, qs), I = R(G, {}, H), k = R(G, {}, A), S = {
    P: d,
    T: C,
    L: b,
    J: !!Be,
    K: n(c, r),
    Z: R(l, "r"),
    G: k,
    tt: (h) => G(A, h) && k(),
    nt: I,
    ot: (h) => G(H, h) && I(),
    st: G({}, A),
    et: G({}, H)
  };
  return Ct(c, "style"), It(c), mt.addEventListener("resize", () => {
    let h;
    if (!b && (!C.x || !C.y)) {
      const O = ee(fn);
      h = !!(O ? O.Y() : St)(S, u);
    }
    i("r", [h]);
  }), S;
}, yt = () => (Ve || (Ve = wo()), Ve), dn = (t, e) => Et(e) ? e.apply(0, t) : e, So = (t, e, n, s) => {
  const o = ae(s) ? n : s;
  return dn(t, o) || e.apply(0, t);
}, Ss = (t, e, n, s) => {
  const o = ae(s) ? n : s, c = dn(t, o);
  return !!c && (ce(c) ? c : e.apply(0, t));
}, xo = (t, e) => {
  const { nativeScrollbarsOverlaid: n, body: s } = e || {}, { T: o, L: c, G: r } = yt(), { nativeScrollbarsOverlaid: l, body: i } = r().cancel, u = n ?? l, a = ae(s) ? i : s, d = (o.x || o.y) && u, b = t && (xe(a) ? !c : a);
  return !!d || !!b;
}, pn = /* @__PURE__ */ new WeakMap(), Oo = (t, e) => {
  pn.set(t, e);
}, Co = (t) => {
  pn.delete(t);
}, xs = (t) => pn.get(t), $o = (t, e, n) => {
  let s = !1;
  const o = n ? /* @__PURE__ */ new WeakMap() : !1, c = () => {
    s = !0;
  }, r = (l) => {
    if (o && n) {
      const i = n.map((u) => {
        const [a, d] = u || [];
        return [d && a ? (l || cs)(a, t) : [], d];
      });
      W(i, (u) => W(u[0], (a) => {
        const d = u[1], b = o.get(a) || [];
        if (t.contains(a) && d) {
          const A = nt(a, d, (H) => {
            s ? (A(), o.delete(a)) : e(H);
          });
          o.set(a, K(b, A));
        } else
          ht(b), o.delete(a);
      }));
    }
  };
  return r(), [c, r];
}, Rn = (t, e, n, s) => {
  let o = !1;
  const { ct: c, rt: r, lt: l, it: i, ut: u, ft: a } = s || {}, d = ts(() => o && n(!0), {
    v: 33,
    p: 99
  }), [b, C] = $o(t, d, l), A = c || [], H = r || [], I = Tt(A, H), k = (h, O) => {
    if (!je(O)) {
      const P = u || St, _ = a || St, z = [], F = [];
      let M = !1, x = !1;
      if (W(O, (y) => {
        const { attributeName: E, target: w, type: $, oldValue: V, addedNodes: X, removedNodes: B } = y, U = $ === "attributes", Y = $ === "childList", Q = t === w, st = U && E, tt = st && He(w, E || "") || null, L = st && V !== tt, J = Ee(H, E) && L;
        if (e && (Y || !Q)) {
          const et = U && L, it = et && i && We(w, i), p = (it ? !P(w, E, V, tt) : !U || et) && !_(y, !!it, t, s);
          W(X, (v) => K(z, v)), W(B, (v) => K(z, v)), x = x || p;
        }
        !e && Q && L && !P(w, E, V, tt) && (K(F, E), M = M || J);
      }), C((y) => hn(z).reduce((E, w) => (K(E, cs(y, w)), We(w, y) ? K(E, w) : E), [])), e)
        return !h && x && n(!1), [!1];
      if (!je(F) || M) {
        const y = [hn(F), M];
        return !h && n.apply(0, y), y;
      }
    }
  }, S = new Ns(R(k, !1));
  return [() => (S.observe(t, {
    attributes: !0,
    attributeOldValue: !0,
    attributeFilter: I,
    subtree: e,
    childList: e,
    characterData: e
  }), o = !0, () => {
    o && (b(), S.disconnect(), o = !1);
  }), () => {
    if (o)
      return d.m(), k(!0, S.takeRecords());
  }];
}, Os = (t, e, n) => {
  const { _t: o, dt: c } = n || {}, r = ee(mo), { K: l } = yt(), i = R(Dt, t), [u] = wt({
    o: !1,
    _: !0
  });
  return () => {
    const a = [], b = ls(`<div class="${an}"><div class="${so}"></div></div>`)[0], C = b.firstChild, A = (H) => {
      const I = H instanceof ResizeObserverEntry, k = !I && xt(H);
      let S = !1, h = !1, O = !0;
      if (I) {
        const [P, , _] = u(H.contentRect), z = qe(P), F = as(P, _);
        h = !_ || F, S = !h && !z, O = !S;
      } else k ? [, O] = H : h = H === !0;
      if (o && O) {
        const P = k ? H[0] : Dt(b);
        Pt(b, {
          x: ge(3333333, 3333333, P && l),
          y: 3333333
        });
      }
      S || e({
        vt: k ? H : void 0,
        ht: !k,
        dt: h
      });
    };
    if (me) {
      const H = new me((I) => A(I.pop()));
      H.observe(C), K(a, () => {
        H.disconnect();
      });
    } else if (r) {
      const [H, I] = r(C, A, c);
      K(a, Tt([ye(b, no), nt(b, "animationstart", H)], I));
    } else
      return St;
    if (o) {
      const [H] = wt({
        o: void 0
      }, i);
      K(a, nt(b, "scroll", (I) => {
        const k = H(), [S, h, O] = k;
        h && (on(C, "ltr rtl"), ye(C, S ? "rtl" : "ltr"), A([!!S, h, O])), ln(I);
      }));
    }
    return R(ht, K(a, bt(t, b)));
  };
}, Eo = (t, e) => {
  let n;
  const s = (i) => i.h === 0 || i.isIntersecting || i.intersectionRatio > 0, o = Gt(oo), [c] = wt({
    o: !1
  }), r = (i, u) => {
    if (i) {
      const a = c(s(i)), [, d] = a;
      return d && !u && e(a) && [a];
    }
  }, l = (i, u) => r(u.pop(), i);
  return [() => {
    const i = [];
    if (mn)
      n = new mn(R(l, !1), {
        root: t
      }), n.observe(o), K(i, () => {
        n.disconnect();
      });
    else {
      const u = () => {
        const a = re(o);
        r(a);
      };
      K(i, Os(o, u)()), u();
    }
    return R(ht, K(i, bt(t, o)));
  }, () => n && l(!0, n.takeRecords())];
}, To = (t, e, n, s) => {
  let o, c, r, l, i, u;
  const { L: a } = yt(), d = `[${vt}]`, b = `[${_t}]`, C = ["tabindex"], A = ["wrap", "cols", "rows"], H = ["id", "class", "style", "open"], { gt: I, bt: k, D: S, wt: h, St: O, V: P, yt: _, Ot: z } = t, F = {
    $t: !1,
    N: Dt(I)
  }, M = yt(), x = ee(fn), [y] = wt({
    u: Jn,
    o: {
      w: 0,
      h: 0
    }
  }, () => {
    const f = x && x.M(t, e, F, M, n).W, p = _(Xt), v = !P && _(to), m = v && Qt(S);
    z(Xt), P && z(Je, !0);
    const g = v && f && f()[0], T = Ze(h), D = Ze(S), N = rn(S);
    return z(Xt, p), P && z(Je), g && g(), Pt(S, m), {
      w: D.w + T.w + N.w,
      h: D.h + T.h + N.h
    };
  }), E = O ? A : Tt(H, A), w = ts(s, {
    v: () => o,
    p: () => c,
    S(f, p) {
      const [v] = f, [m] = p;
      return [Tt(At(v), At(m)).reduce((g, T) => (g[T] = v[T] || m[T], g), {})];
    }
  }), $ = (f) => {
    if (P) {
      const p = Dt(I);
      G(f, {
        Ct: u !== p
      }), G(F, {
        N: p
      }), u = p;
    }
  }, V = (f) => {
    W(f || C, (p) => {
      if (Ee(C, p)) {
        const v = He(k, p);
        Oe(v) ? gt(S, p, v) : Ct(S, p);
      }
    });
  }, X = (f, p) => {
    const [v, m] = f, g = {
      xt: m
    };
    return G(F, {
      $t: v
    }), !p && s(g), g;
  }, B = ({ ht: f, vt: p, dt: v }) => {
    const g = !(f && !v && !p) && a ? w : s, [T, D] = p || [], N = {
      ht: f || v,
      dt: v,
      Ct: D
    };
    $(N), p && G(F, {
      N: T
    }), g(N);
  }, U = (f, p) => {
    const [, v] = y(), m = {
      Ht: v
    };
    return $(m), v && !p && (f ? s : w)(m), m;
  }, Y = (f, p, v) => {
    const m = {
      It: p
    };
    return $(m), p && !v ? w(m) : P || V(f), m;
  }, { Z: Q } = M, [st, tt] = h ? Eo(k, X) : [], L = !P && Os(k, B, {
    dt: !0,
    _t: !0
  }), [J, et] = Rn(k, !1, Y, {
    rt: H,
    ct: Tt(H, C)
  }), it = P && me && new me((f) => {
    const p = f[f.length - 1].contentRect;
    B({
      ht: !0,
      dt: as(p, i)
    }), i = p;
  });
  return [() => {
    V(), it && it.observe(k);
    const f = L && L(), p = st && st(), v = J(), m = Q((g) => {
      const [, T] = y();
      w({
        zt: g,
        Ht: T
      });
    });
    return () => {
      it && it.disconnect(), f && f(), p && p(), l && l(), v(), m();
    };
  }, ({ Et: f, At: p, Tt: v }) => {
    const m = {}, [g] = f("update.ignoreMutation"), [T, D] = f("update.attributes"), [N, Z] = f("update.elementEvents"), [rt, at] = f("update.debounce"), q = Z || D, lt = p || v, Rt = (j) => Et(g) && g(j);
    if (q) {
      r && r(), l && l();
      const [j, ct] = Rn(h || S, !0, U, {
        ct: Tt(E, T || []),
        lt: N,
        it: d,
        ft: (ut, ft) => {
          const { target: ot, attributeName: pt } = ut;
          return (!ft && pt && !P ? Gs(ot, d, b) : !1) || !!jt(ot, `.${dt}`) || !!Rt(ut);
        }
      });
      l = j(), r = ct;
    }
    if (at)
      if (w.m(), xt(rt)) {
        const j = rt[0], ct = rt[1];
        o = $t(j) && j, c = $t(ct) && ct;
      } else $t(rt) ? (o = rt, c = !1) : (o = !1, c = !1);
    if (lt) {
      const j = et(), ct = tt && tt(), ut = r && r();
      j && G(m, Y(j[0], j[1], lt)), ct && G(m, X(ct[0], lt)), ut && G(m, U(ut[0], lt));
    }
    return $(m), m;
  }, F];
}, Ao = (t, e, n, s) => {
  const { G: o, K: c } = yt(), { scrollbars: r } = o(), { slot: l } = r, { gt: i, bt: u, D: a, Dt: d, kt: b, Rt: C, V: A } = e, { scrollbars: H } = d ? {} : t, { slot: I } = H || {}, k = /* @__PURE__ */ new Map(), S = (f) => Be && new Be({
    source: b,
    axis: f
  }), h = S("x"), O = S("y"), P = Ss([i, u, a], () => A && C ? i : u, l, I), _ = (f, p) => {
    if (p) {
      const N = f ? Yt : Zt, { Mt: Z, Vt: rt } = p, at = Wt(rt)[N], q = Wt(Z)[N];
      return Ge(0, 1, at / q || 0);
    }
    const v = f ? "x" : "y", { Lt: m, Pt: g } = n, T = g[v], D = m[v];
    return Ge(0, 1, T / (T + D) || 0);
  }, z = (f, p, v, m) => {
    const g = _(v, f);
    return 1 / g * (1 - g) * (m ? 1 - p : p) || 0;
  }, F = (f, p) => G(f, p ? {
    clear: ["left"]
  } : {}), M = (f) => {
    k.forEach((p, v) => {
      (f ? Ee(Bn(f), v) : !0) && (W(p || [], (g) => {
        g && g.cancel();
      }), k.delete(v));
    });
  }, x = (f, p, v, m) => {
    const g = k.get(f) || [], T = g.find((D) => D && D.timeline === p);
    T ? T.effect = new KeyframeEffect(f, v, {
      composite: m
    }) : k.set(f, Tt(g, [f.animate(v, {
      timeline: p,
      composite: m
    })]));
  }, y = (f, p, v) => {
    const m = v ? ye : on;
    W(f, (g) => {
      m(g.Ut, p);
    });
  }, E = (f, p) => {
    W(f, (v) => {
      const [m, g] = p(v);
      Jt(m, g);
    });
  }, w = (f, p) => {
    E(f, (v) => {
      const { Vt: m } = v;
      return [m, {
        [p ? Yt : Zt]: Sn(_(p))
      }];
    });
  }, $ = (f, p) => {
    const { Lt: v } = n, m = p ? v.x : v.y, g = (T, D, N) => Re(Sn(z(T, En(D, m, N), p, N)), p);
    if (h && O)
      W(f, (T) => {
        const { Ut: D, Vt: N } = T, Z = p && Dt(D) && c;
        x(N, p ? h : O, F({
          transform: $n(m, Z).map((rt) => g(T, rt, Z))
        }, Z));
      });
    else {
      const T = Qt(b);
      E(f, (D) => {
        const { Vt: N, Ut: Z } = D;
        return [N, {
          transform: g(D, p ? T.x : T.y, p && Dt(Z) && c)
        }];
      });
    }
  }, V = (f) => A && !C && Kt(f) === a, X = [], B = [], U = [], Y = (f, p, v) => {
    const m = Un(v), g = m ? v : !0, T = m ? !v : !0;
    g && y(B, f, p), T && y(U, f, p);
  }, Q = () => {
    w(B, !0), w(U);
  }, st = () => {
    $(B, !0), $(U);
  }, tt = () => {
    if (A) {
      const { Lt: f } = n, p = 0.5;
      if (h && O)
        W(Tt(U, B), ({ Ut: v }) => {
          if (V(v)) {
            const m = (g, T, D) => {
              const N = D && Dt(v) && c;
              x(v, g, F({
                transform: $n(T - p, N).map((Z) => Re(Ye(Z), D))
              }, N), "add");
            };
            m(h, f.x, !0), m(O, f.y);
          } else
            M(v);
        });
      else {
        const v = Qt(b), m = (g) => {
          const { Ut: T } = g, D = V(T) && T, N = (Z, rt, at) => {
            const q = En(Z, rt, at), lt = rt * q;
            return Ye(at ? -lt : lt);
          };
          return [D, {
            transform: D ? Re({
              x: N(v.x, f.x, Dt(T) && c),
              y: N(v.y, f.y)
            }) : ""
          }];
        };
        E(B, m), E(U, m);
      }
    }
  }, L = (f) => {
    const v = Gt(`${dt} ${f ? lo : io}`), m = Gt(ms), g = Gt(un), T = {
      Ut: v,
      Mt: m,
      Vt: g
    };
    return K(f ? B : U, T), K(X, [bt(v, m), bt(m, g), R(It, v), M, s(T, Y, $, f)]), T;
  }, J = R(L, !0), et = R(L, !1), it = () => (bt(P, B[0].Ut), bt(P, U[0].Ut), R(ht, X));
  return J(), et(), [{
    Bt: Q,
    Nt: st,
    jt: tt,
    Ft: Y,
    qt: {
      J: h,
      Wt: B,
      Xt: J,
      Yt: R(E, B)
    },
    Jt: {
      J: O,
      Wt: U,
      Xt: et,
      Yt: R(E, U)
    }
  }, it];
}, Ho = (t, e, n) => {
  const { bt: s, kt: o, Kt: c } = e;
  return (r, l, i, u) => {
    const { Ut: a, Mt: d, Vt: b } = r, [C, A] = Lt(333), [H, I] = Lt(), k = R(i, [r], u), S = !!o.scrollBy, h = `client${u ? "X" : "Y"}`, O = u ? Yt : Zt, P = u ? "left" : "top", _ = u ? "w" : "h", z = u ? "x" : "y", F = (y) => y.propertyName.indexOf(O) > -1, M = () => {
      const y = "pointerup pointerleave pointercancel lostpointercapture", E = (w, $) => (V) => {
        const { Lt: X } = n, B = re(d)[_] - re(b)[_], Y = $ * V / B * X[z];
        Pt(o, {
          [z]: w + Y
        });
      };
      return nt(d, "pointerdown", (w) => {
        const $ = jt(w.target, `.${un}`) === b, V = $ ? b : d, X = t.scrollbars, { button: B, isPrimary: U, pointerType: Y } = w, { pointers: Q } = X;
        if (B === 0 && U && X[$ ? "dragScroll" : "clickScroll"] && (Q || []).includes(Y)) {
          const tt = !$ && w.shiftKey, L = R(Wt, b), J = R(Wt, d), et = (q, lt) => (q || L())[P] - (lt || J())[P], it = ze(Wt(o)[O]) / re(o)[_] || 1, f = E(Qt(o)[z] || 0, 1 / it), p = w[h], v = L(), m = J(), g = v[O], T = et(v, m) + g / 2, D = p - m[P], N = $ ? 0 : D - T, Z = (q) => {
            ht(at), V.releasePointerCapture(q.pointerId);
          }, at = [ie(s, vt, Js), nt(c, y, Z), nt(c, "selectstart", (q) => Cn(q), {
            H: !1
          }), nt(d, y, Z), nt(d, "pointermove", (q) => {
            const lt = q[h] - p;
            ($ || tt) && f(N + lt);
          })];
          if (V.setPointerCapture(w.pointerId), tt)
            f(N);
          else if (!$) {
            const q = ee(go);
            q && K(at, q(f, et, N, g, D));
          }
        }
      });
    };
    let x = !0;
    return R(ht, [nt(a, "pointerenter", () => {
      l(_n, !0);
    }), nt(a, "pointerleave pointercancel", () => {
      l(_n, !1);
    }), nt(a, "wheel", (y) => {
      const { deltaX: E, deltaY: w, deltaMode: $ } = y;
      S && x && $ === 0 && Kt(a) === s && o.scrollBy({
        left: E,
        top: w,
        behavior: "smooth"
      }), x = !1, l(Pn, !0), C(() => {
        x = !0, l(Pn);
      }), Cn(y);
    }, {
      H: !1,
      I: !0
    }), nt(b, "transitionstart", (y) => {
      if (F(y)) {
        const E = () => {
          k(), H(E);
        };
        E();
      }
    }), nt(b, "transitionend transitioncancel", (y) => {
      F(y) && (I(), k());
    }), nt(a, "mousedown", R(nt, c, "click", ln, {
      A: !0,
      I: !0
    }), {
      I: !0
    }), M(), A, I]);
  };
}, ko = (t, e, n, s, o, c) => {
  let r, l, i, u, a, d = St, b = 0;
  const [C, A] = Lt(), [H, I] = Lt(), [k, S] = Lt(100), [h, O] = Lt(100), [P, _] = Lt(100), [z, F] = Lt(() => b), [M, x] = Ao(t, o, s, Ho(e, o, s)), { bt: y, Zt: E, Rt: w } = o, { Ft: $, Bt: V, Nt: X, jt: B } = M, U = (L) => {
    $(tn, L, !0), $(tn, L, !1);
  }, Y = (L, J) => {
    if (F(), L)
      $(In);
    else {
      const et = R($, In, !0);
      b > 0 && !J ? z(et) : et();
    }
  }, Q = (L) => L.pointerType === "mouse", st = (L) => {
    Q(L) && (u = l, u && Y(!0));
  }, tt = [S, F, O, _, I, A, () => d(), nt(y, "pointerover", st, {
    A: !0
  }), nt(y, "pointerenter", st), nt(y, "pointerleave", (L) => {
    Q(L) && (u = !1, l && Y(!1));
  }), nt(y, "pointermove", (L) => {
    Q(L) && r && C(() => {
      S(), Y(!0), h(() => {
        r && Y(!1);
      });
    });
  }), nt(E, "scroll", (L) => {
    H(() => {
      X(), i && Y(!0), k(() => {
        i && !u && Y(!1);
      });
    }), c(L), B();
  })];
  return [() => R(ht, K(tt, x())), ({ Et: L, Tt: J, Gt: et, Qt: it }) => {
    const { tn: f, nn: p, sn: v } = it || {}, { Ct: m, dt: g } = et || {}, { N: T } = n, { T: D } = yt(), { k: N, en: Z } = s, [rt, at] = L("showNativeOverlaidScrollbars"), [q, lt] = L("scrollbars.theme"), [Rt, j] = L("scrollbars.visibility"), [ct, ut] = L("scrollbars.autoHide"), [ft, ot] = L("scrollbars.autoHideSuspend"), [pt] = L("scrollbars.autoHideDelay"), [Mt, Ut] = L("scrollbars.dragScroll"), [Ot, Nt] = L("scrollbars.clickScroll"), [Ht, _e] = L("overflow"), kt = g && !J, De = Z.x || Z.y, ne = f || p || m || J, fe = v || j || _e, de = rt && D.x && D.y, se = (oe, Bt, vn) => {
      const bn = oe.includes("scroll") && (Rt === "visible" || Rt === "auto" && Bt === "scroll");
      return $(ao, bn, vn), bn;
    };
    if (b = pt, kt && (ft && De ? (U(!1), d(), P(() => {
      d = nt(E, "scroll", R(U, !0), {
        A: !0
      });
    })) : U(!0)), at && $(co, de), lt && ($(a), $(q, !0), a = q), ot && !ft && U(!0), ut && (r = ct === "move", l = ct === "leave", i = ct !== "never", Y(!i, !0)), Ut && $(po, Mt), Nt && $(fo, Ot), fe) {
      const oe = se(Ht.x, N.x, !0), Bt = se(Ht.y, N.y, !1);
      $(uo, !(oe && Bt));
    }
    ne && (V(), X(), B(), $(Dn, !Z.x, !0), $(Dn, !Z.y, !1), $(ro, T && !w));
  }, {}, M];
}, Lo = (t) => {
  const e = yt(), { G: n, L: s } = e, { elements: o } = n(), { host: c, padding: r, viewport: l, content: i } = o, u = ce(t), a = u ? {} : t, { elements: d } = a, { host: b, padding: C, viewport: A, content: H } = d || {}, I = u ? t : a.target, k = We(I, "textarea"), S = I.ownerDocument, h = S.documentElement, O = I === S.body, P = S.defaultView, _ = () => S.activeElement, z = (j) => {
    j && j.focus && j.focus();
  }, F = R(So, [I]), M = R(Ss, [I]), x = R(dn, [I]), y = R(Gt, ""), E = R(F, y, l), w = R(M, y, i), $ = E(A), V = $ === I, X = V && O, B = !V && w(H), U = !V && ce($) && $ === B, Y = U && !!x(i), Q = Y ? E() : $, st = Y ? B : w(), L = X ? h : U ? Q : $, J = k ? F(y, c, b) : I, et = X ? L : J, it = U ? st : B, f = {
    gt: I,
    bt: et,
    D: L,
    cn: !V && M(y, r, C),
    wt: it,
    kt: X ? h : L,
    Zt: X ? S : L,
    rn: O ? h : I,
    ln: P,
    Kt: S,
    St: k,
    Rt: O,
    Dt: u,
    V,
    an: U,
    yt: (j) => Bs(L, V ? vt : _t, j),
    Ot: (j, ct) => be(L, V ? vt : _t, j, ct)
  }, p = At(f).reduce((j, ct) => {
    const ut = f[ct];
    return K(j, ut && ce(ut) && !Kt(ut) ? ut : !1);
  }, []), v = (j) => j ? Ee(p, j) : null, { gt: m, bt: g, cn: T, D, wt: N } = f, Z = [() => {
    Ct(g, [vt, Ne]), Ct(m, Ne), O && Ct(h, [Ne, vt]);
  }], rt = k && v(g);
  let at = k ? m : Xe([N, D, T, g, m].find((j) => v(j) === !1));
  const q = X ? m : N || D, lt = R(ht, Z);
  return [f, () => {
    const j = _(), ct = (ot) => {
      bt(Kt(ot), Xe(ot)), It(ot);
    }, ut = (ot) => ot ? nt(ot, "focusin focusout focus blur", (pt) => {
      ln(pt), pt.stopImmediatePropagation();
    }, {
      I: !0,
      H: !1
    }) : St, ft = ut(j);
    if (gt(g, vt, V ? "viewport" : "host"), gt(T, Qe, ""), gt(N, Ln, ""), V || (gt(D, _t, ""), O && ie(h, vt, Qs)), rt && (gn(m, g), K(Z, () => {
      gn(g, m), It(g);
    })), bt(q, at), bt(g, T), bt(T || g, !V && D), bt(D, N), K(Z, [ft, () => {
      const ot = _(), pt = ut(ot);
      Ct(T, Qe), Ct(N, Ln), Ct(D, [ds, ps, _t]), v(N) && ct(N), v(D) && ct(D), v(T) && ct(T), z(ot), pt();
    }]), s && !V && (ie(D, _t, bs), K(Z, R(Ct, D, _t))), !V && P.top === P && j === I) {
      const ot = "tabindex", pt = He(D, ot);
      gt(D, ot, "-1"), z(D);
      const Mt = () => pt ? gt(D, ot, pt) : Ct(D, ot), Ut = nt(S, "pointerdown keydown", () => {
        Mt(), Ut();
      });
      K(Z, [Mt, Ut]);
    } else
      z(j);
    return ft(), at = 0, lt;
  }, lt];
}, _o = ({ wt: t }) => ({ Gt: e, un: n, Tt: s }) => {
  const { xt: o } = e || {}, { $t: c } = n;
  t && (o || s) && Jt(t, {
    [Zt]: c && "100%"
  });
}, Do = ({ bt: t, cn: e, D: n, V: s }, o) => {
  const [c, r] = wt({
    u: Us,
    o: xn()
  }, R(xn, t, "padding", ""));
  return ({ Et: l, Gt: i, un: u, Tt: a }) => {
    let [d, b] = r(a);
    const { L: C } = yt(), { ht: A, Ht: H, Ct: I } = i || {}, { N: k } = u, [S, h] = l("paddingAbsolute");
    (A || b || (a || H)) && ([d, b] = c(a));
    const P = !s && (h || I || b);
    if (P) {
      const _ = !S || !e && !C, z = d.r + d.l, F = d.t + d.b, M = {
        [Zn]: _ && !k ? -z : 0,
        [qn]: _ ? -F : 0,
        [Yn]: _ && k ? -z : 0,
        top: _ ? -d.t : 0,
        right: _ ? k ? -d.r : "auto" : 0,
        left: _ ? k ? "auto" : -d.l : 0,
        [Yt]: _ && `calc(100% + ${z}px)`
      }, x = {
        [jn]: _ ? d.t : 0,
        [Gn]: _ ? d.r : 0,
        [Xn]: _ ? d.b : 0,
        [Wn]: _ ? d.l : 0
      };
      Jt(e || n, M), Jt(n, x), G(o, {
        cn: d,
        fn: !_,
        j: e ? x : G({}, M, x)
      });
    }
    return {
      _n: P
    };
  };
}, Io = (t, e) => {
  const n = yt(), { bt: s, cn: o, D: c, V: r, Ot: l, Rt: i, ln: u } = t, { L: a } = n, d = i && r, b = R(ve, 0), C = {
    u: Jn,
    o: {
      w: 0,
      h: 0
    }
  }, A = {
    u: Qn,
    o: {
      x: qt,
      y: qt
    }
  }, H = (x, y) => {
    const E = mt.devicePixelRatio % 1 !== 0 ? 1 : 0, w = {
      w: b(x.w - y.w),
      h: b(x.h - y.h)
    };
    return {
      w: w.w > E ? w.w : 0,
      h: w.h > E ? w.h : 0
    };
  }, [I, k] = wt(C, R(rn, c)), [S, h] = wt(C, R(Ze, c)), [O, P] = wt(C), [_, z] = wt(C), [F] = wt(A), M = ee(fn);
  return ({ Et: x, Gt: y, un: E, Tt: w }, { _n: $ }) => {
    const { ht: V, Ht: X, Ct: B, zt: U } = y || {}, Y = M && M.M(t, e, E, n, x), { q: Q, W: st, X: tt } = Y || {}, [L, J] = ho(x, n), [et, it] = x("overflow"), f = V || $ || X || B || U || J, p = we(et.x), v = we(et.y), m = p || v;
    let g = k(w), T = h(w), D = P(w), N = z(w), Z;
    if (J && a && l(bs, !L), f) {
      m && l(Xt, !1);
      const [Ot, Nt] = st ? st(Z) : [], [Ht, _e] = g = I(w), [kt, De] = T = S(w), ne = is(c), fe = kt, de = ne;
      Ot && Ot(), (De || _e || J) && Nt && !L && Q && Q(Nt, kt, Ht);
      const se = Ys(u), oe = {
        w: b(ve(kt.w, fe.w) + Ht.w),
        h: b(ve(kt.h, fe.h) + Ht.h)
      }, Bt = {
        w: b((d ? se.w : de.w + b(ne.w - kt.w)) + Ht.w),
        h: b((d ? se.h : de.h + b(ne.h - kt.h)) + Ht.h)
      };
      N = _(Bt), D = O(H(oe, Bt), w);
    }
    const [rt, at] = N, [q, lt] = D, [Rt, j] = T, [ct, ut] = g, ft = {
      x: q.w > 0,
      y: q.h > 0
    }, ot = p && v && (ft.x || ft.y) || p && ft.x && !ft.y || v && ft.y && !ft.x;
    if ($ || B || U || ut || j || at || lt || it || J || f) {
      const Ot = {}, Nt = yo(t, ft, et, Ot);
      tt && tt(Nt, E, !!Q && Q(Nt, Rt, ct), Ot), r ? (gt(s, ds, Ot[Te]), gt(s, ps, Ot[Ae])) : Jt(c, Ot);
    }
    be(s, vt, vs, ot), be(o, Qe, eo, ot), r || be(c, _t, Xt, m);
    const [Mt, Ut] = F(ws(t).k);
    return G(e, {
      k: Mt,
      Pt: {
        x: rt.w,
        y: rt.h
      },
      Lt: {
        x: q.w,
        y: q.h
      },
      en: ft
    }), {
      sn: Ut,
      tn: at,
      nn: lt
    };
  };
}, Po = (t) => {
  const [e, n, s] = Lo(t), o = {
    cn: {
      t: 0,
      r: 0,
      b: 0,
      l: 0
    },
    fn: !1,
    j: {
      [Zn]: 0,
      [qn]: 0,
      [Yn]: 0,
      [jn]: 0,
      [Gn]: 0,
      [Xn]: 0,
      [Wn]: 0
    },
    Pt: {
      x: 0,
      y: 0
    },
    Lt: {
      x: 0,
      y: 0
    },
    k: {
      x: qt,
      y: qt
    },
    en: {
      x: !1,
      y: !1
    }
  }, { gt: c, D: r, V: l } = e, { L: i, T: u } = yt(), a = !i && (u.x || u.y), d = [_o(e), Do(e, o), Io(e, o)];
  return [n, (b) => {
    const C = {}, H = a && Qt(r), I = l ? ie(r, vt, Je) : St;
    return W(d, (k) => {
      G(C, k(b, C) || {});
    }), I(), Pt(r, H), !l && Pt(c, 0), C;
  }, o, e, s];
}, Ro = (t, e, n, s) => {
  const o = kn(e, {}), [c, r, l, i, u] = Po(t), [a, d, b] = To(i, l, o, (S) => {
    k({}, S);
  }), [C, A, , H] = ko(t, e, b, l, i, s), I = (S) => At(S).some((h) => !!S[h]), k = (S, h) => {
    const { dn: O, Tt: P, At: _, vn: z } = S, F = O || {}, M = !!P, x = {
      Et: kn(e, F, M),
      dn: F,
      Tt: M
    };
    if (z)
      return A(x), !1;
    const y = h || d(G({}, x, {
      At: _
    })), E = r(G({}, x, {
      un: b,
      Gt: y
    }));
    A(G({}, x, {
      Gt: y,
      Qt: E
    }));
    const w = I(y), $ = I(E), V = w || $ || !sn(F) || M;
    return V && n(S, {
      Gt: y,
      Qt: E
    }), V;
  };
  return [() => {
    const { rn: S, D: h } = i, O = Qt(S), P = [a(), c(), C()];
    return Pt(h, O), R(ht, P);
  }, k, () => ({
    hn: b,
    pn: l
  }), {
    gn: i,
    bn: H
  }, u];
}, te = (t, e, n) => {
  const { nt: s } = yt(), o = ce(t), c = o ? t : t.target, r = xs(c);
  if (e && !r) {
    let l = !1;
    const i = [], u = {}, a = (x) => {
      const y = ns(x), E = ee(bo);
      return E ? E(y, !0) : y;
    }, d = G({}, s(), a(e)), [b, C, A] = Ke(), [H, I, k] = Ke(n), S = (x, y) => {
      k(x, y), A(x, y);
    }, [h, O, P, _, z] = Ro(t, d, ({ dn: x, Tt: y }, { Gt: E, Qt: w }) => {
      const { ht: $, Ct: V, xt: X, Ht: B, It: U, dt: Y } = E, { tn: Q, nn: st, sn: tt } = w;
      S("updated", [M, {
        updateHints: {
          sizeChanged: !!$,
          directionChanged: !!V,
          heightIntrinsicChanged: !!X,
          overflowEdgeChanged: !!Q,
          overflowAmountChanged: !!st,
          overflowStyleChanged: !!tt,
          contentMutation: !!B,
          hostMutation: !!U,
          appear: !!Y
        },
        changedOptions: x || {},
        force: !!y
      }]);
    }, (x) => S("scroll", [M, x])), F = (x) => {
      Co(c), ht(i), l = !0, S("destroyed", [M, x]), C(), I();
    }, M = {
      options(x, y) {
        if (x) {
          const E = y ? s() : {}, w = us(d, G(E, a(x)));
          sn(w) || (G(d, w), O({
            dn: w
          }));
        }
        return G({}, d);
      },
      on: H,
      off: (x, y) => {
        x && y && I(x, y);
      },
      state() {
        const { hn: x, pn: y } = P(), { N: E } = x, { Pt: w, Lt: $, k: V, en: X, cn: B, fn: U } = y;
        return G({}, {
          overflowEdge: w,
          overflowAmount: $,
          overflowStyle: V,
          hasOverflow: X,
          padding: B,
          paddingAbsolute: U,
          directionRTL: E,
          destroyed: l
        });
      },
      elements() {
        const { gt: x, bt: y, cn: E, D: w, wt: $, kt: V, Zt: X } = _.gn, { qt: B, Jt: U } = _.bn, Y = (st) => {
          const { Vt: tt, Mt: L, Ut: J } = st;
          return {
            scrollbar: J,
            track: L,
            handle: tt
          };
        }, Q = (st) => {
          const { Wt: tt, Xt: L } = st, J = Y(tt[0]);
          return G({}, J, {
            clone: () => {
              const et = Y(L());
              return O({
                vn: !0
              }), et;
            }
          });
        };
        return G({}, {
          target: x,
          host: y,
          padding: E || w,
          viewport: w,
          content: $ || w,
          scrollOffsetElement: V,
          scrollEventElement: X,
          scrollbarHorizontal: Q(B),
          scrollbarVertical: Q(U)
        });
      },
      update: (x) => O({
        Tt: x,
        At: !0
      }),
      destroy: R(F, !1),
      plugin: (x) => u[At(x)[0]]
    };
    return K(i, [z]), Oo(c, M), gs(hs, te, [M, b, u]), xo(_.gn.Rt, !o && t.cancel) ? (F(!0), M) : (K(i, h()), S("initialized", [M]), M.update(!0), M);
  }
  return r;
};
te.plugin = (t) => {
  const e = xt(t), n = e ? t : [t], s = n.map((o) => gs(o, te)[0]);
  return vo(n), e ? s : s[0];
};
te.valid = (t) => {
  const e = t && t.elements, n = Et(e) && e();
  return he(n) && !!xs(n.target);
};
te.env = () => {
  const { P: t, T: e, L: n, K: s, J: o, st: c, et: r, G: l, tt: i, nt: u, ot: a } = yt();
  return G({}, {
    scrollbarsSize: t,
    scrollbarsOverlaid: e,
    scrollbarsHiding: n,
    rtlScrollBehavior: s,
    scrollTimeline: o,
    staticDefaultInitialization: c,
    staticDefaultOptions: r,
    getDefaultInitialization: l,
    setDefaultInitialization: i,
    getDefaultOptions: u,
    setDefaultOptions: a
  });
};
const Mo = async (t, e) => {
  let n = t;
  return e.target && (typeof e.target == "string" && (n = e.target), typeof e.target == "function" && (n = await e.target(t))), n;
}, No = (t, e) => {
  let n = !0;
  if (e.visible !== void 0 && (typeof e.visible == "function" ? n = e.visible(t) : n = e.visible), n === !1) return { x: "hidden", y: "hidden" };
  let s = !0, o = !0;
  return e.x !== void 0 && (typeof e.x == "function" ? s = e.x(t) : s = e.x), e.y !== void 0 && (typeof e.y == "function" ? o = e.y(t) : o = e.y), { x: s ? "scroll" : "hidden", y: o ? "scroll" : "hidden" };
}, Ko = {
  mounted: async (t, e, n) => {
    const s = (n ? e.value : e) || {}, o = await Mo(t, s);
    if (!o) return;
    const c = No(o, s), r = "os-theme-dark das-scrollbar", l = s != null && s.className ? `${r} ${s == null ? void 0 : s.className}` : r, i = te(o, {
      scrollbars: {
        autoHide: "leave",
        // 鼠标移开自动隐藏
        autoHideDelay: 0,
        theme: l
      },
      overflow: c
    }, {
      scroll: (u, a) => {
        s && s.scroll && typeof s.scroll == "function" && s.scroll(u, a);
      }
    });
    s && s.scrollReady && s.scrollReady(i);
  }
};
function Vo(t, e) {
  if (!t || !e.value) return;
  let n = null, s = null;
  n = new MutationObserver((c) => {
    var r, l;
    for (let i = 0; i < c.length; i++)
      if (c[i].type === "attributes" && c[i].attributeName === "style" && /zoom|scale/g.test((l = (r = c[i].target) == null ? void 0 : r.style) == null ? void 0 : l.cssText)) {
        s && clearTimeout(s), s = setTimeout(() => {
          var u;
          (u = e.value) == null || u.update();
        }, 200);
        break;
      }
  });
  const o = { attributes: !0 };
  for (let c = 0; c < t.children[0].children.length; c++)
    n && n.observe(t.children[0].children[c], o);
  Nn(() => {
    n && n.disconnect();
  });
}
let Mn = 0;
function zo(t, e) {
  if (!t || !e.value) return;
  let n = null, s = null;
  n = new MutationObserver((c) => {
    for (let r = 0; r < c.length; r++)
      if (c[r].type === "childList") {
        s && clearTimeout(s), s = setTimeout(() => {
          var l;
          (l = e.value) == null || l.update();
        }, 200);
        break;
      } else if (c[r].type === "attributes" && (t == null ? void 0 : t.scrollHeight) !== Mn) {
        Mn = t == null ? void 0 : t.scrollHeight, s && clearTimeout(s), s = setTimeout(() => {
          var l;
          (l = e.value) == null || l.update();
        }, 200);
        break;
      }
  });
  const o = { childList: !0, subtree: !0, attributes: !0 };
  n && n.observe(t, o), Nn(() => {
    n && n.disconnect();
  });
}
const Fo = /* @__PURE__ */ $s({
  __name: "scrollbar",
  props: {
    wrapClass: { default: "" },
    viewClass: { default: "" }
  },
  setup(t) {
    const e = Ie(null);
    function n(r) {
      var l = window.getComputedStyle(r), i = {
        display: l.display,
        "flex-direction": l["flex-direction"],
        "flex-wrap": l["flex-wrap"],
        "flex-flow": l["flex-flow"],
        "justify-content": l["justify-content"],
        "align-items": l["align-items"],
        "align-content": l["align-content"],
        "flex-grow": l["flex-grow"],
        "flex-shrink": l["flex-shrink"],
        "flex-basis": l["flex-basis"],
        flex: l.flex,
        order: l.order
      };
      return i.display === "flex" ? i : {};
    }
    const s = Ie(1), o = Es(() => ({
      "--das-ui-scrollbar-z-index": s.value
    })), c = Ie("");
    return Ts(() => {
      c.value = `das-scrollbar-pro-${parseInt(Math.random() * 1e8)}`, Is(c.value, [
        {
          className: `.${c.value} .das-scrollbar-pro-wrap .inherit-scrollbar-parent-flex`,
          style: n(e.value.wrapRef.parentNode.parentNode)
        }
      ]), s.value = Rs().nextZIndex();
      const r = e.value.wrapRef;
      zo(r, e), Vo(r, e);
    }), (r, l) => (Hs(), As(ks(Ps), Ls({
      ref_key: "scrollbarRef",
      ref: e,
      class: "das-scrollbar-pro " + c.value
    }, r.$attrs, {
      "wrap-class": "das-scrollbar-pro-wrap " + r.wrapClass,
      "view-class": "das-scrollbar-pro-view inherit-scrollbar-parent-flex" + r.viewClass,
      style: o.value
    }), {
      default: _s(() => [
        Ds(r.$slots, "default", {}, void 0, !0)
      ]),
      _: 3
      /* FORWARDED */
    }, 16, ["class", "wrap-class", "view-class", "style"]));
  }
}), Uo = (t, e) => {
  const n = t.__vccOpts || t;
  for (const [s, o] of e)
    n[s] = o;
  return n;
}, Bo = /* @__PURE__ */ Uo(Fo, [["__scopeId", "data-v-34741a5d"]]), Jo = Cs(Bo);
export {
  Jo as DasScrollbar,
  Ko as vScrollbar
};
