import * as r from "react";
import { flushSync as c } from "react-dom";
import { Virtualizer as f, elementScroll as i, observeElementOffset as m, observeElementRect as d } from "../../../../../../@tanstack_virtual-core@3.13.12/node_modules/@tanstack/virtual-core/dist/esm/index.js";
import { defaultKeyExtractor as R, defaultRangeExtractor as g, measureElement as z } from "../../../../../../@tanstack_virtual-core@3.13.12/node_modules/@tanstack/virtual-core/dist/esm/index.js";
const a = typeof document < "u" ? r.useLayoutEffect : r.useEffect;
function p(e) {
  const n = r.useReducer(() => ({}), {})[1], o = {
    ...e,
    onChange: (l, u) => {
      var s;
      u ? c(n) : n(), (s = e.onChange) == null || s.call(e, l, u);
    }
  }, [t] = r.useState(
    () => new f(o)
  );
  return t.setOptions(o), a(() => t._didMount(), []), a(() => t._willUpdate()), t;
}
function h(e) {
  return p({
    observeElementRect: d,
    observeElementOffset: m,
    scrollToFn: i,
    ...e
  });
}
export {
  f as Virtualizer,
  R as defaultKeyExtractor,
  g as defaultRangeExtractor,
  i as elementScroll,
  z as measureElement,
  m as observeElementOffset,
  d as observeElementRect,
  h as useVirtualizer
};
//# sourceMappingURL=index.js.map
