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 Ts, onMounted as Es, 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 a = (u, d) => {
    const b = c, C = u, A = d || (s ? !s(b, C) : b !== C);
    return (A || o) && (c = C, r = b), [c, A, r];
  };
  return [e ? (u) => a(e(c, r), u) : a, (u) => [c, !!u, 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", Tt = (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) || !Tt(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 Te = (t, e) => t.indexOf(e) >= 0, Et = (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", Ee = "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], a = e[c];
      r !== a && (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, Tt(t) ? t() : t);
  }, () => s(e)];
}, ts = (t, e) => {
  let n, s, o, c = St;
  const { v: r, p: a, S: l } = e || {}, i = function(A) {
    c(), Ue(n), n = s = void 0, c = St, t.apply(this, A);
  }, u = (C) => l && s ? l(s, C) : C, d = () => {
    c !== St && i(u(o) || o);
  }, b = function() {
    const A = Ft(arguments), H = Tt(r) ? r() : r;
    if ($t(H) && H >= 0) {
      const k = Tt(a) ? a() : a, S = $t(k) && k >= 0, h = H > 0 ? Fe : zn, O = H > 0 ? Ue : Vn, _ = u(A) || A, z = i.bind(0, _);
      c();
      const F = h(z, H);
      c = () => O(F), S && !n && (n = Fe(d, k)), s = o = _;
    } else
      i(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 a = [e, n, s, o, c, r];
  return (typeof t != "object" || xe(t)) && !Tt(t) && (t = {}), W(a, (l) => {
    W(l, (i, u) => {
      const d = l[u];
      if (t === d)
        return !0;
      const b = xt(d);
      if (d && he(d)) {
        const C = t[u];
        let A = C;
        b && !xt(C) ? A = [] : !b && !he(C) && (A = {}), t[u] = G(A, d);
      } else
        t[u] = 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), yt = (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(yt, t, e), o = (c, r) => {
    const a = new Set(n);
    return W(Vt(c), (l) => a[r](l)), Ft(a).join(" ");
  };
  return {
    O: (c) => s(o(c, "delete")),
    $: (c) => s(o(c, "add")),
    C: (c) => {
      const r = Vt(c);
      return r.reduce((a, l) => a && n.includes(l), 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);
}, ge = (t, e) => (os(t).$(e), R(on, t, e)), gn = 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) ? (gn.matches || gn.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), yn = (t, e) => rs(Kt(t), t && t.nextSibling, e), Gt = (t) => {
  const e = document.createElement("div");
  return yt(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, a) => (r[a] = wn(c, a), 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}`, a = `${s}bottom${o}`, l = `${s}left${o}`, i = zt(t, [c, r, a, l]);
  return {
    t: pe(i[c]),
    r: pe(i[r]),
    b: pe(i[a]),
    l: pe(i[l])
  };
}, 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, a = s && s.A || !1, l = {
    passive: c,
    capture: r
  };
  return R(ht, Vt(e).map((i) => {
    const u = a ? (d) => {
      On(t, i, u, r), n(d);
    } : n;
    return t.addEventListener(i, u, l), R(On, t, i, u, 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;
}, ye = (t, e, n) => n ? n.n ? -t + 0 : n.i ? e - t : t : t, $n = (t, e) => [ye(0, t, e), ye(t, t, e)], Tn = (t, e, n) => Ge(0, 1, ye(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
}), En = (t, e) => {
  W(Bn(e), t);
}, Ke = (t) => {
  const e = /* @__PURE__ */ new Map(), n = (c, r) => {
    if (c) {
      const a = e.get(c);
      En((l) => {
        a && a[l ? "delete" : "clear"](l);
      }, r);
    } else
      e.forEach((a) => {
        a.clear();
      }), e.clear();
  }, s = (c, r) => {
    if (Oe(c)) {
      const i = e.get(c) || /* @__PURE__ */ new Set();
      return e.set(c, i), En((u) => {
        Tt(u) && i.add(u);
      }, r), R(n, c, r);
    }
    Un(r) && r && n();
    const a = At(c), l = [];
    return W(a, (i) => {
      const u = c[i];
      u && K(l, s(i, u));
    }), R(ht, l);
  }, o = (c, r) => {
    W(Ft(e.get(c)), (a) => {
      r && !je(r) ? a.apply(0, r) : a();
    });
  };
  return s(t || {}), [s, n, o];
}, An = (t) => JSON.stringify(t, (e, n) => {
  if (Tt(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 = Et(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 a = !0;
      if (xt(c) || xt(r))
        try {
          An(c) === An(r) && (a = !1);
        } catch {
        }
      a && (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 = {}, gs = {}, vo = (t) => {
  W(t, (e) => W(e, (n, s) => {
    hs[s] = e[s];
  }));
}, ys = (t, e, n) => At(t).map((s) => {
  const { static: o, instance: c } = t[s], [r, a, l] = n || [], i = n ? c : o;
  if (i) {
    const u = n ? i(r, a, e) : i(e);
    return (l || gs)[s] = u;
  }
}), ee = (t) => gs[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 = (l) => {
    const i = zt(n, l), d = (e ? e[l] : i) === "scroll";
    return [i, d];
  }, [o, c] = s(Ee), [r, a] = s(Ae);
  return {
    k: {
      x: o,
      y: r
    },
    R: {
      x: c,
      y: a
    }
  };
}, go = (t, e, n, s) => {
  const o = e.x || e.y, c = (u, d) => {
    const b = we(u), C = b && o ? "hidden" : "", A = d && b && u.replace(`${Kn}-`, "") || C;
    return [d && !b ? u : "", we(A) ? "hidden" : A];
  }, [r, a] = c(n.x, e.x), [l, i] = c(n.y, e.y);
  return s[Ee] = a && l ? a : r, s[Ae] = i && r ? i : l, ws(t, s);
}, fn = "__osScrollbarsHidingPlugin", yo = "__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 = ge(h, Ks);
    try {
      O = zt(h, "scrollbar-width") === "none" || zt(h, "display", "::-webkit-scrollbar") === "none";
    } catch {
    }
    return P(), O;
  }, n = (h, O) => {
    Jt(h, {
      [Ee]: 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, [a, , l] = Ke(), [i, u] = wt({
    o: t(s, c, r),
    u: Qn
  }, R(t, s, c, r, !0)), [d] = u(), 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(a, "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, i);
    }
    l("r", [h]);
  }), S;
}, gt = () => (Ve || (Ve = wo()), Ve), dn = (t, e) => Tt(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 } = gt(), { nativeScrollbarsOverlaid: a, body: l } = r().cancel, i = n ?? a, u = ae(s) ? l : s, d = (o.x || o.y) && i, b = t && (xe(u) ? !c : u);
  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 = (a) => {
    if (o && n) {
      const l = n.map((i) => {
        const [u, d] = i || [];
        return [d && u ? (a || cs)(u, t) : [], d];
      });
      W(l, (i) => W(i[0], (u) => {
        const d = i[1], b = o.get(u) || [];
        if (t.contains(u) && d) {
          const A = nt(u, d, (H) => {
            s ? (A(), o.delete(u)) : e(H);
          });
          o.set(u, K(b, A));
        } else
          ht(b), o.delete(u);
      }));
    }
  };
  return r(), [c, r];
}, Rn = (t, e, n, s) => {
  let o = !1;
  const { ct: c, rt: r, lt: a, it: l, ut: i, ft: u } = s || {}, d = ts(() => o && n(!0), {
    v: 33,
    p: 99
  }), [b, C] = $o(t, d, a), A = c || [], H = r || [], I = Et(A, H), k = (h, O) => {
    if (!je(O)) {
      const P = i || St, _ = u || St, z = [], F = [];
      let M = !1, x = !1;
      if (W(O, (g) => {
        const { attributeName: T, target: w, type: $, oldValue: V, addedNodes: X, removedNodes: B } = g, U = $ === "attributes", Y = $ === "childList", Q = t === w, st = U && T, tt = st && He(w, T || "") || null, L = st && V !== tt, J = Te(H, T) && L;
        if (e && (Y || !Q)) {
          const et = U && L, it = et && l && We(w, l), p = (it ? !P(w, T, V, tt) : !U || et) && !_(g, !!it, t, s);
          W(X, (v) => K(z, v)), W(B, (v) => K(z, v)), x = x || p;
        }
        !e && Q && L && !P(w, T, V, tt) && (K(F, T), M = M || J);
      }), C((g) => hn(z).reduce((T, w) => (K(T, cs(g, w)), We(w, g) ? K(T, w) : T), [])), e)
        return !h && x && n(!1), [!1];
      if (!je(F) || M) {
        const g = [hn(F), M];
        return !h && n.apply(0, g), g;
      }
    }
  }, 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: a } = gt(), l = R(Dt, t), [i] = wt({
    o: !1,
    _: !0
  });
  return () => {
    const u = [], 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, , _] = i(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: ye(3333333, 3333333, P && a),
          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(u, () => {
        H.disconnect();
      });
    } else if (r) {
      const [H, I] = r(C, A, c);
      K(u, Et([ge(b, no), nt(b, "animationstart", H)], I));
    } else
      return St;
    if (o) {
      const [H] = wt({
        o: void 0
      }, l);
      K(u, nt(b, "scroll", (I) => {
        const k = H(), [S, h, O] = k;
        h && (on(C, "ltr rtl"), ge(C, S ? "rtl" : "ltr"), A([!!S, h, O])), ln(I);
      }));
    }
    return R(ht, K(u, bt(t, b)));
  };
}, To = (t, e) => {
  let n;
  const s = (l) => l.h === 0 || l.isIntersecting || l.intersectionRatio > 0, o = Gt(oo), [c] = wt({
    o: !1
  }), r = (l, i) => {
    if (l) {
      const u = c(s(l)), [, d] = u;
      return d && !i && e(u) && [u];
    }
  }, a = (l, i) => r(i.pop(), l);
  return [() => {
    const l = [];
    if (mn)
      n = new mn(R(a, !1), {
        root: t
      }), n.observe(o), K(l, () => {
        n.disconnect();
      });
    else {
      const i = () => {
        const u = re(o);
        r(u);
      };
      K(l, Os(o, i)()), i();
    }
    return R(ht, K(l, bt(t, o)));
  }, () => n && a(!0, n.takeRecords())];
}, Eo = (t, e, n, s) => {
  let o, c, r, a, l, i;
  const { L: u } = gt(), 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 = gt(), x = ee(fn), [g] = 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 y = v && f && f()[0], E = Ze(h), D = Ze(S), N = rn(S);
    return z(Xt, p), P && z(Je), y && y(), Pt(S, m), {
      w: D.w + E.w + N.w,
      h: D.h + E.h + N.h
    };
  }), T = O ? A : Et(H, A), w = ts(s, {
    v: () => o,
    p: () => c,
    S(f, p) {
      const [v] = f, [m] = p;
      return [Et(At(v), At(m)).reduce((y, E) => (y[E] = v[E] || m[E], y), {})];
    }
  }), $ = (f) => {
    if (P) {
      const p = Dt(I);
      G(f, {
        Ct: i !== p
      }), G(F, {
        N: p
      }), i = p;
    }
  }, V = (f) => {
    W(f || C, (p) => {
      if (Te(C, p)) {
        const v = He(k, p);
        Oe(v) ? yt(S, p, v) : Ct(S, p);
      }
    });
  }, X = (f, p) => {
    const [v, m] = f, y = {
      xt: m
    };
    return G(F, {
      $t: v
    }), !p && s(y), y;
  }, B = ({ ht: f, vt: p, dt: v }) => {
    const y = !(f && !v && !p) && u ? w : s, [E, D] = p || [], N = {
      ht: f || v,
      dt: v,
      Ct: D
    };
    $(N), p && G(F, {
      N: E
    }), y(N);
  }, U = (f, p) => {
    const [, v] = g(), 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 ? To(k, X) : [], L = !P && Os(k, B, {
    dt: !0,
    _t: !0
  }), [J, et] = Rn(k, !1, Y, {
    rt: H,
    ct: Et(H, C)
  }), it = P && me && new me((f) => {
    const p = f[f.length - 1].contentRect;
    B({
      ht: !0,
      dt: as(p, l)
    }), l = p;
  });
  return [() => {
    V(), it && it.observe(k);
    const f = L && L(), p = st && st(), v = J(), m = Q((y) => {
      const [, E] = g();
      w({
        zt: y,
        Ht: E
      });
    });
    return () => {
      it && it.disconnect(), f && f(), p && p(), a && a(), v(), m();
    };
  }, ({ Et: f, At: p, Tt: v }) => {
    const m = {}, [y] = f("update.ignoreMutation"), [E, D] = f("update.attributes"), [N, Z] = f("update.elementEvents"), [rt, at] = f("update.debounce"), q = Z || D, lt = p || v, Rt = (j) => Tt(y) && y(j);
    if (q) {
      r && r(), a && a();
      const [j, ct] = Rn(h || S, !0, U, {
        ct: Et(T, E || []),
        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);
        }
      });
      a = 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 } = gt(), { scrollbars: r } = o(), { slot: a } = r, { gt: l, bt: i, D: u, 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([l, i, u], () => A && C ? l : i, a, 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: y } = n, E = y[v], D = m[v];
    return Ge(0, 1, E / (E + D) || 0);
  }, z = (f, p, v, m) => {
    const y = _(v, f);
    return 1 / y * (1 - y) * (m ? 1 - p : p) || 0;
  }, F = (f, p) => G(f, p ? {
    clear: ["left"]
  } : {}), M = (f) => {
    k.forEach((p, v) => {
      (f ? Te(Bn(f), v) : !0) && (W(p || [], (y) => {
        y && y.cancel();
      }), k.delete(v));
    });
  }, x = (f, p, v, m) => {
    const y = k.get(f) || [], E = y.find((D) => D && D.timeline === p);
    E ? E.effect = new KeyframeEffect(f, v, {
      composite: m
    }) : k.set(f, Et(y, [f.animate(v, {
      timeline: p,
      composite: m
    })]));
  }, g = (f, p, v) => {
    const m = v ? ge : on;
    W(f, (y) => {
      m(y.Ut, p);
    });
  }, T = (f, p) => {
    W(f, (v) => {
      const [m, y] = p(v);
      Jt(m, y);
    });
  }, w = (f, p) => {
    T(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, y = (E, D, N) => Re(Sn(z(E, Tn(D, m, N), p, N)), p);
    if (h && O)
      W(f, (E) => {
        const { Ut: D, Vt: N } = E, Z = p && Dt(D) && c;
        x(N, p ? h : O, F({
          transform: $n(m, Z).map((rt) => y(E, rt, Z))
        }, Z));
      });
    else {
      const E = Qt(b);
      T(f, (D) => {
        const { Vt: N, Ut: Z } = D;
        return [N, {
          transform: y(D, p ? E.x : E.y, p && Dt(Z) && c)
        }];
      });
    }
  }, V = (f) => A && !C && Kt(f) === u, X = [], B = [], U = [], Y = (f, p, v) => {
    const m = Un(v), y = m ? v : !0, E = m ? !v : !0;
    y && g(B, f, p), E && g(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(Et(U, B), ({ Ut: v }) => {
          if (V(v)) {
            const m = (y, E, D) => {
              const N = D && Dt(v) && c;
              x(v, y, F({
                transform: $n(E - 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 = (y) => {
          const { Ut: E } = y, D = V(E) && E, N = (Z, rt, at) => {
            const q = Tn(Z, rt, at), lt = rt * q;
            return Ye(at ? -lt : lt);
          };
          return [D, {
            transform: D ? Re({
              x: N(v.x, f.x, Dt(E) && c),
              y: N(v.y, f.y)
            }) : ""
          }];
        };
        T(B, m), T(U, m);
      }
    }
  }, L = (f) => {
    const v = Gt(`${dt} ${f ? lo : io}`), m = Gt(ms), y = Gt(un), E = {
      Ut: v,
      Mt: m,
      Vt: y
    };
    return K(f ? B : U, E), K(X, [bt(v, m), bt(m, y), R(It, v), M, s(E, Y, $, f)]), E;
  }, 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(T, B)
    },
    Jt: {
      J: O,
      Wt: U,
      Xt: et,
      Yt: R(T, U)
    }
  }, it];
}, Ho = (t, e, n) => {
  const { bt: s, kt: o, Kt: c } = e;
  return (r, a, l, i) => {
    const { Ut: u, Mt: d, Vt: b } = r, [C, A] = Lt(333), [H, I] = Lt(), k = R(l, [r], i), S = !!o.scrollBy, h = `client${i ? "X" : "Y"}`, O = i ? Yt : Zt, P = i ? "left" : "top", _ = i ? "w" : "h", z = i ? "x" : "y", F = (g) => g.propertyName.indexOf(O) > -1, M = () => {
      const g = "pointerup pointerleave pointercancel lostpointercapture", T = (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 = T(Qt(o)[z] || 0, 1 / it), p = w[h], v = L(), m = J(), y = v[O], E = et(v, m) + y / 2, D = p - m[P], N = $ ? 0 : D - E, Z = (q) => {
            ht(at), V.releasePointerCapture(q.pointerId);
          }, at = [ie(s, vt, Js), nt(c, g, Z), nt(c, "selectstart", (q) => Cn(q), {
            H: !1
          }), nt(d, g, 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(yo);
            q && K(at, q(f, et, N, y, D));
          }
        }
      });
    };
    let x = !0;
    return R(ht, [nt(u, "pointerenter", () => {
      a(_n, !0);
    }), nt(u, "pointerleave pointercancel", () => {
      a(_n, !1);
    }), nt(u, "wheel", (g) => {
      const { deltaX: T, deltaY: w, deltaMode: $ } = g;
      S && x && $ === 0 && Kt(u) === s && o.scrollBy({
        left: T,
        top: w,
        behavior: "smooth"
      }), x = !1, a(Pn, !0), C(() => {
        x = !0, a(Pn);
      }), Cn(g);
    }, {
      H: !1,
      I: !0
    }), nt(b, "transitionstart", (g) => {
      if (F(g)) {
        const T = () => {
          k(), H(T);
        };
        T();
      }
    }), nt(b, "transitionend transitioncancel", (g) => {
      F(g) && (I(), k());
    }), nt(u, "mousedown", R(nt, c, "click", ln, {
      A: !0,
      I: !0
    }), {
      I: !0
    }), M(), A, I]);
  };
}, ko = (t, e, n, s, o, c) => {
  let r, a, l, i, u, 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: g, Zt: T, 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) && (i = a, i && Y(!0));
  }, tt = [S, F, O, _, I, A, () => d(), nt(g, "pointerover", st, {
    A: !0
  }), nt(g, "pointerenter", st), nt(g, "pointerleave", (L) => {
    Q(L) && (i = !1, a && Y(!1));
  }), nt(g, "pointermove", (L) => {
    Q(L) && r && C(() => {
      S(), Y(!0), h(() => {
        r && Y(!1);
      });
    });
  }), nt(T, "scroll", (L) => {
    H(() => {
      X(), l && Y(!0), k(() => {
        l && !i && 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: y } = et || {}, { N: E } = n, { T: D } = gt(), { 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 = y && !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(T, "scroll", R(U, !0), {
        A: !0
      });
    })) : U(!0)), at && $(co, de), lt && ($(u), $(q, !0), u = q), ot && !ft && U(!0), ut && (r = ct === "move", a = ct === "leave", l = ct !== "never", Y(!l, !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, E && !w));
  }, {}, M];
}, Lo = (t) => {
  const e = gt(), { G: n, L: s } = e, { elements: o } = n(), { host: c, padding: r, viewport: a, content: l } = o, i = ce(t), u = i ? {} : t, { elements: d } = u, { host: b, padding: C, viewport: A, content: H } = d || {}, I = i ? t : u.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]), g = R(Gt, ""), T = R(F, g, a), w = R(M, g, l), $ = T(A), V = $ === I, X = V && O, B = !V && w(H), U = !V && ce($) && $ === B, Y = U && !!x(l), Q = Y ? T() : $, st = Y ? B : w(), L = X ? h : U ? Q : $, J = k ? F(g, c, b) : I, et = X ? L : J, it = U ? st : B, f = {
    gt: I,
    bt: et,
    D: L,
    cn: !V && M(g, 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: i,
    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 ? Te(p, j) : null, { gt: m, bt: y, cn: E, D, wt: N } = f, Z = [() => {
    Ct(y, [vt, Ne]), Ct(m, Ne), O && Ct(h, [Ne, vt]);
  }], rt = k && v(y);
  let at = k ? m : Xe([N, D, E, y, 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 (yt(y, vt, V ? "viewport" : "host"), yt(E, Qe, ""), yt(N, Ln, ""), V || (yt(D, _t, ""), O && ie(h, vt, Qs)), rt && (yn(m, y), K(Z, () => {
      yn(y, m), It(y);
    })), bt(q, at), bt(y, E), bt(E || y, !V && D), bt(D, N), K(Z, [ft, () => {
      const ot = _(), pt = ut(ot);
      Ct(E, Qe), Ct(N, Ln), Ct(D, [ds, ps, _t]), v(N) && ct(N), v(D) && ct(D), v(E) && ct(E), 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);
      yt(D, ot, "-1"), z(D);
      const Mt = () => pt ? yt(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: a, Gt: l, un: i, Tt: u }) => {
    let [d, b] = r(u);
    const { L: C } = gt(), { ht: A, Ht: H, Ct: I } = l || {}, { N: k } = i, [S, h] = a("paddingAbsolute");
    (A || b || (u || H)) && ([d, b] = c(u));
    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 = gt(), { bt: s, cn: o, D: c, V: r, Ot: a, Rt: l, ln: i } = t, { L: u } = n, d = l && r, b = R(ve, 0), C = {
    u: Jn,
    o: {
      w: 0,
      h: 0
    }
  }, A = {
    u: Qn,
    o: {
      x: qt,
      y: qt
    }
  }, H = (x, g) => {
    const T = mt.devicePixelRatio % 1 !== 0 ? 1 : 0, w = {
      w: b(x.w - g.w),
      h: b(x.h - g.h)
    };
    return {
      w: w.w > T ? w.w : 0,
      h: w.h > T ? 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: g, un: T, Tt: w }, { _n: $ }) => {
    const { ht: V, Ht: X, Ct: B, zt: U } = g || {}, Y = M && M.M(t, e, T, 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 y = k(w), E = h(w), D = P(w), N = z(w), Z;
    if (J && u && a(bs, !L), f) {
      m && a(Xt, !1);
      const [Ot, Nt] = st ? st(Z) : [], [Ht, _e] = y = I(w), [kt, De] = E = S(w), ne = is(c), fe = kt, de = ne;
      Ot && Ot(), (De || _e || J) && Nt && !L && Q && Q(Nt, kt, Ht);
      const se = Ys(i), 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] = E, [ct, ut] = y, 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 = go(t, ft, et, Ot);
      tt && tt(Nt, T, !!Q && Q(Nt, Rt, ct), Ot), r ? (yt(s, ds, Ot[Ee]), yt(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: a } = e, { L: l, T: i } = gt(), u = !l && (i.x || i.y), d = [_o(e), Do(e, o), Io(e, o)];
  return [n, (b) => {
    const C = {}, H = u && Qt(r), I = a ? ie(r, vt, Je) : St;
    return W(d, (k) => {
      G(C, k(b, C) || {});
    }), I(), Pt(r, H), !a && Pt(c, 0), C;
  }, o, e, s];
}, Ro = (t, e, n, s) => {
  const o = kn(e, {}), [c, r, a, l, i] = Po(t), [u, d, b] = Eo(l, a, o, (S) => {
    k({}, S);
  }), [C, A, , H] = ko(t, e, b, a, l, 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 g = h || d(G({}, x, {
      At: _
    })), T = r(G({}, x, {
      un: b,
      Gt: g
    }));
    A(G({}, x, {
      Gt: g,
      Qt: T
    }));
    const w = I(g), $ = I(T), V = w || $ || !sn(F) || M;
    return V && n(S, {
      Gt: g,
      Qt: T
    }), V;
  };
  return [() => {
    const { rn: S, D: h } = l, O = Qt(S), P = [u(), c(), C()];
    return Pt(h, O), R(ht, P);
  }, k, () => ({
    hn: b,
    pn: a
  }), {
    gn: l,
    bn: H
  }, i];
}, te = (t, e, n) => {
  const { nt: s } = gt(), o = ce(t), c = o ? t : t.target, r = xs(c);
  if (e && !r) {
    let a = !1;
    const l = [], i = {}, u = (x) => {
      const g = ns(x), T = ee(bo);
      return T ? T(g, !0) : g;
    }, d = G({}, s(), u(e)), [b, C, A] = Ke(), [H, I, k] = Ke(n), S = (x, g) => {
      k(x, g), A(x, g);
    }, [h, O, P, _, z] = Ro(t, d, ({ dn: x, Tt: g }, { Gt: T, Qt: w }) => {
      const { ht: $, Ct: V, xt: X, Ht: B, It: U, dt: Y } = T, { 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: !!g
      }]);
    }, (x) => S("scroll", [M, x])), F = (x) => {
      Co(c), ht(l), a = !0, S("destroyed", [M, x]), C(), I();
    }, M = {
      options(x, g) {
        if (x) {
          const T = g ? s() : {}, w = us(d, G(T, u(x)));
          sn(w) || (G(d, w), O({
            dn: w
          }));
        }
        return G({}, d);
      },
      on: H,
      off: (x, g) => {
        x && g && I(x, g);
      },
      state() {
        const { hn: x, pn: g } = P(), { N: T } = x, { Pt: w, Lt: $, k: V, en: X, cn: B, fn: U } = g;
        return G({}, {
          overflowEdge: w,
          overflowAmount: $,
          overflowStyle: V,
          hasOverflow: X,
          padding: B,
          paddingAbsolute: U,
          directionRTL: T,
          destroyed: a
        });
      },
      elements() {
        const { gt: x, bt: g, cn: T, 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: g,
          padding: T || 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) => i[At(x)[0]]
    };
    return K(l, [z]), Oo(c, M), ys(hs, te, [M, b, i]), xo(_.gn.Rt, !o && t.cancel) ? (F(!0), M) : (K(l, 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) => ys(o, te)[0]);
  return vo(n), e ? s : s[0];
};
te.valid = (t) => {
  const e = t && t.elements, n = Tt(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: a, tt: l, nt: i, ot: u } = gt();
  return G({}, {
    scrollbarsSize: t,
    scrollbarsOverlaid: e,
    scrollbarsHiding: n,
    rtlScrollBehavior: s,
    scrollTimeline: o,
    staticDefaultInitialization: c,
    staticDefaultOptions: r,
    getDefaultInitialization: a,
    setDefaultInitialization: l,
    getDefaultOptions: i,
    setDefaultOptions: u
  });
};
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", a = s != null && s.className ? `${r} ${s == null ? void 0 : s.className}` : r, l = te(o, {
      scrollbars: {
        autoHide: "leave",
        // 鼠标移开自动隐藏
        autoHideDelay: 0,
        theme: a
      },
      overflow: c
    }, {
      scroll: (i, u) => {
        s && s.scroll && typeof s.scroll == "function" && s.scroll(i, u);
      }
    });
    s && s.scrollReady && s.scrollReady(l);
  }
};
function Vo(t, e) {
  if (!t || !e.value) return;
  let n = null, s = null;
  n = new MutationObserver((c) => {
    var r, a;
    for (let l = 0; l < c.length; l++)
      if (c[l].type === "attributes" && c[l].attributeName === "style" && /zoom|scale/g.test((a = (r = c[l].target) == null ? void 0 : r.style) == null ? void 0 : a.cssText)) {
        s && clearTimeout(s), s = setTimeout(() => {
          var i;
          (i = e.value) == null || i.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 a;
          (a = e.value) == null || a.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 a;
          (a = e.value) == null || a.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, { expose: e }) {
    const n = Ie(null);
    function s(l) {
      var i = window.getComputedStyle(l), u = {
        display: i.display,
        "flex-direction": i["flex-direction"],
        "flex-wrap": i["flex-wrap"],
        "flex-flow": i["flex-flow"],
        "justify-content": i["justify-content"],
        "align-items": i["align-items"],
        "align-content": i["align-content"],
        "flex-grow": i["flex-grow"],
        "flex-shrink": i["flex-shrink"],
        "flex-basis": i["flex-basis"],
        flex: i.flex,
        order: i.order
      };
      return console.log(l, u.display), u.display === "flex" ? u : {};
    }
    const o = Ie(1), c = Ts(() => ({
      "--das-ui-scrollbar-z-index": o.value
    })), r = Ie("");
    return Es(() => {
      r.value = `das-scrollbar-pro-${parseInt(Math.random() * 1e8)}`, Is(r.value, [
        {
          className: `.${r.value} .das-scrollbar-pro-wrap .inherit-scrollbar-parent-flex`,
          style: s(n.value.wrapRef.parentNode.parentNode)
        }
      ]), o.value = Rs().nextZIndex();
      const l = n.value.wrapRef;
      console.log("targetNode-----------", l.children[0].children), zo(l, n), Vo(l, n);
    }), e({
      setScrollTop: (l) => {
        n.value && n.value.setScrollTop(l);
      }
    }), (l, i) => (Hs(), As(ks(Ps), Ls({
      ref_key: "scrollbarRef",
      ref: n,
      class: "das-scrollbar-pro " + r.value
    }, l.$attrs, {
      "wrap-class": "das-scrollbar-pro-wrap " + l.wrapClass,
      "view-class": "das-scrollbar-pro-view inherit-scrollbar-parent-flex" + l.viewClass,
      style: c.value
    }), {
      default: _s(() => [
        Ds(l.$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-30af3c1e"]]), Jo = Cs(Bo);
export {
  Jo as DasScrollbar,
  Ko as vScrollbar
};
