'use strict';

const React = require('react');
const useGestureCore_esm = require('../../../../../@use-gesture_core@10.3.1/node_modules/@use-gesture/core/dist/use-gesture-core.esm.cjs');
const actionsFe213e88_esm = require('../../../../../@use-gesture_core@10.3.1/node_modules/@use-gesture/core/dist/actions-fe213e88.esm.cjs');

function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }

const React__default = /*#__PURE__*/_interopDefaultCompat(React);

function useRecognizers(handlers, config = {}, gestureKey, nativeHandlers) {
  const ctrl = React__default.useMemo(() => new useGestureCore_esm.Controller(handlers), []);
  ctrl.applyHandlers(handlers, nativeHandlers);
  ctrl.applyConfig(config, gestureKey);
  React__default.useEffect(ctrl.effect.bind(ctrl));
  React__default.useEffect(() => {
    return ctrl.clean.bind(ctrl);
  }, []);
  if (config.target === undefined) {
    return ctrl.bind.bind(ctrl);
  }
  return undefined;
}

function useDrag(handler, config) {
  actionsFe213e88_esm.r(actionsFe213e88_esm.e);
  return useRecognizers({
    drag: handler
  }, config || {}, 'drag');
}

exports.ConfigResolverMap = actionsFe213e88_esm.C;
exports.EngineMap = actionsFe213e88_esm.E;
exports.dragAction = actionsFe213e88_esm.e;
exports.registerAction = actionsFe213e88_esm.r;
exports.useDrag = useDrag;
