"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

var _typeof = require("@babel/runtime/helpers/typeof");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _react = _interopRequireDefault(require("react"));

var _reactDndMultiBackend = _interopRequireWildcard(require("react-dnd-multi-backend"));

var _reactDnd = require("react-dnd");

var _reactDndTouchBackend = require("react-dnd-touch-backend");

var _reactDndHtml5Backend = require("react-dnd-html5-backend");

var _previewComponent = _interopRequireDefault(require("./preview-component"));

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

var backends = [{
  backend: _reactDndHtml5Backend.HTML5Backend
}, {
  backend: _reactDndTouchBackend.TouchBackend,
  options: {
    enableMouseEvents: true,
    enableTouchEvents: true
  },
  preview: true,
  transition: _reactDndMultiBackend.TouchTransition,
  skipDispatchOnTransition: true
}];

var _default = function _default(Component) {
  return function (props) {
    return /*#__PURE__*/_react["default"].createElement(_reactDnd.DndProvider, {
      backend: _reactDndMultiBackend["default"],
      options: {
        backends: backends
      },
      context: window
    }, /*#__PURE__*/_react["default"].createElement(Component, props), /*#__PURE__*/_react["default"].createElement(_previewComponent["default"], null));
  };
};

exports["default"] = _default;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb2RlL2RyYWcvd2l0aC1kcmFnLWNvbnRleHQuanMiXSwibmFtZXMiOlsiYmFja2VuZHMiLCJiYWNrZW5kIiwiSFRNTDVCYWNrZW5kIiwiVG91Y2hCYWNrZW5kIiwib3B0aW9ucyIsImVuYWJsZU1vdXNlRXZlbnRzIiwiZW5hYmxlVG91Y2hFdmVudHMiLCJwcmV2aWV3IiwidHJhbnNpdGlvbiIsIlRvdWNoVHJhbnNpdGlvbiIsInNraXBEaXNwYXRjaE9uVHJhbnNpdGlvbiIsIkNvbXBvbmVudCIsInByb3BzIiwiTXVsdGlCYWNrZW5kIiwid2luZG93Il0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7OztBQUFBOztBQUNBOztBQUNBOztBQUNBOztBQUNBOztBQUVBOzs7Ozs7QUFFQSxJQUFNQSxRQUFRLEdBQUcsQ0FDZjtBQUFFQyxFQUFBQSxPQUFPLEVBQUVDO0FBQVgsQ0FEZSxFQUVmO0FBQ0VELEVBQUFBLE9BQU8sRUFBRUUsa0NBRFg7QUFFRUMsRUFBQUEsT0FBTyxFQUFFO0FBQUVDLElBQUFBLGlCQUFpQixFQUFFLElBQXJCO0FBQTJCQyxJQUFBQSxpQkFBaUIsRUFBRTtBQUE5QyxHQUZYO0FBR0VDLEVBQUFBLE9BQU8sRUFBRSxJQUhYO0FBSUVDLEVBQUFBLFVBQVUsRUFBRUMscUNBSmQ7QUFLRUMsRUFBQUEsd0JBQXdCLEVBQUU7QUFMNUIsQ0FGZSxDQUFqQjs7ZUFXZSxrQkFBQ0MsU0FBRDtBQUFBLFNBQWUsVUFBQ0MsS0FBRDtBQUFBLHdCQUM1QixnQ0FBQyxxQkFBRDtBQUF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