"use strict";

require("core-js/modules/es.object.define-property.js");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useMouseMoveAnywhere = void 0;
var _react = require("react");
var _mouseMoveAnywhere = require("../utilities/mouse-move-anywhere");
var useMouseMoveAnywhere = exports.useMouseMoveAnywhere = function useMouseMoveAnywhere(cb, windowProxy) {
  var disposer = (0, _react.useRef)();
  return (0, _react.useCallback)(function (dom) {
    if (dom) {
      disposer.current && disposer.current();
      disposer.current = (0, _mouseMoveAnywhere.mouseMoveAnywhere)(dom, cb, windowProxy);
    }
  }, [cb]);
};