"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const React = require("react");
const useWindowEvent = require("../../../../../../../../@mantine_hooks@7.15.2_react@18.3.1/node_modules/@mantine/hooks/esm/use-window-event/use-window-event.cjs");
const useIsomorphicEffect = require("../../../../../../../../@mantine_hooks@7.15.2_react@18.3.1/node_modules/@mantine/hooks/esm/use-isomorphic-effect/use-isomorphic-effect.cjs");
function useResizing({ transitionDuration, disabled }) {
  const [resizing, setResizing] = React.useState(true);
  const resizingTimeout = React.useRef(-1);
  const disabledTimeout = React.useRef(-1);
  useWindowEvent.useWindowEvent("resize", () => {
    setResizing(true);
    clearTimeout(resizingTimeout.current);
    resizingTimeout.current = window.setTimeout(
      () => React.startTransition(() => {
        setResizing(false);
      }),
      200
    );
  });
  useIsomorphicEffect.useIsomorphicEffect(() => {
    setResizing(true);
    clearTimeout(disabledTimeout.current);
    disabledTimeout.current = window.setTimeout(
      () => React.startTransition(() => {
        setResizing(false);
      }),
      transitionDuration || 0
    );
  }, [disabled, transitionDuration]);
  return resizing;
}
exports.useResizing = useResizing;
