"use client";
import { jsxs as Gt, jsx as rt } from "react/jsx-runtime";
import { cn as qt } from "../../../lib/utils.js";
import * as r from "react";
import { u as gt } from "../../../useStableCallback-CudqoENs.js";
import { u as Rt } from "../../../useTimeout-DAqPwigF.js";
import { f as Jt, u as St } from "../../../useRenderElement-DNB2vtF1.js";
import { s as Qt } from "../../../styles-DU5BO7fS.js";
import { u as de } from "../../../useBaseUiId-C8Dq0BQq.js";
import { u as he, c as ut } from "../../../clamp-BxE4ZAuA.js";
import { c as me } from "../../../element-DSo91iOi.js";
import { u as Wt } from "../../../useIsoLayoutEffect-DpJo20by.js";
import { e as pe } from "../../../detectBrowser-Dn2N72k1.js";
import { u as te } from "../../../DirectionContext-BSOheMwC.js";
const At = /* @__PURE__ */ r.createContext(void 0);
process.env.NODE_ENV !== "production" && (At.displayName = "ScrollAreaRootContext");
function Xt() {
  const t = r.useContext(At);
  if (t === void 0)
    throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: ScrollAreaRootContext is missing. ScrollArea parts must be placed within <ScrollArea.Root>." : Jt(53));
  return t;
}
let Ot = /* @__PURE__ */ (function(t) {
  return t.scrollAreaCornerHeight = "--scroll-area-corner-height", t.scrollAreaCornerWidth = "--scroll-area-corner-width", t;
})({});
const yt = 500, Ft = 16;
function N(t, e, l) {
  if (!t)
    return 0;
  const S = getComputedStyle(t), X = l === "x" ? "Inline" : "Block";
  return l === "x" && e === "margin" ? parseFloat(S[`${e}InlineStart`]) * 2 : parseFloat(S[`${e}${X}Start`]) + parseFloat(S[`${e}${X}End`]);
}
let ve = /* @__PURE__ */ (function(t) {
  return t.orientation = "data-orientation", t.hovering = "data-hovering", t.scrolling = "data-scrolling", t.hasOverflowX = "data-has-overflow-x", t.hasOverflowY = "data-has-overflow-y", t.overflowXStart = "data-overflow-x-start", t.overflowXEnd = "data-overflow-x-end", t.overflowYStart = "data-overflow-y-start", t.overflowYEnd = "data-overflow-y-end", t;
})({}), ft = /* @__PURE__ */ (function(t) {
  return t.scrolling = "data-scrolling", t.hasOverflowX = "data-has-overflow-x", t.hasOverflowY = "data-has-overflow-y", t.overflowXStart = "data-overflow-x-start", t.overflowXEnd = "data-overflow-x-end", t.overflowYStart = "data-overflow-y-start", t.overflowYEnd = "data-overflow-y-end", t;
})({});
const Pt = {
  hasOverflowX: (t) => t ? {
    [ft.hasOverflowX]: ""
  } : null,
  hasOverflowY: (t) => t ? {
    [ft.hasOverflowY]: ""
  } : null,
  overflowXStart: (t) => t ? {
    [ft.overflowXStart]: ""
  } : null,
  overflowXEnd: (t) => t ? {
    [ft.overflowXEnd]: ""
  } : null,
  overflowYStart: (t) => t ? {
    [ft.overflowYStart]: ""
  } : null,
  overflowYEnd: (t) => t ? {
    [ft.overflowYEnd]: ""
  } : null,
  cornerHidden: () => null
}, we = {
  x: 0,
  y: 0
}, kt = {
  width: 0,
  height: 0
}, ge = {
  xStart: !1,
  xEnd: !1,
  yStart: !1,
  yEnd: !1
}, Se = {
  x: !0,
  y: !0,
  corner: !0
}, ee = /* @__PURE__ */ r.forwardRef(function(e, l) {
  const {
    render: S,
    className: X,
    overflowEdgeThreshold: s,
    ...a
  } = e, H = Ee(s), P = de(), L = Rt(), $ = Rt(), {
    nonce: M,
    disableStyleElements: C
  } = he(), [E, u] = r.useState(!1), [m, R] = r.useState(!1), [h, I] = r.useState(!1), [ot, K] = r.useState(!1), [Z, _] = r.useState(!1), [W, nt] = r.useState(kt), [j, G] = r.useState(kt), [O, lt] = r.useState(ge), [T, st] = r.useState(Se), o = r.useRef(null), n = r.useRef(null), x = r.useRef(null), d = r.useRef(null), b = r.useRef(null), y = r.useRef(null), f = r.useRef(null), p = r.useRef(!1), w = r.useRef(0), v = r.useRef(0), g = r.useRef(0), Et = r.useRef(0), Y = r.useRef("vertical"), V = r.useRef(we), U = gt((c) => {
    const z = c.x - V.current.x, J = c.y - V.current.y;
    V.current = c, J !== 0 && (I(!0), L.start(yt, () => {
      I(!1);
    })), z !== 0 && (R(!0), $.start(yt, () => {
      R(!1);
    }));
  }), F = gt((c) => {
    c.button === 0 && (p.current = !0, w.current = c.clientY, v.current = c.clientX, Y.current = c.currentTarget.getAttribute(ve.orientation), n.current && (g.current = n.current.scrollTop, Et.current = n.current.scrollLeft), b.current && Y.current === "vertical" && b.current.setPointerCapture(c.pointerId), y.current && Y.current === "horizontal" && y.current.setPointerCapture(c.pointerId));
  }), dt = gt((c) => {
    if (!p.current)
      return;
    const z = c.clientY - w.current, J = c.clientX - v.current;
    if (n.current) {
      const it = n.current.scrollHeight, ht = n.current.clientHeight, Nt = n.current.scrollWidth, mt = n.current.clientWidth;
      if (b.current && x.current && Y.current === "vertical") {
        const at = N(x.current, "padding", "y"), pt = N(b.current, "margin", "y"), vt = b.current.offsetHeight, Q = x.current.offsetHeight - vt - at - pt, tt = z / Q;
        n.current.scrollTop = g.current + tt * (it - ht), c.preventDefault(), I(!0), L.start(yt, () => {
          I(!1);
        });
      }
      if (y.current && d.current && Y.current === "horizontal") {
        const at = N(d.current, "padding", "x"), pt = N(y.current, "margin", "x"), vt = y.current.offsetWidth, Q = d.current.offsetWidth - vt - at - pt, tt = J / Q;
        n.current.scrollLeft = Et.current + tt * (Nt - mt), c.preventDefault(), R(!0), $.start(yt, () => {
          R(!1);
        });
      }
    }
  }), ct = gt((c) => {
    p.current = !1, b.current && Y.current === "vertical" && b.current.releasePointerCapture(c.pointerId), y.current && Y.current === "horizontal" && y.current.releasePointerCapture(c.pointerId);
  });
  function k(c) {
    K(c.pointerType === "touch");
  }
  function xt(c) {
    if (k(c), c.pointerType !== "touch") {
      const z = me(o.current, c.target);
      u(z);
    }
  }
  const q = r.useMemo(() => ({
    scrolling: m || h,
    hasOverflowX: !T.x,
    hasOverflowY: !T.y,
    overflowXStart: O.xStart,
    overflowXEnd: O.xEnd,
    overflowYStart: O.yStart,
    overflowYEnd: O.yEnd,
    cornerHidden: T.corner
  }), [m, h, T.x, T.y, T.corner, O]), A = {
    role: "presentation",
    onPointerEnter: xt,
    onPointerMove: xt,
    onPointerDown: k,
    onPointerLeave() {
      u(!1);
    },
    style: {
      position: "relative",
      [Ot.scrollAreaCornerHeight]: `${W.height}px`,
      [Ot.scrollAreaCornerWidth]: `${W.width}px`
    }
  }, D = St("div", e, {
    state: q,
    ref: [l, o],
    props: [A, a],
    stateAttributesMapping: Pt
  }), Tt = r.useMemo(() => ({
    handlePointerDown: F,
    handlePointerMove: dt,
    handlePointerUp: ct,
    handleScroll: U,
    cornerSize: W,
    setCornerSize: nt,
    thumbSize: j,
    setThumbSize: G,
    hasMeasuredScrollbar: Z,
    setHasMeasuredScrollbar: _,
    touchModality: ot,
    cornerRef: f,
    scrollingX: m,
    setScrollingX: R,
    scrollingY: h,
    setScrollingY: I,
    hovering: E,
    setHovering: u,
    viewportRef: n,
    rootRef: o,
    scrollbarYRef: x,
    scrollbarXRef: d,
    thumbYRef: b,
    thumbXRef: y,
    rootId: P,
    hiddenState: T,
    setHiddenState: st,
    overflowEdges: O,
    setOverflowEdges: lt,
    viewportState: q,
    overflowEdgeThreshold: H
  }), [F, dt, ct, U, W, j, Z, ot, m, R, h, I, E, u, P, T, O, q, H]);
  return /* @__PURE__ */ Gt(At.Provider, {
    value: Tt,
    children: [!C && Qt.getElement(M), D]
  });
});
process.env.NODE_ENV !== "production" && (ee.displayName = "ScrollAreaRoot");
function Ee(t) {
  if (typeof t == "number") {
    const e = Math.max(0, t);
    return {
      xStart: e,
      xEnd: e,
      yStart: e,
      yEnd: e
    };
  }
  return {
    xStart: Math.max(0, t?.xStart || 0),
    xEnd: Math.max(0, t?.xEnd || 0),
    yStart: Math.max(0, t?.yStart || 0),
    yEnd: Math.max(0, t?.yEnd || 0)
  };
}
const re = /* @__PURE__ */ r.createContext(void 0);
process.env.NODE_ENV !== "production" && (re.displayName = "ScrollAreaViewportContext");
function xe(t, e) {
  if (typeof IntersectionObserver > "u")
    return () => {
    };
  const l = new IntersectionObserver((S) => {
    S.forEach((X) => {
      X.intersectionRatio > 0 && (e(), l.disconnect());
    });
  });
  return l.observe(t), () => {
    l.disconnect();
  };
}
let B = /* @__PURE__ */ (function(t) {
  return t.scrollAreaOverflowXStart = "--scroll-area-overflow-x-start", t.scrollAreaOverflowXEnd = "--scroll-area-overflow-x-end", t.scrollAreaOverflowYStart = "--scroll-area-overflow-y-start", t.scrollAreaOverflowYEnd = "--scroll-area-overflow-y-end", t;
})({});
const Bt = 1;
function Kt(t, e) {
  if (e <= 0)
    return 0;
  const l = ut(t, 0, e), S = l, X = e - l, s = S <= Bt, a = X <= Bt;
  return s && a ? S <= X ? 0 : e : s ? 0 : a ? e : l;
}
let Zt = !1;
const jt = typeof ResizeObserver < "u";
function be() {
  Zt || // When `inherits: false`, specifying `inherit` on child elements doesn't work
  // in Safari. To let CSS features work correctly, this optimization must be skipped.
  pe || (typeof CSS < "u" && "registerProperty" in CSS && [B.scrollAreaOverflowXStart, B.scrollAreaOverflowXEnd, B.scrollAreaOverflowYStart, B.scrollAreaOverflowYEnd].forEach((t) => {
    try {
      CSS.registerProperty({
        name: t,
        syntax: "<length>",
        inherits: !1,
        initialValue: "0px"
      });
    } catch {
    }
  }), Zt = !0);
}
const oe = /* @__PURE__ */ r.forwardRef(function(e, l) {
  const {
    render: S,
    className: X,
    ...s
  } = e, {
    viewportRef: a,
    scrollbarYRef: H,
    scrollbarXRef: P,
    thumbYRef: L,
    thumbXRef: $,
    cornerRef: M,
    cornerSize: C,
    setCornerSize: E,
    setThumbSize: u,
    rootId: m,
    setHiddenState: R,
    hiddenState: h,
    setHasMeasuredScrollbar: I,
    handleScroll: ot,
    setHovering: K,
    setOverflowEdges: Z,
    overflowEdges: _,
    overflowEdgeThreshold: W,
    scrollingX: nt,
    scrollingY: j
  } = Xt(), G = te(), O = r.useRef(!0), lt = r.useRef([NaN, NaN, NaN, NaN]), T = Rt(), st = Rt(), o = gt(() => {
    const f = a.current, p = H.current, w = P.current, v = L.current, g = $.current, Et = M.current;
    if (!f)
      return;
    const Y = f.scrollHeight, V = f.scrollWidth, U = f.clientHeight, F = f.clientWidth, dt = f.scrollTop, ct = f.scrollLeft, k = lt.current, xt = Number.isNaN(k[0]);
    if (k[0] = U, k[1] = Y, k[2] = F, k[3] = V, xt && I(!0), Y === 0 || V === 0)
      return;
    const q = ye(f), A = q.y, D = q.x, Tt = F / V, c = U / Y, z = Math.max(0, V - F), J = Math.max(0, Y - U);
    let it = 0, ht = 0;
    if (!D) {
      let i = 0;
      G === "rtl" ? i = ut(-ct, 0, z) : i = ut(ct, 0, z), it = Kt(i, z), ht = z - it;
    }
    const Nt = A ? 0 : ut(dt, 0, J), mt = A ? 0 : Kt(Nt, J), at = A ? 0 : J - mt, pt = D ? 0 : F, vt = A ? 0 : U;
    let Q = 0, tt = 0;
    !D && !A && (Q = p?.offsetWidth || 0, tt = w?.offsetHeight || 0);
    const It = C.width === 0 && C.height === 0, ce = It ? Q : 0, ie = It ? tt : 0, zt = N(w, "padding", "x"), _t = N(p, "padding", "y"), Vt = N(g, "margin", "x"), Dt = N(v, "margin", "y"), $t = pt - zt - Vt, Ut = vt - _t - Dt, ae = w ? Math.min(w.offsetWidth - ce, $t) : $t, fe = p ? Math.min(p.offsetHeight - ie, Ut) : Ut, Ht = Math.max(Ft, ae * Tt), Mt = Math.max(Ft, fe * c);
    if (u((i) => i.height === Mt && i.width === Ht ? i : {
      width: Ht,
      height: Mt
    }), p && v) {
      const i = p.offsetHeight - Mt - _t - Dt, et = Y - U, bt = et === 0 ? 0 : dt / et, Ct = Math.min(i, Math.max(0, bt * i));
      v.style.transform = `translate3d(0,${Ct}px,0)`;
    }
    if (w && g) {
      const i = w.offsetWidth - Ht - zt - Vt, et = V - F, bt = et === 0 ? 0 : ct / et, Ct = G === "rtl" ? ut(bt * i, -i, 0) : ut(bt * i, 0, i);
      g.style.transform = `translate3d(${Ct}px,0,0)`;
    }
    const ue = [[B.scrollAreaOverflowXStart, it], [B.scrollAreaOverflowXEnd, ht], [B.scrollAreaOverflowYStart, mt], [B.scrollAreaOverflowYEnd, at]];
    for (const [i, et] of ue)
      f.style.setProperty(i, `${et}px`);
    Et && (D || A ? E({
      width: 0,
      height: 0
    }) : !D && !A && E({
      width: Q,
      height: tt
    })), R((i) => Re(i, q));
    const wt = {
      xStart: !D && it > W.xStart,
      xEnd: !D && ht > W.xEnd,
      yStart: !A && mt > W.yStart,
      yEnd: !A && at > W.yEnd
    };
    Z((i) => i.xStart === wt.xStart && i.xEnd === wt.xEnd && i.yStart === wt.yStart && i.yEnd === wt.yEnd ? i : wt);
  });
  Wt(() => {
    if (a.current && (be(), !jt))
      return xe(a.current, () => {
        o();
      });
  }, [o, a]), Wt(() => {
    queueMicrotask(o);
  }, [o, h, G]), Wt(() => {
    a.current?.matches(":hover") && K(!0);
  }, [a, K]), r.useEffect(() => {
    const f = a.current;
    if (!jt || !f)
      return;
    let p = !1;
    const w = new ResizeObserver(() => {
      if (!p) {
        p = !0;
        const v = lt.current;
        if (v[0] === f.clientHeight && v[1] === f.scrollHeight && v[2] === f.clientWidth && v[3] === f.scrollWidth)
          return;
      }
      o();
    });
    return w.observe(f), st.start(0, () => {
      const v = f.getAnimations({
        subtree: !0
      });
      v.length !== 0 && Promise.allSettled(v.map((g) => g.finished)).then(o).catch(() => {
      });
    }), () => {
      w.disconnect(), st.clear();
    };
  }, [o, a, st]);
  function n() {
    O.current = !1;
  }
  const x = {
    role: "presentation",
    ...m && {
      "data-id": `${m}-viewport`
    },
    // https://accessibilityinsights.io/info-examples/web/scrollable-region-focusable/
    // Keep non-scrollable viewports out of tab order.
    tabIndex: h.x && h.y ? -1 : 0,
    className: Qt.className,
    style: {
      overflow: "scroll"
    },
    onScroll() {
      a.current && (o(), O.current || ot({
        x: a.current.scrollLeft,
        y: a.current.scrollTop
      }), T.start(100, () => {
        O.current = !0;
      }));
    },
    onWheel: n,
    onTouchMove: n,
    onPointerMove: n,
    onPointerEnter: n,
    onKeyDown: n
  }, d = r.useMemo(() => ({
    scrolling: nt || j,
    hasOverflowX: !h.x,
    hasOverflowY: !h.y,
    overflowXStart: _.xStart,
    overflowXEnd: _.xEnd,
    overflowYStart: _.yStart,
    overflowYEnd: _.yEnd,
    cornerHidden: h.corner
  }), [nt, j, h.x, h.y, h.corner, _]), b = St("div", e, {
    ref: [l, a],
    state: d,
    props: [x, s],
    stateAttributesMapping: Pt
  }), y = r.useMemo(() => ({
    computeThumbPosition: o
  }), [o]);
  return /* @__PURE__ */ rt(re.Provider, {
    value: y,
    children: b
  });
});
process.env.NODE_ENV !== "production" && (oe.displayName = "ScrollAreaViewport");
function ye(t) {
  const e = t.clientHeight >= t.scrollHeight, l = t.clientWidth >= t.scrollWidth;
  return {
    y: e,
    x: l,
    corner: e || l
  };
}
function Re(t, e) {
  return t.y === e.y && t.x === e.x && t.corner === e.corner ? t : e;
}
const Lt = /* @__PURE__ */ r.createContext(void 0);
process.env.NODE_ENV !== "production" && (Lt.displayName = "ScrollAreaScrollbarContext");
function Oe() {
  const t = r.useContext(Lt);
  if (t === void 0)
    throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: ScrollAreaScrollbarContext is missing. ScrollAreaScrollbar parts must be placed within <ScrollArea.Scrollbar>." : Jt(54));
  return t;
}
let Yt = /* @__PURE__ */ (function(t) {
  return t.scrollAreaThumbHeight = "--scroll-area-thumb-height", t.scrollAreaThumbWidth = "--scroll-area-thumb-width", t;
})({});
const ne = /* @__PURE__ */ r.forwardRef(function(e, l) {
  const {
    render: S,
    className: X,
    orientation: s = "vertical",
    keepMounted: a = !1,
    ...H
  } = e, {
    hovering: P,
    scrollingX: L,
    scrollingY: $,
    hiddenState: M,
    overflowEdges: C,
    scrollbarYRef: E,
    scrollbarXRef: u,
    viewportRef: m,
    thumbYRef: R,
    thumbXRef: h,
    handlePointerDown: I,
    handlePointerUp: ot,
    rootId: K,
    thumbSize: Z,
    hasMeasuredScrollbar: _
  } = Xt(), W = {
    hovering: P,
    scrolling: {
      horizontal: L,
      vertical: $
    }[s],
    orientation: s,
    hasOverflowX: !M.x,
    hasOverflowY: !M.y,
    overflowXStart: C.xStart,
    overflowXEnd: C.xEnd,
    overflowYStart: C.yStart,
    overflowYEnd: C.yEnd,
    cornerHidden: M.corner
  }, nt = te(), j = !_ && !a;
  r.useEffect(() => {
    const o = m.current, n = s === "vertical" ? E.current : u.current;
    if (!n)
      return;
    function x(d) {
      if (!(!o || !n || d.ctrlKey)) {
        if (d.preventDefault(), s === "vertical") {
          if (o.scrollTop === 0 && d.deltaY < 0)
            return;
        } else if (o.scrollLeft === 0 && d.deltaX < 0)
          return;
        if (s === "vertical") {
          if (o.scrollTop === o.scrollHeight - o.clientHeight && d.deltaY > 0)
            return;
        } else if (o.scrollLeft === o.scrollWidth - o.clientWidth && d.deltaX > 0)
          return;
        s === "vertical" ? o.scrollTop += d.deltaY : o.scrollLeft += d.deltaX;
      }
    }
    return n.addEventListener("wheel", x, {
      passive: !1
    }), () => {
      n.removeEventListener("wheel", x);
    };
  }, [s, u, E, m]);
  const G = {
    ...K && {
      "data-id": `${K}-scrollbar`
    },
    onPointerDown(o) {
      if (o.button === 0 && o.currentTarget === o.target && m.current) {
        if (R.current && E.current && s === "vertical") {
          const n = N(R.current, "margin", "y"), x = N(E.current, "padding", "y"), d = R.current.offsetHeight, b = E.current.getBoundingClientRect(), y = o.clientY - b.top - d / 2 - x + n / 2, f = m.current.scrollHeight, p = m.current.clientHeight, w = E.current.offsetHeight - d - x - n, g = y / w * (f - p);
          m.current.scrollTop = g;
        }
        if (h.current && u.current && s === "horizontal") {
          const n = N(h.current, "margin", "x"), x = N(u.current, "padding", "x"), d = h.current.offsetWidth, b = u.current.getBoundingClientRect(), y = o.clientX - b.left - d / 2 - x + n / 2, f = m.current.scrollWidth, p = m.current.clientWidth, w = u.current.offsetWidth - d - x - n, v = y / w;
          let g;
          nt === "rtl" ? (g = (1 - v) * (f - p), m.current.scrollLeft <= 0 && (g = -g)) : g = v * (f - p), m.current.scrollLeft = g;
        }
        I(o);
      }
    },
    onPointerUp: ot,
    style: {
      position: "absolute",
      touchAction: "none",
      WebkitUserSelect: "none",
      userSelect: "none",
      visibility: j ? "hidden" : void 0,
      ...s === "vertical" && {
        top: 0,
        bottom: `var(${Ot.scrollAreaCornerHeight})`,
        insetInlineEnd: 0,
        [Yt.scrollAreaThumbHeight]: `${Z.height}px`
      },
      ...s === "horizontal" && {
        insetInlineStart: 0,
        insetInlineEnd: `var(${Ot.scrollAreaCornerWidth})`,
        bottom: 0,
        [Yt.scrollAreaThumbWidth]: `${Z.width}px`
      }
    }
  }, O = St("div", e, {
    ref: [l, s === "vertical" ? E : u],
    state: W,
    props: [G, H],
    stateAttributesMapping: Pt
  }), lt = r.useMemo(() => ({
    orientation: s
  }), [s]), T = s === "vertical" ? M.y : M.x;
  return a || !T ? /* @__PURE__ */ rt(Lt.Provider, {
    value: lt,
    children: O
  }) : null;
});
process.env.NODE_ENV !== "production" && (ne.displayName = "ScrollAreaScrollbar");
const le = /* @__PURE__ */ r.forwardRef(function(e, l) {
  const {
    render: S,
    className: X,
    ...s
  } = e, {
    thumbYRef: a,
    thumbXRef: H,
    handlePointerDown: P,
    handlePointerMove: L,
    handlePointerUp: $,
    setScrollingX: M,
    setScrollingY: C,
    hasMeasuredScrollbar: E
  } = Xt(), {
    orientation: u
  } = Oe();
  return St("div", e, {
    ref: [l, u === "vertical" ? a : H],
    state: {
      orientation: u
    },
    props: [{
      onPointerDown: P,
      onPointerMove: L,
      onPointerUp(h) {
        u === "vertical" && C(!1), u === "horizontal" && M(!1), $(h);
      },
      style: {
        visibility: E ? void 0 : "hidden",
        ...u === "vertical" && {
          height: `var(${Yt.scrollAreaThumbHeight})`
        },
        ...u === "horizontal" && {
          width: `var(${Yt.scrollAreaThumbWidth})`
        }
      }
    }, s]
  });
});
process.env.NODE_ENV !== "production" && (le.displayName = "ScrollAreaThumb");
const se = /* @__PURE__ */ r.forwardRef(function(e, l) {
  const {
    render: S,
    className: X,
    ...s
  } = e, {
    cornerRef: a,
    cornerSize: H,
    hiddenState: P
  } = Xt(), L = St("div", e, {
    ref: [l, a],
    props: [{
      style: {
        position: "absolute",
        bottom: 0,
        insetInlineEnd: 0,
        width: H.width,
        height: H.height
      }
    }, s]
  });
  return P.corner ? null : L;
});
process.env.NODE_ENV !== "production" && (se.displayName = "ScrollAreaCorner");
const Ye = {
  always: "",
  auto: "",
  hover: "opacity-0 data-hovering:opacity-100 data-scrolling:opacity-100 transition-opacity duration-150",
  scroll: "opacity-0 data-scrolling:opacity-100 transition-opacity duration-150"
};
function Ve({
  className: t,
  children: e,
  type: l = "auto",
  ...S
}) {
  return /* @__PURE__ */ Gt(
    ee,
    {
      className: qt("relative", t),
      "data-slot": "scroll-area",
      ...S,
      children: [
        /* @__PURE__ */ rt(
          oe,
          {
            className: "size-full rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:outline-1 focus-visible:ring-[3px] focus-visible:ring-ring/50",
            "data-slot": "scroll-area-viewport",
            children: e
          }
        ),
        /* @__PURE__ */ rt(Xe, { className: Ye[l] }),
        /* @__PURE__ */ rt(se, {})
      ]
    }
  );
}
function Xe({
  className: t,
  orientation: e = "vertical",
  ...l
}) {
  return /* @__PURE__ */ rt(
    ne,
    {
      className: qt(
        "flex touch-none select-none p-px transition-colors data-[orientation=horizontal]:h-2.5 data-[orientation=vertical]:h-full data-[orientation=vertical]:w-2.5 data-[orientation=horizontal]:flex-col data-[orientation=horizontal]:border-t data-[orientation=horizontal]:border-t-transparent data-[orientation=vertical]:border-l data-[orientation=vertical]:border-l-transparent",
        t
      ),
      "data-orientation": e,
      "data-slot": "scroll-area-scrollbar",
      orientation: e,
      ...l,
      children: /* @__PURE__ */ rt(
        le,
        {
          className: "relative flex-1 rounded-full bg-border",
          "data-slot": "scroll-area-thumb"
        }
      )
    }
  );
}
export {
  Ve as ScrollArea,
  Xe as ScrollBar
};
