{"version":3,"file":"chunk-ScrollArea.mjs","names":["_Fragment","createContext"],"sources":["../../src/components/ScrollArea/ScrollAreaThumbs.tsx","../../src/components/ScrollArea/scrollbar.ts","../../src/components/ScrollArea/position.ts","../../src/components/ScrollArea/tracker.ts","../../src/components/ScrollArea/ScrollArea.tsx"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\n\nimport { mx } from '@dxos/ui-theme';\nimport { type AllowedAxis } from '@dxos/ui-types';\n\nimport { type ScrollbarDensity } from './scrollbar.ts';\n\n/** Smallest rendered thumb so it stays grabbable on very long content. */\nconst MIN_THUMB = 24;\n\ntype ThumbGeometry = {\n  visible: boolean;\n  offset: number;\n  length: number;\n};\n\nconst HIDDEN: ThumbGeometry = { visible: false, offset: 0, length: 0 };\n\n/**\n * Project scroll state onto a track of `viewportLength`, inset by `padding` at both ends and starting `start` in.\n */\nexport const measure = (\n  scrollOffset: number,\n  scrollLength: number,\n  viewportLength: number,\n  padding: number,\n  start = 0,\n): ThumbGeometry => {\n  const overflow = scrollLength - viewportLength;\n  if (overflow <= 1) {\n    return HIDDEN;\n  }\n\n  const track = viewportLength - start - padding * 2;\n  // A viewport too short to seat the minimum thumb would otherwise place it past the far edge.\n  if (track <= MIN_THUMB) {\n    return HIDDEN;\n  }\n\n  // The share of the scrolling region in view: a sticky `start` column is neither, so it leaves both lengths.\n  const visible = (viewportLength - start) / (scrollLength - start);\n  const length = Math.min(track, Math.max(MIN_THUMB, visible * track));\n  const offset = start + padding + (scrollOffset / overflow) * (track - length);\n  return { visible: true, offset, length };\n};\n\ntype ScrollAreaThumbsProps = {\n  viewport: HTMLElement;\n  orientation: AllowedAxis;\n  density: ScrollbarDensity;\n  autoHide: boolean;\n  /** Pixels at the start of the horizontal track the thumb keeps clear of, e.g. a sticky column it does not scroll. */\n  trackStart?: number;\n  /** Called when a thumb appears or disappears, i.e. when the viewport starts or stops overflowing on that axis. */\n  onOverflowChange?: (overflow: { vertical: boolean; horizontal: boolean }) => void;\n};\n\n/**\n * Absolutely positioned thumbs painted over the viewport; the viewport keeps native scrolling\n * (its own scrollbars are hidden via CSS), so scroll chaining and nesting behave as the browser\n * intends. Must be rendered as a sibling of the viewport inside a positioned root.\n */\nexport const ScrollAreaThumbs = ({\n  viewport,\n  orientation,\n  density,\n  autoHide,\n  trackStart = 0,\n  onOverflowChange,\n}: ScrollAreaThumbsProps) => {\n  const [vertical, setVertical] = useState<ThumbGeometry>(HIDDEN);\n  const [horizontal, setHorizontal] = useState<ThumbGeometry>(HIDDEN);\n  const [dragging, setDragging] = useState<AllowedAxis | undefined>();\n\n  const showVertical = orientation === 'vertical' || orientation === 'all';\n  const showHorizontal = orientation === 'horizontal' || orientation === 'all';\n\n  const update = useCallback(() => {\n    setVertical(\n      showVertical\n        ? measure(viewport.scrollTop, viewport.scrollHeight, viewport.clientHeight, density.padding)\n        : HIDDEN,\n    );\n    setHorizontal(\n      showHorizontal\n        ? measure(viewport.scrollLeft, viewport.scrollWidth, viewport.clientWidth, density.padding, trackStart)\n        : HIDDEN,\n    );\n  }, [viewport, showVertical, showHorizontal, density.padding, trackStart]);\n\n  useEffect(() => {\n    // Observe the scrolled content too, since content growth does not resize the viewport; the\n    // set of children is re-synced on mutation so appended content is measured as it arrives.\n    // Measured only from the observer, whose first report of each element comes after layout:\n    // reading geometry here instead would force a layout in the middle of the commit.\n    const resize = new ResizeObserver(update);\n    const observeContent = () => {\n      resize.disconnect();\n      resize.observe(viewport);\n      Array.from(viewport.children).forEach((child) => resize.observe(child));\n    };\n\n    observeContent();\n    const mutation = new MutationObserver(observeContent);\n    mutation.observe(viewport, { childList: true });\n    viewport.addEventListener('scroll', update, { passive: true });\n    return () => {\n      viewport.removeEventListener('scroll', update);\n      mutation.disconnect();\n      resize.disconnect();\n    };\n  }, [viewport, update]);\n\n  useEffect(() => {\n    onOverflowChange?.({ vertical: vertical.visible, horizontal: horizontal.visible });\n  }, [vertical.visible, horizontal.visible, onOverflowChange]);\n\n  // Read current geometry during a drag without re-binding the move handler on every frame.\n  const verticalRef = useRef(vertical);\n  const horizontalRef = useRef(horizontal);\n  verticalRef.current = vertical;\n  horizontalRef.current = horizontal;\n\n  const drag = useRef<{ origin: number; scroll: number } | undefined>(undefined);\n\n  const handlePointerDown = useCallback(\n    (axis: AllowedAxis) => (event: React.PointerEvent<HTMLDivElement>) => {\n      event.preventDefault();\n      event.currentTarget.setPointerCapture(event.pointerId);\n      drag.current = {\n        origin: axis === 'vertical' ? event.clientY : event.clientX,\n        scroll: axis === 'vertical' ? viewport.scrollTop : viewport.scrollLeft,\n      };\n      setDragging(axis);\n    },\n    [viewport],\n  );\n\n  const handlePointerMove = useCallback(\n    (axis: AllowedAxis) => (event: React.PointerEvent<HTMLDivElement>) => {\n      if (!drag.current) {\n        return;\n      }\n\n      const isVertical = axis === 'vertical';\n      const viewportLength = isVertical ? viewport.clientHeight : viewport.clientWidth;\n      const scrollLength = isVertical ? viewport.scrollHeight : viewport.scrollWidth;\n      const thumb = isVertical ? verticalRef.current : horizontalRef.current;\n      const track = viewportLength - (isVertical ? 0 : trackStart) - density.padding * 2 - thumb.length;\n      if (track <= 0) {\n        return;\n      }\n\n      const delta = (isVertical ? event.clientY : event.clientX) - drag.current.origin;\n      const scroll = drag.current.scroll + (delta / track) * (scrollLength - viewportLength);\n      if (isVertical) {\n        viewport.scrollTop = scroll;\n      } else {\n        viewport.scrollLeft = scroll;\n      }\n    },\n    [viewport, density.padding, trackStart],\n  );\n\n  // Also bound to pointercancel and lostpointercapture: without them an interrupted drag leaves\n  // `drag` set, and the next hover-move over the thumb would scroll with no button held.\n  const handlePointerUp = useCallback((event: React.PointerEvent<HTMLDivElement>) => {\n    if (event.currentTarget.hasPointerCapture(event.pointerId)) {\n      event.currentTarget.releasePointerCapture(event.pointerId);\n    }\n\n    drag.current = undefined;\n    setDragging(undefined);\n  }, []);\n\n  const visibility =\n    autoHide && !dragging\n      ? mx(\n          'opacity-0 transition-opacity',\n          orientation === 'vertical' && 'group-hover/scroll-v:opacity-100',\n          orientation === 'horizontal' && 'group-hover/scroll-h:opacity-100',\n          orientation === 'all' && 'group-hover/scroll-all:opacity-100',\n        )\n      : 'opacity-100';\n\n  // A captured pointer keeps `:active` on the thumb only while the cursor stays over it,\n  // so the dragged state is driven by `dragging` instead.\n  const appearance = (axis: AllowedAxis) =>\n    mx(\n      'absolute z-10 touch-none cursor-default transition-colors',\n      dragging === axis ? 'bg-scrollbar-thumb-active' : 'bg-scrollbar-thumb hover:bg-scrollbar-thumb-hover',\n    );\n\n  return (\n    <>\n      {vertical.visible && (\n        <div\n          className={mx(appearance('vertical'), visibility)}\n          data-scroll-thumb='vertical'\n          style={{\n            width: density.size,\n            height: vertical.length,\n            top: vertical.offset,\n            // A host that draws an inset ring at its edge (a focused popup) sets this so the thumb clears the ring.\n            insetInlineEnd: 'var(--scroll-thumb-inset, 0px)',\n          }}\n          onPointerDown={handlePointerDown('vertical')}\n          onPointerMove={handlePointerMove('vertical')}\n          onPointerUp={handlePointerUp}\n          onPointerCancel={handlePointerUp}\n          onLostPointerCapture={handlePointerUp}\n        />\n      )}\n      {horizontal.visible && (\n        <div\n          className={mx(appearance('horizontal'), visibility)}\n          data-scroll-thumb='horizontal'\n          style={{\n            height: density.size,\n            width: horizontal.length,\n            insetInlineStart: horizontal.offset,\n            bottom: density.padding,\n          }}\n          onPointerDown={handlePointerDown('horizontal')}\n          onPointerMove={handlePointerMove('horizontal')}\n          onPointerUp={handlePointerUp}\n          onPointerCancel={handlePointerUp}\n          onLostPointerCapture={handlePointerUp}\n        />\n      )}\n    </>\n  );\n};\n","//\n// Copyright 2026 DXOS.org\n//\n\nexport type ScrollbarDensity = {\n  /** Thickness of the bar/thumb. */\n  size: number;\n  /** Inset from the track ends; 0 seats the thumb flush, as it is against the end edge. */\n  padding: number;\n};\n\n/**\n * Scrollbar sizing presets keyed by density tier.\n */\nexport const scrollbar: Record<'sm' | 'md' | 'lg', ScrollbarDensity> = {\n  sm: {\n    size: 2,\n    padding: 0,\n  },\n  md: {\n    size: 4,\n    padding: 0,\n  },\n  lg: {\n    size: 8,\n    padding: 0,\n  },\n};\n","//\n// Copyright 2026 DXOS.org\n//\n\n/** Marks an element a scroll position can be kept against, by an id that names the same item in every session. */\nexport const SCROLL_ANCHOR_ATTRIBUTE = 'data-scroll-anchor';\n\n// Object rows and tiles already carry their object's id, which serves as an anchor with no markup of their own.\nconst ANCHOR_ATTRIBUTES = [SCROLL_ANCHOR_ATTRIBUTE, 'data-object-id'];\n\nconst ANCHOR_SELECTOR = ANCHOR_ATTRIBUTES.map((attribute) => `[${attribute}]`).join(', ');\n\nconst getAnchorId = (element: Element) =>\n  ANCHOR_ATTRIBUTES.map((attribute) => element.getAttribute(attribute)).find((id) => id !== null);\n\n/** Where a scrolling area is scrolled to, in a form another session with another width can restore. */\nexport type ScrollPosition = {\n  /** The anchor of the element at the top of the area. */\n  anchor?: string;\n  /** How far, in pixels, the area is scrolled past the anchor's top. */\n  offset?: number;\n  /** The fraction of the vertical scroll range scrolled. */\n  y: number;\n  /** The fraction of the horizontal scroll range scrolled, when the area scrolls sideways. */\n  x?: number;\n};\n\n// A viewport merged onto its child with `asChild` takes the child's data attributes but keeps the recipe's class.\nconst VIEWPORT_SELECTOR = '.dx-scroll-viewport';\n\nconst fraction = (scrolled: number, range: number) => (range > 0 ? Math.min(Math.max(scrolled / range, 0), 1) : 0);\n\n// Anchors are in document order, which is their order down the area, so the first one whose bottom is below the area's\n// top is found by bisection.\nconst findTopAnchor = (viewport: HTMLElement, top: number): HTMLElement | undefined => {\n  const anchors = viewport.querySelectorAll<HTMLElement>(ANCHOR_SELECTOR);\n  let low = 0;\n  let high = anchors.length;\n  while (low < high) {\n    const middle = (low + high) >> 1;\n    if (anchors[middle].getBoundingClientRect().bottom <= top) {\n      low = middle + 1;\n    } else {\n      high = middle;\n    }\n  }\n  const anchor = anchors[low];\n  // An anchor inside a nested scrolling area moves with that area, not this one.\n  return anchor && anchor.closest(VIEWPORT_SELECTOR) === viewport ? anchor : undefined;\n};\n\n/** Reads where `viewport` is scrolled to. */\nexport const captureScrollPosition = (viewport: HTMLElement): ScrollPosition => {\n  const { scrollTop, scrollHeight, clientHeight, scrollLeft, scrollWidth, clientWidth } = viewport;\n  const top = viewport.getBoundingClientRect().top;\n  const anchor = scrollTop > 0 ? findTopAnchor(viewport, top) : undefined;\n  const id = anchor && getAnchorId(anchor);\n  return {\n    ...(anchor && id && { anchor: id, offset: Math.round(top - anchor.getBoundingClientRect().top) }),\n    y: fraction(scrollTop, scrollHeight - clientHeight),\n    ...(scrollWidth > clientWidth && { x: fraction(scrollLeft, scrollWidth - clientWidth) }),\n  };\n};\n\n/**\n * Scrolls `viewport` to `position`: to its anchor when the area holds it, else to its fractions. Answers whether it\n * landed on the anchor, or had none to land on.\n */\nexport const applyScrollPosition = (viewport: HTMLElement, position: ScrollPosition): boolean => {\n  const { scrollHeight, clientHeight, scrollWidth, clientWidth } = viewport;\n  const left = position.x === undefined ? undefined : position.x * (scrollWidth - clientWidth);\n  const id = position.anchor;\n  const anchor =\n    id === undefined\n      ? undefined\n      : [\n          ...viewport.querySelectorAll<HTMLElement>(\n            ANCHOR_ATTRIBUTES.map((attribute) => `[${attribute}=\"${CSS.escape(id)}\"]`).join(', '),\n          ),\n        ].find((element) => element.closest(VIEWPORT_SELECTOR) === viewport && getAnchorId(element) === id);\n  if (anchor) {\n    const top =\n      viewport.scrollTop +\n      anchor.getBoundingClientRect().top -\n      viewport.getBoundingClientRect().top +\n      (position.offset ?? 0);\n    viewport.scrollTo({ top, left, behavior: 'instant' });\n    return true;\n  }\n\n  viewport.scrollTo({ top: position.y * (scrollHeight - clientHeight), left, behavior: 'instant' });\n  return position.anchor === undefined;\n};\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport { type ScrollPosition, applyScrollPosition, captureScrollPosition } from './position.ts';\n\n/** The name an unnamed area is tracked under when it is the outermost one. */\nexport const MAIN_AREA = 'main';\n\nexport type ScrollTrackerOptions = {\n  /** The position to restore in an area as it starts being tracked. */\n  initial?: (name: string) => ScrollPosition | undefined;\n  /** Called as the reader scrolls a tracked area, at most once an `interval`. */\n  onScroll?: (name: string, position: ScrollPosition) => void;\n  /** Milliseconds between reports while an area scrolls. */\n  interval?: number;\n  /** Milliseconds a restore keeps re-applying as the area's content resizes, unless the reader takes over. */\n  restoreWindow?: number;\n};\n\nconst DEFAULT_INTERVAL = 100;\nconst DEFAULT_RESTORE_WINDOW = 5_000;\n\n/** Input on an area that means the reader is moving it, which ends a restore. */\nconst INPUT_EVENTS = ['wheel', 'pointerdown', 'keydown', 'touchstart'] as const;\n\ntype Tracked = {\n  name: string;\n  restore: (position: ScrollPosition) => void;\n  dispose: () => void;\n};\n\nconst track = (viewport: HTMLElement, name: string, getOptions: () => ScrollTrackerOptions): Tracked => {\n  let restoring: { position: ScrollPosition; timer: ReturnType<typeof setTimeout> } | undefined;\n  let pending: ReturnType<typeof setTimeout> | undefined;\n  // The frame holds the area's thumbs, so dragging one counts as the reader's input.\n  const frame =\n    viewport.closest<HTMLElement>('[data-scope=\"scroll-area\"][data-part=\"root\"]') ?? viewport.parentElement ?? viewport;\n\n  const reapply = () => restoring && applyScrollPosition(viewport, restoring.position);\n  const observer = typeof ResizeObserver === 'undefined' ? undefined : new ResizeObserver(reapply);\n  // A child added mid-restore is observed too; its first size report re-applies the position.\n  const observeChildren = () => {\n    for (const child of viewport.children) {\n      observer?.observe(child);\n    }\n  };\n  const mutations =\n    !observer || typeof MutationObserver === 'undefined' ? undefined : new MutationObserver(observeChildren);\n\n  const stopRestoring = () => {\n    if (restoring) {\n      clearTimeout(restoring.timer);\n      restoring = undefined;\n      observer?.disconnect();\n      mutations?.disconnect();\n    }\n  };\n\n  // Scrolling a restore causes is not the reader's, so it is not reported.\n  const onScroll = () => {\n    if (restoring || pending) {\n      return;\n    }\n    pending = setTimeout(() => {\n      pending = undefined;\n      if (!restoring) {\n        getOptions().onScroll?.(name, captureScrollPosition(viewport));\n      }\n    }, getOptions().interval ?? DEFAULT_INTERVAL);\n  };\n\n  const restore = (position: ScrollPosition) => {\n    stopRestoring();\n    restoring = { position, timer: setTimeout(stopRestoring, getOptions().restoreWindow ?? DEFAULT_RESTORE_WINDOW) };\n    applyScrollPosition(viewport, position);\n    observer?.observe(viewport);\n    observeChildren();\n    mutations?.observe(viewport, { childList: true });\n  };\n\n  viewport.addEventListener('scroll', onScroll, { passive: true });\n  for (const type of INPUT_EVENTS) {\n    frame.addEventListener(type, stopRestoring, { passive: true, capture: true });\n  }\n\n  const initial = getOptions().initial?.(name);\n  if (initial) {\n    restore(initial);\n  }\n\n  return {\n    name,\n    restore,\n    dispose: () => {\n      stopRestoring();\n      clearTimeout(pending);\n      viewport.removeEventListener('scroll', onScroll);\n      for (const type of INPUT_EVENTS) {\n        frame.removeEventListener(type, stopRestoring, { capture: true });\n      }\n    },\n  };\n};\n\n/**\n * Keeps the scroll position of the scrolling areas inside one element: the outermost unnamed area as {@link MAIN_AREA},\n * and each named one under its name. Areas outside the element (in a portal) are not tracked.\n */\nexport class ScrollTracker {\n  readonly #getOptions: () => ScrollTrackerOptions;\n  readonly #areas = new Map<HTMLElement, { name?: string; tracked?: Tracked }>();\n  #root: HTMLElement | null = null;\n  #updating = false;\n\n  constructor(getOptions: () => ScrollTrackerOptions) {\n    this.#getOptions = getOptions;\n  }\n\n  setRoot(root: HTMLElement | null): void {\n    this.#root = root;\n  }\n\n  /** Starts tracking `viewport`, under `name` or, unnamed, as the main area when it is the outermost one. */\n  register(viewport: HTMLElement, name?: string): () => void {\n    if (!this.#root?.contains(viewport)) {\n      return () => {};\n    }\n    this.#areas.set(viewport, { name });\n    this.#scheduleUpdate();\n    return () => {\n      this.#areas.get(viewport)?.tracked?.dispose();\n      this.#areas.delete(viewport);\n      this.#scheduleUpdate();\n    };\n  }\n\n  /** Restores `position` in the area tracked under `name`. */\n  restore(name: string, position: ScrollPosition): void {\n    for (const { tracked } of this.#areas.values()) {\n      if (tracked?.name === name) {\n        tracked.restore(position);\n      }\n    }\n  }\n\n  dispose(): void {\n    for (const area of this.#areas.values()) {\n      area.tracked?.dispose();\n    }\n    this.#areas.clear();\n  }\n\n  // A nested viewport registers before the one around it (child effects run first), so the main area is picked once\n  // every viewport of the same commit has registered; otherwise the nested one would take the main restore.\n  #scheduleUpdate(): void {\n    if (this.#updating) {\n      return;\n    }\n    this.#updating = true;\n    queueMicrotask(() => {\n      this.#updating = false;\n      this.#update();\n    });\n  }\n\n  // Of several outermost unnamed areas (side by side), the largest is the main one.\n  #update(): void {\n    const unnamed = [...this.#areas.entries()]\n      .filter(([, { name }]) => name === undefined)\n      .map(([viewport]) => viewport);\n    const outermost = unnamed.filter(\n      (viewport) => !unnamed.some((other) => other !== viewport && other.contains(viewport)),\n    );\n    const main = outermost.reduce<HTMLElement | undefined>(\n      (largest, viewport) =>\n        !largest || viewport.clientWidth * viewport.clientHeight > largest.clientWidth * largest.clientHeight\n          ? viewport\n          : largest,\n      undefined,\n    );\n    for (const [viewport, area] of this.#areas) {\n      const name = area.name ?? (viewport === main ? MAIN_AREA : undefined);\n      if (area.tracked?.name !== name) {\n        area.tracked?.dispose();\n        area.tracked = name === undefined ? undefined : track(viewport, name, this.#getOptions);\n      }\n    }\n  }\n}\n","//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport { ark } from '@ark-ui/react/factory';\nimport React, {\n  type PropsWithChildren,\n  forwardRef,\n  useCallback,\n  useEffect,\n  useImperativeHandle,\n  useMemo,\n  useRef,\n  useState,\n} from 'react';\n\nimport { createContext, useComposedRefs } from '@dxos/react-hooks';\nimport { type AllowedAxis } from '@dxos/ui-types';\n\nimport { recipes } from '../../recipes.ts';\nimport { type Size } from '../../sizes.ts';\nimport { composableProps, slottable } from '../../util/slots.ts';\nimport { type ScrollPosition } from './position.ts';\nimport { ScrollAreaThumbs } from './ScrollAreaThumbs.tsx';\nimport { scrollbar } from './scrollbar.ts';\nimport { MAIN_AREA, ScrollTracker, type ScrollTrackerOptions } from './tracker.ts';\n\ntype ScrollAreaContextValue = {\n  native: boolean;\n  setViewport: (viewport: HTMLElement | null) => void;\n};\n\nconst [ScrollAreaProvider, useScrollAreaContext] = createContext<ScrollAreaContextValue>('ScrollArea');\n\ntype ScrollTrackingContextValue = { tracker?: ScrollTracker };\n\nconst [ScrollTrackingProvider, useScrollTrackingContext] = createContext<ScrollTrackingContextValue>(\n  'ScrollTracking',\n  {},\n);\n\n//\n// Tracking\n//\n\ntype ScrollAreaTrackingProps = PropsWithChildren<ScrollTrackerOptions>;\n\ntype ScrollAreaTrackingHandle = {\n  /** Restores `position` in the area tracked under `name`. */\n  restore: (name: string, position: ScrollPosition) => void;\n};\n\n/**\n * Keeps the scroll position of the areas inside it: the outermost `Viewport` as the main area, and each `Viewport`\n * given a `follow` name under that name. It renders a `display: contents` element, so it does not change the layout.\n */\nconst ScrollAreaTracking = forwardRef<ScrollAreaTrackingHandle, ScrollAreaTrackingProps>(\n  ({ children, ...options }, forwardedRef) => {\n    const optionsRef = useRef(options);\n    optionsRef.current = options;\n    const tracker = useMemo(() => new ScrollTracker(() => optionsRef.current), []);\n    const setRoot = useCallback((element: HTMLElement | null) => tracker.setRoot(element), [tracker]);\n    useEffect(() => () => tracker.dispose(), [tracker]);\n    useImperativeHandle(forwardedRef, () => ({ restore: (name, position) => tracker.restore(name, position) }), [\n      tracker,\n    ]);\n    return (\n      <ScrollTrackingProvider tracker={tracker}>\n        <div className='contents' ref={setRoot}>\n          {children}\n        </div>\n      </ScrollTrackingProvider>\n    );\n  },\n);\n\nScrollAreaTracking.displayName = 'ScrollArea.Tracking';\n\n//\n// Root\n//\n\ntype ScrollAreaRootProps = {\n  size?: Size;\n  /** `overlay` paints the thumb over the end gutter; `reserve` takes its width out of the end track. */\n  mode?: 'overlay' | 'reserve';\n  /** `thin` fits the thumb in a rail Block's margin at every size; `regular` overlaps it. */\n  width?: 'thin' | 'regular';\n  /** Platform scrollbar instead of overlay thumbs; implies `reserve`. */\n  native?: boolean;\n  /** Scrolling axis; `all` scrolls both (the current ScrollArea's values). */\n  orientation?: AllowedAxis;\n  /** Overlay thumbs show only while the pointer is over the frame (or a thumb is dragged); `false` keeps them visible. */\n  autoHide?: boolean;\n  /** Mandatory snapping on the scrolling axis; children carry their own `scroll-snap-align`. */\n  snap?: boolean;\n  /** `false` scrolls without any visible bar, overlay or native. */\n  scrollbars?: boolean;\n  /** Pixels at the start of the horizontal bar's track left clear, so the bar spans only what scrolls past a sticky column. */\n  trackStart?: number;\n};\n\n/** Tailwind group names the overlay thumbs' `autoHide` hover rule targets (`ScrollAreaThumbs`). */\nconst AUTO_HIDE_GROUP: Record<AllowedAxis, string> = {\n  vertical: 'group/scroll-v',\n  horizontal: 'group/scroll-h',\n  all: 'group/scroll-all',\n};\n\n/** Non-scrolling frame: hosts the overlay thumbs and is the query container for its content. */\nconst ScrollAreaRoot = slottable<HTMLDivElement, ScrollAreaRootProps>(\n  (\n    {\n      children,\n      asChild,\n      size,\n      mode = 'overlay',\n      width = 'thin',\n      native = false,\n      orientation = 'vertical',\n      autoHide = true,\n      snap = false,\n      scrollbars = true,\n      trackStart,\n      ...props\n    },\n    forwardedRef,\n  ) => {\n    const [viewport, setViewport] = useState<HTMLElement | null>(null);\n    // Which axes currently show an overlay thumb, published as `data-overflow-*` so CSS can reserve its strip.\n    const [overflow, setOverflow] = useState({ vertical: false, horizontal: false });\n    const handleOverflowChange = useCallback(\n      (next: { vertical: boolean; horizontal: boolean }) =>\n        setOverflow((current) =>\n          current.vertical === next.vertical && current.horizontal === next.horizontal ? current : next,\n        ),\n      [],\n    );\n    const { className, ...rest } = composableProps(props, {\n      classNames: [recipes.scrollRoot(), autoHide && AUTO_HIDE_GROUP[orientation]],\n    });\n    return (\n      <ScrollAreaProvider native={native} setViewport={setViewport}>\n        <ark.div\n          asChild={asChild}\n          {...rest}\n          data-scope='scroll-area'\n          data-part='root'\n          data-size={size}\n          data-mode={native ? 'reserve' : mode}\n          data-width={width}\n          data-orientation={orientation}\n          data-snap={snap ? '' : undefined}\n          data-scrollbars={scrollbars ? undefined : 'false'}\n          data-overflow-y={overflow.vertical ? '' : undefined}\n          data-overflow-x={overflow.horizontal ? '' : undefined}\n          className={className}\n          ref={forwardedRef}\n        >\n          {children}\n          {!native && scrollbars && viewport && (\n            <ScrollAreaThumbs\n              viewport={viewport}\n              orientation={orientation}\n              density={width === 'thin' ? scrollbar.md : scrollbar.lg}\n              autoHide={autoHide}\n              trackStart={trackStart}\n              onOverflowChange={handleOverflowChange}\n            />\n          )}\n        </ark.div>\n      </ScrollAreaProvider>\n    );\n  },\n);\n\nScrollAreaRoot.displayName = 'ScrollArea.Root';\n\n//\n// Viewport\n//\n\ntype ScrollAreaViewportProps = {\n  /**\n   * Whether a `Tracking` ancestor keeps this area's scroll position: the outermost area is kept by default, `false` opts\n   * out, and a name keeps an inner area under that name.\n   */\n  follow?: boolean | string;\n};\n\n/** The scrolling element; under `asChild` it is the child (e.g. a Container) itself. */\nconst ScrollAreaViewport = slottable<HTMLDivElement, ScrollAreaViewportProps>(\n  ({ children, asChild, follow = true, ...props }, forwardedRef) => {\n    const { native, setViewport } = useScrollAreaContext('ScrollArea.Viewport');\n    const { tracker } = useScrollTrackingContext('ScrollArea.Viewport');\n    const [element, setElement] = useState<HTMLElement | null>(null);\n    const ref = useComposedRefs(forwardedRef, setViewport, setElement);\n    useEffect(() => {\n      if (tracker && element && follow !== false) {\n        return tracker.register(element, typeof follow === 'string' ? follow : undefined);\n      }\n    }, [tracker, element, follow]);\n    const { className, ...rest } = composableProps(props, { classNames: recipes.scrollViewport() });\n    return (\n      <ark.div\n        asChild={asChild}\n        {...rest}\n        data-scope='scroll-area'\n        data-part='viewport'\n        data-native={native ? '' : undefined}\n        className={className}\n        ref={ref}\n      >\n        {children}\n      </ark.div>\n    );\n  },\n);\n\nScrollAreaViewport.displayName = 'ScrollArea.Viewport';\n\nexport { MAIN_AREA, ScrollAreaRoot as Root, ScrollAreaTracking as Tracking, ScrollAreaViewport as Viewport };\nexport type {\n  ScrollAreaRootProps as RootProps,\n  ScrollPosition,\n  ScrollAreaTrackingHandle as TrackingHandle,\n  ScrollAreaTrackingProps as TrackingProps,\n  ScrollAreaViewportProps as ViewportProps,\n};\nexport { SCROLL_ANCHOR_ATTRIBUTE, applyScrollPosition, captureScrollPosition } from './position.ts';\n"],"mappings":";;;;;;;;;;AAYA,IAAM,YAAY;AAQlB,IAAM,SAAwB;CAAE,SAAS;CAAO,QAAQ;CAAG,QAAQ;AAAE;;;;AAKrE,IAAa,WACX,cACA,cACA,gBACA,SACA,QAAQ,MACU;CAClB,MAAM,WAAW,eAAe;CAChC,IAAI,YAAY,GACd,OAAO;CAGT,MAAM,QAAQ,iBAAiB,QAAQ,UAAU;CAEjD,IAAI,SAAS,WACX,OAAO;CAIT,MAAM,WAAW,iBAAiB,UAAU,eAAe;CAC3D,MAAM,SAAS,KAAK,IAAI,OAAO,KAAK,IAAI,WAAW,UAAU,KAAK,CAAC;CAEnE,OAAO;EAAE,SAAS;EAAM,QADT,QAAQ,UAAW,eAAe,YAAa,QAAQ;EACtC;CAAO;AACzC;;;;;;AAkBA,IAAa,oBAAoB,EAC/B,UACA,aACA,SACA,UACA,aAAa,GACb,uBAC2B;CAC3B,MAAM,CAAC,UAAU,eAAe,SAAwB,MAAM;CAC9D,MAAM,CAAC,YAAY,iBAAiB,SAAwB,MAAM;CAClE,MAAM,CAAC,UAAU,eAAe,SAAkC;CAElE,MAAM,eAAe,gBAAgB,cAAc,gBAAgB;CACnE,MAAM,iBAAiB,gBAAgB,gBAAgB,gBAAgB;CAEvE,MAAM,SAAS,kBAAkB;EAC/B,YACE,eACI,QAAQ,SAAS,WAAW,SAAS,cAAc,SAAS,cAAc,QAAQ,OAAO,IACzF,MACN;EACA,cACE,iBACI,QAAQ,SAAS,YAAY,SAAS,aAAa,SAAS,aAAa,QAAQ,SAAS,UAAU,IACpG,MACN;CACF,GAAG;EAAC;EAAU;EAAc;EAAgB,QAAQ;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