import { isServer } from './chunk-ZVWX56RU.mjs';

// src/scrollToTop/index.ts
function scrollToTop() {
  if (isServer())
    return;
  const c = document.documentElement.scrollTop || document.body.scrollTop;
  if (c > 0) {
    window.requestAnimationFrame(scrollToTop);
    window.scrollTo(0, c - c / 8);
  }
}

export { scrollToTop };
