(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[189],{
/***/ "+M/w":
/*!***********************************************************************!*\
!*** ./src/components/EcListItems/Problemset/Card/index.less?modules ***!
\***********************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
module.exports = {"flexRow":"flexRow___1Kwk7","flexColumn":"flexColumn___1x58l","action":"action___osaCD","setScore":"setScore___kmMlR","delete":"delete___XpFlx","content":"content___9Naj3","titleWrap":"titleWrap___32PZL","titleNumber":"titleNumber___3HPb0","score":"score___3zGYh","titleHtml":"titleHtml___2vgPo","answerWrap":"answerWrap___2vM8f","answer":"answer___1Q0Tc"};
/***/ }),
/***/ "6cGi":
/*!*********************************************************!*\
!*** ./node_modules/rc-util/es/hooks/useMergedState.js ***!
\*********************************************************/
/*! exports provided: default */
/*! exports used: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useControlledState; });
/* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ "ODXe");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "cDcd");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
function useControlledState(defaultStateValue, option) {
var _ref = option || {},
defaultValue = _ref.defaultValue,
value = _ref.value,
onChange = _ref.onChange,
postState = _ref.postState;
var _React$useState = react__WEBPACK_IMPORTED_MODULE_1__["useState"](function () {
if (value !== undefined) {
return value;
}
if (defaultValue !== undefined) {
return typeof defaultValue === 'function' ? defaultValue() : defaultValue;
}
return typeof defaultStateValue === 'function' ? defaultStateValue() : defaultStateValue;
}),
_React$useState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(_React$useState, 2),
innerValue = _React$useState2[0],
setInnerValue = _React$useState2[1];
var mergedValue = value !== undefined ? value : innerValue;
if (postState) {
mergedValue = postState(mergedValue);
} // setState
var onChangeRef = react__WEBPACK_IMPORTED_MODULE_1__["useRef"](onChange);
onChangeRef.current = onChange;
var triggerChange = react__WEBPACK_IMPORTED_MODULE_1__["useCallback"](function (newValue) {
setInnerValue(newValue);
if (mergedValue !== newValue && onChangeRef.current) {
onChangeRef.current(newValue, mergedValue);
}
}, [mergedValue, onChangeRef]); // Effect of reset value to `undefined`
var firstRenderRef = react__WEBPACK_IMPORTED_MODULE_1__["useRef"](true);
react__WEBPACK_IMPORTED_MODULE_1__["useEffect"](function () {
if (firstRenderRef.current) {
firstRenderRef.current = false;
return;
}
if (value === undefined) {
setInnerValue(value);
}
}, [value]);
return [mergedValue, triggerChange];
}
/***/ }),
/***/ "9ZNV":
/*!**********************************************!*\
!*** ./src/components/FixedButton/index.tsx ***!
\**********************************************/
/*! exports provided: FixedButton */
/*! exports used: FixedButton */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FixedButton; });
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/extends */ "0Owb");
/* harmony import */ var antd_es_button_style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd/es/button/style */ "+L6B");
/* harmony import */ var antd_es_button__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! antd/es/button */ "2/Rp");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "cDcd");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./index.less?modules */ "UUDw");
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_index_less_modules__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! classnames */ "TSYQ");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_5__);
var FixedButton = function FixedButton(_ref) {
var _ref$cancelText = _ref.cancelText,
cancelText = _ref$cancelText === void 0 ? '取消' : _ref$cancelText,
_ref$okText = _ref.okText,
okText = _ref$okText === void 0 ? '确定' : _ref$okText,
_ref$loading = _ref.loading,
loading = _ref$loading === void 0 ? false : _ref$loading,
_ref$hasOkBtn = _ref.hasOkBtn,
hasOkBtn = _ref$hasOkBtn === void 0 ? true : _ref$hasOkBtn,
_ref$okButtonProps = _ref.okButtonProps,
okButtonProps = _ref$okButtonProps === void 0 ? {} : _ref$okButtonProps,
_ref$onCancel = _ref.onCancel,
onCancel = _ref$onCancel === void 0 ? function () {} : _ref$onCancel,
_ref$onOk = _ref.onOk,
onOk = _ref$onOk === void 0 ? function () {} : _ref$onOk,
_ref$className = _ref.className,
className = _ref$className === void 0 ? '' : _ref$className;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
className: classnames__WEBPACK_IMPORTED_MODULE_5___default()(_index_less_modules__WEBPACK_IMPORTED_MODULE_4___default.a.buttonFixed, className)
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_4___default.a.buttonWrap
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(antd_es_button__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"], {
size: "large",
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_4___default.a.button, " mr20"),
onClick: onCancel
}, cancelText), hasOkBtn && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(antd_es_button__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"], Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({
size: "large",
type: "primary",
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_4___default.a.button, " mr20"),
loading: loading,
onClick: onOk
}, okButtonProps), okText)));
};
/***/ }),
/***/ "DaK5":
/*!************************************************!*\
!*** ./src/pages/Problemset/Preview/index.tsx ***!
\************************************************/
/*! exports provided: formatTypeNameToDefaultScore, default */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./src/.umi-production/core/routes.ts (referenced with import()) */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatTypeNameToDefaultScore", function() { return formatTypeNameToDefaultScore; });
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/extends */ "0Owb");
/* harmony import */ var antd_es_breadcrumb_style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd/es/breadcrumb/style */ "sPJy");
/* harmony import */ var antd_es_breadcrumb__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! antd/es/breadcrumb */ "bE4q");
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/asyncToGenerator */ "9og8");
/* harmony import */ var antd_es_input_number_style__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd/es/input-number/style */ "giR+");
/* harmony import */ var antd_es_input_number__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! antd/es/input-number */ "fyUT");
/* harmony import */ var antd_es_modal_style__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! antd/es/modal/style */ "2qtc");
/* harmony import */ var antd_es_modal__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! antd/es/modal */ "kLXV");
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */ "k1fw");
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */ "tJVT");
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties */ "PpiC");
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator */ "WmNS");
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_11__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react */ "cDcd");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_12__);
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! umi */ "9kvl");
/* harmony import */ var react_beautiful_dnd__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! react-beautiful-dnd */ "ngQI");
/* harmony import */ var _components_EcListItems_Problemset_Card__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/components/EcListItems/Problemset/Card */ "NNiE");
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./index.less?modules */ "tKIZ");
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_index_less_modules__WEBPACK_IMPORTED_MODULE_16__);
/* harmony import */ var _components_FixedButton__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/components/FixedButton */ "9ZNV");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! lodash */ "LvDl");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_18__);
/* harmony import */ var _service_problemset__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @/service/problemset */ "WCUW");
var formatTypeNameToDefaultScore = function formatTypeNameToDefaultScore(typeName) {
var mapping = {
'单选题': 2,
'多选题': 5,
'填空题': 2,
'判断题': 2,
'简答题': 10,
'编程题': 10,
'实训题': 5,
'组合题': 10
};
return mapping[typeName] || 0;
};
var Preview = function Preview(_ref) {
var _problemsetPreview$pa, _problemsetPreview$pa2, _problemsetPreview$pa3, _problemsetPreview$pa4;
var problemsetPreview = _ref.problemsetPreview,
user = _ref.user,
globalSetting = _ref.globalSetting,
loading = _ref.loading,
dispatch = _ref.dispatch,
props = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_10__[/* default */ "a"])(_ref, ["problemsetPreview", "user", "globalSetting", "loading", "dispatch"]);
var _useState = Object(react__WEBPACK_IMPORTED_MODULE_12__["useState"])(),
_useState2 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"])(_useState, 2),
inMouseId = _useState2[0],
setInMouseId = _useState2[1];
var _useState3 = Object(react__WEBPACK_IMPORTED_MODULE_12__["useState"])(),
_useState4 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"])(_useState3, 2),
inMouseBatchType = _useState4[0],
setInMouseBatchType = _useState4[1];
var score = Object(react__WEBPACK_IMPORTED_MODULE_12__["useRef"])();
console.log(problemsetPreview, 'problemsetPreview');
Object(react__WEBPACK_IMPORTED_MODULE_12__["useEffect"])(function () {
dispatch({
type: 'globalSetting/footerToggle',
payload: false
});
return function () {
dispatch({
type: 'globalSetting/footerToggle',
payload: true
});
};
}, []);
Object(react__WEBPACK_IMPORTED_MODULE_12__["useEffect"])(function () {
getPaperData();
}, []);
var getPaperData = function getPaperData() {
dispatch({
type: 'problemsetPreview/getPaperData'
});
};
var handleSetScore = function handleSetScore(id, typeName) {
var shixun = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
var originScore = arguments.length > 3 ? arguments[3] : undefined;
var param = arguments.length > 4 ? arguments[4] : undefined;
var cloneData = lodash__WEBPACK_IMPORTED_MODULE_18___default.a.cloneDeep(param);
var shixunData = lodash__WEBPACK_IMPORTED_MODULE_18___default.a.cloneDeep(shixun).map(function (item) {
return Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_8__[/* default */ "a"])(Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_8__[/* default */ "a"])({}, item), {}, {
challenge_score: item.challenge_score || 5
});
});
score.current = originScore || formatTypeNameToDefaultScore(typeName);
if (typeName === "实训题") {
return antd_es_modal__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"].confirm({
centered: true,
width: 530,
title: '设置分数',
content: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.shixunModal
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("div", null, "\u5173\u5361\uFF1A"), shixunData === null || shixunData === void 0 ? void 0 : shixunData.map(function (item, index) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.shixunScore
}, index + 1, "\u3001", item.challenge_name, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("div", {
style: {
minWidth: '130px'
}
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement(antd_es_input_number__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"], {
defaultValue: item.challenge_score,
min: 1,
onChange: function onChange(value) {
item.challenge_score = value;
}
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("span", {
className: "ml5"
}, "\u5206/\u9898")));
})),
okText: '确认',
cancelText: '取消',
onOk: function () {
var _onOk = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])( /*#__PURE__*/_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_11___default.a.mark(function _callee() {
return _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_11___default.a.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return Object(_service_problemset__WEBPACK_IMPORTED_MODULE_19__[/* setChallengeScore */ "K"])({
id: id,
challenge_scores: shixunData.map(function (item) {
return {
challenge_id: item.challenge_id,
score: item.challenge_score
};
})
});
case 2:
score.current = null;
getPaperData();
case 4:
case "end":
return _context.stop();
}
}
}, _callee);
}));
function onOk() {
return _onOk.apply(this, arguments);
}
return onOk;
}()
});
}
if (typeName === "组合题") {
var _cloneData$sub_questi;
return antd_es_modal__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"].confirm({
centered: true,
width: 530,
title: '设置分数',
content: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.shixunModal,
style: {
maxHeight: 200,
overflow: 'auto'
}
}, cloneData === null || cloneData === void 0 ? void 0 : (_cloneData$sub_questi = cloneData.sub_questions) === null || _cloneData$sub_questi === void 0 ? void 0 : _cloneData$sub_questi.map(function (item, index) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.shixunScore
}, "\u7B2C", index + 1, "\u5C0F\u9898", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("div", {
style: {
minWidth: '130px'
}
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement(antd_es_input_number__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"], {
defaultValue: item.score,
min: 1,
onChange: function onChange(value) {
item.score = value;
}
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("span", {
className: "ml5"
}, "\u5206")));
})),
okText: '确认',
cancelText: '取消',
onOk: function () {
var _onOk2 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])( /*#__PURE__*/_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_11___default.a.mark(function _callee2() {
var _cloneData$sub_questi2;
return _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_11___default.a.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
_context2.next = 2;
return Object(_service_problemset__WEBPACK_IMPORTED_MODULE_19__[/* setCombinationScore */ "L"])({
id: id,
subs: cloneData === null || cloneData === void 0 ? void 0 : (_cloneData$sub_questi2 = cloneData.sub_questions) === null || _cloneData$sub_questi2 === void 0 ? void 0 : _cloneData$sub_questi2.map(function (item) {
return {
basket_id: item.basket_id,
score: item.score
};
})
});
case 2:
score.current = null;
getPaperData();
case 4:
case "end":
return _context2.stop();
}
}
}, _callee2);
}));
function onOk() {
return _onOk2.apply(this, arguments);
}
return onOk;
}()
});
}
antd_es_modal__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"].confirm({
centered: true,
title: '设置分数',
content: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("div", {
className: ''
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("span", null, "\u672C\u9898\u5206\u503C\uFF1A"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement(antd_es_input_number__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"], {
min: 1,
defaultValue: score.current,
onChange: function onChange(value) {
score.current = value;
}
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("span", {
className: "ml5"
}, "\u5206/\u9898"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("br", null), typeName === "填空题" && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("div", {
style: {
color: 'rgb(255, 0, 0)'
}
}, "\u6BCF\u7A7A\u5206\u503C\u6309\u6BCF\u9898\u5206\u503C\u53D6\u5E73\u5747\u5206\u8BA1\u7B97")),
okText: '确认',
cancelText: '取消',
onOk: function () {
var _onOk3 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])( /*#__PURE__*/_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_11___default.a.mark(function _callee3() {
return _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_11___default.a.wrap(function _callee3$(_context3) {
while (1) {
switch (_context3.prev = _context3.next) {
case 0:
_context3.next = 2;
return dispatch({
type: 'problemsetPreview/setScore',
payload: {
id: id,
score: score.current
}
});
case 2:
score.current = null;
getPaperData();
case 4:
case "end":
return _context3.stop();
}
}
}, _callee3);
}));
function onOk() {
return _onOk3.apply(this, arguments);
}
return onOk;
}()
});
};
var handleDelete = function handleDelete(id) {
antd_es_modal__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"].confirm({
centered: true,
title: '提示',
content: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.modal
}, "\u786E\u8BA4\u5220\u9664\u8BE5\u8BD5\u9898\uFF1F"),
okText: '确认',
cancelText: '取消',
onOk: function () {
var _onOk4 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])( /*#__PURE__*/_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_11___default.a.mark(function _callee4() {
return _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_11___default.a.wrap(function _callee4$(_context4) {
while (1) {
switch (_context4.prev = _context4.next) {
case 0:
_context4.next = 2;
return dispatch({
type: 'problemsetPreview/handleDelete',
payload: {
id: id
}
});
case 2:
getPaperData();
case 3:
case "end":
return _context4.stop();
}
}
}, _callee4);
}));
function onOk() {
return _onOk4.apply(this, arguments);
}
return onOk;
}()
});
};
var handleBatchSetScore = function handleBatchSetScore(type, typeName) {
score.current = formatTypeNameToDefaultScore(typeName);
antd_es_modal__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"].confirm({
centered: true,
title: '批量设置分数',
content: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("div", {
className: ''
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("span", null, typeName === "组合题" ? '组合题中的每小题' : typeName, "\uFF1A"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement(antd_es_input_number__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"], {
min: 1,
defaultValue: score.current,
onChange: function onChange(value) {
score.current = value;
}
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("span", {
className: "ml5"
}, "\u5206/\u9898"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("br", null), typeName === "填空题" && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("div", {
style: {
color: 'rgb(255, 0, 0)'
}
}, "\u6BCF\u7A7A\u5206\u503C\u6309\u6BCF\u9898\u5206\u503C\u53D6\u5E73\u5747\u5206\u8BA1\u7B97")),
okText: '确认',
cancelText: '取消',
onOk: function () {
var _onOk5 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])( /*#__PURE__*/_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_11___default.a.mark(function _callee5() {
return _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_11___default.a.wrap(function _callee5$(_context5) {
while (1) {
switch (_context5.prev = _context5.next) {
case 0:
_context5.next = 2;
return dispatch({
type: 'problemsetPreview/batchSetScore',
payload: {
item_type: type,
score: score.current
}
});
case 2:
score.current = null;
getPaperData();
case 4:
case "end":
return _context5.stop();
}
}
}, _callee5);
}));
function onOk() {
return _onOk5.apply(this, arguments);
}
return onOk;
}()
});
};
var handleBatchDelete = function handleBatchDelete(type) {
antd_es_modal__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"].confirm({
centered: true,
title: '提示',
content: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.modalColumn
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("p", null, "\u5220\u9664\u5927\u9898\uFF0C\u5C06\u5220\u9664\u8BE5\u5927\u9898\u4E0B\u6240\u6709\u5C0F\u9898"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("p", null, "\u786E\u8BA4\u5220\u9664\u8BE5\u5927\u9898\uFF1F")),
okText: '确认',
cancelText: '取消',
onOk: function () {
var _onOk6 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])( /*#__PURE__*/_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_11___default.a.mark(function _callee6() {
return _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_11___default.a.wrap(function _callee6$(_context6) {
while (1) {
switch (_context6.prev = _context6.next) {
case 0:
_context6.next = 2;
return dispatch({
type: 'problemsetPreview/batchDelete',
payload: {
item_type: type
}
});
case 2:
getPaperData();
case 3:
case "end":
return _context6.stop();
}
}
}, _callee6);
}));
function onOk() {
return _onOk6.apply(this, arguments);
}
return onOk;
}()
});
};
var handleDragEnd = /*#__PURE__*/function () {
var _ref2 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])( /*#__PURE__*/_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_11___default.a.mark(function _callee7(data, paperItem) {
var id, position, res;
return _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_11___default.a.wrap(function _callee7$(_context7) {
while (1) {
switch (_context7.prev = _context7.next) {
case 0:
if (!(!data.destination || !data.source)) {
_context7.next = 2;
break;
}
return _context7.abrupt("return");
case 2:
id = paperItem.questions[data.source.index].id;
position = data.destination.index + 1;
_context7.next = 6;
return dispatch({
type: 'problemsetPreview/adjustPosition',
payload: {
id: id,
position: position
}
});
case 6:
res = _context7.sent;
if (!(res.status === -1)) {
_context7.next = 9;
break;
}
return _context7.abrupt("return");
case 9:
getPaperData();
case 10:
case "end":
return _context7.stop();
}
}
}, _callee7);
}));
return function handleDragEnd(_x, _x2) {
return _ref2.apply(this, arguments);
};
}();
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("section", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.bg
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement(antd_es_breadcrumb__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"], {
className: "mt30",
separator: ">"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement(antd_es_breadcrumb__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].Item, null, "\u8BD5\u9898\u5E93"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement(antd_es_breadcrumb__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].Item, {
href: "/problemset"
}, "\u4EBA\u5DE5\u7EC4\u5377"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement(antd_es_breadcrumb__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].Item, null, "\u8BD5\u5377\u9884\u89C8")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.wrap
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("div", {
className: "pt20 pb20"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("div", {
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.flexRow, " ").concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.flexJustifyBetween)
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("span", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.questionNumber
}, "\u9898\u6570\uFF1A", (_problemsetPreview$pa = problemsetPreview.paperData) === null || _problemsetPreview$pa === void 0 ? void 0 : _problemsetPreview$pa.all_questions_count), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("span", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.score
}, "\u603B\u5206\uFF1A", (_problemsetPreview$pa2 = problemsetPreview.paperData) === null || _problemsetPreview$pa2 === void 0 ? void 0 : _problemsetPreview$pa2.all_score)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.selectTopicButton,
onClick: function onClick() {
return umi__WEBPACK_IMPORTED_MODULE_13__[/* history */ "d"].push('/problemset/preview_select');
}
}, "\u7EE7\u7EED\u9009\u9898")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.line
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.dragTip
}, "\u5C0F\u9898\u4E4B\u95F4\u53EF\u4EE5\u62D6\u52A8\u6392\u5E8F"), (_problemsetPreview$pa3 = problemsetPreview.paperData) === null || _problemsetPreview$pa3 === void 0 ? void 0 : (_problemsetPreview$pa4 = _problemsetPreview$pa3.questionList) === null || _problemsetPreview$pa4 === void 0 ? void 0 : _problemsetPreview$pa4.map(function (paperItem, paperKey) {
var inMouseBatch = paperItem.type === inMouseBatchType;
console.log(paperItem, 'paperItem');
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("div", {
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.relative, " mt20 mb20"),
key: paperKey
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("div", {
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.typeActive, " ").concat(inMouseBatch ? _index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.mouseTypeActive : ''),
onMouseEnter: function onMouseEnter() {
setInMouseBatchType(paperItem.type);
setInMouseId(null);
}
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("span", {
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.typeName, " ").concat(inMouseBatch ? 'ml20' : '')
}, paperItem.number, "\u3001", paperItem.name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("span", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.typeNumber
}, "\uFF08\u5171", paperItem.questions_count, "\u9898\uFF0C", (paperItem === null || paperItem === void 0 ? void 0 : paperItem.type) === "COMBINATION" ? "\u5305\u542B".concat(paperItem === null || paperItem === void 0 ? void 0 : paperItem.sub_questions_count, "\u5C0F\u9898\uFF0C") : '', "\u5171", paperItem.questions_score, "\u5206\uFF09")), inMouseBatch && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("div", {
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.typeAction, " ").concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.flexRow)
}, paperItem.type !== 'PRACTICAL' && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.setScore,
onClick: function onClick() {
return handleBatchSetScore(paperItem.type, paperItem.name);
}
}, "\u6279\u91CF\u8BBE\u7F6E\u5F97\u5206"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_16___default.a.delete,
onClick: function onClick() {
return handleBatchDelete(paperItem.type);
}
}, "\u5220\u9664")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement(react_beautiful_dnd__WEBPACK_IMPORTED_MODULE_14__[/* DragDropContext */ "a"], {
onDragEnd: function onDragEnd(result) {
return handleDragEnd(result, paperItem);
}
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement(react_beautiful_dnd__WEBPACK_IMPORTED_MODULE_14__[/* Droppable */ "c"], {
droppableId: paperKey.toString()
}, function (provided, snapshot) {
var _paperItem$questions;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("div", Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({
className: "mt20",
ref: provided.innerRef
}, provided.droppableProps, {
onScroll: function onScroll() {}
}), (_paperItem$questions = paperItem.questions) === null || _paperItem$questions === void 0 ? void 0 : _paperItem$questions.map(function (questionItem, qeustionKey) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement(react_beautiful_dnd__WEBPACK_IMPORTED_MODULE_14__[/* Draggable */ "b"], {
draggableId: questionItem.id.toString(),
index: qeustionKey,
key: questionItem.id
}, function (provided) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement("div", Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({
ref: provided.innerRef
}, provided.draggableProps, provided.dragHandleProps), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement(_components_EcListItems_Problemset_Card__WEBPACK_IMPORTED_MODULE_15__[/* default */ "a"], {
index: qeustionKey,
typeName: paperItem.name,
type: paperItem.type,
data: questionItem,
inMouseId: inMouseId,
onSetScore: handleSetScore,
onDelete: handleDelete,
onMouseEnter: function onMouseEnter(id) {
setInMouseId(id);
setInMouseBatchType(null);
}
}));
});
}));
})));
}))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_12___default.a.createElement(_components_FixedButton__WEBPACK_IMPORTED_MODULE_17__[/* FixedButton */ "a"], {
okText: "\u4FDD\u5B58\u8BD5\u5377",
onCancel: function onCancel() {
return umi__WEBPACK_IMPORTED_MODULE_13__[/* history */ "d"].replace('/problemset');
},
onOk: function onOk() {
return umi__WEBPACK_IMPORTED_MODULE_13__[/* history */ "d"].push('/problemset/preview_new');
}
}));
};
/* harmony default export */ __webpack_exports__["default"] = (Object(umi__WEBPACK_IMPORTED_MODULE_13__[/* connect */ "a"])(function (_ref3) {
var problemsetPreview = _ref3.problemsetPreview,
user = _ref3.user,
loading = _ref3.loading,
globalSetting = _ref3.globalSetting;
return {
problemsetPreview: problemsetPreview,
user: user,
globalSetting: globalSetting,
loading: loading.effects
};
})(Preview));
/***/ }),
/***/ "NNiE":
/*!**************************************************************!*\
!*** ./src/components/EcListItems/Problemset/Card/index.tsx ***!
\**************************************************************/
/*! exports provided: default */
/*! exports used: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var antd_es_radio_style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! antd/es/radio/style */ "7Kak");
/* harmony import */ var antd_es_radio__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd/es/radio */ "9yH6");
/* harmony import */ var _Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */ "tJVT");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "cDcd");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _components_RenderHtml__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/RenderHtml */ "9Bee");
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./index.less?modules */ "+M/w");
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_index_less_modules__WEBPACK_IMPORTED_MODULE_5__);
var tagDotList = ['A.', 'B.', 'C.', 'D.', 'E.', 'F.', 'G.', 'H.', 'I.', 'J.', 'K.', 'L.', 'M.', 'N.', 'O.', 'P.', 'Q.', 'R.', 'S.', 'T.', 'U.', 'V.', 'W.', 'X.', 'Y.', 'Z.'];
var Card = function Card(_ref) {
var index = _ref.index,
typeName = _ref.typeName,
type = _ref.type,
_ref$data = _ref.data,
data = _ref$data === void 0 ? {} : _ref$data,
inMouseId = _ref.inMouseId,
isshow = _ref.isshow,
_ref$onSetScore = _ref.onSetScore,
onSetScore = _ref$onSetScore === void 0 ? function () {} : _ref$onSetScore,
_ref$onDelete = _ref.onDelete,
onDelete = _ref$onDelete === void 0 ? function () {} : _ref$onDelete,
_ref$onMouseEnter = _ref.onMouseEnter,
_onMouseEnter = _ref$onMouseEnter === void 0 ? function () {} : _ref$onMouseEnter;
var _useState = Object(react__WEBPACK_IMPORTED_MODULE_3__["useState"])(false),
_useState2 = Object(_Users_dingyongkang_Documents_workspace_zhiqing_educoder_node_modules_umijs_babel_preset_umi_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(_useState, 2),
isopen = _useState2[0],
setisopen = _useState2[1];
var renderSingleOrMultiple = function renderSingleOrMultiple() {
var _data$choices;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5___default.a.answerWrap
}, data === null || data === void 0 ? void 0 : (_data$choices = data.choices) === null || _data$choices === void 0 ? void 0 : _data$choices.map(function (item, index) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_5___default.a.flexRow, " mt15"),
key: index
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
style: {
lineHeight: '24px',
flexShrink: 0
}
}, tagDotList[index]), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_5___default.a.answer, " ml5")
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"], {
value: item === null || item === void 0 ? void 0 : item.choice_text
})));
}));
};
var renderJudgment = function renderJudgment() {
var _data$choices2;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5___default.a.answerWrap
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_5___default.a.flexRow, " mt15")
}, data === null || data === void 0 ? void 0 : (_data$choices2 = data.choices) === null || _data$choices2 === void 0 ? void 0 : _data$choices2.map(function (item, index) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(antd_es_radio__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"], {
disabled: true,
key: index
}, item === null || item === void 0 ? void 0 : item.choice_text);
})));
};
var renderProgram = function renderProgram() {
var _data$program_attr;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5___default.a.answerWrap
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_5___default.a.flexRow, " mt15")
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"], {
value: data === null || data === void 0 ? void 0 : (_data$program_attr = data.program_attr) === null || _data$program_attr === void 0 ? void 0 : _data$program_attr.description
})));
};
var renderCompletion = function renderCompletion() {
var _data$standard_answer;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5___default.a.answerWrap
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_5___default.a.flexColumn, " mt15")
}, data === null || data === void 0 ? void 0 : (_data$standard_answer = data.standard_answer) === null || _data$standard_answer === void 0 ? void 0 : _data$standard_answer.map(function (item, index) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"], {
key: index,
value: "\u7B54\u6848\uFF08\u586B\u7A7A".concat(item.position, "\uFF09\uFF1A").concat(item.answer_text.join("、"))
});
})));
};
var renderSubjective = function renderSubjective() {
var _data$answer_texts;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5___default.a.answerWrap
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
className: "mt15"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", null, "\u7B54\u6848\uFF1A"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"], {
value: data === null || data === void 0 ? void 0 : (_data$answer_texts = data.answer_texts) === null || _data$answer_texts === void 0 ? void 0 : _data$answer_texts[0]
})));
};
var renderShixun = function renderShixun() {
var _data$shixun;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5___default.a.answerWrap
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
className: "mt10"
}, "\u5173\u5361"), data === null || data === void 0 ? void 0 : (_data$shixun = data.shixun) === null || _data$shixun === void 0 ? void 0 : _data$shixun.map(function (item, index) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
className: "mt10 font14"
}, index + 1, ". ", item === null || item === void 0 ? void 0 : item.challenge_name);
}));
};
var renderCombination = function renderCombination() {
var _data$sub_questions;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5___default.a.answerWrap,
style: {
display: isopen && 'none'
}
}, data === null || data === void 0 ? void 0 : (_data$sub_questions = data.sub_questions) === null || _data$sub_questions === void 0 ? void 0 : _data$sub_questions.map(function (e, i) {
var _e$choices;
var str = "".concat(index + 1, ".").concat(i + 1, "\uFF08\u5355\u9009\u9898\uFF09\uFF08").concat(e.score, "\u5206\uFF09");
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_3__["Fragment"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5___default.a.titleWrap,
style: {
marginTop: 16
}
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"], {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5___default.a.titleHtml,
value: str + e.name
})), e === null || e === void 0 ? void 0 : (_e$choices = e.choices) === null || _e$choices === void 0 ? void 0 : _e$choices.map(function (item, index) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_5___default.a.flexRow, " mt15"),
key: index
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
style: {
lineHeight: '24px',
flexShrink: 0
}
}, tagDotList[index]), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_5___default.a.answer, " ml5")
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"], {
value: item === null || item === void 0 ? void 0 : item.choice_text
})));
}));
}));
};
var renderAnswer = function renderAnswer() {
var mapping = {
'SINGLE': renderSingleOrMultiple,
'MULTIPLE': renderSingleOrMultiple,
'JUDGMENT': renderJudgment,
'PROGRAM': renderProgram,
'COMPLETION': renderCompletion,
'SUBJECTIVE': renderSubjective,
'PRACTICAL': renderShixun,
'COMBINATION': renderCombination
};
return mapping[type] ? mapping[type]() : null;
};
var getDomString = function getDomString(data, i) {
var _data$sub_questions2;
var str = "".concat(i + 1, "\u3001\uFF08").concat((data === null || data === void 0 ? void 0 : data.item_type) === "combination" ? "\u5171".concat(data === null || data === void 0 ? void 0 : (_data$sub_questions2 = data.sub_questions) === null || _data$sub_questions2 === void 0 ? void 0 : _data$sub_questions2.length, "\u5C0F\u9898\uFF0C") : '').concat(data.score, "\u5206\uFF09 ");
return str;
};
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
onMouseEnter: function onMouseEnter() {
return _onMouseEnter(data.id);
}
}, inMouseId === data.id && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5___default.a.action
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5___default.a.setScore,
onClick: function onClick() {
return onSetScore(data.id, typeName, data === null || data === void 0 ? void 0 : data.shixun, data.score, data);
}
}, "\u8BBE\u7F6E\u5F97\u5206"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5___default.a.delete,
onClick: function onClick() {
return onDelete(data.id);
}
}, "\u5220\u9664")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5___default.a.content
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5___default.a.titleWrap,
style: {
justifyContent: 'space-between'
}
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"], {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_5___default.a.titleHtml,
value: getDomString(data, index) + ((data === null || data === void 0 ? void 0 : data.item_type) === "combination" ? "\uFF08\u9898\u5E72\uFF09" : '') + (data.name || (data === null || data === void 0 ? void 0 : data.shixun_name))
}), (data === null || data === void 0 ? void 0 : data.item_type) === "combination" && !isshow && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("span", {
onClick: function onClick(e) {
setisopen(!isopen);
},
style: {
textAlign: 'end',
flexShrink: 0
}
}, isopen ? '展开' : '收起')), renderAnswer()));
};
/* harmony default export */ __webpack_exports__["a"] = (Card);
/***/ }),
/***/ "UUDw":
/*!*******************************************************!*\
!*** ./src/components/FixedButton/index.less?modules ***!
\*******************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
module.exports = {"buttonFixed":"buttonFixed___2zLVJ","button":"button___-JgFH","buttonWrap":"buttonWrap___aZhhk"};
/***/ }),
/***/ "dmUQ":
/*!**************************************************************!*\
!*** ./node_modules/rc-input-number/es/index.js + 1 modules ***!
\**************************************************************/
/*! exports provided: default */
/*! exports used: default */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/KeyCode.js */
/*! ModuleConcatenation bailout: Cannot concat with external "window.React" (<- Module is not an ECMAScript module) */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
var objectWithoutProperties = __webpack_require__("Ff2n");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
var defineProperty = __webpack_require__("rePB");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
var classCallCheck = __webpack_require__("1OyB");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
var createClass = __webpack_require__("vuIU");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
var inherits = __webpack_require__("Ji7U");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
var possibleConstructorReturn = __webpack_require__("md7G");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
var getPrototypeOf = __webpack_require__("foSv");
// EXTERNAL MODULE: external "window.React"
var external_window_React_ = __webpack_require__("cDcd");
var external_window_React_default = /*#__PURE__*/__webpack_require__.n(external_window_React_);
// EXTERNAL MODULE: ./node_modules/classnames/index.js
var classnames = __webpack_require__("TSYQ");
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
// EXTERNAL MODULE: ./node_modules/rc-util/es/KeyCode.js
var KeyCode = __webpack_require__("4IlW");
// CONCATENATED MODULE: ./node_modules/rc-input-number/es/InputNumber.js
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
/* eslint-disable react/prop-types */
function noop() {}
function preventDefault(e) {
e.preventDefault();
}
var defaultParser = function defaultParser(input) {
return input.replace(/[^\w.-]+/g, '');
};
/**
* When click and hold on a button - the speed of auto changin the value.
*/
var SPEED = 200;
/**
* When click and hold on a button - the delay before auto changin the value.
*/
var DELAY = 600;
/**
* Max Safe Integer -- on IE this is not available, so manually set the number in that case.
* The reason this is used, instead of Infinity is because numbers above the MSI are unstable
*/
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || Math.pow(2, 53) - 1;
var isValidProps = function isValidProps(value) {
return value !== undefined && value !== null;
};
var isEqual = function isEqual(oldValue, newValue) {
return newValue === oldValue || typeof newValue === 'number' && typeof oldValue === 'number' && isNaN(newValue) && isNaN(oldValue);
};
var InputNumber_InputNumber = /*#__PURE__*/function (_React$Component) {
Object(inherits["a" /* default */])(InputNumber, _React$Component);
var _super = _createSuper(InputNumber);
function InputNumber(props) {
var _this;
Object(classCallCheck["a" /* default */])(this, InputNumber);
_this = _super.call(this, props);
_this.onKeyDown = function (e) {
var _this$props = _this.props,
onKeyDown = _this$props.onKeyDown,
onPressEnter = _this$props.onPressEnter;
if (e.keyCode === KeyCode["a" /* default */].UP) {
var ratio = _this.getRatio(e);
_this.up(e, ratio, null);
_this.stop();
} else if (e.keyCode === KeyCode["a" /* default */].DOWN) {
var _ratio = _this.getRatio(e);
_this.down(e, _ratio, null);
_this.stop();
} else if (e.keyCode === KeyCode["a" /* default */].ENTER && onPressEnter) {
onPressEnter(e);
} // Trigger user key down
_this.recordCursorPosition();
_this.lastKeyCode = e.keyCode;
if (onKeyDown) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
onKeyDown.apply(void 0, [e].concat(args));
}
};
_this.onKeyUp = function (e) {
var onKeyUp = _this.props.onKeyUp;
_this.stop();
_this.recordCursorPosition(); // Trigger user key up
if (onKeyUp) {
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
args[_key2 - 1] = arguments[_key2];
}
onKeyUp.apply(void 0, [e].concat(args));
}
};
_this.onChange = function (e) {
var onChange = _this.props.onChange;
if (_this.state.focused) {
_this.inputting = true;
}
_this.rawInput = _this.props.parser(_this.getValueFromEvent(e));
_this.setState({
inputValue: _this.rawInput
});
onChange(_this.toNumber(_this.rawInput)); // valid number or invalid string
};
_this.onMouseUp = function () {
var onMouseUp = _this.props.onMouseUp;
_this.recordCursorPosition();
if (onMouseUp) {
onMouseUp.apply(void 0, arguments);
}
};
_this.onFocus = function () {
var _this$props2;
_this.setState({
focused: true
});
(_this$props2 = _this.props).onFocus.apply(_this$props2, arguments);
};
_this.onBlur = function () {
var onBlur = _this.props.onBlur;
_this.inputting = false;
_this.setState({
focused: false
});
var value = _this.getCurrentValidValue(_this.state.inputValue);
var newValue = _this.setValue(value, noop);
if (onBlur) {
var originValue = _this.input.value;
var displayValue = _this.getInputDisplayValue({
focus: false,
value: newValue
});
_this.input.value = displayValue ? Number(displayValue) : displayValue;
onBlur.apply(void 0, arguments);
_this.input.value = originValue;
}
};
_this.getRatio = function (e) {
var ratio = 1;
if (e.metaKey || e.ctrlKey) {
ratio = 0.1;
} else if (e.shiftKey) {
ratio = 10;
}
return ratio;
};
_this.getFullNum = function (num) {
if (isNaN(num)) {
return num;
}
if (!/e/i.test(String(num))) {
return num;
}
return Number(num).toFixed(18).replace(/\.?0+$/, '');
};
_this.getPrecision = function (value) {
if (isValidProps(_this.props.precision)) {
return _this.props.precision;
}
var valueString = String(value);
if (valueString.indexOf('e-') >= 0) {
return parseInt(valueString.slice(valueString.indexOf('e-') + 2), 10);
}
var precision = 0;
if (valueString.indexOf('.') >= 0) {
precision = valueString.length - valueString.indexOf('.') - 1;
}
return precision;
};
_this.getInputDisplayValue = function (state) {
var _ref = state || _this.state,
focused = _ref.focused,
inputValue = _ref.inputValue,
value = _ref.value;
var inputDisplayValue;
if (focused) {
inputDisplayValue = inputValue;
} else {
inputDisplayValue = _this.toPrecisionAsStep(value);
}
if (inputDisplayValue === undefined || inputDisplayValue === null) {
inputDisplayValue = '';
}
var inputDisplayValueFormat = _this.formatWrapper(inputDisplayValue);
if (isValidProps(_this.props.decimalSeparator)) {
inputDisplayValueFormat = inputDisplayValueFormat.toString().replace('.', _this.props.decimalSeparator);
}
return inputDisplayValueFormat;
};
_this.recordCursorPosition = function () {
// Record position
try {
_this.cursorStart = _this.input.selectionStart;
_this.cursorEnd = _this.input.selectionEnd;
_this.currentValue = _this.input.value;
_this.cursorBefore = _this.input.value.substring(0, _this.cursorStart);
_this.cursorAfter = _this.input.value.substring(_this.cursorEnd);
} catch (e) {// Fix error in Chrome:
// Failed to read the 'selectionStart' property from 'HTMLInputElement'
// http://stackoverflow.com/q/21177489/3040605
}
};
_this.restoreByAfter = function (str) {
if (str === undefined) return false;
var fullStr = _this.input.value;
var index = fullStr.lastIndexOf(str);
if (index === -1) return false;
var prevCursorPos = _this.cursorBefore.length;
if (_this.lastKeyCode === KeyCode["a" /* default */].DELETE && _this.cursorBefore.charAt(prevCursorPos - 1) === str[0]) {
_this.fixCaret(prevCursorPos, prevCursorPos);
return true;
}
if (index + str.length === fullStr.length) {
_this.fixCaret(index, index);
return true;
}
return false;
};
_this.partRestoreByAfter = function (str) {
if (str === undefined) return false; // For loop from full str to the str with last char to map. e.g. 123
// -> 123
// -> 23
// -> 3
return Array.prototype.some.call(str, function (_, start) {
var partStr = str.substring(start);
return _this.restoreByAfter(partStr);
});
}; // '1.' '1x' 'xx' '' => are not complete numbers
_this.isNotCompleteNumber = function (num) {
return isNaN(num) || num === '' || num === null || num && num.toString().indexOf('.') === num.toString().length - 1;
};
_this.stop = function () {
if (_this.autoStepTimer) {
clearTimeout(_this.autoStepTimer);
}
};
_this.down = function (e, ratio, recursive) {
_this.pressingUpOrDown = true;
_this.step('down', e, ratio, recursive);
};
_this.up = function (e, ratio, recursive) {
_this.pressingUpOrDown = true;
_this.step('up', e, ratio, recursive);
};
_this.saveInput = function (node) {
_this.input = node;
};
var value = props.value;
if (value === undefined) {
value = props.defaultValue;
}
_this.state = {
focused: props.autoFocus
};
var validValue = _this.getValidValue(_this.toNumber(value));
_this.state = _objectSpread(_objectSpread({}, _this.state), {}, {
inputValue: _this.toPrecisionAsStep(validValue),
value: validValue
});
return _this;
}
Object(createClass["a" /* default */])(InputNumber, [{
key: "componentDidMount",
value: function componentDidMount() {
this.componentDidUpdate(null);
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps) {
var _this$props3 = this.props,
value = _this$props3.value,
onChange = _this$props3.onChange,
max = _this$props3.max,
min = _this$props3.min;
var focused = this.state.focused; // Don't trigger in componentDidMount
if (prevProps) {
if (!isEqual(prevProps.value, value) || !isEqual(prevProps.max, max) || !isEqual(prevProps.min, min)) {
var validValue = focused ? value : this.getValidValue(value);
var nextInputValue;
if (this.pressingUpOrDown) {
nextInputValue = validValue;
} else if (this.inputting) {
nextInputValue = this.rawInput;
} else {
nextInputValue = this.toPrecisionAsStep(validValue);
}
this.setState({
// eslint-disable-line
value: validValue,
inputValue: nextInputValue
});
} // Trigger onChange when max or min change
// https://github.com/ant-design/ant-design/issues/11574
var nextValue = 'value' in this.props ? value : this.state.value; // ref: null < 20 === true
// https://github.com/ant-design/ant-design/issues/14277
if ('max' in this.props && prevProps.max !== max && typeof nextValue === 'number' && nextValue > max && onChange) {
onChange(max);
}
if ('min' in this.props && prevProps.min !== min && typeof nextValue === 'number' && nextValue < min && onChange) {
onChange(min);
}
} // Restore cursor
try {
// Firefox set the input cursor after it get focused.
// This caused that if an input didn't init with the selection,
// set will cause cursor not correct when first focus.
// Safari will focus input if set selection. We need skip this.
if (this.cursorStart !== undefined && this.state.focused) {
// In most cases, the string after cursor is stable.
// We can move the cursor before it
if ( // If not match full str, try to match part of str
!this.partRestoreByAfter(this.cursorAfter) && this.state.value !== this.props.value) {
// If not match any of then, let's just keep the position
// TODO: Logic should not reach here, need check if happens
var pos = this.cursorStart + 1; // If not have last string, just position to the end
if (!this.cursorAfter) {
pos = this.input.value.length;
} else if (this.lastKeyCode === KeyCode["a" /* default */].BACKSPACE) {
pos = this.cursorStart - 1;
} else if (this.lastKeyCode === KeyCode["a" /* default */].DELETE) {
pos = this.cursorStart;
}
this.fixCaret(pos, pos);
} else if (this.currentValue === this.input.value) {
// Handle some special key code
switch (this.lastKeyCode) {
case KeyCode["a" /* default */].BACKSPACE:
this.fixCaret(this.cursorStart - 1, this.cursorStart - 1);
break;
case KeyCode["a" /* default */].DELETE:
this.fixCaret(this.cursorStart + 1, this.cursorStart + 1);
break;
default: // Do nothing
}
}
}
} catch (e) {// Do nothing
} // Reset last key
this.lastKeyCode = null; // pressingUpOrDown is true means that someone just click up or down button
if (!this.pressingUpOrDown) {
return;
}
if (this.props.focusOnUpDown && this.state.focused) {
if (document.activeElement !== this.input) {
this.focus();
}
}
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.stop();
}
}, {
key: "getCurrentValidValue",
value: function getCurrentValidValue(value) {
var val = value;
if (val === '') {
val = '';
} else if (!this.isNotCompleteNumber(parseFloat(val))) {
val = this.getValidValue(val);
} else {
val = this.state.value;
}
return this.toNumber(val);
}
}, {
key: "getValueFromEvent",
value: function getValueFromEvent(e) {
// optimize for chinese input expierence
// https://github.com/ant-design/ant-design/issues/8196
var value = e.target.value.trim().replace(/。/g, '.');
if (isValidProps(this.props.decimalSeparator)) {
value = value.replace(this.props.decimalSeparator, '.');
}
return value;
}
}, {
key: "getValidValue",
value: function getValidValue(value) {
var min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.props.min;
var max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.props.max;
var val = parseFloat(value); // https://github.com/ant-design/ant-design/issues/7358
if (isNaN(val)) {
return value;
}
if (val < min) {
val = min;
}
if (val > max) {
val = max;
}
return val;
}
}, {
key: "setValue",
value: function setValue(v, callback) {
// trigger onChange
var precision = this.props.precision;
var newValue = this.isNotCompleteNumber(parseFloat(v)) ? null : parseFloat(v);
var _this$state$value = this.state.value,
value = _this$state$value === void 0 ? null : _this$state$value;
var _this$state$inputValu = this.state.inputValue,
inputValue = _this$state$inputValu === void 0 ? null : _this$state$inputValu; // https://github.com/ant-design/ant-design/issues/7363
// https://github.com/ant-design/ant-design/issues/16622
var newValueInString = typeof newValue === 'number' ? newValue.toFixed(precision) : "".concat(newValue);
var changed = newValue !== value || newValueInString !== "".concat(inputValue);
if (!('value' in this.props)) {
this.setState({
value: newValue,
inputValue: this.toPrecisionAsStep(v)
}, callback);
} else {
// always set input value same as value
inputValue = this.toPrecisionAsStep(this.state.value);
this.setState({
inputValue: inputValue
}, callback);
}
if (changed) {
this.props.onChange(newValue);
}
return newValue;
} // step={1.0} value={1.51}
// press +
// then value should be 2.51, rather than 2.5
// if this.props.precision is undefined
// https://github.com/react-component/input-number/issues/39
}, {
key: "getMaxPrecision",
value: function getMaxPrecision(currentValue) {
var ratio = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
var _this$props4 = this.props,
precision = _this$props4.precision,
step = _this$props4.step;
if (isValidProps(precision)) {
return precision;
}
var ratioPrecision = this.getPrecision(ratio);
var stepPrecision = this.getPrecision(step);
var currentValuePrecision = this.getPrecision(currentValue);
if (!currentValue) {
return ratioPrecision + stepPrecision;
}
return Math.max(currentValuePrecision, ratioPrecision + stepPrecision);
}
}, {
key: "getPrecisionFactor",
value: function getPrecisionFactor(currentValue) {
var ratio = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
var precision = this.getMaxPrecision(currentValue, ratio);
return Math.pow(10, precision);
}
}, {
key: "focus",
value: function focus() {
this.input.focus();
this.recordCursorPosition();
}
}, {
key: "blur",
value: function blur() {
this.input.blur();
}
}, {
key: "select",
value: function select() {
this.input.select();
}
}, {
key: "formatWrapper",
value: function formatWrapper(num) {
// http://2ality.com/2012/03/signedzero.html
// https://github.com/ant-design/ant-design/issues/9439
if (this.props.formatter) {
return this.props.formatter(num);
}
return num;
}
}, {
key: "toPrecisionAsStep",
value: function toPrecisionAsStep(num) {
if (this.isNotCompleteNumber(num) || num === '') {
return num;
}
var precision = Math.abs(this.getMaxPrecision(num));
if (!isNaN(precision)) {
return Number(num).toFixed(precision);
}
return num.toString();
}
}, {
key: "toNumber",
value: function toNumber(num) {
var precision = this.props.precision;
var focused = this.state.focused; // num.length > 16 => This is to prevent input of large numbers
var numberIsTooLarge = num && num.length > 16 && focused;
if (this.isNotCompleteNumber(num) || numberIsTooLarge) {
return num;
}
if (isValidProps(precision)) {
return Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision);
}
return Number(num);
}
}, {
key: "upStep",
value: function upStep(val, rat) {
var step = this.props.step;
var precisionFactor = this.getPrecisionFactor(val, rat);
var precision = Math.abs(this.getMaxPrecision(val, rat));
var result = ((precisionFactor * val + precisionFactor * step * rat) / precisionFactor).toFixed(precision);
return this.toNumber(result);
}
}, {
key: "downStep",
value: function downStep(val, rat) {
var step = this.props.step;
var precisionFactor = this.getPrecisionFactor(val, rat);
var precision = Math.abs(this.getMaxPrecision(val, rat));
var result = ((precisionFactor * val - precisionFactor * step * rat) / precisionFactor).toFixed(precision);
return this.toNumber(result);
}
}, {
key: "step",
value: function step(type, e) {
var _this2 = this;
var ratio = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
var recursive = arguments.length > 3 ? arguments[3] : undefined;
this.stop();
if (e) {
e.persist();
e.preventDefault();
}
var props = this.props;
if (props.disabled) {
return;
}
var value = this.getCurrentValidValue(this.state.inputValue) || 0;
if (this.isNotCompleteNumber(value)) {
return;
}
var val = this["".concat(type, "Step")](value, ratio);
var outOfRange = val > props.max || val < props.min;
if (val > props.max) {
val = props.max;
} else if (val < props.min) {
val = props.min;
}
this.setValue(val, null);
this.setState({
focused: true
}, function () {
_this2.pressingUpOrDown = false;
});
if (outOfRange) {
return;
}
this.autoStepTimer = setTimeout(function () {
_this2[type](e, ratio, true);
}, recursive ? SPEED : DELAY);
}
}, {
key: "fixCaret",
value: function fixCaret(start, end) {
if (start === undefined || end === undefined || !this.input || !this.input.value) {
return;
}
try {
var currentStart = this.input.selectionStart;
var currentEnd = this.input.selectionEnd;
if (start !== currentStart || end !== currentEnd) {
this.input.setSelectionRange(start, end);
}
} catch (e) {// Fix error in Chrome:
// Failed to read the 'selectionStart' property from 'HTMLInputElement'
// http://stackoverflow.com/q/21177489/3040605
}
}
}, {
key: "render",
value: function render() {
var _classNames;
var _this$props5 = this.props,
prefixCls = _this$props5.prefixCls,
disabled = _this$props5.disabled,
readOnly = _this$props5.readOnly,
useTouch = _this$props5.useTouch,
autoComplete = _this$props5.autoComplete,
upHandler = _this$props5.upHandler,
downHandler = _this$props5.downHandler,
className = _this$props5.className,
max = _this$props5.max,
min = _this$props5.min,
style = _this$props5.style,
title = _this$props5.title,
onMouseEnter = _this$props5.onMouseEnter,
onMouseLeave = _this$props5.onMouseLeave,
onMouseOver = _this$props5.onMouseOver,
onMouseOut = _this$props5.onMouseOut,
required = _this$props5.required,
onClick = _this$props5.onClick,
tabIndex = _this$props5.tabIndex,
type = _this$props5.type,
placeholder = _this$props5.placeholder,
id = _this$props5.id,
inputMode = _this$props5.inputMode,
pattern = _this$props5.pattern,
step = _this$props5.step,
maxLength = _this$props5.maxLength,
autoFocus = _this$props5.autoFocus,
name = _this$props5.name,
onPaste = _this$props5.onPaste,
onInput = _this$props5.onInput,
rest = Object(objectWithoutProperties["a" /* default */])(_this$props5, ["prefixCls", "disabled", "readOnly", "useTouch", "autoComplete", "upHandler", "downHandler", "className", "max", "min", "style", "title", "onMouseEnter", "onMouseLeave", "onMouseOver", "onMouseOut", "required", "onClick", "tabIndex", "type", "placeholder", "id", "inputMode", "pattern", "step", "maxLength", "autoFocus", "name", "onPaste", "onInput"]);
var _this$state = this.state,
value = _this$state.value,
focused = _this$state.focused;
var classes = classnames_default()(prefixCls, (_classNames = {}, Object(defineProperty["a" /* default */])(_classNames, className, !!className), Object(defineProperty["a" /* default */])(_classNames, "".concat(prefixCls, "-disabled"), disabled), Object(defineProperty["a" /* default */])(_classNames, "".concat(prefixCls, "-focused"), focused), _classNames));
var dataOrAriaAttributeProps = {};
Object.keys(rest).forEach(function (key) {
if (key.substr(0, 5) === 'data-' || key.substr(0, 5) === 'aria-' || key === 'role') {
dataOrAriaAttributeProps[key] = rest[key];
}
});
var editable = !readOnly && !disabled; // focus state, show input value
// unfocus state, show valid value
var inputDisplayValue = this.getInputDisplayValue(null);
var upDisabled = (value || value === 0) && (isNaN(value) || Number(value) >= max);
var downDisabled = (value || value === 0) && (isNaN(value) || Number(value) <= min);
var isUpDisabled = upDisabled || disabled || readOnly;
var isDownDisabled = downDisabled || disabled || readOnly;
var upClassName = classnames_default()("".concat(prefixCls, "-handler"), "".concat(prefixCls, "-handler-up"), Object(defineProperty["a" /* default */])({}, "".concat(prefixCls, "-handler-up-disabled"), isUpDisabled));
var downClassName = classnames_default()("".concat(prefixCls, "-handler"), "".concat(prefixCls, "-handler-down"), Object(defineProperty["a" /* default */])({}, "".concat(prefixCls, "-handler-down-disabled"), isDownDisabled));
var upEvents = useTouch ? {
onTouchStart: isUpDisabled ? noop : this.up,
onTouchEnd: this.stop
} : {
onMouseDown: isUpDisabled ? noop : this.up,
onMouseUp: this.stop,
onMouseLeave: this.stop
};
var downEvents = useTouch ? {
onTouchStart: isDownDisabled ? noop : this.down,
onTouchEnd: this.stop
} : {
onMouseDown: isDownDisabled ? noop : this.down,
onMouseUp: this.stop,
onMouseLeave: this.stop
};
return external_window_React_default.a.createElement("div", {
className: classes,
style: style,
title: title,
onMouseEnter: onMouseEnter,
onMouseLeave: onMouseLeave,
onMouseOver: onMouseOver,
onMouseOut: onMouseOut,
onFocus: function onFocus() {
return null;
},
onBlur: function onBlur() {
return null;
}
}, external_window_React_default.a.createElement("div", {
className: "".concat(prefixCls, "-handler-wrap")
}, external_window_React_default.a.createElement("span", Object.assign({
unselectable: "on"
}, upEvents, {
role: "button",
"aria-label": "Increase Value",
"aria-disabled": isUpDisabled,
className: upClassName
}), upHandler || external_window_React_default.a.createElement("span", {
unselectable: "on",
className: "".concat(prefixCls, "-handler-up-inner"),
onClick: preventDefault
})), external_window_React_default.a.createElement("span", Object.assign({
unselectable: "on"
}, downEvents, {
role: "button",
"aria-label": "Decrease Value",
"aria-disabled": isDownDisabled,
className: downClassName
}), downHandler || external_window_React_default.a.createElement("span", {
unselectable: "on",
className: "".concat(prefixCls, "-handler-down-inner"),
onClick: preventDefault
}))), external_window_React_default.a.createElement("div", {
className: "".concat(prefixCls, "-input-wrap")
}, external_window_React_default.a.createElement("input", Object.assign({
role: "spinbutton",
"aria-valuemin": min,
"aria-valuemax": max,
"aria-valuenow": value,
required: required,
type: type,
placeholder: placeholder,
onPaste: onPaste,
onClick: onClick,
onMouseUp: this.onMouseUp,
className: "".concat(prefixCls, "-input"),
tabIndex: tabIndex,
autoComplete: autoComplete,
onFocus: this.onFocus,
onBlur: this.onBlur,
onKeyDown: editable ? this.onKeyDown : noop,
onKeyUp: editable ? this.onKeyUp : noop,
autoFocus: autoFocus,
maxLength: maxLength,
readOnly: readOnly,
disabled: disabled,
max: max,
min: min,
step: step,
name: name,
title: title,
id: id,
onChange: this.onChange,
ref: this.saveInput,
value: this.getFullNum(inputDisplayValue),
pattern: pattern,
inputMode: inputMode,
onInput: onInput
}, dataOrAriaAttributeProps))));
}
}]);
return InputNumber;
}(external_window_React_default.a.Component);
InputNumber_InputNumber.defaultProps = {
focusOnUpDown: true,
useTouch: false,
prefixCls: 'rc-input-number',
max: MAX_SAFE_INTEGER,
min: -MAX_SAFE_INTEGER,
step: 1,
style: {},
onChange: noop,
onKeyDown: noop,
onPressEnter: noop,
onFocus: noop,
onBlur: noop,
parser: defaultParser,
required: false,
autoComplete: 'off'
};
/* harmony default export */ var es_InputNumber = (InputNumber_InputNumber);
// CONCATENATED MODULE: ./node_modules/rc-input-number/es/index.js
/* harmony default export */ var es = __webpack_exports__["a"] = (es_InputNumber);
/***/ }),
/***/ "ngQI":
/*!**************************************************************************************!*\
!*** ./node_modules/react-beautiful-dnd/dist/react-beautiful-dnd.esm.js + 4 modules ***!
\**************************************************************************************/
/*! exports provided: DragDropContext, Draggable, Droppable, resetServerContext */
/*! exports used: DragDropContext, Draggable, Droppable */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/extends.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react-redux/es/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/redux/es/redux.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/tiny-invariant/dist/tiny-invariant.esm.js */
/*! ModuleConcatenation bailout: Cannot concat with external "window.React" (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with external "window.ReactDOM" (<- Module is not an ECMAScript module) */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// EXPORTS
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ DragDropContext; });
__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ PublicDraggable; });
__webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ ConnectedDroppable; });
// UNUSED EXPORTS: resetServerContext
// EXTERNAL MODULE: external "window.React"
var external_window_React_ = __webpack_require__("cDcd");
var external_window_React_default = /*#__PURE__*/__webpack_require__.n(external_window_React_);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
var inheritsLoose = __webpack_require__("dI71");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__("wx14");
// EXTERNAL MODULE: ./node_modules/redux/es/redux.js
var redux = __webpack_require__("ANjH");
// EXTERNAL MODULE: ./node_modules/react-redux/es/index.js + 19 modules
var es = __webpack_require__("/MKj");
// CONCATENATED MODULE: ./node_modules/use-memo-one/dist/use-memo-one.esm.js
function areInputsEqual(newInputs, lastInputs) {
if (newInputs.length !== lastInputs.length) {
return false;
}
for (var i = 0; i < newInputs.length; i++) {
if (newInputs[i] !== lastInputs[i]) {
return false;
}
}
return true;
}
function useMemoOne(getResult, inputs) {
var initial = Object(external_window_React_["useState"])(function () {
return {
inputs: inputs,
result: getResult()
};
})[0];
var isFirstRun = Object(external_window_React_["useRef"])(true);
var committed = Object(external_window_React_["useRef"])(initial);
var useCache = isFirstRun.current || Boolean(inputs && committed.current.inputs && areInputsEqual(inputs, committed.current.inputs));
var cache = useCache ? committed.current : {
inputs: inputs,
result: getResult()
};
Object(external_window_React_["useEffect"])(function () {
isFirstRun.current = false;
committed.current = cache;
}, [cache]);
return cache.result;
}
function useCallbackOne(callback, inputs) {
return useMemoOne(function () {
return callback;
}, inputs);
}
var useMemo = useMemoOne;
var useCallback = useCallbackOne;
// EXTERNAL MODULE: ./node_modules/tiny-invariant/dist/tiny-invariant.esm.js
var tiny_invariant_esm = __webpack_require__("9R94");
// CONCATENATED MODULE: ./node_modules/css-box-model/dist/css-box-model.esm.js
var getRect = function getRect(_ref) {
var top = _ref.top,
right = _ref.right,
bottom = _ref.bottom,
left = _ref.left;
var width = right - left;
var height = bottom - top;
var rect = {
top: top,
right: right,
bottom: bottom,
left: left,
width: width,
height: height,
x: left,
y: top,
center: {
x: (right + left) / 2,
y: (bottom + top) / 2
}
};
return rect;
};
var expand = function expand(target, expandBy) {
return {
top: target.top - expandBy.top,
left: target.left - expandBy.left,
bottom: target.bottom + expandBy.bottom,
right: target.right + expandBy.right
};
};
var shrink = function shrink(target, shrinkBy) {
return {
top: target.top + shrinkBy.top,
left: target.left + shrinkBy.left,
bottom: target.bottom - shrinkBy.bottom,
right: target.right - shrinkBy.right
};
};
var shift = function shift(target, shiftBy) {
return {
top: target.top + shiftBy.y,
left: target.left + shiftBy.x,
bottom: target.bottom + shiftBy.y,
right: target.right + shiftBy.x
};
};
var noSpacing = {
top: 0,
right: 0,
bottom: 0,
left: 0
};
var createBox = function createBox(_ref2) {
var borderBox = _ref2.borderBox,
_ref2$margin = _ref2.margin,
margin = _ref2$margin === void 0 ? noSpacing : _ref2$margin,
_ref2$border = _ref2.border,
border = _ref2$border === void 0 ? noSpacing : _ref2$border,
_ref2$padding = _ref2.padding,
padding = _ref2$padding === void 0 ? noSpacing : _ref2$padding;
var marginBox = getRect(expand(borderBox, margin));
var paddingBox = getRect(shrink(borderBox, border));
var contentBox = getRect(shrink(paddingBox, padding));
return {
marginBox: marginBox,
borderBox: getRect(borderBox),
paddingBox: paddingBox,
contentBox: contentBox,
margin: margin,
border: border,
padding: padding
};
};
var css_box_model_esm_parse = function parse(raw) {
var value = raw.slice(0, -2);
var suffix = raw.slice(-2);
if (suffix !== 'px') {
return 0;
}
var result = Number(value);
!!isNaN(result) ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
return result;
};
var getWindowScroll = function getWindowScroll() {
return {
x: window.pageXOffset,
y: window.pageYOffset
};
};
var css_box_model_esm_offset = function offset(original, change) {
var borderBox = original.borderBox,
border = original.border,
margin = original.margin,
padding = original.padding;
var shifted = shift(borderBox, change);
return createBox({
borderBox: shifted,
border: border,
margin: margin,
padding: padding
});
};
var withScroll = function withScroll(original, scroll) {
if (scroll === void 0) {
scroll = getWindowScroll();
}
return css_box_model_esm_offset(original, scroll);
};
var calculateBox = function calculateBox(borderBox, styles) {
var margin = {
top: css_box_model_esm_parse(styles.marginTop),
right: css_box_model_esm_parse(styles.marginRight),
bottom: css_box_model_esm_parse(styles.marginBottom),
left: css_box_model_esm_parse(styles.marginLeft)
};
var padding = {
top: css_box_model_esm_parse(styles.paddingTop),
right: css_box_model_esm_parse(styles.paddingRight),
bottom: css_box_model_esm_parse(styles.paddingBottom),
left: css_box_model_esm_parse(styles.paddingLeft)
};
var border = {
top: css_box_model_esm_parse(styles.borderTopWidth),
right: css_box_model_esm_parse(styles.borderRightWidth),
bottom: css_box_model_esm_parse(styles.borderBottomWidth),
left: css_box_model_esm_parse(styles.borderLeftWidth)
};
return createBox({
borderBox: borderBox,
margin: margin,
padding: padding,
border: border
});
};
var getBox = function getBox(el) {
var borderBox = el.getBoundingClientRect();
var styles = window.getComputedStyle(el);
return calculateBox(borderBox, styles);
};
// CONCATENATED MODULE: ./node_modules/memoize-one/dist/memoize-one.esm.js
var safeIsNaN = Number.isNaN ||
function ponyfill(value) {
return typeof value === 'number' && value !== value;
};
function isEqual(first, second) {
if (first === second) {
return true;
}
if (safeIsNaN(first) && safeIsNaN(second)) {
return true;
}
return false;
}
function memoize_one_esm_areInputsEqual(newInputs, lastInputs) {
if (newInputs.length !== lastInputs.length) {
return false;
}
for (var i = 0; i < newInputs.length; i++) {
if (!isEqual(newInputs[i], lastInputs[i])) {
return false;
}
}
return true;
}
function memoizeOne(resultFn, isEqual) {
if (isEqual === void 0) { isEqual = memoize_one_esm_areInputsEqual; }
var lastThis;
var lastArgs = [];
var lastResult;
var calledOnce = false;
function memoized() {
var newArgs = [];
for (var _i = 0; _i < arguments.length; _i++) {
newArgs[_i] = arguments[_i];
}
if (calledOnce && lastThis === this && isEqual(newArgs, lastArgs)) {
return lastResult;
}
lastResult = resultFn.apply(this, newArgs);
calledOnce = true;
lastThis = this;
lastArgs = newArgs;
return lastResult;
}
return memoized;
}
/* harmony default export */ var memoize_one_esm = (memoizeOne);
// CONCATENATED MODULE: ./node_modules/raf-schd/dist/raf-schd.esm.js
var rafSchd = function rafSchd(fn) {
var lastArgs = [];
var frameId = null;
var wrapperFn = function wrapperFn() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
lastArgs = args;
if (frameId) {
return;
}
frameId = requestAnimationFrame(function () {
frameId = null;
fn.apply(void 0, lastArgs);
});
};
wrapperFn.cancel = function () {
if (!frameId) {
return;
}
cancelAnimationFrame(frameId);
frameId = null;
};
return wrapperFn;
};
/* harmony default export */ var raf_schd_esm = (rafSchd);
// EXTERNAL MODULE: external "window.ReactDOM"
var external_window_ReactDOM_ = __webpack_require__("faye");
var external_window_ReactDOM_default = /*#__PURE__*/__webpack_require__.n(external_window_ReactDOM_);
// CONCATENATED MODULE: ./node_modules/react-beautiful-dnd/dist/react-beautiful-dnd.esm.js
var isProduction = "production" === 'production';
var spacesAndTabs = /[ \t]{2,}/g;
var lineStartWithSpaces = /^[ \t]*/gm;
var clean = function clean(value) {
return value.replace(spacesAndTabs, ' ').replace(lineStartWithSpaces, '').trim();
};
var getDevMessage = function getDevMessage(message) {
return clean("\n %creact-beautiful-dnd\n\n %c" + clean(message) + "\n\n %c\uD83D\uDC77\u200D This is a development only message. It will be removed in production builds.\n");
};
var getFormattedMessage = function getFormattedMessage(message) {
return [getDevMessage(message), 'color: #00C584; font-size: 1.2em; font-weight: bold;', 'line-height: 1.5', 'color: #723874;'];
};
var isDisabledFlag = '__react-beautiful-dnd-disable-dev-warnings';
function log(type, message) {
var _console;
if (isProduction) {
return;
}
if (typeof window !== 'undefined' && window[isDisabledFlag]) {
return;
}
(_console = console)[type].apply(_console, getFormattedMessage(message));
}
var warning = log.bind(null, 'warn');
var error = log.bind(null, 'error');
function noop() {}
function getOptions(shared, fromBinding) {
return Object(esm_extends["a" /* default */])({}, shared, {}, fromBinding);
}
function bindEvents(el, bindings, sharedOptions) {
var unbindings = bindings.map(function (binding) {
var options = getOptions(sharedOptions, binding.options);
el.addEventListener(binding.eventName, binding.fn, options);
return function unbind() {
el.removeEventListener(binding.eventName, binding.fn, options);
};
});
return function unbindAll() {
unbindings.forEach(function (unbind) {
unbind();
});
};
}
var isProduction$1 = "production" === 'production';
var react_beautiful_dnd_esm_prefix = 'Invariant failed';
function RbdInvariant(message) {
this.message = message;
}
RbdInvariant.prototype.toString = function toString() {
return this.message;
};
function invariant(condition, message) {
if (condition) {
return;
}
if (isProduction$1) {
throw new RbdInvariant(react_beautiful_dnd_esm_prefix);
} else {
throw new RbdInvariant(react_beautiful_dnd_esm_prefix + ": " + (message || ''));
}
}
var react_beautiful_dnd_esm_ErrorBoundary = function (_React$Component) {
Object(inheritsLoose["a" /* default */])(ErrorBoundary, _React$Component);
function ErrorBoundary() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
_this.callbacks = null;
_this.unbind = noop;
_this.onWindowError = function (event) {
var callbacks = _this.getCallbacks();
if (callbacks.isDragging()) {
callbacks.tryAbort();
false ? undefined : void 0;
}
var err = event.error;
if (err instanceof RbdInvariant) {
event.preventDefault();
if (false) {}
}
};
_this.getCallbacks = function () {
if (!_this.callbacks) {
throw new Error('Unable to find AppCallbacks in ');
}
return _this.callbacks;
};
_this.setCallbacks = function (callbacks) {
_this.callbacks = callbacks;
};
return _this;
}
var _proto = ErrorBoundary.prototype;
_proto.componentDidMount = function componentDidMount() {
this.unbind = bindEvents(window, [{
eventName: 'error',
fn: this.onWindowError
}]);
};
_proto.componentWillUnmount = function componentWillUnmount() {
this.unbind();
};
_proto.componentDidCatch = function componentDidCatch(err) {
if (err instanceof RbdInvariant) {
if (false) {}
this.setState({});
return;
}
throw err;
};
_proto.render = function render() {
return this.props.children(this.setCallbacks);
};
return ErrorBoundary;
}(external_window_React_default.a.Component);
var react_beautiful_dnd_esm_dragHandleUsageInstructions = "\n Press space bar to start a drag.\n When dragging you can use the arrow keys to move the item around and escape to cancel.\n Some screen readers may require you to be in focus mode or to use your pass through key\n";
var position = function position(index) {
return index + 1;
};
var onDragStart = function onDragStart(start) {
return "\n You have lifted an item in position " + position(start.source.index) + "\n";
};
var withLocation = function withLocation(source, destination) {
var isInHomeList = source.droppableId === destination.droppableId;
var startPosition = position(source.index);
var endPosition = position(destination.index);
if (isInHomeList) {
return "\n You have moved the item from position " + startPosition + "\n to position " + endPosition + "\n ";
}
return "\n You have moved the item from position " + startPosition + "\n in list " + source.droppableId + "\n to list " + destination.droppableId + "\n in position " + endPosition + "\n ";
};
var withCombine = function withCombine(id, source, combine) {
var inHomeList = source.droppableId === combine.droppableId;
if (inHomeList) {
return "\n The item " + id + "\n has been combined with " + combine.draggableId;
}
return "\n The item " + id + "\n in list " + source.droppableId + "\n has been combined with " + combine.draggableId + "\n in list " + combine.droppableId + "\n ";
};
var onDragUpdate = function onDragUpdate(update) {
var location = update.destination;
if (location) {
return withLocation(update.source, location);
}
var combine = update.combine;
if (combine) {
return withCombine(update.draggableId, update.source, combine);
}
return 'You are over an area that cannot be dropped on';
};
var returnedToStart = function returnedToStart(source) {
return "\n The item has returned to its starting position\n of " + position(source.index) + "\n";
};
var onDragEnd = function onDragEnd(result) {
if (result.reason === 'CANCEL') {
return "\n Movement cancelled.\n " + returnedToStart(result.source) + "\n ";
}
var location = result.destination;
var combine = result.combine;
if (location) {
return "\n You have dropped the item.\n " + withLocation(result.source, location) + "\n ";
}
if (combine) {
return "\n You have dropped the item.\n " + withCombine(result.draggableId, result.source, combine) + "\n ";
}
return "\n The item has been dropped while not over a drop area.\n " + returnedToStart(result.source) + "\n ";
};
var preset = {
dragHandleUsageInstructions: react_beautiful_dnd_esm_dragHandleUsageInstructions,
onDragStart: onDragStart,
onDragUpdate: onDragUpdate,
onDragEnd: onDragEnd
};
var origin = {
x: 0,
y: 0
};
var add = function add(point1, point2) {
return {
x: point1.x + point2.x,
y: point1.y + point2.y
};
};
var subtract = function subtract(point1, point2) {
return {
x: point1.x - point2.x,
y: point1.y - point2.y
};
};
var react_beautiful_dnd_esm_isEqual = function isEqual(point1, point2) {
return point1.x === point2.x && point1.y === point2.y;
};
var negate = function negate(point) {
return {
x: point.x !== 0 ? -point.x : 0,
y: point.y !== 0 ? -point.y : 0
};
};
var patch = function patch(line, value, otherValue) {
var _ref;
if (otherValue === void 0) {
otherValue = 0;
}
return _ref = {}, _ref[line] = value, _ref[line === 'x' ? 'y' : 'x'] = otherValue, _ref;
};
var distance = function distance(point1, point2) {
return Math.sqrt(Math.pow(point2.x - point1.x, 2) + Math.pow(point2.y - point1.y, 2));
};
var react_beautiful_dnd_esm_closest = function closest(target, points) {
return Math.min.apply(Math, points.map(function (point) {
return distance(target, point);
}));
};
var apply = function apply(fn) {
return function (point) {
return {
x: fn(point.x),
y: fn(point.y)
};
};
};
var executeClip = (function (frame, subject) {
var result = getRect({
top: Math.max(subject.top, frame.top),
right: Math.min(subject.right, frame.right),
bottom: Math.min(subject.bottom, frame.bottom),
left: Math.max(subject.left, frame.left)
});
if (result.width <= 0 || result.height <= 0) {
return null;
}
return result;
});
var offsetByPosition = function offsetByPosition(spacing, point) {
return {
top: spacing.top + point.y,
left: spacing.left + point.x,
bottom: spacing.bottom + point.y,
right: spacing.right + point.x
};
};
var getCorners = function getCorners(spacing) {
return [{
x: spacing.left,
y: spacing.top
}, {
x: spacing.right,
y: spacing.top
}, {
x: spacing.left,
y: spacing.bottom
}, {
x: spacing.right,
y: spacing.bottom
}];
};
var react_beautiful_dnd_esm_noSpacing = {
top: 0,
right: 0,
bottom: 0,
left: 0
};
var react_beautiful_dnd_esm_scroll = function scroll(target, frame) {
if (!frame) {
return target;
}
return offsetByPosition(target, frame.scroll.diff.displacement);
};
var react_beautiful_dnd_esm_increase = function increase(target, axis, withPlaceholder) {
if (withPlaceholder && withPlaceholder.increasedBy) {
var _extends2;
return Object(esm_extends["a" /* default */])({}, target, (_extends2 = {}, _extends2[axis.end] = target[axis.end] + withPlaceholder.increasedBy[axis.line], _extends2));
}
return target;
};
var react_beautiful_dnd_esm_clip = function clip(target, frame) {
if (frame && frame.shouldClipSubject) {
return executeClip(frame.pageMarginBox, target);
}
return getRect(target);
};
var getSubject = (function (_ref) {
var page = _ref.page,
withPlaceholder = _ref.withPlaceholder,
axis = _ref.axis,
frame = _ref.frame;
var scrolled = react_beautiful_dnd_esm_scroll(page.marginBox, frame);
var increased = react_beautiful_dnd_esm_increase(scrolled, axis, withPlaceholder);
var clipped = react_beautiful_dnd_esm_clip(increased, frame);
return {
page: page,
withPlaceholder: withPlaceholder,
active: clipped
};
});
var react_beautiful_dnd_esm_scrollDroppable = (function (droppable, newScroll) {
!droppable.frame ? false ? undefined : invariant(false) : void 0;
var scrollable = droppable.frame;
var scrollDiff = subtract(newScroll, scrollable.scroll.initial);
var scrollDisplacement = negate(scrollDiff);
var frame = Object(esm_extends["a" /* default */])({}, scrollable, {
scroll: {
initial: scrollable.scroll.initial,
current: newScroll,
diff: {
value: scrollDiff,
displacement: scrollDisplacement
},
max: scrollable.scroll.max
}
});
var subject = getSubject({
page: droppable.subject.page,
withPlaceholder: droppable.subject.withPlaceholder,
axis: droppable.axis,
frame: frame
});
var result = Object(esm_extends["a" /* default */])({}, droppable, {
frame: frame,
subject: subject
});
return result;
});
function isInteger(value) {
if (Number.isInteger) {
return Number.isInteger(value);
}
return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;
}
function values(map) {
if (Object.values) {
return Object.values(map);
}
return Object.keys(map).map(function (key) {
return map[key];
});
}
function findIndex(list, predicate) {
if (list.findIndex) {
return list.findIndex(predicate);
}
for (var i = 0; i < list.length; i++) {
if (predicate(list[i])) {
return i;
}
}
return -1;
}
function find(list, predicate) {
if (list.find) {
return list.find(predicate);
}
var index = findIndex(list, predicate);
if (index !== -1) {
return list[index];
}
return undefined;
}
function toArray(list) {
return Array.prototype.slice.call(list);
}
var toDroppableMap = memoize_one_esm(function (droppables) {
return droppables.reduce(function (previous, current) {
previous[current.descriptor.id] = current;
return previous;
}, {});
});
var toDraggableMap = memoize_one_esm(function (draggables) {
return draggables.reduce(function (previous, current) {
previous[current.descriptor.id] = current;
return previous;
}, {});
});
var toDroppableList = memoize_one_esm(function (droppables) {
return values(droppables);
});
var toDraggableList = memoize_one_esm(function (draggables) {
return values(draggables);
});
var getDraggablesInsideDroppable = memoize_one_esm(function (droppableId, draggables) {
var result = toDraggableList(draggables).filter(function (draggable) {
return droppableId === draggable.descriptor.droppableId;
}).sort(function (a, b) {
return a.descriptor.index - b.descriptor.index;
});
return result;
});
function tryGetDestination(impact) {
if (impact.at && impact.at.type === 'REORDER') {
return impact.at.destination;
}
return null;
}
function tryGetCombine(impact) {
if (impact.at && impact.at.type === 'COMBINE') {
return impact.at.combine;
}
return null;
}
var removeDraggableFromList = memoize_one_esm(function (remove, list) {
return list.filter(function (item) {
return item.descriptor.id !== remove.descriptor.id;
});
});
var moveToNextCombine = (function (_ref) {
var isMovingForward = _ref.isMovingForward,
draggable = _ref.draggable,
destination = _ref.destination,
insideDestination = _ref.insideDestination,
previousImpact = _ref.previousImpact;
if (!destination.isCombineEnabled) {
return null;
}
var location = tryGetDestination(previousImpact);
if (!location) {
return null;
}
function getImpact(target) {
var at = {
type: 'COMBINE',
combine: {
draggableId: target,
droppableId: destination.descriptor.id
}
};
return Object(esm_extends["a" /* default */])({}, previousImpact, {
at: at
});
}
var all = previousImpact.displaced.all;
var closestId = all.length ? all[0] : null;
if (isMovingForward) {
return closestId ? getImpact(closestId) : null;
}
var withoutDraggable = removeDraggableFromList(draggable, insideDestination);
if (!closestId) {
if (!withoutDraggable.length) {
return null;
}
var last = withoutDraggable[withoutDraggable.length - 1];
return getImpact(last.descriptor.id);
}
var indexOfClosest = findIndex(withoutDraggable, function (d) {
return d.descriptor.id === closestId;
});
!(indexOfClosest !== -1) ? false ? undefined : invariant(false) : void 0;
var proposedIndex = indexOfClosest - 1;
if (proposedIndex < 0) {
return null;
}
var before = withoutDraggable[proposedIndex];
return getImpact(before.descriptor.id);
});
var isHomeOf = (function (draggable, destination) {
return draggable.descriptor.droppableId === destination.descriptor.id;
});
var noDisplacedBy = {
point: origin,
value: 0
};
var emptyGroups = {
invisible: {},
visible: {},
all: []
};
var noImpact = {
displaced: emptyGroups,
displacedBy: noDisplacedBy,
at: null
};
var isWithin = (function (lowerBound, upperBound) {
return function (value) {
return lowerBound <= value && value <= upperBound;
};
});
var isPartiallyVisibleThroughFrame = (function (frame) {
var isWithinVertical = isWithin(frame.top, frame.bottom);
var isWithinHorizontal = isWithin(frame.left, frame.right);
return function (subject) {
var isContained = isWithinVertical(subject.top) && isWithinVertical(subject.bottom) && isWithinHorizontal(subject.left) && isWithinHorizontal(subject.right);
if (isContained) {
return true;
}
var isPartiallyVisibleVertically = isWithinVertical(subject.top) || isWithinVertical(subject.bottom);
var isPartiallyVisibleHorizontally = isWithinHorizontal(subject.left) || isWithinHorizontal(subject.right);
var isPartiallyContained = isPartiallyVisibleVertically && isPartiallyVisibleHorizontally;
if (isPartiallyContained) {
return true;
}
var isBiggerVertically = subject.top < frame.top && subject.bottom > frame.bottom;
var isBiggerHorizontally = subject.left < frame.left && subject.right > frame.right;
var isTargetBiggerThanFrame = isBiggerVertically && isBiggerHorizontally;
if (isTargetBiggerThanFrame) {
return true;
}
var isTargetBiggerOnOneAxis = isBiggerVertically && isPartiallyVisibleHorizontally || isBiggerHorizontally && isPartiallyVisibleVertically;
return isTargetBiggerOnOneAxis;
};
});
var isTotallyVisibleThroughFrame = (function (frame) {
var isWithinVertical = isWithin(frame.top, frame.bottom);
var isWithinHorizontal = isWithin(frame.left, frame.right);
return function (subject) {
var isContained = isWithinVertical(subject.top) && isWithinVertical(subject.bottom) && isWithinHorizontal(subject.left) && isWithinHorizontal(subject.right);
return isContained;
};
});
var vertical = {
direction: 'vertical',
line: 'y',
crossAxisLine: 'x',
start: 'top',
end: 'bottom',
size: 'height',
crossAxisStart: 'left',
crossAxisEnd: 'right',
crossAxisSize: 'width'
};
var horizontal = {
direction: 'horizontal',
line: 'x',
crossAxisLine: 'y',
start: 'left',
end: 'right',
size: 'width',
crossAxisStart: 'top',
crossAxisEnd: 'bottom',
crossAxisSize: 'height'
};
var isTotallyVisibleThroughFrameOnAxis = (function (axis) {
return function (frame) {
var isWithinVertical = isWithin(frame.top, frame.bottom);
var isWithinHorizontal = isWithin(frame.left, frame.right);
return function (subject) {
if (axis === vertical) {
return isWithinVertical(subject.top) && isWithinVertical(subject.bottom);
}
return isWithinHorizontal(subject.left) && isWithinHorizontal(subject.right);
};
};
});
var getDroppableDisplaced = function getDroppableDisplaced(target, destination) {
var displacement = destination.frame ? destination.frame.scroll.diff.displacement : origin;
return offsetByPosition(target, displacement);
};
var isVisibleInDroppable = function isVisibleInDroppable(target, destination, isVisibleThroughFrameFn) {
if (!destination.subject.active) {
return false;
}
return isVisibleThroughFrameFn(destination.subject.active)(target);
};
var isVisibleInViewport = function isVisibleInViewport(target, viewport, isVisibleThroughFrameFn) {
return isVisibleThroughFrameFn(viewport)(target);
};
var isVisible = function isVisible(_ref) {
var toBeDisplaced = _ref.target,
destination = _ref.destination,
viewport = _ref.viewport,
withDroppableDisplacement = _ref.withDroppableDisplacement,
isVisibleThroughFrameFn = _ref.isVisibleThroughFrameFn;
var displacedTarget = withDroppableDisplacement ? getDroppableDisplaced(toBeDisplaced, destination) : toBeDisplaced;
return isVisibleInDroppable(displacedTarget, destination, isVisibleThroughFrameFn) && isVisibleInViewport(displacedTarget, viewport, isVisibleThroughFrameFn);
};
var react_beautiful_dnd_esm_isPartiallyVisible = function isPartiallyVisible(args) {
return isVisible(Object(esm_extends["a" /* default */])({}, args, {
isVisibleThroughFrameFn: isPartiallyVisibleThroughFrame
}));
};
var react_beautiful_dnd_esm_isTotallyVisible = function isTotallyVisible(args) {
return isVisible(Object(esm_extends["a" /* default */])({}, args, {
isVisibleThroughFrameFn: isTotallyVisibleThroughFrame
}));
};
var react_beautiful_dnd_esm_isTotallyVisibleOnAxis = function isTotallyVisibleOnAxis(args) {
return isVisible(Object(esm_extends["a" /* default */])({}, args, {
isVisibleThroughFrameFn: isTotallyVisibleThroughFrameOnAxis(args.destination.axis)
}));
};
var getShouldAnimate = function getShouldAnimate(id, last, forceShouldAnimate) {
if (typeof forceShouldAnimate === 'boolean') {
return forceShouldAnimate;
}
if (!last) {
return true;
}
var invisible = last.invisible,
visible = last.visible;
if (invisible[id]) {
return false;
}
var previous = visible[id];
return previous ? previous.shouldAnimate : true;
};
function getTarget(draggable, displacedBy) {
var marginBox = draggable.page.marginBox;
var expandBy = {
top: displacedBy.point.y,
right: 0,
bottom: 0,
left: displacedBy.point.x
};
return getRect(expand(marginBox, expandBy));
}
function getDisplacementGroups(_ref) {
var afterDragging = _ref.afterDragging,
destination = _ref.destination,
displacedBy = _ref.displacedBy,
viewport = _ref.viewport,
forceShouldAnimate = _ref.forceShouldAnimate,
last = _ref.last;
return afterDragging.reduce(function process(groups, draggable) {
var target = getTarget(draggable, displacedBy);
var id = draggable.descriptor.id;
groups.all.push(id);
var isVisible = react_beautiful_dnd_esm_isPartiallyVisible({
target: target,
destination: destination,
viewport: viewport,
withDroppableDisplacement: true
});
if (!isVisible) {
groups.invisible[draggable.descriptor.id] = true;
return groups;
}
var shouldAnimate = getShouldAnimate(id, last, forceShouldAnimate);
var displacement = {
draggableId: id,
shouldAnimate: shouldAnimate
};
groups.visible[id] = displacement;
return groups;
}, {
all: [],
visible: {},
invisible: {}
});
}
function getIndexOfLastItem(draggables, options) {
if (!draggables.length) {
return 0;
}
var indexOfLastItem = draggables[draggables.length - 1].descriptor.index;
return options.inHomeList ? indexOfLastItem : indexOfLastItem + 1;
}
function goAtEnd(_ref) {
var insideDestination = _ref.insideDestination,
inHomeList = _ref.inHomeList,
displacedBy = _ref.displacedBy,
destination = _ref.destination;
var newIndex = getIndexOfLastItem(insideDestination, {
inHomeList: inHomeList
});
return {
displaced: emptyGroups,
displacedBy: displacedBy,
at: {
type: 'REORDER',
destination: {
droppableId: destination.descriptor.id,
index: newIndex
}
}
};
}
function calculateReorderImpact(_ref2) {
var draggable = _ref2.draggable,
insideDestination = _ref2.insideDestination,
destination = _ref2.destination,
viewport = _ref2.viewport,
displacedBy = _ref2.displacedBy,
last = _ref2.last,
index = _ref2.index,
forceShouldAnimate = _ref2.forceShouldAnimate;
var inHomeList = isHomeOf(draggable, destination);
if (index == null) {
return goAtEnd({
insideDestination: insideDestination,
inHomeList: inHomeList,
displacedBy: displacedBy,
destination: destination
});
}
var match = find(insideDestination, function (item) {
return item.descriptor.index === index;
});
if (!match) {
return goAtEnd({
insideDestination: insideDestination,
inHomeList: inHomeList,
displacedBy: displacedBy,
destination: destination
});
}
var withoutDragging = removeDraggableFromList(draggable, insideDestination);
var sliceFrom = insideDestination.indexOf(match);
var impacted = withoutDragging.slice(sliceFrom);
var displaced = getDisplacementGroups({
afterDragging: impacted,
destination: destination,
displacedBy: displacedBy,
last: last,
viewport: viewport.frame,
forceShouldAnimate: forceShouldAnimate
});
return {
displaced: displaced,
displacedBy: displacedBy,
at: {
type: 'REORDER',
destination: {
droppableId: destination.descriptor.id,
index: index
}
}
};
}
function didStartAfterCritical(draggableId, afterCritical) {
return Boolean(afterCritical.effected[draggableId]);
}
var fromCombine = (function (_ref) {
var isMovingForward = _ref.isMovingForward,
destination = _ref.destination,
draggables = _ref.draggables,
combine = _ref.combine,
afterCritical = _ref.afterCritical;
if (!destination.isCombineEnabled) {
return null;
}
var combineId = combine.draggableId;
var combineWith = draggables[combineId];
var combineWithIndex = combineWith.descriptor.index;
var didCombineWithStartAfterCritical = didStartAfterCritical(combineId, afterCritical);
if (didCombineWithStartAfterCritical) {
if (isMovingForward) {
return combineWithIndex;
}
return combineWithIndex - 1;
}
if (isMovingForward) {
return combineWithIndex + 1;
}
return combineWithIndex;
});
var fromReorder = (function (_ref) {
var isMovingForward = _ref.isMovingForward,
isInHomeList = _ref.isInHomeList,
insideDestination = _ref.insideDestination,
location = _ref.location;
if (!insideDestination.length) {
return null;
}
var currentIndex = location.index;
var proposedIndex = isMovingForward ? currentIndex + 1 : currentIndex - 1;
var firstIndex = insideDestination[0].descriptor.index;
var lastIndex = insideDestination[insideDestination.length - 1].descriptor.index;
var upperBound = isInHomeList ? lastIndex : lastIndex + 1;
if (proposedIndex < firstIndex) {
return null;
}
if (proposedIndex > upperBound) {
return null;
}
return proposedIndex;
});
var moveToNextIndex = (function (_ref) {
var isMovingForward = _ref.isMovingForward,
isInHomeList = _ref.isInHomeList,
draggable = _ref.draggable,
draggables = _ref.draggables,
destination = _ref.destination,
insideDestination = _ref.insideDestination,
previousImpact = _ref.previousImpact,
viewport = _ref.viewport,
afterCritical = _ref.afterCritical;
var wasAt = previousImpact.at;
!wasAt ? false ? undefined : invariant(false) : void 0;
if (wasAt.type === 'REORDER') {
var _newIndex = fromReorder({
isMovingForward: isMovingForward,
isInHomeList: isInHomeList,
location: wasAt.destination,
insideDestination: insideDestination
});
if (_newIndex == null) {
return null;
}
return calculateReorderImpact({
draggable: draggable,
insideDestination: insideDestination,
destination: destination,
viewport: viewport,
last: previousImpact.displaced,
displacedBy: previousImpact.displacedBy,
index: _newIndex
});
}
var newIndex = fromCombine({
isMovingForward: isMovingForward,
destination: destination,
displaced: previousImpact.displaced,
draggables: draggables,
combine: wasAt.combine,
afterCritical: afterCritical
});
if (newIndex == null) {
return null;
}
return calculateReorderImpact({
draggable: draggable,
insideDestination: insideDestination,
destination: destination,
viewport: viewport,
last: previousImpact.displaced,
displacedBy: previousImpact.displacedBy,
index: newIndex
});
});
var getCombinedItemDisplacement = (function (_ref) {
var displaced = _ref.displaced,
afterCritical = _ref.afterCritical,
combineWith = _ref.combineWith,
displacedBy = _ref.displacedBy;
var isDisplaced = Boolean(displaced.visible[combineWith] || displaced.invisible[combineWith]);
if (didStartAfterCritical(combineWith, afterCritical)) {
return isDisplaced ? origin : negate(displacedBy.point);
}
return isDisplaced ? displacedBy.point : origin;
});
var whenCombining = (function (_ref) {
var afterCritical = _ref.afterCritical,
impact = _ref.impact,
draggables = _ref.draggables;
var combine = tryGetCombine(impact);
!combine ? false ? undefined : invariant(false) : void 0;
var combineWith = combine.draggableId;
var center = draggables[combineWith].page.borderBox.center;
var displaceBy = getCombinedItemDisplacement({
displaced: impact.displaced,
afterCritical: afterCritical,
combineWith: combineWith,
displacedBy: impact.displacedBy
});
return add(center, displaceBy);
});
var distanceFromStartToBorderBoxCenter = function distanceFromStartToBorderBoxCenter(axis, box) {
return box.margin[axis.start] + box.borderBox[axis.size] / 2;
};
var distanceFromEndToBorderBoxCenter = function distanceFromEndToBorderBoxCenter(axis, box) {
return box.margin[axis.end] + box.borderBox[axis.size] / 2;
};
var getCrossAxisBorderBoxCenter = function getCrossAxisBorderBoxCenter(axis, target, isMoving) {
return target[axis.crossAxisStart] + isMoving.margin[axis.crossAxisStart] + isMoving.borderBox[axis.crossAxisSize] / 2;
};
var goAfter = function goAfter(_ref) {
var axis = _ref.axis,
moveRelativeTo = _ref.moveRelativeTo,
isMoving = _ref.isMoving;
return patch(axis.line, moveRelativeTo.marginBox[axis.end] + distanceFromStartToBorderBoxCenter(axis, isMoving), getCrossAxisBorderBoxCenter(axis, moveRelativeTo.marginBox, isMoving));
};
var goBefore = function goBefore(_ref2) {
var axis = _ref2.axis,
moveRelativeTo = _ref2.moveRelativeTo,
isMoving = _ref2.isMoving;
return patch(axis.line, moveRelativeTo.marginBox[axis.start] - distanceFromEndToBorderBoxCenter(axis, isMoving), getCrossAxisBorderBoxCenter(axis, moveRelativeTo.marginBox, isMoving));
};
var goIntoStart = function goIntoStart(_ref3) {
var axis = _ref3.axis,
moveInto = _ref3.moveInto,
isMoving = _ref3.isMoving;
return patch(axis.line, moveInto.contentBox[axis.start] + distanceFromStartToBorderBoxCenter(axis, isMoving), getCrossAxisBorderBoxCenter(axis, moveInto.contentBox, isMoving));
};
var whenReordering = (function (_ref) {
var impact = _ref.impact,
draggable = _ref.draggable,
draggables = _ref.draggables,
droppable = _ref.droppable,
afterCritical = _ref.afterCritical;
var insideDestination = getDraggablesInsideDroppable(droppable.descriptor.id, draggables);
var draggablePage = draggable.page;
var axis = droppable.axis;
if (!insideDestination.length) {
return goIntoStart({
axis: axis,
moveInto: droppable.page,
isMoving: draggablePage
});
}
var displaced = impact.displaced,
displacedBy = impact.displacedBy;
var closestAfter = displaced.all[0];
if (closestAfter) {
var closest = draggables[closestAfter];
if (didStartAfterCritical(closestAfter, afterCritical)) {
return goBefore({
axis: axis,
moveRelativeTo: closest.page,
isMoving: draggablePage
});
}
var withDisplacement = css_box_model_esm_offset(closest.page, displacedBy.point);
return goBefore({
axis: axis,
moveRelativeTo: withDisplacement,
isMoving: draggablePage
});
}
var last = insideDestination[insideDestination.length - 1];
if (last.descriptor.id === draggable.descriptor.id) {
return draggablePage.borderBox.center;
}
if (didStartAfterCritical(last.descriptor.id, afterCritical)) {
var page = css_box_model_esm_offset(last.page, negate(afterCritical.displacedBy.point));
return goAfter({
axis: axis,
moveRelativeTo: page,
isMoving: draggablePage
});
}
return goAfter({
axis: axis,
moveRelativeTo: last.page,
isMoving: draggablePage
});
});
var withDroppableDisplacement = (function (droppable, point) {
var frame = droppable.frame;
if (!frame) {
return point;
}
return add(point, frame.scroll.diff.displacement);
});
var getResultWithoutDroppableDisplacement = function getResultWithoutDroppableDisplacement(_ref) {
var impact = _ref.impact,
draggable = _ref.draggable,
droppable = _ref.droppable,
draggables = _ref.draggables,
afterCritical = _ref.afterCritical;
var original = draggable.page.borderBox.center;
var at = impact.at;
if (!droppable) {
return original;
}
if (!at) {
return original;
}
if (at.type === 'REORDER') {
return whenReordering({
impact: impact,
draggable: draggable,
draggables: draggables,
droppable: droppable,
afterCritical: afterCritical
});
}
return whenCombining({
impact: impact,
draggables: draggables,
afterCritical: afterCritical
});
};
var getPageBorderBoxCenterFromImpact = (function (args) {
var withoutDisplacement = getResultWithoutDroppableDisplacement(args);
var droppable = args.droppable;
var withDisplacement = droppable ? withDroppableDisplacement(droppable, withoutDisplacement) : withoutDisplacement;
return withDisplacement;
});
var scrollViewport = (function (viewport, newScroll) {
var diff = subtract(newScroll, viewport.scroll.initial);
var displacement = negate(diff);
var frame = getRect({
top: newScroll.y,
bottom: newScroll.y + viewport.frame.height,
left: newScroll.x,
right: newScroll.x + viewport.frame.width
});
var updated = {
frame: frame,
scroll: {
initial: viewport.scroll.initial,
max: viewport.scroll.max,
current: newScroll,
diff: {
value: diff,
displacement: displacement
}
}
};
return updated;
});
function getDraggables(ids, draggables) {
return ids.map(function (id) {
return draggables[id];
});
}
function tryGetVisible(id, groups) {
for (var i = 0; i < groups.length; i++) {
var displacement = groups[i].visible[id];
if (displacement) {
return displacement;
}
}
return null;
}
var speculativelyIncrease = (function (_ref) {
var impact = _ref.impact,
viewport = _ref.viewport,
destination = _ref.destination,
draggables = _ref.draggables,
maxScrollChange = _ref.maxScrollChange;
var scrolledViewport = scrollViewport(viewport, add(viewport.scroll.current, maxScrollChange));
var scrolledDroppable = destination.frame ? react_beautiful_dnd_esm_scrollDroppable(destination, add(destination.frame.scroll.current, maxScrollChange)) : destination;
var last = impact.displaced;
var withViewportScroll = getDisplacementGroups({
afterDragging: getDraggables(last.all, draggables),
destination: destination,
displacedBy: impact.displacedBy,
viewport: scrolledViewport.frame,
last: last,
forceShouldAnimate: false
});
var withDroppableScroll = getDisplacementGroups({
afterDragging: getDraggables(last.all, draggables),
destination: scrolledDroppable,
displacedBy: impact.displacedBy,
viewport: viewport.frame,
last: last,
forceShouldAnimate: false
});
var invisible = {};
var visible = {};
var groups = [last, withViewportScroll, withDroppableScroll];
last.all.forEach(function (id) {
var displacement = tryGetVisible(id, groups);
if (displacement) {
visible[id] = displacement;
return;
}
invisible[id] = true;
});
var newImpact = Object(esm_extends["a" /* default */])({}, impact, {
displaced: {
all: last.all,
invisible: invisible,
visible: visible
}
});
return newImpact;
});
var withViewportDisplacement = (function (viewport, point) {
return add(viewport.scroll.diff.displacement, point);
});
var getClientFromPageBorderBoxCenter = (function (_ref) {
var pageBorderBoxCenter = _ref.pageBorderBoxCenter,
draggable = _ref.draggable,
viewport = _ref.viewport;
var withoutPageScrollChange = withViewportDisplacement(viewport, pageBorderBoxCenter);
var offset = subtract(withoutPageScrollChange, draggable.page.borderBox.center);
return add(draggable.client.borderBox.center, offset);
});
var isTotallyVisibleInNewLocation = (function (_ref) {
var draggable = _ref.draggable,
destination = _ref.destination,
newPageBorderBoxCenter = _ref.newPageBorderBoxCenter,
viewport = _ref.viewport,
withDroppableDisplacement = _ref.withDroppableDisplacement,
_ref$onlyOnMainAxis = _ref.onlyOnMainAxis,
onlyOnMainAxis = _ref$onlyOnMainAxis === void 0 ? false : _ref$onlyOnMainAxis;
var changeNeeded = subtract(newPageBorderBoxCenter, draggable.page.borderBox.center);
var shifted = offsetByPosition(draggable.page.borderBox, changeNeeded);
var args = {
target: shifted,
destination: destination,
withDroppableDisplacement: withDroppableDisplacement,
viewport: viewport
};
return onlyOnMainAxis ? react_beautiful_dnd_esm_isTotallyVisibleOnAxis(args) : react_beautiful_dnd_esm_isTotallyVisible(args);
});
var moveToNextPlace = (function (_ref) {
var isMovingForward = _ref.isMovingForward,
draggable = _ref.draggable,
destination = _ref.destination,
draggables = _ref.draggables,
previousImpact = _ref.previousImpact,
viewport = _ref.viewport,
previousPageBorderBoxCenter = _ref.previousPageBorderBoxCenter,
previousClientSelection = _ref.previousClientSelection,
afterCritical = _ref.afterCritical;
if (!destination.isEnabled) {
return null;
}
var insideDestination = getDraggablesInsideDroppable(destination.descriptor.id, draggables);
var isInHomeList = isHomeOf(draggable, destination);
var impact = moveToNextCombine({
isMovingForward: isMovingForward,
draggable: draggable,
destination: destination,
insideDestination: insideDestination,
previousImpact: previousImpact
}) || moveToNextIndex({
isMovingForward: isMovingForward,
isInHomeList: isInHomeList,
draggable: draggable,
draggables: draggables,
destination: destination,
insideDestination: insideDestination,
previousImpact: previousImpact,
viewport: viewport,
afterCritical: afterCritical
});
if (!impact) {
return null;
}
var pageBorderBoxCenter = getPageBorderBoxCenterFromImpact({
impact: impact,
draggable: draggable,
droppable: destination,
draggables: draggables,
afterCritical: afterCritical
});
var isVisibleInNewLocation = isTotallyVisibleInNewLocation({
draggable: draggable,
destination: destination,
newPageBorderBoxCenter: pageBorderBoxCenter,
viewport: viewport.frame,
withDroppableDisplacement: false,
onlyOnMainAxis: true
});
if (isVisibleInNewLocation) {
var clientSelection = getClientFromPageBorderBoxCenter({
pageBorderBoxCenter: pageBorderBoxCenter,
draggable: draggable,
viewport: viewport
});
return {
clientSelection: clientSelection,
impact: impact,
scrollJumpRequest: null
};
}
var distance = subtract(pageBorderBoxCenter, previousPageBorderBoxCenter);
var cautious = speculativelyIncrease({
impact: impact,
viewport: viewport,
destination: destination,
draggables: draggables,
maxScrollChange: distance
});
return {
clientSelection: previousClientSelection,
impact: cautious,
scrollJumpRequest: distance
};
});
var getKnownActive = function getKnownActive(droppable) {
var rect = droppable.subject.active;
!rect ? false ? undefined : invariant(false) : void 0;
return rect;
};
var getBestCrossAxisDroppable = (function (_ref) {
var isMovingForward = _ref.isMovingForward,
pageBorderBoxCenter = _ref.pageBorderBoxCenter,
source = _ref.source,
droppables = _ref.droppables,
viewport = _ref.viewport;
var active = source.subject.active;
if (!active) {
return null;
}
var axis = source.axis;
var isBetweenSourceClipped = isWithin(active[axis.start], active[axis.end]);
var candidates = toDroppableList(droppables).filter(function (droppable) {
return droppable !== source;
}).filter(function (droppable) {
return droppable.isEnabled;
}).filter(function (droppable) {
return Boolean(droppable.subject.active);
}).filter(function (droppable) {
return isPartiallyVisibleThroughFrame(viewport.frame)(getKnownActive(droppable));
}).filter(function (droppable) {
var activeOfTarget = getKnownActive(droppable);
if (isMovingForward) {
return active[axis.crossAxisEnd] < activeOfTarget[axis.crossAxisEnd];
}
return activeOfTarget[axis.crossAxisStart] < active[axis.crossAxisStart];
}).filter(function (droppable) {
var activeOfTarget = getKnownActive(droppable);
var isBetweenDestinationClipped = isWithin(activeOfTarget[axis.start], activeOfTarget[axis.end]);
return isBetweenSourceClipped(activeOfTarget[axis.start]) || isBetweenSourceClipped(activeOfTarget[axis.end]) || isBetweenDestinationClipped(active[axis.start]) || isBetweenDestinationClipped(active[axis.end]);
}).sort(function (a, b) {
var first = getKnownActive(a)[axis.crossAxisStart];
var second = getKnownActive(b)[axis.crossAxisStart];
if (isMovingForward) {
return first - second;
}
return second - first;
}).filter(function (droppable, index, array) {
return getKnownActive(droppable)[axis.crossAxisStart] === getKnownActive(array[0])[axis.crossAxisStart];
});
if (!candidates.length) {
return null;
}
if (candidates.length === 1) {
return candidates[0];
}
var contains = candidates.filter(function (droppable) {
var isWithinDroppable = isWithin(getKnownActive(droppable)[axis.start], getKnownActive(droppable)[axis.end]);
return isWithinDroppable(pageBorderBoxCenter[axis.line]);
});
if (contains.length === 1) {
return contains[0];
}
if (contains.length > 1) {
return contains.sort(function (a, b) {
return getKnownActive(a)[axis.start] - getKnownActive(b)[axis.start];
})[0];
}
return candidates.sort(function (a, b) {
var first = react_beautiful_dnd_esm_closest(pageBorderBoxCenter, getCorners(getKnownActive(a)));
var second = react_beautiful_dnd_esm_closest(pageBorderBoxCenter, getCorners(getKnownActive(b)));
if (first !== second) {
return first - second;
}
return getKnownActive(a)[axis.start] - getKnownActive(b)[axis.start];
})[0];
});
var getCurrentPageBorderBoxCenter = function getCurrentPageBorderBoxCenter(draggable, afterCritical) {
var original = draggable.page.borderBox.center;
return didStartAfterCritical(draggable.descriptor.id, afterCritical) ? subtract(original, afterCritical.displacedBy.point) : original;
};
var getCurrentPageBorderBox = function getCurrentPageBorderBox(draggable, afterCritical) {
var original = draggable.page.borderBox;
return didStartAfterCritical(draggable.descriptor.id, afterCritical) ? offsetByPosition(original, negate(afterCritical.displacedBy.point)) : original;
};
var getClosestDraggable = (function (_ref) {
var pageBorderBoxCenter = _ref.pageBorderBoxCenter,
viewport = _ref.viewport,
destination = _ref.destination,
insideDestination = _ref.insideDestination,
afterCritical = _ref.afterCritical;
var sorted = insideDestination.filter(function (draggable) {
return react_beautiful_dnd_esm_isTotallyVisible({
target: getCurrentPageBorderBox(draggable, afterCritical),
destination: destination,
viewport: viewport.frame,
withDroppableDisplacement: true
});
}).sort(function (a, b) {
var distanceToA = distance(pageBorderBoxCenter, withDroppableDisplacement(destination, getCurrentPageBorderBoxCenter(a, afterCritical)));
var distanceToB = distance(pageBorderBoxCenter, withDroppableDisplacement(destination, getCurrentPageBorderBoxCenter(b, afterCritical)));
if (distanceToA < distanceToB) {
return -1;
}
if (distanceToB < distanceToA) {
return 1;
}
return a.descriptor.index - b.descriptor.index;
});
return sorted[0] || null;
});
var getDisplacedBy = memoize_one_esm(function getDisplacedBy(axis, displaceBy) {
var displacement = displaceBy[axis.line];
return {
value: displacement,
point: patch(axis.line, displacement)
};
});
var getRequiredGrowthForPlaceholder = function getRequiredGrowthForPlaceholder(droppable, placeholderSize, draggables) {
var axis = droppable.axis;
if (droppable.descriptor.mode === 'virtual') {
return patch(axis.line, placeholderSize[axis.line]);
}
var availableSpace = droppable.subject.page.contentBox[axis.size];
var insideDroppable = getDraggablesInsideDroppable(droppable.descriptor.id, draggables);
var spaceUsed = insideDroppable.reduce(function (sum, dimension) {
return sum + dimension.client.marginBox[axis.size];
}, 0);
var requiredSpace = spaceUsed + placeholderSize[axis.line];
var needsToGrowBy = requiredSpace - availableSpace;
if (needsToGrowBy <= 0) {
return null;
}
return patch(axis.line, needsToGrowBy);
};
var react_beautiful_dnd_esm_withMaxScroll = function withMaxScroll(frame, max) {
return Object(esm_extends["a" /* default */])({}, frame, {
scroll: Object(esm_extends["a" /* default */])({}, frame.scroll, {
max: max
})
});
};
var react_beautiful_dnd_esm_addPlaceholder = function addPlaceholder(droppable, draggable, draggables) {
var frame = droppable.frame;
!!isHomeOf(draggable, droppable) ? false ? undefined : invariant(false) : void 0;
!!droppable.subject.withPlaceholder ? false ? undefined : invariant(false) : void 0;
var placeholderSize = getDisplacedBy(droppable.axis, draggable.displaceBy).point;
var requiredGrowth = getRequiredGrowthForPlaceholder(droppable, placeholderSize, draggables);
var added = {
placeholderSize: placeholderSize,
increasedBy: requiredGrowth,
oldFrameMaxScroll: droppable.frame ? droppable.frame.scroll.max : null
};
if (!frame) {
var _subject = getSubject({
page: droppable.subject.page,
withPlaceholder: added,
axis: droppable.axis,
frame: droppable.frame
});
return Object(esm_extends["a" /* default */])({}, droppable, {
subject: _subject
});
}
var maxScroll = requiredGrowth ? add(frame.scroll.max, requiredGrowth) : frame.scroll.max;
var newFrame = react_beautiful_dnd_esm_withMaxScroll(frame, maxScroll);
var subject = getSubject({
page: droppable.subject.page,
withPlaceholder: added,
axis: droppable.axis,
frame: newFrame
});
return Object(esm_extends["a" /* default */])({}, droppable, {
subject: subject,
frame: newFrame
});
};
var react_beautiful_dnd_esm_removePlaceholder = function removePlaceholder(droppable) {
var added = droppable.subject.withPlaceholder;
!added ? false ? undefined : invariant(false) : void 0;
var frame = droppable.frame;
if (!frame) {
var _subject2 = getSubject({
page: droppable.subject.page,
axis: droppable.axis,
frame: null,
withPlaceholder: null
});
return Object(esm_extends["a" /* default */])({}, droppable, {
subject: _subject2
});
}
var oldMaxScroll = added.oldFrameMaxScroll;
!oldMaxScroll ? false ? undefined : invariant(false) : void 0;
var newFrame = react_beautiful_dnd_esm_withMaxScroll(frame, oldMaxScroll);
var subject = getSubject({
page: droppable.subject.page,
axis: droppable.axis,
frame: newFrame,
withPlaceholder: null
});
return Object(esm_extends["a" /* default */])({}, droppable, {
subject: subject,
frame: newFrame
});
};
var moveToNewDroppable = (function (_ref) {
var previousPageBorderBoxCenter = _ref.previousPageBorderBoxCenter,
moveRelativeTo = _ref.moveRelativeTo,
insideDestination = _ref.insideDestination,
draggable = _ref.draggable,
draggables = _ref.draggables,
destination = _ref.destination,
viewport = _ref.viewport,
afterCritical = _ref.afterCritical;
if (!moveRelativeTo) {
if (insideDestination.length) {
return null;
}
var proposed = {
displaced: emptyGroups,
displacedBy: noDisplacedBy,
at: {
type: 'REORDER',
destination: {
droppableId: destination.descriptor.id,
index: 0
}
}
};
var proposedPageBorderBoxCenter = getPageBorderBoxCenterFromImpact({
impact: proposed,
draggable: draggable,
droppable: destination,
draggables: draggables,
afterCritical: afterCritical
});
var withPlaceholder = isHomeOf(draggable, destination) ? destination : react_beautiful_dnd_esm_addPlaceholder(destination, draggable, draggables);
var isVisibleInNewLocation = isTotallyVisibleInNewLocation({
draggable: draggable,
destination: withPlaceholder,
newPageBorderBoxCenter: proposedPageBorderBoxCenter,
viewport: viewport.frame,
withDroppableDisplacement: false,
onlyOnMainAxis: true
});
return isVisibleInNewLocation ? proposed : null;
}
var isGoingBeforeTarget = Boolean(previousPageBorderBoxCenter[destination.axis.line] <= moveRelativeTo.page.borderBox.center[destination.axis.line]);
var proposedIndex = function () {
var relativeTo = moveRelativeTo.descriptor.index;
if (moveRelativeTo.descriptor.id === draggable.descriptor.id) {
return relativeTo;
}
if (isGoingBeforeTarget) {
return relativeTo;
}
return relativeTo + 1;
}();
var displacedBy = getDisplacedBy(destination.axis, draggable.displaceBy);
return calculateReorderImpact({
draggable: draggable,
insideDestination: insideDestination,
destination: destination,
viewport: viewport,
displacedBy: displacedBy,
last: emptyGroups,
index: proposedIndex
});
});
var moveCrossAxis = (function (_ref) {
var isMovingForward = _ref.isMovingForward,
previousPageBorderBoxCenter = _ref.previousPageBorderBoxCenter,
draggable = _ref.draggable,
isOver = _ref.isOver,
draggables = _ref.draggables,
droppables = _ref.droppables,
viewport = _ref.viewport,
afterCritical = _ref.afterCritical;
var destination = getBestCrossAxisDroppable({
isMovingForward: isMovingForward,
pageBorderBoxCenter: previousPageBorderBoxCenter,
source: isOver,
droppables: droppables,
viewport: viewport
});
if (!destination) {
return null;
}
var insideDestination = getDraggablesInsideDroppable(destination.descriptor.id, draggables);
var moveRelativeTo = getClosestDraggable({
pageBorderBoxCenter: previousPageBorderBoxCenter,
viewport: viewport,
destination: destination,
insideDestination: insideDestination,
afterCritical: afterCritical
});
var impact = moveToNewDroppable({
previousPageBorderBoxCenter: previousPageBorderBoxCenter,
destination: destination,
draggable: draggable,
draggables: draggables,
moveRelativeTo: moveRelativeTo,
insideDestination: insideDestination,
viewport: viewport,
afterCritical: afterCritical
});
if (!impact) {
return null;
}
var pageBorderBoxCenter = getPageBorderBoxCenterFromImpact({
impact: impact,
draggable: draggable,
droppable: destination,
draggables: draggables,
afterCritical: afterCritical
});
var clientSelection = getClientFromPageBorderBoxCenter({
pageBorderBoxCenter: pageBorderBoxCenter,
draggable: draggable,
viewport: viewport
});
return {
clientSelection: clientSelection,
impact: impact,
scrollJumpRequest: null
};
});
var whatIsDraggedOver = (function (impact) {
var at = impact.at;
if (!at) {
return null;
}
if (at.type === 'REORDER') {
return at.destination.droppableId;
}
return at.combine.droppableId;
});
var getDroppableOver = function getDroppableOver(impact, droppables) {
var id = whatIsDraggedOver(impact);
return id ? droppables[id] : null;
};
var moveInDirection = (function (_ref) {
var state = _ref.state,
type = _ref.type;
var isActuallyOver = getDroppableOver(state.impact, state.dimensions.droppables);
var isMainAxisMovementAllowed = Boolean(isActuallyOver);
var home = state.dimensions.droppables[state.critical.droppable.id];
var isOver = isActuallyOver || home;
var direction = isOver.axis.direction;
var isMovingOnMainAxis = direction === 'vertical' && (type === 'MOVE_UP' || type === 'MOVE_DOWN') || direction === 'horizontal' && (type === 'MOVE_LEFT' || type === 'MOVE_RIGHT');
if (isMovingOnMainAxis && !isMainAxisMovementAllowed) {
return null;
}
var isMovingForward = type === 'MOVE_DOWN' || type === 'MOVE_RIGHT';
var draggable = state.dimensions.draggables[state.critical.draggable.id];
var previousPageBorderBoxCenter = state.current.page.borderBoxCenter;
var _state$dimensions = state.dimensions,
draggables = _state$dimensions.draggables,
droppables = _state$dimensions.droppables;
return isMovingOnMainAxis ? moveToNextPlace({
isMovingForward: isMovingForward,
previousPageBorderBoxCenter: previousPageBorderBoxCenter,
draggable: draggable,
destination: isOver,
draggables: draggables,
viewport: state.viewport,
previousClientSelection: state.current.client.selection,
previousImpact: state.impact,
afterCritical: state.afterCritical
}) : moveCrossAxis({
isMovingForward: isMovingForward,
previousPageBorderBoxCenter: previousPageBorderBoxCenter,
draggable: draggable,
isOver: isOver,
draggables: draggables,
droppables: droppables,
viewport: state.viewport,
afterCritical: state.afterCritical
});
});
function react_beautiful_dnd_esm_isMovementAllowed(state) {
return state.phase === 'DRAGGING' || state.phase === 'COLLECTING';
}
function isPositionInFrame(frame) {
var isWithinVertical = isWithin(frame.top, frame.bottom);
var isWithinHorizontal = isWithin(frame.left, frame.right);
return function run(point) {
return isWithinVertical(point.y) && isWithinHorizontal(point.x);
};
}
function getHasOverlap(first, second) {
return first.left < second.right && first.right > second.left && first.top < second.bottom && first.bottom > second.top;
}
function getFurthestAway(_ref) {
var pageBorderBox = _ref.pageBorderBox,
draggable = _ref.draggable,
candidates = _ref.candidates;
var startCenter = draggable.page.borderBox.center;
var sorted = candidates.map(function (candidate) {
var axis = candidate.axis;
var target = patch(candidate.axis.line, pageBorderBox.center[axis.line], candidate.page.borderBox.center[axis.crossAxisLine]);
return {
id: candidate.descriptor.id,
distance: distance(startCenter, target)
};
}).sort(function (a, b) {
return b.distance - a.distance;
});
return sorted[0] ? sorted[0].id : null;
}
function getDroppableOver$1(_ref2) {
var pageBorderBox = _ref2.pageBorderBox,
draggable = _ref2.draggable,
droppables = _ref2.droppables;
var candidates = toDroppableList(droppables).filter(function (item) {
if (!item.isEnabled) {
return false;
}
var active = item.subject.active;
if (!active) {
return false;
}
if (!getHasOverlap(pageBorderBox, active)) {
return false;
}
if (isPositionInFrame(active)(pageBorderBox.center)) {
return true;
}
var axis = item.axis;
var childCenter = active.center[axis.crossAxisLine];
var crossAxisStart = pageBorderBox[axis.crossAxisStart];
var crossAxisEnd = pageBorderBox[axis.crossAxisEnd];
var isContained = isWithin(active[axis.crossAxisStart], active[axis.crossAxisEnd]);
var isStartContained = isContained(crossAxisStart);
var isEndContained = isContained(crossAxisEnd);
if (!isStartContained && !isEndContained) {
return true;
}
if (isStartContained) {
return crossAxisStart < childCenter;
}
return crossAxisEnd > childCenter;
});
if (!candidates.length) {
return null;
}
if (candidates.length === 1) {
return candidates[0].descriptor.id;
}
return getFurthestAway({
pageBorderBox: pageBorderBox,
draggable: draggable,
candidates: candidates
});
}
var react_beautiful_dnd_esm_offsetRectByPosition = function offsetRectByPosition(rect, point) {
return getRect(offsetByPosition(rect, point));
};
var react_beautiful_dnd_esm_withDroppableScroll = (function (droppable, area) {
var frame = droppable.frame;
if (!frame) {
return area;
}
return react_beautiful_dnd_esm_offsetRectByPosition(area, frame.scroll.diff.value);
});
function getIsDisplaced(_ref) {
var displaced = _ref.displaced,
id = _ref.id;
return Boolean(displaced.visible[id] || displaced.invisible[id]);
}
function atIndex(_ref) {
var draggable = _ref.draggable,
closest = _ref.closest,
inHomeList = _ref.inHomeList;
if (!closest) {
return null;
}
if (!inHomeList) {
return closest.descriptor.index;
}
if (closest.descriptor.index > draggable.descriptor.index) {
return closest.descriptor.index - 1;
}
return closest.descriptor.index;
}
var getReorderImpact = (function (_ref2) {
var targetRect = _ref2.pageBorderBoxWithDroppableScroll,
draggable = _ref2.draggable,
destination = _ref2.destination,
insideDestination = _ref2.insideDestination,
last = _ref2.last,
viewport = _ref2.viewport,
afterCritical = _ref2.afterCritical;
var axis = destination.axis;
var displacedBy = getDisplacedBy(destination.axis, draggable.displaceBy);
var displacement = displacedBy.value;
var targetStart = targetRect[axis.start];
var targetEnd = targetRect[axis.end];
var withoutDragging = removeDraggableFromList(draggable, insideDestination);
var closest = find(withoutDragging, function (child) {
var id = child.descriptor.id;
var childCenter = child.page.borderBox.center[axis.line];
var didStartAfterCritical$1 = didStartAfterCritical(id, afterCritical);
var isDisplaced = getIsDisplaced({
displaced: last,
id: id
});
if (didStartAfterCritical$1) {
if (isDisplaced) {
return targetEnd <= childCenter;
}
return targetStart < childCenter - displacement;
}
if (isDisplaced) {
return targetEnd <= childCenter + displacement;
}
return targetStart < childCenter;
});
var newIndex = atIndex({
draggable: draggable,
closest: closest,
inHomeList: isHomeOf(draggable, destination)
});
return calculateReorderImpact({
draggable: draggable,
insideDestination: insideDestination,
destination: destination,
viewport: viewport,
last: last,
displacedBy: displacedBy,
index: newIndex
});
});
var combineThresholdDivisor = 4;
var getCombineImpact = (function (_ref) {
var draggable = _ref.draggable,
targetRect = _ref.pageBorderBoxWithDroppableScroll,
previousImpact = _ref.previousImpact,
destination = _ref.destination,
insideDestination = _ref.insideDestination,
afterCritical = _ref.afterCritical;
if (!destination.isCombineEnabled) {
return null;
}
var axis = destination.axis;
var displacedBy = getDisplacedBy(destination.axis, draggable.displaceBy);
var displacement = displacedBy.value;
var targetStart = targetRect[axis.start];
var targetEnd = targetRect[axis.end];
var withoutDragging = removeDraggableFromList(draggable, insideDestination);
var combineWith = find(withoutDragging, function (child) {
var id = child.descriptor.id;
var childRect = child.page.borderBox;
var childSize = childRect[axis.size];
var threshold = childSize / combineThresholdDivisor;
var didStartAfterCritical$1 = didStartAfterCritical(id, afterCritical);
var isDisplaced = getIsDisplaced({
displaced: previousImpact.displaced,
id: id
});
if (didStartAfterCritical$1) {
if (isDisplaced) {
return targetEnd > childRect[axis.start] + threshold && targetEnd < childRect[axis.end] - threshold;
}
return targetStart > childRect[axis.start] - displacement + threshold && targetStart < childRect[axis.end] - displacement - threshold;
}
if (isDisplaced) {
return targetEnd > childRect[axis.start] + displacement + threshold && targetEnd < childRect[axis.end] + displacement - threshold;
}
return targetStart > childRect[axis.start] + threshold && targetStart < childRect[axis.end] - threshold;
});
if (!combineWith) {
return null;
}
var impact = {
displacedBy: displacedBy,
displaced: previousImpact.displaced,
at: {
type: 'COMBINE',
combine: {
draggableId: combineWith.descriptor.id,
droppableId: destination.descriptor.id
}
}
};
return impact;
});
var getDragImpact = (function (_ref) {
var pageOffset = _ref.pageOffset,
draggable = _ref.draggable,
draggables = _ref.draggables,
droppables = _ref.droppables,
previousImpact = _ref.previousImpact,
viewport = _ref.viewport,
afterCritical = _ref.afterCritical;
var pageBorderBox = react_beautiful_dnd_esm_offsetRectByPosition(draggable.page.borderBox, pageOffset);
var destinationId = getDroppableOver$1({
pageBorderBox: pageBorderBox,
draggable: draggable,
droppables: droppables
});
if (!destinationId) {
return noImpact;
}
var destination = droppables[destinationId];
var insideDestination = getDraggablesInsideDroppable(destination.descriptor.id, draggables);
var pageBorderBoxWithDroppableScroll = react_beautiful_dnd_esm_withDroppableScroll(destination, pageBorderBox);
return getCombineImpact({
pageBorderBoxWithDroppableScroll: pageBorderBoxWithDroppableScroll,
draggable: draggable,
previousImpact: previousImpact,
destination: destination,
insideDestination: insideDestination,
afterCritical: afterCritical
}) || getReorderImpact({
pageBorderBoxWithDroppableScroll: pageBorderBoxWithDroppableScroll,
draggable: draggable,
destination: destination,
insideDestination: insideDestination,
last: previousImpact.displaced,
viewport: viewport,
afterCritical: afterCritical
});
});
var patchDroppableMap = (function (droppables, updated) {
var _extends2;
return Object(esm_extends["a" /* default */])({}, droppables, (_extends2 = {}, _extends2[updated.descriptor.id] = updated, _extends2));
});
var clearUnusedPlaceholder = function clearUnusedPlaceholder(_ref) {
var previousImpact = _ref.previousImpact,
impact = _ref.impact,
droppables = _ref.droppables;
var last = whatIsDraggedOver(previousImpact);
var now = whatIsDraggedOver(impact);
if (!last) {
return droppables;
}
if (last === now) {
return droppables;
}
var lastDroppable = droppables[last];
if (!lastDroppable.subject.withPlaceholder) {
return droppables;
}
var updated = react_beautiful_dnd_esm_removePlaceholder(lastDroppable);
return patchDroppableMap(droppables, updated);
};
var recomputePlaceholders = (function (_ref2) {
var draggable = _ref2.draggable,
draggables = _ref2.draggables,
droppables = _ref2.droppables,
previousImpact = _ref2.previousImpact,
impact = _ref2.impact;
var cleaned = clearUnusedPlaceholder({
previousImpact: previousImpact,
impact: impact,
droppables: droppables
});
var isOver = whatIsDraggedOver(impact);
if (!isOver) {
return cleaned;
}
var droppable = droppables[isOver];
if (isHomeOf(draggable, droppable)) {
return cleaned;
}
if (droppable.subject.withPlaceholder) {
return cleaned;
}
var patched = react_beautiful_dnd_esm_addPlaceholder(droppable, draggable, draggables);
return patchDroppableMap(cleaned, patched);
});
var react_beautiful_dnd_esm_update = (function (_ref) {
var state = _ref.state,
forcedClientSelection = _ref.clientSelection,
forcedDimensions = _ref.dimensions,
forcedViewport = _ref.viewport,
forcedImpact = _ref.impact,
scrollJumpRequest = _ref.scrollJumpRequest;
var viewport = forcedViewport || state.viewport;
var dimensions = forcedDimensions || state.dimensions;
var clientSelection = forcedClientSelection || state.current.client.selection;
var offset = subtract(clientSelection, state.initial.client.selection);
var client = {
offset: offset,
selection: clientSelection,
borderBoxCenter: add(state.initial.client.borderBoxCenter, offset)
};
var page = {
selection: add(client.selection, viewport.scroll.current),
borderBoxCenter: add(client.borderBoxCenter, viewport.scroll.current),
offset: add(client.offset, viewport.scroll.diff.value)
};
var current = {
client: client,
page: page
};
if (state.phase === 'COLLECTING') {
return Object(esm_extends["a" /* default */])({
phase: 'COLLECTING'
}, state, {
dimensions: dimensions,
viewport: viewport,
current: current
});
}
var draggable = dimensions.draggables[state.critical.draggable.id];
var newImpact = forcedImpact || getDragImpact({
pageOffset: page.offset,
draggable: draggable,
draggables: dimensions.draggables,
droppables: dimensions.droppables,
previousImpact: state.impact,
viewport: viewport,
afterCritical: state.afterCritical
});
var withUpdatedPlaceholders = recomputePlaceholders({
draggable: draggable,
impact: newImpact,
previousImpact: state.impact,
draggables: dimensions.draggables,
droppables: dimensions.droppables
});
var result = Object(esm_extends["a" /* default */])({}, state, {
current: current,
dimensions: {
draggables: dimensions.draggables,
droppables: withUpdatedPlaceholders
},
impact: newImpact,
viewport: viewport,
scrollJumpRequest: scrollJumpRequest || null,
forceShouldAnimate: scrollJumpRequest ? false : null
});
return result;
});
function getDraggables$1(ids, draggables) {
return ids.map(function (id) {
return draggables[id];
});
}
var recompute = (function (_ref) {
var impact = _ref.impact,
viewport = _ref.viewport,
draggables = _ref.draggables,
destination = _ref.destination,
forceShouldAnimate = _ref.forceShouldAnimate;
var last = impact.displaced;
var afterDragging = getDraggables$1(last.all, draggables);
var displaced = getDisplacementGroups({
afterDragging: afterDragging,
destination: destination,
displacedBy: impact.displacedBy,
viewport: viewport.frame,
forceShouldAnimate: forceShouldAnimate,
last: last
});
return Object(esm_extends["a" /* default */])({}, impact, {
displaced: displaced
});
});
var getClientBorderBoxCenter = (function (_ref) {
var impact = _ref.impact,
draggable = _ref.draggable,
droppable = _ref.droppable,
draggables = _ref.draggables,
viewport = _ref.viewport,
afterCritical = _ref.afterCritical;
var pageBorderBoxCenter = getPageBorderBoxCenterFromImpact({
impact: impact,
draggable: draggable,
draggables: draggables,
droppable: droppable,
afterCritical: afterCritical
});
return getClientFromPageBorderBoxCenter({
pageBorderBoxCenter: pageBorderBoxCenter,
draggable: draggable,
viewport: viewport
});
});
var refreshSnap = (function (_ref) {
var state = _ref.state,
forcedDimensions = _ref.dimensions,
forcedViewport = _ref.viewport;
!(state.movementMode === 'SNAP') ? false ? undefined : invariant(false) : void 0;
var needsVisibilityCheck = state.impact;
var viewport = forcedViewport || state.viewport;
var dimensions = forcedDimensions || state.dimensions;
var draggables = dimensions.draggables,
droppables = dimensions.droppables;
var draggable = draggables[state.critical.draggable.id];
var isOver = whatIsDraggedOver(needsVisibilityCheck);
!isOver ? false ? undefined : invariant(false) : void 0;
var destination = droppables[isOver];
var impact = recompute({
impact: needsVisibilityCheck,
viewport: viewport,
destination: destination,
draggables: draggables
});
var clientSelection = getClientBorderBoxCenter({
impact: impact,
draggable: draggable,
droppable: destination,
draggables: draggables,
viewport: viewport,
afterCritical: state.afterCritical
});
return react_beautiful_dnd_esm_update({
impact: impact,
clientSelection: clientSelection,
state: state,
dimensions: dimensions,
viewport: viewport
});
});
var getHomeLocation = (function (descriptor) {
return {
index: descriptor.index,
droppableId: descriptor.droppableId
};
});
var getLiftEffect = (function (_ref) {
var draggable = _ref.draggable,
home = _ref.home,
draggables = _ref.draggables,
viewport = _ref.viewport;
var displacedBy = getDisplacedBy(home.axis, draggable.displaceBy);
var insideHome = getDraggablesInsideDroppable(home.descriptor.id, draggables);
var rawIndex = insideHome.indexOf(draggable);
!(rawIndex !== -1) ? false ? undefined : invariant(false) : void 0;
var afterDragging = insideHome.slice(rawIndex + 1);
var effected = afterDragging.reduce(function (previous, item) {
previous[item.descriptor.id] = true;
return previous;
}, {});
var afterCritical = {
inVirtualList: home.descriptor.mode === 'virtual',
displacedBy: displacedBy,
effected: effected
};
var displaced = getDisplacementGroups({
afterDragging: afterDragging,
destination: home,
displacedBy: displacedBy,
last: null,
viewport: viewport.frame,
forceShouldAnimate: false
});
var impact = {
displaced: displaced,
displacedBy: displacedBy,
at: {
type: 'REORDER',
destination: getHomeLocation(draggable.descriptor)
}
};
return {
impact: impact,
afterCritical: afterCritical
};
});
var patchDimensionMap = (function (dimensions, updated) {
return {
draggables: dimensions.draggables,
droppables: patchDroppableMap(dimensions.droppables, updated)
};
});
var react_beautiful_dnd_esm_start = function start(key) {
if (false) {}
};
var react_beautiful_dnd_esm_finish = function finish(key) {
if (false) {}
};
var offsetDraggable = (function (_ref) {
var draggable = _ref.draggable,
offset$1 = _ref.offset,
initialWindowScroll = _ref.initialWindowScroll;
var client = css_box_model_esm_offset(draggable.client, offset$1);
var page = withScroll(client, initialWindowScroll);
var moved = Object(esm_extends["a" /* default */])({}, draggable, {
placeholder: Object(esm_extends["a" /* default */])({}, draggable.placeholder, {
client: client
}),
client: client,
page: page
});
return moved;
});
var getFrame = (function (droppable) {
var frame = droppable.frame;
!frame ? false ? undefined : invariant(false) : void 0;
return frame;
});
var adjustAdditionsForScrollChanges = (function (_ref) {
var additions = _ref.additions,
updatedDroppables = _ref.updatedDroppables,
viewport = _ref.viewport;
var windowScrollChange = viewport.scroll.diff.value;
return additions.map(function (draggable) {
var droppableId = draggable.descriptor.droppableId;
var modified = updatedDroppables[droppableId];
var frame = getFrame(modified);
var droppableScrollChange = frame.scroll.diff.value;
var totalChange = add(windowScrollChange, droppableScrollChange);
var moved = offsetDraggable({
draggable: draggable,
offset: totalChange,
initialWindowScroll: viewport.scroll.initial
});
return moved;
});
});
var publishWhileDraggingInVirtual = (function (_ref) {
var state = _ref.state,
published = _ref.published;
react_beautiful_dnd_esm_start();
var withScrollChange = published.modified.map(function (update) {
var existing = state.dimensions.droppables[update.droppableId];
var scrolled = react_beautiful_dnd_esm_scrollDroppable(existing, update.scroll);
return scrolled;
});
var droppables = Object(esm_extends["a" /* default */])({}, state.dimensions.droppables, {}, toDroppableMap(withScrollChange));
var updatedAdditions = toDraggableMap(adjustAdditionsForScrollChanges({
additions: published.additions,
updatedDroppables: droppables,
viewport: state.viewport
}));
var draggables = Object(esm_extends["a" /* default */])({}, state.dimensions.draggables, {}, updatedAdditions);
published.removals.forEach(function (id) {
delete draggables[id];
});
var dimensions = {
droppables: droppables,
draggables: draggables
};
var wasOverId = whatIsDraggedOver(state.impact);
var wasOver = wasOverId ? dimensions.droppables[wasOverId] : null;
var draggable = dimensions.draggables[state.critical.draggable.id];
var home = dimensions.droppables[state.critical.droppable.id];
var _getLiftEffect = getLiftEffect({
draggable: draggable,
home: home,
draggables: draggables,
viewport: state.viewport
}),
onLiftImpact = _getLiftEffect.impact,
afterCritical = _getLiftEffect.afterCritical;
var previousImpact = wasOver && wasOver.isCombineEnabled ? state.impact : onLiftImpact;
var impact = getDragImpact({
pageOffset: state.current.page.offset,
draggable: dimensions.draggables[state.critical.draggable.id],
draggables: dimensions.draggables,
droppables: dimensions.droppables,
previousImpact: previousImpact,
viewport: state.viewport,
afterCritical: afterCritical
});
react_beautiful_dnd_esm_finish();
var draggingState = Object(esm_extends["a" /* default */])({
phase: 'DRAGGING'
}, state, {
phase: 'DRAGGING',
impact: impact,
onLiftImpact: onLiftImpact,
dimensions: dimensions,
afterCritical: afterCritical,
forceShouldAnimate: false
});
if (state.phase === 'COLLECTING') {
return draggingState;
}
var dropPending = Object(esm_extends["a" /* default */])({
phase: 'DROP_PENDING'
}, draggingState, {
phase: 'DROP_PENDING',
reason: state.reason,
isWaiting: false
});
return dropPending;
});
var isSnapping = function isSnapping(state) {
return state.movementMode === 'SNAP';
};
var postDroppableChange = function postDroppableChange(state, updated, isEnabledChanging) {
var dimensions = patchDimensionMap(state.dimensions, updated);
if (!isSnapping(state) || isEnabledChanging) {
return react_beautiful_dnd_esm_update({
state: state,
dimensions: dimensions
});
}
return refreshSnap({
state: state,
dimensions: dimensions
});
};
function removeScrollJumpRequest(state) {
if (state.isDragging && state.movementMode === 'SNAP') {
return Object(esm_extends["a" /* default */])({
phase: 'DRAGGING'
}, state, {
scrollJumpRequest: null
});
}
return state;
}
var idle = {
phase: 'IDLE',
completed: null,
shouldFlush: false
};
var reducer = (function (state, action) {
if (state === void 0) {
state = idle;
}
if (action.type === 'FLUSH') {
return Object(esm_extends["a" /* default */])({}, idle, {
shouldFlush: true
});
}
if (action.type === 'INITIAL_PUBLISH') {
!(state.phase === 'IDLE') ? false ? undefined : invariant(false) : void 0;
var _action$payload = action.payload,
critical = _action$payload.critical,
clientSelection = _action$payload.clientSelection,
viewport = _action$payload.viewport,
dimensions = _action$payload.dimensions,
movementMode = _action$payload.movementMode;
var draggable = dimensions.draggables[critical.draggable.id];
var home = dimensions.droppables[critical.droppable.id];
var client = {
selection: clientSelection,
borderBoxCenter: draggable.client.borderBox.center,
offset: origin
};
var initial = {
client: client,
page: {
selection: add(client.selection, viewport.scroll.initial),
borderBoxCenter: add(client.selection, viewport.scroll.initial),
offset: add(client.selection, viewport.scroll.diff.value)
}
};
var isWindowScrollAllowed = toDroppableList(dimensions.droppables).every(function (item) {
return !item.isFixedOnPage;
});
var _getLiftEffect = getLiftEffect({
draggable: draggable,
home: home,
draggables: dimensions.draggables,
viewport: viewport
}),
impact = _getLiftEffect.impact,
afterCritical = _getLiftEffect.afterCritical;
var result = {
phase: 'DRAGGING',
isDragging: true,
critical: critical,
movementMode: movementMode,
dimensions: dimensions,
initial: initial,
current: initial,
isWindowScrollAllowed: isWindowScrollAllowed,
impact: impact,
afterCritical: afterCritical,
onLiftImpact: impact,
viewport: viewport,
scrollJumpRequest: null,
forceShouldAnimate: null
};
return result;
}
if (action.type === 'COLLECTION_STARTING') {
if (state.phase === 'COLLECTING' || state.phase === 'DROP_PENDING') {
return state;
}
!(state.phase === 'DRAGGING') ? false ? undefined : invariant(false) : void 0;
var _result = Object(esm_extends["a" /* default */])({
phase: 'COLLECTING'
}, state, {
phase: 'COLLECTING'
});
return _result;
}
if (action.type === 'PUBLISH_WHILE_DRAGGING') {
!(state.phase === 'COLLECTING' || state.phase === 'DROP_PENDING') ? false ? undefined : invariant(false) : void 0;
return publishWhileDraggingInVirtual({
state: state,
published: action.payload
});
}
if (action.type === 'MOVE') {
if (state.phase === 'DROP_PENDING') {
return state;
}
!react_beautiful_dnd_esm_isMovementAllowed(state) ? false ? undefined : invariant(false) : void 0;
var _clientSelection = action.payload.client;
if (react_beautiful_dnd_esm_isEqual(_clientSelection, state.current.client.selection)) {
return state;
}
return react_beautiful_dnd_esm_update({
state: state,
clientSelection: _clientSelection,
impact: isSnapping(state) ? state.impact : null
});
}
if (action.type === 'UPDATE_DROPPABLE_SCROLL') {
if (state.phase === 'DROP_PENDING') {
return removeScrollJumpRequest(state);
}
if (state.phase === 'COLLECTING') {
return removeScrollJumpRequest(state);
}
!react_beautiful_dnd_esm_isMovementAllowed(state) ? false ? undefined : invariant(false) : void 0;
var _action$payload2 = action.payload,
id = _action$payload2.id,
newScroll = _action$payload2.newScroll;
var target = state.dimensions.droppables[id];
if (!target) {
return state;
}
var scrolled = react_beautiful_dnd_esm_scrollDroppable(target, newScroll);
return postDroppableChange(state, scrolled, false);
}
if (action.type === 'UPDATE_DROPPABLE_IS_ENABLED') {
if (state.phase === 'DROP_PENDING') {
return state;
}
!react_beautiful_dnd_esm_isMovementAllowed(state) ? false ? undefined : invariant(false) : void 0;
var _action$payload3 = action.payload,
_id = _action$payload3.id,
isEnabled = _action$payload3.isEnabled;
var _target = state.dimensions.droppables[_id];
!_target ? false ? undefined : invariant(false) : void 0;
!(_target.isEnabled !== isEnabled) ? false ? undefined : invariant(false) : void 0;
var updated = Object(esm_extends["a" /* default */])({}, _target, {
isEnabled: isEnabled
});
return postDroppableChange(state, updated, true);
}
if (action.type === 'UPDATE_DROPPABLE_IS_COMBINE_ENABLED') {
if (state.phase === 'DROP_PENDING') {
return state;
}
!react_beautiful_dnd_esm_isMovementAllowed(state) ? false ? undefined : invariant(false) : void 0;
var _action$payload4 = action.payload,
_id2 = _action$payload4.id,
isCombineEnabled = _action$payload4.isCombineEnabled;
var _target2 = state.dimensions.droppables[_id2];
!_target2 ? false ? undefined : invariant(false) : void 0;
!(_target2.isCombineEnabled !== isCombineEnabled) ? false ? undefined : invariant(false) : void 0;
var _updated = Object(esm_extends["a" /* default */])({}, _target2, {
isCombineEnabled: isCombineEnabled
});
return postDroppableChange(state, _updated, true);
}
if (action.type === 'MOVE_BY_WINDOW_SCROLL') {
if (state.phase === 'DROP_PENDING' || state.phase === 'DROP_ANIMATING') {
return state;
}
!react_beautiful_dnd_esm_isMovementAllowed(state) ? false ? undefined : invariant(false) : void 0;
!state.isWindowScrollAllowed ? false ? undefined : invariant(false) : void 0;
var _newScroll = action.payload.newScroll;
if (react_beautiful_dnd_esm_isEqual(state.viewport.scroll.current, _newScroll)) {
return removeScrollJumpRequest(state);
}
var _viewport = scrollViewport(state.viewport, _newScroll);
if (isSnapping(state)) {
return refreshSnap({
state: state,
viewport: _viewport
});
}
return react_beautiful_dnd_esm_update({
state: state,
viewport: _viewport
});
}
if (action.type === 'UPDATE_VIEWPORT_MAX_SCROLL') {
if (!react_beautiful_dnd_esm_isMovementAllowed(state)) {
return state;
}
var maxScroll = action.payload.maxScroll;
if (react_beautiful_dnd_esm_isEqual(maxScroll, state.viewport.scroll.max)) {
return state;
}
var withMaxScroll = Object(esm_extends["a" /* default */])({}, state.viewport, {
scroll: Object(esm_extends["a" /* default */])({}, state.viewport.scroll, {
max: maxScroll
})
});
return Object(esm_extends["a" /* default */])({
phase: 'DRAGGING'
}, state, {
viewport: withMaxScroll
});
}
if (action.type === 'MOVE_UP' || action.type === 'MOVE_DOWN' || action.type === 'MOVE_LEFT' || action.type === 'MOVE_RIGHT') {
if (state.phase === 'COLLECTING' || state.phase === 'DROP_PENDING') {
return state;
}
!(state.phase === 'DRAGGING') ? false ? undefined : invariant(false) : void 0;
var _result2 = moveInDirection({
state: state,
type: action.type
});
if (!_result2) {
return state;
}
return react_beautiful_dnd_esm_update({
state: state,
impact: _result2.impact,
clientSelection: _result2.clientSelection,
scrollJumpRequest: _result2.scrollJumpRequest
});
}
if (action.type === 'DROP_PENDING') {
var reason = action.payload.reason;
!(state.phase === 'COLLECTING') ? false ? undefined : invariant(false) : void 0;
var newState = Object(esm_extends["a" /* default */])({
phase: 'DROP_PENDING'
}, state, {
phase: 'DROP_PENDING',
isWaiting: true,
reason: reason
});
return newState;
}
if (action.type === 'DROP_ANIMATE') {
var _action$payload5 = action.payload,
completed = _action$payload5.completed,
dropDuration = _action$payload5.dropDuration,
newHomeClientOffset = _action$payload5.newHomeClientOffset;
!(state.phase === 'DRAGGING' || state.phase === 'DROP_PENDING') ? false ? undefined : invariant(false) : void 0;
var _result3 = {
phase: 'DROP_ANIMATING',
completed: completed,
dropDuration: dropDuration,
newHomeClientOffset: newHomeClientOffset,
dimensions: state.dimensions
};
return _result3;
}
if (action.type === 'DROP_COMPLETE') {
var _completed = action.payload.completed;
return {
phase: 'IDLE',
completed: _completed,
shouldFlush: false
};
}
return state;
});
var beforeInitialCapture = function beforeInitialCapture(args) {
return {
type: 'BEFORE_INITIAL_CAPTURE',
payload: args
};
};
var lift = function lift(args) {
return {
type: 'LIFT',
payload: args
};
};
var initialPublish = function initialPublish(args) {
return {
type: 'INITIAL_PUBLISH',
payload: args
};
};
var publishWhileDragging = function publishWhileDragging(args) {
return {
type: 'PUBLISH_WHILE_DRAGGING',
payload: args
};
};
var collectionStarting = function collectionStarting() {
return {
type: 'COLLECTION_STARTING',
payload: null
};
};
var updateDroppableScroll = function updateDroppableScroll(args) {
return {
type: 'UPDATE_DROPPABLE_SCROLL',
payload: args
};
};
var updateDroppableIsEnabled = function updateDroppableIsEnabled(args) {
return {
type: 'UPDATE_DROPPABLE_IS_ENABLED',
payload: args
};
};
var updateDroppableIsCombineEnabled = function updateDroppableIsCombineEnabled(args) {
return {
type: 'UPDATE_DROPPABLE_IS_COMBINE_ENABLED',
payload: args
};
};
var move = function move(args) {
return {
type: 'MOVE',
payload: args
};
};
var moveByWindowScroll = function moveByWindowScroll(args) {
return {
type: 'MOVE_BY_WINDOW_SCROLL',
payload: args
};
};
var react_beautiful_dnd_esm_updateViewportMaxScroll = function updateViewportMaxScroll(args) {
return {
type: 'UPDATE_VIEWPORT_MAX_SCROLL',
payload: args
};
};
var moveUp = function moveUp() {
return {
type: 'MOVE_UP',
payload: null
};
};
var moveDown = function moveDown() {
return {
type: 'MOVE_DOWN',
payload: null
};
};
var moveRight = function moveRight() {
return {
type: 'MOVE_RIGHT',
payload: null
};
};
var moveLeft = function moveLeft() {
return {
type: 'MOVE_LEFT',
payload: null
};
};
var react_beautiful_dnd_esm_flush = function flush() {
return {
type: 'FLUSH',
payload: null
};
};
var animateDrop = function animateDrop(args) {
return {
type: 'DROP_ANIMATE',
payload: args
};
};
var completeDrop = function completeDrop(args) {
return {
type: 'DROP_COMPLETE',
payload: args
};
};
var react_beautiful_dnd_esm_drop = function drop(args) {
return {
type: 'DROP',
payload: args
};
};
var react_beautiful_dnd_esm_dropPending = function dropPending(args) {
return {
type: 'DROP_PENDING',
payload: args
};
};
var dropAnimationFinished = function dropAnimationFinished() {
return {
type: 'DROP_ANIMATION_FINISHED',
payload: null
};
};
function checkIndexes(insideDestination) {
if (insideDestination.length <= 1) {
return;
}
var indexes = insideDestination.map(function (d) {
return d.descriptor.index;
});
var errors = {};
for (var i = 1; i < indexes.length; i++) {
var current = indexes[i];
var previous = indexes[i - 1];
if (current !== previous + 1) {
errors[current] = true;
}
}
if (!Object.keys(errors).length) {
return;
}
var formatted = indexes.map(function (index) {
var hasError = Boolean(errors[index]);
return hasError ? "[\uD83D\uDD25" + index + "]" : "" + index;
}).join(', ');
false ? undefined : void 0;
}
function validateDimensions(critical, dimensions) {
if (false) { var insideDestination; }
}
var react_beautiful_dnd_esm_lift$1 = (function (marshal) {
return function (_ref) {
var getState = _ref.getState,
dispatch = _ref.dispatch;
return function (next) {
return function (action) {
if (action.type !== 'LIFT') {
next(action);
return;
}
var _action$payload = action.payload,
id = _action$payload.id,
clientSelection = _action$payload.clientSelection,
movementMode = _action$payload.movementMode;
var initial = getState();
if (initial.phase === 'DROP_ANIMATING') {
dispatch(completeDrop({
completed: initial.completed
}));
}
!(getState().phase === 'IDLE') ? false ? undefined : invariant(false) : void 0;
dispatch(react_beautiful_dnd_esm_flush());
dispatch(beforeInitialCapture({
draggableId: id,
movementMode: movementMode
}));
var scrollOptions = {
shouldPublishImmediately: movementMode === 'SNAP'
};
var request = {
draggableId: id,
scrollOptions: scrollOptions
};
var _marshal$startPublish = marshal.startPublishing(request),
critical = _marshal$startPublish.critical,
dimensions = _marshal$startPublish.dimensions,
viewport = _marshal$startPublish.viewport;
validateDimensions(critical, dimensions);
dispatch(initialPublish({
critical: critical,
dimensions: dimensions,
clientSelection: clientSelection,
movementMode: movementMode,
viewport: viewport
}));
};
};
};
});
var react_beautiful_dnd_esm_style = (function (marshal) {
return function () {
return function (next) {
return function (action) {
if (action.type === 'INITIAL_PUBLISH') {
marshal.dragging();
}
if (action.type === 'DROP_ANIMATE') {
marshal.dropping(action.payload.completed.result.reason);
}
if (action.type === 'FLUSH' || action.type === 'DROP_COMPLETE') {
marshal.resting();
}
next(action);
};
};
};
});
var curves = {
outOfTheWay: 'cubic-bezier(0.2, 0, 0, 1)',
drop: 'cubic-bezier(.2,1,.1,1)'
};
var react_beautiful_dnd_esm_combine = {
opacity: {
drop: 0,
combining: 0.7
},
scale: {
drop: 0.75
}
};
var timings = {
outOfTheWay: 0.2,
minDropTime: 0.33,
maxDropTime: 0.55
};
var outOfTheWayTiming = timings.outOfTheWay + "s " + curves.outOfTheWay;
var transitions = {
fluid: "opacity " + outOfTheWayTiming,
snap: "transform " + outOfTheWayTiming + ", opacity " + outOfTheWayTiming,
drop: function drop(duration) {
var timing = duration + "s " + curves.drop;
return "transform " + timing + ", opacity " + timing;
},
outOfTheWay: "transform " + outOfTheWayTiming,
placeholder: "height " + outOfTheWayTiming + ", width " + outOfTheWayTiming + ", margin " + outOfTheWayTiming
};
var moveTo = function moveTo(offset) {
return react_beautiful_dnd_esm_isEqual(offset, origin) ? null : "translate(" + offset.x + "px, " + offset.y + "px)";
};
var transforms = {
moveTo: moveTo,
drop: function drop(offset, isCombining) {
var translate = moveTo(offset);
if (!translate) {
return null;
}
if (!isCombining) {
return translate;
}
return translate + " scale(" + react_beautiful_dnd_esm_combine.scale.drop + ")";
}
};
var minDropTime = timings.minDropTime,
maxDropTime = timings.maxDropTime;
var dropTimeRange = maxDropTime - minDropTime;
var maxDropTimeAtDistance = 1500;
var cancelDropModifier = 0.6;
var getDropDuration = (function (_ref) {
var current = _ref.current,
destination = _ref.destination,
reason = _ref.reason;
var distance$1 = distance(current, destination);
if (distance$1 <= 0) {
return minDropTime;
}
if (distance$1 >= maxDropTimeAtDistance) {
return maxDropTime;
}
var percentage = distance$1 / maxDropTimeAtDistance;
var duration = minDropTime + dropTimeRange * percentage;
var withDuration = reason === 'CANCEL' ? duration * cancelDropModifier : duration;
return Number(withDuration.toFixed(2));
});
var getNewHomeClientOffset = (function (_ref) {
var impact = _ref.impact,
draggable = _ref.draggable,
dimensions = _ref.dimensions,
viewport = _ref.viewport,
afterCritical = _ref.afterCritical;
var draggables = dimensions.draggables,
droppables = dimensions.droppables;
var droppableId = whatIsDraggedOver(impact);
var destination = droppableId ? droppables[droppableId] : null;
var home = droppables[draggable.descriptor.droppableId];
var newClientCenter = getClientBorderBoxCenter({
impact: impact,
draggable: draggable,
draggables: draggables,
afterCritical: afterCritical,
droppable: destination || home,
viewport: viewport
});
var offset = subtract(newClientCenter, draggable.client.borderBox.center);
return offset;
});
var getDropImpact = (function (_ref) {
var draggables = _ref.draggables,
reason = _ref.reason,
lastImpact = _ref.lastImpact,
home = _ref.home,
viewport = _ref.viewport,
onLiftImpact = _ref.onLiftImpact;
if (!lastImpact.at || reason !== 'DROP') {
var recomputedHomeImpact = recompute({
draggables: draggables,
impact: onLiftImpact,
destination: home,
viewport: viewport,
forceShouldAnimate: true
});
return {
impact: recomputedHomeImpact,
didDropInsideDroppable: false
};
}
if (lastImpact.at.type === 'REORDER') {
return {
impact: lastImpact,
didDropInsideDroppable: true
};
}
var withoutMovement = Object(esm_extends["a" /* default */])({}, lastImpact, {
displaced: emptyGroups
});
return {
impact: withoutMovement,
didDropInsideDroppable: true
};
});
var drop$1 = (function (_ref) {
var getState = _ref.getState,
dispatch = _ref.dispatch;
return function (next) {
return function (action) {
if (action.type !== 'DROP') {
next(action);
return;
}
var state = getState();
var reason = action.payload.reason;
if (state.phase === 'COLLECTING') {
dispatch(react_beautiful_dnd_esm_dropPending({
reason: reason
}));
return;
}
if (state.phase === 'IDLE') {
return;
}
var isWaitingForDrop = state.phase === 'DROP_PENDING' && state.isWaiting;
!!isWaitingForDrop ? false ? undefined : invariant(false) : void 0;
!(state.phase === 'DRAGGING' || state.phase === 'DROP_PENDING') ? false ? undefined : invariant(false) : void 0;
var critical = state.critical;
var dimensions = state.dimensions;
var draggable = dimensions.draggables[state.critical.draggable.id];
var _getDropImpact = getDropImpact({
reason: reason,
lastImpact: state.impact,
afterCritical: state.afterCritical,
onLiftImpact: state.onLiftImpact,
home: state.dimensions.droppables[state.critical.droppable.id],
viewport: state.viewport,
draggables: state.dimensions.draggables
}),
impact = _getDropImpact.impact,
didDropInsideDroppable = _getDropImpact.didDropInsideDroppable;
var destination = didDropInsideDroppable ? tryGetDestination(impact) : null;
var combine = didDropInsideDroppable ? tryGetCombine(impact) : null;
var source = {
index: critical.draggable.index,
droppableId: critical.droppable.id
};
var result = {
draggableId: draggable.descriptor.id,
type: draggable.descriptor.type,
source: source,
reason: reason,
mode: state.movementMode,
destination: destination,
combine: combine
};
var newHomeClientOffset = getNewHomeClientOffset({
impact: impact,
draggable: draggable,
dimensions: dimensions,
viewport: state.viewport,
afterCritical: state.afterCritical
});
var completed = {
critical: state.critical,
afterCritical: state.afterCritical,
result: result,
impact: impact
};
var isAnimationRequired = !react_beautiful_dnd_esm_isEqual(state.current.client.offset, newHomeClientOffset) || Boolean(result.combine);
if (!isAnimationRequired) {
dispatch(completeDrop({
completed: completed
}));
return;
}
var dropDuration = getDropDuration({
current: state.current.client.offset,
destination: newHomeClientOffset,
reason: reason
});
var args = {
newHomeClientOffset: newHomeClientOffset,
dropDuration: dropDuration,
completed: completed
};
dispatch(animateDrop(args));
};
};
});
var react_beautiful_dnd_esm_getWindowScroll = (function () {
return {
x: window.pageXOffset,
y: window.pageYOffset
};
});
function getWindowScrollBinding(update) {
return {
eventName: 'scroll',
options: {
passive: true,
capture: false
},
fn: function fn(event) {
if (event.target !== window && event.target !== window.document) {
return;
}
update();
}
};
}
function getScrollListener(_ref) {
var onWindowScroll = _ref.onWindowScroll;
function updateScroll() {
onWindowScroll(react_beautiful_dnd_esm_getWindowScroll());
}
var scheduled = raf_schd_esm(updateScroll);
var binding = getWindowScrollBinding(scheduled);
var unbind = noop;
function isActive() {
return unbind !== noop;
}
function start() {
!!isActive() ? false ? undefined : invariant(false) : void 0;
unbind = bindEvents(window, [binding]);
}
function stop() {
!isActive() ? false ? undefined : invariant(false) : void 0;
scheduled.cancel();
unbind();
unbind = noop;
}
return {
start: start,
stop: stop,
isActive: isActive
};
}
var shouldEnd = function shouldEnd(action) {
return action.type === 'DROP_COMPLETE' || action.type === 'DROP_ANIMATE' || action.type === 'FLUSH';
};
var scrollListener = (function (store) {
var listener = getScrollListener({
onWindowScroll: function onWindowScroll(newScroll) {
store.dispatch(moveByWindowScroll({
newScroll: newScroll
}));
}
});
return function (next) {
return function (action) {
if (!listener.isActive() && action.type === 'INITIAL_PUBLISH') {
listener.start();
}
if (listener.isActive() && shouldEnd(action)) {
listener.stop();
}
next(action);
};
};
});
var getExpiringAnnounce = (function (announce) {
var wasCalled = false;
var isExpired = false;
var timeoutId = setTimeout(function () {
isExpired = true;
});
var result = function result(message) {
if (wasCalled) {
false ? undefined : void 0;
return;
}
if (isExpired) {
false ? undefined : void 0;
return;
}
wasCalled = true;
announce(message);
clearTimeout(timeoutId);
};
result.wasCalled = function () {
return wasCalled;
};
return result;
});
var getAsyncMarshal = (function () {
var entries = [];
var execute = function execute(timerId) {
var index = findIndex(entries, function (item) {
return item.timerId === timerId;
});
!(index !== -1) ? false ? undefined : invariant(false) : void 0;
var _entries$splice = entries.splice(index, 1),
entry = _entries$splice[0];
entry.callback();
};
var add = function add(fn) {
var timerId = setTimeout(function () {
return execute(timerId);
});
var entry = {
timerId: timerId,
callback: fn
};
entries.push(entry);
};
var flush = function flush() {
if (!entries.length) {
return;
}
var shallow = [].concat(entries);
entries.length = 0;
shallow.forEach(function (entry) {
clearTimeout(entry.timerId);
entry.callback();
});
};
return {
add: add,
flush: flush
};
});
var areLocationsEqual = function areLocationsEqual(first, second) {
if (first == null && second == null) {
return true;
}
if (first == null || second == null) {
return false;
}
return first.droppableId === second.droppableId && first.index === second.index;
};
var isCombineEqual = function isCombineEqual(first, second) {
if (first == null && second == null) {
return true;
}
if (first == null || second == null) {
return false;
}
return first.draggableId === second.draggableId && first.droppableId === second.droppableId;
};
var isCriticalEqual = function isCriticalEqual(first, second) {
if (first === second) {
return true;
}
var isDraggableEqual = first.draggable.id === second.draggable.id && first.draggable.droppableId === second.draggable.droppableId && first.draggable.type === second.draggable.type && first.draggable.index === second.draggable.index;
var isDroppableEqual = first.droppable.id === second.droppable.id && first.droppable.type === second.droppable.type;
return isDraggableEqual && isDroppableEqual;
};
var withTimings = function withTimings(key, fn) {
react_beautiful_dnd_esm_start();
fn();
react_beautiful_dnd_esm_finish();
};
var getDragStart = function getDragStart(critical, mode) {
return {
draggableId: critical.draggable.id,
type: critical.droppable.type,
source: {
droppableId: critical.droppable.id,
index: critical.draggable.index
},
mode: mode
};
};
var execute = function execute(responder, data, announce, getDefaultMessage) {
if (!responder) {
announce(getDefaultMessage(data));
return;
}
var willExpire = getExpiringAnnounce(announce);
var provided = {
announce: willExpire
};
responder(data, provided);
if (!willExpire.wasCalled()) {
announce(getDefaultMessage(data));
}
};
var getPublisher = (function (getResponders, announce) {
var asyncMarshal = getAsyncMarshal();
var dragging = null;
var beforeCapture = function beforeCapture(draggableId, mode) {
!!dragging ? false ? undefined : invariant(false) : void 0;
withTimings('onBeforeCapture', function () {
var fn = getResponders().onBeforeCapture;
if (fn) {
var before = {
draggableId: draggableId,
mode: mode
};
fn(before);
}
});
};
var beforeStart = function beforeStart(critical, mode) {
!!dragging ? false ? undefined : invariant(false) : void 0;
withTimings('onBeforeDragStart', function () {
var fn = getResponders().onBeforeDragStart;
if (fn) {
fn(getDragStart(critical, mode));
}
});
};
var start = function start(critical, mode) {
!!dragging ? false ? undefined : invariant(false) : void 0;
var data = getDragStart(critical, mode);
dragging = {
mode: mode,
lastCritical: critical,
lastLocation: data.source,
lastCombine: null
};
asyncMarshal.add(function () {
withTimings('onDragStart', function () {
return execute(getResponders().onDragStart, data, announce, preset.onDragStart);
});
});
};
var update = function update(critical, impact) {
var location = tryGetDestination(impact);
var combine = tryGetCombine(impact);
!dragging ? false ? undefined : invariant(false) : void 0;
var hasCriticalChanged = !isCriticalEqual(critical, dragging.lastCritical);
if (hasCriticalChanged) {
dragging.lastCritical = critical;
}
var hasLocationChanged = !areLocationsEqual(dragging.lastLocation, location);
if (hasLocationChanged) {
dragging.lastLocation = location;
}
var hasGroupingChanged = !isCombineEqual(dragging.lastCombine, combine);
if (hasGroupingChanged) {
dragging.lastCombine = combine;
}
if (!hasCriticalChanged && !hasLocationChanged && !hasGroupingChanged) {
return;
}
var data = Object(esm_extends["a" /* default */])({}, getDragStart(critical, dragging.mode), {
combine: combine,
destination: location
});
asyncMarshal.add(function () {
withTimings('onDragUpdate', function () {
return execute(getResponders().onDragUpdate, data, announce, preset.onDragUpdate);
});
});
};
var flush = function flush() {
!dragging ? false ? undefined : invariant(false) : void 0;
asyncMarshal.flush();
};
var drop = function drop(result) {
!dragging ? false ? undefined : invariant(false) : void 0;
dragging = null;
withTimings('onDragEnd', function () {
return execute(getResponders().onDragEnd, result, announce, preset.onDragEnd);
});
};
var abort = function abort() {
if (!dragging) {
return;
}
var result = Object(esm_extends["a" /* default */])({}, getDragStart(dragging.lastCritical, dragging.mode), {
combine: null,
destination: null,
reason: 'CANCEL'
});
drop(result);
};
return {
beforeCapture: beforeCapture,
beforeStart: beforeStart,
start: start,
update: update,
flush: flush,
drop: drop,
abort: abort
};
});
var responders = (function (getResponders, announce) {
var publisher = getPublisher(getResponders, announce);
return function (store) {
return function (next) {
return function (action) {
if (action.type === 'BEFORE_INITIAL_CAPTURE') {
publisher.beforeCapture(action.payload.draggableId, action.payload.movementMode);
return;
}
if (action.type === 'INITIAL_PUBLISH') {
var critical = action.payload.critical;
publisher.beforeStart(critical, action.payload.movementMode);
next(action);
publisher.start(critical, action.payload.movementMode);
return;
}
if (action.type === 'DROP_COMPLETE') {
var result = action.payload.completed.result;
publisher.flush();
next(action);
publisher.drop(result);
return;
}
next(action);
if (action.type === 'FLUSH') {
publisher.abort();
return;
}
var state = store.getState();
if (state.phase === 'DRAGGING') {
publisher.update(state.critical, state.impact);
}
};
};
};
});
var dropAnimationFinish = (function (store) {
return function (next) {
return function (action) {
if (action.type !== 'DROP_ANIMATION_FINISHED') {
next(action);
return;
}
var state = store.getState();
!(state.phase === 'DROP_ANIMATING') ? false ? undefined : invariant(false) : void 0;
store.dispatch(completeDrop({
completed: state.completed
}));
};
};
});
var dropAnimationFlushOnScroll = (function (store) {
var unbind = null;
var frameId = null;
function clear() {
if (frameId) {
cancelAnimationFrame(frameId);
frameId = null;
}
if (unbind) {
unbind();
unbind = null;
}
}
return function (next) {
return function (action) {
if (action.type === 'FLUSH' || action.type === 'DROP_COMPLETE' || action.type === 'DROP_ANIMATION_FINISHED') {
clear();
}
next(action);
if (action.type !== 'DROP_ANIMATE') {
return;
}
var binding = {
eventName: 'scroll',
options: {
capture: true,
passive: false,
once: true
},
fn: function flushDropAnimation() {
var state = store.getState();
if (state.phase === 'DROP_ANIMATING') {
store.dispatch(dropAnimationFinished());
}
}
};
frameId = requestAnimationFrame(function () {
frameId = null;
unbind = bindEvents(window, [binding]);
});
};
};
});
var dimensionMarshalStopper = (function (marshal) {
return function () {
return function (next) {
return function (action) {
if (action.type === 'DROP_COMPLETE' || action.type === 'FLUSH' || action.type === 'DROP_ANIMATE') {
marshal.stopPublishing();
}
next(action);
};
};
};
});
var react_beautiful_dnd_esm_focus = (function (marshal) {
var isWatching = false;
return function () {
return function (next) {
return function (action) {
if (action.type === 'INITIAL_PUBLISH') {
isWatching = true;
marshal.tryRecordFocus(action.payload.critical.draggable.id);
next(action);
marshal.tryRestoreFocusRecorded();
return;
}
next(action);
if (!isWatching) {
return;
}
if (action.type === 'FLUSH') {
isWatching = false;
marshal.tryRestoreFocusRecorded();
return;
}
if (action.type === 'DROP_COMPLETE') {
isWatching = false;
var result = action.payload.completed.result;
if (result.combine) {
marshal.tryShiftRecord(result.draggableId, result.combine.draggableId);
}
marshal.tryRestoreFocusRecorded();
}
};
};
};
});
var shouldStop = function shouldStop(action) {
return action.type === 'DROP_COMPLETE' || action.type === 'DROP_ANIMATE' || action.type === 'FLUSH';
};
var autoScroll = (function (autoScroller) {
return function (store) {
return function (next) {
return function (action) {
if (shouldStop(action)) {
autoScroller.stop();
next(action);
return;
}
if (action.type === 'INITIAL_PUBLISH') {
next(action);
var state = store.getState();
!(state.phase === 'DRAGGING') ? false ? undefined : invariant(false) : void 0;
autoScroller.start(state);
return;
}
next(action);
autoScroller.scroll(store.getState());
};
};
};
});
var pendingDrop = (function (store) {
return function (next) {
return function (action) {
next(action);
if (action.type !== 'PUBLISH_WHILE_DRAGGING') {
return;
}
var postActionState = store.getState();
if (postActionState.phase !== 'DROP_PENDING') {
return;
}
if (postActionState.isWaiting) {
return;
}
store.dispatch(react_beautiful_dnd_esm_drop({
reason: postActionState.reason
}));
};
};
});
var composeEnhancers = false ? undefined : redux["d" /* compose */];
var createStore = (function (_ref) {
var dimensionMarshal = _ref.dimensionMarshal,
focusMarshal = _ref.focusMarshal,
styleMarshal = _ref.styleMarshal,
getResponders = _ref.getResponders,
announce = _ref.announce,
autoScroller = _ref.autoScroller;
return Object(redux["e" /* createStore */])(reducer, composeEnhancers(Object(redux["a" /* applyMiddleware */])(react_beautiful_dnd_esm_style(styleMarshal), dimensionMarshalStopper(dimensionMarshal), react_beautiful_dnd_esm_lift$1(dimensionMarshal), drop$1, dropAnimationFinish, dropAnimationFlushOnScroll, pendingDrop, autoScroll(autoScroller), scrollListener, react_beautiful_dnd_esm_focus(focusMarshal), responders(getResponders, announce))));
});
var clean$1 = function clean() {
return {
additions: {},
removals: {},
modified: {}
};
};
function createPublisher(_ref) {
var registry = _ref.registry,
callbacks = _ref.callbacks;
var staging = clean$1();
var frameId = null;
var collect = function collect() {
if (frameId) {
return;
}
callbacks.collectionStarting();
frameId = requestAnimationFrame(function () {
frameId = null;
react_beautiful_dnd_esm_start();
var _staging = staging,
additions = _staging.additions,
removals = _staging.removals,
modified = _staging.modified;
var added = Object.keys(additions).map(function (id) {
return registry.draggable.getById(id).getDimension(origin);
}).sort(function (a, b) {
return a.descriptor.index - b.descriptor.index;
});
var updated = Object.keys(modified).map(function (id) {
var entry = registry.droppable.getById(id);
var scroll = entry.callbacks.getScrollWhileDragging();
return {
droppableId: id,
scroll: scroll
};
});
var result = {
additions: added,
removals: Object.keys(removals),
modified: updated
};
staging = clean$1();
react_beautiful_dnd_esm_finish();
callbacks.publish(result);
});
};
var add = function add(entry) {
var id = entry.descriptor.id;
staging.additions[id] = entry;
staging.modified[entry.descriptor.droppableId] = true;
if (staging.removals[id]) {
delete staging.removals[id];
}
collect();
};
var remove = function remove(entry) {
var descriptor = entry.descriptor;
staging.removals[descriptor.id] = true;
staging.modified[descriptor.droppableId] = true;
if (staging.additions[descriptor.id]) {
delete staging.additions[descriptor.id];
}
collect();
};
var stop = function stop() {
if (!frameId) {
return;
}
cancelAnimationFrame(frameId);
frameId = null;
staging = clean$1();
};
return {
add: add,
remove: remove,
stop: stop
};
}
var getMaxScroll = (function (_ref) {
var scrollHeight = _ref.scrollHeight,
scrollWidth = _ref.scrollWidth,
height = _ref.height,
width = _ref.width;
var maxScroll = subtract({
x: scrollWidth,
y: scrollHeight
}, {
x: width,
y: height
});
var adjustedMaxScroll = {
x: Math.max(0, maxScroll.x),
y: Math.max(0, maxScroll.y)
};
return adjustedMaxScroll;
});
var getDocumentElement = (function () {
var doc = document.documentElement;
!doc ? false ? undefined : invariant(false) : void 0;
return doc;
});
var getMaxWindowScroll = (function () {
var doc = getDocumentElement();
var maxScroll = getMaxScroll({
scrollHeight: doc.scrollHeight,
scrollWidth: doc.scrollWidth,
width: doc.clientWidth,
height: doc.clientHeight
});
return maxScroll;
});
var getViewport = (function () {
var scroll = react_beautiful_dnd_esm_getWindowScroll();
var maxScroll = getMaxWindowScroll();
var top = scroll.y;
var left = scroll.x;
var doc = getDocumentElement();
var width = doc.clientWidth;
var height = doc.clientHeight;
var right = left + width;
var bottom = top + height;
var frame = getRect({
top: top,
left: left,
right: right,
bottom: bottom
});
var viewport = {
frame: frame,
scroll: {
initial: scroll,
current: scroll,
max: maxScroll,
diff: {
value: origin,
displacement: origin
}
}
};
return viewport;
});
var getInitialPublish = (function (_ref) {
var critical = _ref.critical,
scrollOptions = _ref.scrollOptions,
registry = _ref.registry;
react_beautiful_dnd_esm_start();
var viewport = getViewport();
var windowScroll = viewport.scroll.current;
var home = critical.droppable;
var droppables = registry.droppable.getAllByType(home.type).map(function (entry) {
return entry.callbacks.getDimensionAndWatchScroll(windowScroll, scrollOptions);
});
var draggables = registry.draggable.getAllByType(critical.draggable.type).map(function (entry) {
return entry.getDimension(windowScroll);
});
var dimensions = {
draggables: toDraggableMap(draggables),
droppables: toDroppableMap(droppables)
};
react_beautiful_dnd_esm_finish();
var result = {
dimensions: dimensions,
critical: critical,
viewport: viewport
};
return result;
});
function shouldPublishUpdate(registry, dragging, entry) {
if (entry.descriptor.id === dragging.id) {
return false;
}
if (entry.descriptor.type !== dragging.type) {
return false;
}
var home = registry.droppable.getById(entry.descriptor.droppableId);
if (home.descriptor.mode !== 'virtual') {
false ? undefined : void 0;
return false;
}
return true;
}
var createDimensionMarshal = (function (registry, callbacks) {
var collection = null;
var publisher = createPublisher({
callbacks: {
publish: callbacks.publishWhileDragging,
collectionStarting: callbacks.collectionStarting
},
registry: registry
});
var updateDroppableIsEnabled = function updateDroppableIsEnabled(id, isEnabled) {
!registry.droppable.exists(id) ? false ? undefined : invariant(false) : void 0;
if (!collection) {
return;
}
callbacks.updateDroppableIsEnabled({
id: id,
isEnabled: isEnabled
});
};
var updateDroppableIsCombineEnabled = function updateDroppableIsCombineEnabled(id, isCombineEnabled) {
if (!collection) {
return;
}
!registry.droppable.exists(id) ? false ? undefined : invariant(false) : void 0;
callbacks.updateDroppableIsCombineEnabled({
id: id,
isCombineEnabled: isCombineEnabled
});
};
var updateDroppableScroll = function updateDroppableScroll(id, newScroll) {
if (!collection) {
return;
}
!registry.droppable.exists(id) ? false ? undefined : invariant(false) : void 0;
callbacks.updateDroppableScroll({
id: id,
newScroll: newScroll
});
};
var scrollDroppable = function scrollDroppable(id, change) {
if (!collection) {
return;
}
registry.droppable.getById(id).callbacks.scroll(change);
};
var stopPublishing = function stopPublishing() {
if (!collection) {
return;
}
publisher.stop();
var home = collection.critical.droppable;
registry.droppable.getAllByType(home.type).forEach(function (entry) {
return entry.callbacks.dragStopped();
});
collection.unsubscribe();
collection = null;
};
var subscriber = function subscriber(event) {
!collection ? false ? undefined : invariant(false) : void 0;
var dragging = collection.critical.draggable;
if (event.type === 'ADDITION') {
if (shouldPublishUpdate(registry, dragging, event.value)) {
publisher.add(event.value);
}
}
if (event.type === 'REMOVAL') {
if (shouldPublishUpdate(registry, dragging, event.value)) {
publisher.remove(event.value);
}
}
};
var startPublishing = function startPublishing(request) {
!!collection ? false ? undefined : invariant(false) : void 0;
var entry = registry.draggable.getById(request.draggableId);
var home = registry.droppable.getById(entry.descriptor.droppableId);
var critical = {
draggable: entry.descriptor,
droppable: home.descriptor
};
var unsubscribe = registry.subscribe(subscriber);
collection = {
critical: critical,
unsubscribe: unsubscribe
};
return getInitialPublish({
critical: critical,
registry: registry,
scrollOptions: request.scrollOptions
});
};
var marshal = {
updateDroppableIsEnabled: updateDroppableIsEnabled,
updateDroppableIsCombineEnabled: updateDroppableIsCombineEnabled,
scrollDroppable: scrollDroppable,
updateDroppableScroll: updateDroppableScroll,
startPublishing: startPublishing,
stopPublishing: stopPublishing
};
return marshal;
});
var canStartDrag = (function (state, id) {
if (state.phase === 'IDLE') {
return true;
}
if (state.phase !== 'DROP_ANIMATING') {
return false;
}
if (state.completed.result.draggableId === id) {
return false;
}
return state.completed.result.reason === 'DROP';
});
var react_beautiful_dnd_esm_scrollWindow = (function (change) {
window.scrollBy(change.x, change.y);
});
var getScrollableDroppables = memoize_one_esm(function (droppables) {
return toDroppableList(droppables).filter(function (droppable) {
if (!droppable.isEnabled) {
return false;
}
if (!droppable.frame) {
return false;
}
return true;
});
});
var getScrollableDroppableOver = function getScrollableDroppableOver(target, droppables) {
var maybe = find(getScrollableDroppables(droppables), function (droppable) {
!droppable.frame ? false ? undefined : invariant(false) : void 0;
return isPositionInFrame(droppable.frame.pageMarginBox)(target);
});
return maybe;
};
var getBestScrollableDroppable = (function (_ref) {
var center = _ref.center,
destination = _ref.destination,
droppables = _ref.droppables;
if (destination) {
var _dimension = droppables[destination];
if (!_dimension.frame) {
return null;
}
return _dimension;
}
var dimension = getScrollableDroppableOver(center, droppables);
return dimension;
});
var config = {
startFromPercentage: 0.25,
maxScrollAtPercentage: 0.05,
maxPixelScroll: 28,
ease: function ease(percentage) {
return Math.pow(percentage, 2);
},
durationDampening: {
stopDampeningAt: 1200,
accelerateAt: 360
}
};
var getDistanceThresholds = (function (container, axis) {
var startScrollingFrom = container[axis.size] * config.startFromPercentage;
var maxScrollValueAt = container[axis.size] * config.maxScrollAtPercentage;
var thresholds = {
startScrollingFrom: startScrollingFrom,
maxScrollValueAt: maxScrollValueAt
};
return thresholds;
});
var getPercentage = (function (_ref) {
var startOfRange = _ref.startOfRange,
endOfRange = _ref.endOfRange,
current = _ref.current;
var range = endOfRange - startOfRange;
if (range === 0) {
false ? undefined : void 0;
return 0;
}
var currentInRange = current - startOfRange;
var percentage = currentInRange / range;
return percentage;
});
var minScroll = 1;
var getValueFromDistance = (function (distanceToEdge, thresholds) {
if (distanceToEdge > thresholds.startScrollingFrom) {
return 0;
}
if (distanceToEdge <= thresholds.maxScrollValueAt) {
return config.maxPixelScroll;
}
if (distanceToEdge === thresholds.startScrollingFrom) {
return minScroll;
}
var percentageFromMaxScrollValueAt = getPercentage({
startOfRange: thresholds.maxScrollValueAt,
endOfRange: thresholds.startScrollingFrom,
current: distanceToEdge
});
var percentageFromStartScrollingFrom = 1 - percentageFromMaxScrollValueAt;
var scroll = config.maxPixelScroll * config.ease(percentageFromStartScrollingFrom);
return Math.ceil(scroll);
});
var accelerateAt = config.durationDampening.accelerateAt;
var stopAt = config.durationDampening.stopDampeningAt;
var dampenValueByTime = (function (proposedScroll, dragStartTime) {
var startOfRange = dragStartTime;
var endOfRange = stopAt;
var now = Date.now();
var runTime = now - startOfRange;
if (runTime >= stopAt) {
return proposedScroll;
}
if (runTime < accelerateAt) {
return minScroll;
}
var betweenAccelerateAtAndStopAtPercentage = getPercentage({
startOfRange: accelerateAt,
endOfRange: endOfRange,
current: runTime
});
var scroll = proposedScroll * config.ease(betweenAccelerateAtAndStopAtPercentage);
return Math.ceil(scroll);
});
var getValue = (function (_ref) {
var distanceToEdge = _ref.distanceToEdge,
thresholds = _ref.thresholds,
dragStartTime = _ref.dragStartTime,
shouldUseTimeDampening = _ref.shouldUseTimeDampening;
var scroll = getValueFromDistance(distanceToEdge, thresholds);
if (scroll === 0) {
return 0;
}
if (!shouldUseTimeDampening) {
return scroll;
}
return Math.max(dampenValueByTime(scroll, dragStartTime), minScroll);
});
var getScrollOnAxis = (function (_ref) {
var container = _ref.container,
distanceToEdges = _ref.distanceToEdges,
dragStartTime = _ref.dragStartTime,
axis = _ref.axis,
shouldUseTimeDampening = _ref.shouldUseTimeDampening;
var thresholds = getDistanceThresholds(container, axis);
var isCloserToEnd = distanceToEdges[axis.end] < distanceToEdges[axis.start];
if (isCloserToEnd) {
return getValue({
distanceToEdge: distanceToEdges[axis.end],
thresholds: thresholds,
dragStartTime: dragStartTime,
shouldUseTimeDampening: shouldUseTimeDampening
});
}
return -1 * getValue({
distanceToEdge: distanceToEdges[axis.start],
thresholds: thresholds,
dragStartTime: dragStartTime,
shouldUseTimeDampening: shouldUseTimeDampening
});
});
var adjustForSizeLimits = (function (_ref) {
var container = _ref.container,
subject = _ref.subject,
proposedScroll = _ref.proposedScroll;
var isTooBigVertically = subject.height > container.height;
var isTooBigHorizontally = subject.width > container.width;
if (!isTooBigHorizontally && !isTooBigVertically) {
return proposedScroll;
}
if (isTooBigHorizontally && isTooBigVertically) {
return null;
}
return {
x: isTooBigHorizontally ? 0 : proposedScroll.x,
y: isTooBigVertically ? 0 : proposedScroll.y
};
});
var clean$2 = apply(function (value) {
return value === 0 ? 0 : value;
});
var getScroll = (function (_ref) {
var dragStartTime = _ref.dragStartTime,
container = _ref.container,
subject = _ref.subject,
center = _ref.center,
shouldUseTimeDampening = _ref.shouldUseTimeDampening;
var distanceToEdges = {
top: center.y - container.top,
right: container.right - center.x,
bottom: container.bottom - center.y,
left: center.x - container.left
};
var y = getScrollOnAxis({
container: container,
distanceToEdges: distanceToEdges,
dragStartTime: dragStartTime,
axis: vertical,
shouldUseTimeDampening: shouldUseTimeDampening
});
var x = getScrollOnAxis({
container: container,
distanceToEdges: distanceToEdges,
dragStartTime: dragStartTime,
axis: horizontal,
shouldUseTimeDampening: shouldUseTimeDampening
});
var required = clean$2({
x: x,
y: y
});
if (react_beautiful_dnd_esm_isEqual(required, origin)) {
return null;
}
var limited = adjustForSizeLimits({
container: container,
subject: subject,
proposedScroll: required
});
if (!limited) {
return null;
}
return react_beautiful_dnd_esm_isEqual(limited, origin) ? null : limited;
});
var smallestSigned = apply(function (value) {
if (value === 0) {
return 0;
}
return value > 0 ? 1 : -1;
});
var getOverlap = function () {
var getRemainder = function getRemainder(target, max) {
if (target < 0) {
return target;
}
if (target > max) {
return target - max;
}
return 0;
};
return function (_ref) {
var current = _ref.current,
max = _ref.max,
change = _ref.change;
var targetScroll = add(current, change);
var overlap = {
x: getRemainder(targetScroll.x, max.x),
y: getRemainder(targetScroll.y, max.y)
};
if (react_beautiful_dnd_esm_isEqual(overlap, origin)) {
return null;
}
return overlap;
};
}();
var canPartiallyScroll = function canPartiallyScroll(_ref2) {
var rawMax = _ref2.max,
current = _ref2.current,
change = _ref2.change;
var max = {
x: Math.max(current.x, rawMax.x),
y: Math.max(current.y, rawMax.y)
};
var smallestChange = smallestSigned(change);
var overlap = getOverlap({
max: max,
current: current,
change: smallestChange
});
if (!overlap) {
return true;
}
if (smallestChange.x !== 0 && overlap.x === 0) {
return true;
}
if (smallestChange.y !== 0 && overlap.y === 0) {
return true;
}
return false;
};
var canScrollWindow = function canScrollWindow(viewport, change) {
return canPartiallyScroll({
current: viewport.scroll.current,
max: viewport.scroll.max,
change: change
});
};
var getWindowOverlap = function getWindowOverlap(viewport, change) {
if (!canScrollWindow(viewport, change)) {
return null;
}
var max = viewport.scroll.max;
var current = viewport.scroll.current;
return getOverlap({
current: current,
max: max,
change: change
});
};
var canScrollDroppable = function canScrollDroppable(droppable, change) {
var frame = droppable.frame;
if (!frame) {
return false;
}
return canPartiallyScroll({
current: frame.scroll.current,
max: frame.scroll.max,
change: change
});
};
var getDroppableOverlap = function getDroppableOverlap(droppable, change) {
var frame = droppable.frame;
if (!frame) {
return null;
}
if (!canScrollDroppable(droppable, change)) {
return null;
}
return getOverlap({
current: frame.scroll.current,
max: frame.scroll.max,
change: change
});
};
var getWindowScrollChange = (function (_ref) {
var viewport = _ref.viewport,
subject = _ref.subject,
center = _ref.center,
dragStartTime = _ref.dragStartTime,
shouldUseTimeDampening = _ref.shouldUseTimeDampening;
var scroll = getScroll({
dragStartTime: dragStartTime,
container: viewport.frame,
subject: subject,
center: center,
shouldUseTimeDampening: shouldUseTimeDampening
});
return scroll && canScrollWindow(viewport, scroll) ? scroll : null;
});
var getDroppableScrollChange = (function (_ref) {
var droppable = _ref.droppable,
subject = _ref.subject,
center = _ref.center,
dragStartTime = _ref.dragStartTime,
shouldUseTimeDampening = _ref.shouldUseTimeDampening;
var frame = droppable.frame;
if (!frame) {
return null;
}
var scroll = getScroll({
dragStartTime: dragStartTime,
container: frame.pageMarginBox,
subject: subject,
center: center,
shouldUseTimeDampening: shouldUseTimeDampening
});
return scroll && canScrollDroppable(droppable, scroll) ? scroll : null;
});
var scroll$1 = (function (_ref) {
var state = _ref.state,
dragStartTime = _ref.dragStartTime,
shouldUseTimeDampening = _ref.shouldUseTimeDampening,
scrollWindow = _ref.scrollWindow,
scrollDroppable = _ref.scrollDroppable;
var center = state.current.page.borderBoxCenter;
var draggable = state.dimensions.draggables[state.critical.draggable.id];
var subject = draggable.page.marginBox;
if (state.isWindowScrollAllowed) {
var viewport = state.viewport;
var _change = getWindowScrollChange({
dragStartTime: dragStartTime,
viewport: viewport,
subject: subject,
center: center,
shouldUseTimeDampening: shouldUseTimeDampening
});
if (_change) {
scrollWindow(_change);
return;
}
}
var droppable = getBestScrollableDroppable({
center: center,
destination: whatIsDraggedOver(state.impact),
droppables: state.dimensions.droppables
});
if (!droppable) {
return;
}
var change = getDroppableScrollChange({
dragStartTime: dragStartTime,
droppable: droppable,
subject: subject,
center: center,
shouldUseTimeDampening: shouldUseTimeDampening
});
if (change) {
scrollDroppable(droppable.descriptor.id, change);
}
});
var createFluidScroller = (function (_ref) {
var scrollWindow = _ref.scrollWindow,
scrollDroppable = _ref.scrollDroppable;
var scheduleWindowScroll = raf_schd_esm(scrollWindow);
var scheduleDroppableScroll = raf_schd_esm(scrollDroppable);
var dragging = null;
var tryScroll = function tryScroll(state) {
!dragging ? false ? undefined : invariant(false) : void 0;
var _dragging = dragging,
shouldUseTimeDampening = _dragging.shouldUseTimeDampening,
dragStartTime = _dragging.dragStartTime;
scroll$1({
state: state,
scrollWindow: scheduleWindowScroll,
scrollDroppable: scheduleDroppableScroll,
dragStartTime: dragStartTime,
shouldUseTimeDampening: shouldUseTimeDampening
});
};
var start$1 = function start$1(state) {
react_beautiful_dnd_esm_start();
!!dragging ? false ? undefined : invariant(false) : void 0;
var dragStartTime = Date.now();
var wasScrollNeeded = false;
var fakeScrollCallback = function fakeScrollCallback() {
wasScrollNeeded = true;
};
scroll$1({
state: state,
dragStartTime: 0,
shouldUseTimeDampening: false,
scrollWindow: fakeScrollCallback,
scrollDroppable: fakeScrollCallback
});
dragging = {
dragStartTime: dragStartTime,
shouldUseTimeDampening: wasScrollNeeded
};
react_beautiful_dnd_esm_finish();
if (wasScrollNeeded) {
tryScroll(state);
}
};
var stop = function stop() {
if (!dragging) {
return;
}
scheduleWindowScroll.cancel();
scheduleDroppableScroll.cancel();
dragging = null;
};
return {
start: start$1,
stop: stop,
scroll: tryScroll
};
});
var createJumpScroller = (function (_ref) {
var move = _ref.move,
scrollDroppable = _ref.scrollDroppable,
scrollWindow = _ref.scrollWindow;
var moveByOffset = function moveByOffset(state, offset) {
var client = add(state.current.client.selection, offset);
move({
client: client
});
};
var scrollDroppableAsMuchAsItCan = function scrollDroppableAsMuchAsItCan(droppable, change) {
if (!canScrollDroppable(droppable, change)) {
return change;
}
var overlap = getDroppableOverlap(droppable, change);
if (!overlap) {
scrollDroppable(droppable.descriptor.id, change);
return null;
}
var whatTheDroppableCanScroll = subtract(change, overlap);
scrollDroppable(droppable.descriptor.id, whatTheDroppableCanScroll);
var remainder = subtract(change, whatTheDroppableCanScroll);
return remainder;
};
var scrollWindowAsMuchAsItCan = function scrollWindowAsMuchAsItCan(isWindowScrollAllowed, viewport, change) {
if (!isWindowScrollAllowed) {
return change;
}
if (!canScrollWindow(viewport, change)) {
return change;
}
var overlap = getWindowOverlap(viewport, change);
if (!overlap) {
scrollWindow(change);
return null;
}
var whatTheWindowCanScroll = subtract(change, overlap);
scrollWindow(whatTheWindowCanScroll);
var remainder = subtract(change, whatTheWindowCanScroll);
return remainder;
};
var jumpScroller = function jumpScroller(state) {
var request = state.scrollJumpRequest;
if (!request) {
return;
}
var destination = whatIsDraggedOver(state.impact);
!destination ? false ? undefined : invariant(false) : void 0;
var droppableRemainder = scrollDroppableAsMuchAsItCan(state.dimensions.droppables[destination], request);
if (!droppableRemainder) {
return;
}
var viewport = state.viewport;
var windowRemainder = scrollWindowAsMuchAsItCan(state.isWindowScrollAllowed, viewport, droppableRemainder);
if (!windowRemainder) {
return;
}
moveByOffset(state, windowRemainder);
};
return jumpScroller;
});
var createAutoScroller = (function (_ref) {
var scrollDroppable = _ref.scrollDroppable,
scrollWindow = _ref.scrollWindow,
move = _ref.move;
var fluidScroller = createFluidScroller({
scrollWindow: scrollWindow,
scrollDroppable: scrollDroppable
});
var jumpScroll = createJumpScroller({
move: move,
scrollWindow: scrollWindow,
scrollDroppable: scrollDroppable
});
var scroll = function scroll(state) {
if (state.phase !== 'DRAGGING') {
return;
}
if (state.movementMode === 'FLUID') {
fluidScroller.scroll(state);
return;
}
if (!state.scrollJumpRequest) {
return;
}
jumpScroll(state);
};
var scroller = {
scroll: scroll,
start: fluidScroller.start,
stop: fluidScroller.stop
};
return scroller;
});
var prefix$1 = 'data-rbd';
var dragHandle = function () {
var base = prefix$1 + "-drag-handle";
return {
base: base,
draggableId: base + "-draggable-id",
contextId: base + "-context-id"
};
}();
var react_beautiful_dnd_esm_draggable = function () {
var base = prefix$1 + "-draggable";
return {
base: base,
contextId: base + "-context-id",
id: base + "-id"
};
}();
var react_beautiful_dnd_esm_droppable = function () {
var base = prefix$1 + "-droppable";
return {
base: base,
contextId: base + "-context-id",
id: base + "-id"
};
}();
var scrollContainer = {
contextId: prefix$1 + "-scroll-container-context-id"
};
var makeGetSelector = function makeGetSelector(context) {
return function (attribute) {
return "[" + attribute + "=\"" + context + "\"]";
};
};
var getStyles = function getStyles(rules, property) {
return rules.map(function (rule) {
var value = rule.styles[property];
if (!value) {
return '';
}
return rule.selector + " { " + value + " }";
}).join(' ');
};
var noPointerEvents = 'pointer-events: none;';
var getStyles$1 = (function (contextId) {
var getSelector = makeGetSelector(contextId);
var dragHandle$1 = function () {
var grabCursor = "\n cursor: -webkit-grab;\n cursor: grab;\n ";
return {
selector: getSelector(dragHandle.contextId),
styles: {
always: "\n -webkit-touch-callout: none;\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n touch-action: manipulation;\n ",
resting: grabCursor,
dragging: noPointerEvents,
dropAnimating: grabCursor
}
};
}();
var draggable$1 = function () {
var transition = "\n transition: " + transitions.outOfTheWay + ";\n ";
return {
selector: getSelector(react_beautiful_dnd_esm_draggable.contextId),
styles: {
dragging: transition,
dropAnimating: transition,
userCancel: transition
}
};
}();
var droppable$1 = {
selector: getSelector(react_beautiful_dnd_esm_droppable.contextId),
styles: {
always: "overflow-anchor: none;"
}
};
var body = {
selector: 'body',
styles: {
dragging: "\n cursor: grabbing;\n cursor: -webkit-grabbing;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n overflow-anchor: none;\n "
}
};
var rules = [draggable$1, dragHandle$1, droppable$1, body];
return {
always: getStyles(rules, 'always'),
resting: getStyles(rules, 'resting'),
dragging: getStyles(rules, 'dragging'),
dropAnimating: getStyles(rules, 'dropAnimating'),
userCancel: getStyles(rules, 'userCancel')
};
});
var useIsomorphicLayoutEffect = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined' ? external_window_React_["useLayoutEffect"] : external_window_React_["useEffect"];
var getHead = function getHead() {
var head = document.querySelector('head');
!head ? false ? undefined : invariant(false) : void 0;
return head;
};
var createStyleEl = function createStyleEl(nonce) {
var el = document.createElement('style');
if (nonce) {
el.setAttribute('nonce', nonce);
}
el.type = 'text/css';
return el;
};
function useStyleMarshal(contextId, nonce) {
var styles = useMemo(function () {
return getStyles$1(contextId);
}, [contextId]);
var alwaysRef = Object(external_window_React_["useRef"])(null);
var dynamicRef = Object(external_window_React_["useRef"])(null);
var setDynamicStyle = useCallback(memoize_one_esm(function (proposed) {
var el = dynamicRef.current;
!el ? false ? undefined : invariant(false) : void 0;
el.textContent = proposed;
}), []);
var setAlwaysStyle = useCallback(function (proposed) {
var el = alwaysRef.current;
!el ? false ? undefined : invariant(false) : void 0;
el.textContent = proposed;
}, []);
useIsomorphicLayoutEffect(function () {
!(!alwaysRef.current && !dynamicRef.current) ? false ? undefined : invariant(false) : void 0;
var always = createStyleEl(nonce);
var dynamic = createStyleEl(nonce);
alwaysRef.current = always;
dynamicRef.current = dynamic;
always.setAttribute(prefix$1 + "-always", contextId);
dynamic.setAttribute(prefix$1 + "-dynamic", contextId);
getHead().appendChild(always);
getHead().appendChild(dynamic);
setAlwaysStyle(styles.always);
setDynamicStyle(styles.resting);
return function () {
var remove = function remove(ref) {
var current = ref.current;
!current ? false ? undefined : invariant(false) : void 0;
getHead().removeChild(current);
ref.current = null;
};
remove(alwaysRef);
remove(dynamicRef);
};
}, [nonce, setAlwaysStyle, setDynamicStyle, styles.always, styles.resting, contextId]);
var dragging = useCallback(function () {
return setDynamicStyle(styles.dragging);
}, [setDynamicStyle, styles.dragging]);
var dropping = useCallback(function (reason) {
if (reason === 'DROP') {
setDynamicStyle(styles.dropAnimating);
return;
}
setDynamicStyle(styles.userCancel);
}, [setDynamicStyle, styles.dropAnimating, styles.userCancel]);
var resting = useCallback(function () {
if (!dynamicRef.current) {
return;
}
setDynamicStyle(styles.resting);
}, [setDynamicStyle, styles.resting]);
var marshal = useMemo(function () {
return {
dragging: dragging,
dropping: dropping,
resting: resting
};
}, [dragging, dropping, resting]);
return marshal;
}
var getWindowFromEl = (function (el) {
return el && el.ownerDocument ? el.ownerDocument.defaultView : window;
});
function isHtmlElement(el) {
return el instanceof getWindowFromEl(el).HTMLElement;
}
function findDragHandle(contextId, draggableId) {
var selector = "[" + dragHandle.contextId + "=\"" + contextId + "\"]";
var possible = toArray(document.querySelectorAll(selector));
if (!possible.length) {
false ? undefined : void 0;
return null;
}
var handle = find(possible, function (el) {
return el.getAttribute(dragHandle.draggableId) === draggableId;
});
if (!handle) {
false ? undefined : void 0;
return null;
}
if (!isHtmlElement(handle)) {
false ? undefined : void 0;
return null;
}
return handle;
}
function useFocusMarshal(contextId) {
var entriesRef = Object(external_window_React_["useRef"])({});
var recordRef = Object(external_window_React_["useRef"])(null);
var restoreFocusFrameRef = Object(external_window_React_["useRef"])(null);
var isMountedRef = Object(external_window_React_["useRef"])(false);
var register = useCallback(function register(id, focus) {
var entry = {
id: id,
focus: focus
};
entriesRef.current[id] = entry;
return function unregister() {
var entries = entriesRef.current;
var current = entries[id];
if (current !== entry) {
delete entries[id];
}
};
}, []);
var tryGiveFocus = useCallback(function tryGiveFocus(tryGiveFocusTo) {
var handle = findDragHandle(contextId, tryGiveFocusTo);
if (handle && handle !== document.activeElement) {
handle.focus();
}
}, [contextId]);
var tryShiftRecord = useCallback(function tryShiftRecord(previous, redirectTo) {
if (recordRef.current === previous) {
recordRef.current = redirectTo;
}
}, []);
var tryRestoreFocusRecorded = useCallback(function tryRestoreFocusRecorded() {
if (restoreFocusFrameRef.current) {
return;
}
if (!isMountedRef.current) {
return;
}
restoreFocusFrameRef.current = requestAnimationFrame(function () {
restoreFocusFrameRef.current = null;
var record = recordRef.current;
if (record) {
tryGiveFocus(record);
}
});
}, [tryGiveFocus]);
var tryRecordFocus = useCallback(function tryRecordFocus(id) {
recordRef.current = null;
var focused = document.activeElement;
if (!focused) {
return;
}
if (focused.getAttribute(dragHandle.draggableId) !== id) {
return;
}
recordRef.current = id;
}, []);
useIsomorphicLayoutEffect(function () {
isMountedRef.current = true;
return function clearFrameOnUnmount() {
isMountedRef.current = false;
var frameId = restoreFocusFrameRef.current;
if (frameId) {
cancelAnimationFrame(frameId);
}
};
}, []);
var marshal = useMemo(function () {
return {
register: register,
tryRecordFocus: tryRecordFocus,
tryRestoreFocusRecorded: tryRestoreFocusRecorded,
tryShiftRecord: tryShiftRecord
};
}, [register, tryRecordFocus, tryRestoreFocusRecorded, tryShiftRecord]);
return marshal;
}
function createRegistry() {
var entries = {
draggables: {},
droppables: {}
};
var subscribers = [];
function subscribe(cb) {
subscribers.push(cb);
return function unsubscribe() {
var index = subscribers.indexOf(cb);
if (index === -1) {
return;
}
subscribers.splice(index, 1);
};
}
function notify(event) {
if (subscribers.length) {
subscribers.forEach(function (cb) {
return cb(event);
});
}
}
function findDraggableById(id) {
return entries.draggables[id] || null;
}
function getDraggableById(id) {
var entry = findDraggableById(id);
!entry ? false ? undefined : invariant(false) : void 0;
return entry;
}
var draggableAPI = {
register: function register(entry) {
entries.draggables[entry.descriptor.id] = entry;
notify({
type: 'ADDITION',
value: entry
});
},
update: function update(entry, last) {
var current = entries.draggables[last.descriptor.id];
if (!current) {
return;
}
if (current.uniqueId !== entry.uniqueId) {
return;
}
delete entries.draggables[last.descriptor.id];
entries.draggables[entry.descriptor.id] = entry;
},
unregister: function unregister(entry) {
var draggableId = entry.descriptor.id;
var current = findDraggableById(draggableId);
if (!current) {
return;
}
if (entry.uniqueId !== current.uniqueId) {
return;
}
delete entries.draggables[draggableId];
notify({
type: 'REMOVAL',
value: entry
});
},
getById: getDraggableById,
findById: findDraggableById,
exists: function exists(id) {
return Boolean(findDraggableById(id));
},
getAllByType: function getAllByType(type) {
return values(entries.draggables).filter(function (entry) {
return entry.descriptor.type === type;
});
}
};
function findDroppableById(id) {
return entries.droppables[id] || null;
}
function getDroppableById(id) {
var entry = findDroppableById(id);
!entry ? false ? undefined : invariant(false) : void 0;
return entry;
}
var droppableAPI = {
register: function register(entry) {
entries.droppables[entry.descriptor.id] = entry;
},
unregister: function unregister(entry) {
var current = findDroppableById(entry.descriptor.id);
if (!current) {
return;
}
if (entry.uniqueId !== current.uniqueId) {
return;
}
delete entries.droppables[entry.descriptor.id];
},
getById: getDroppableById,
findById: findDroppableById,
exists: function exists(id) {
return Boolean(findDroppableById(id));
},
getAllByType: function getAllByType(type) {
return values(entries.droppables).filter(function (entry) {
return entry.descriptor.type === type;
});
}
};
function clean() {
entries.draggables = {};
entries.droppables = {};
subscribers.length = 0;
}
return {
draggable: draggableAPI,
droppable: droppableAPI,
subscribe: subscribe,
clean: clean
};
}
function useRegistry() {
var registry = useMemo(createRegistry, []);
Object(external_window_React_["useEffect"])(function () {
return function unmount() {
requestAnimationFrame(registry.clean);
};
}, [registry]);
return registry;
}
var StoreContext = external_window_React_default.a.createContext(null);
var getBodyElement = (function () {
var body = document.body;
!body ? false ? undefined : invariant(false) : void 0;
return body;
});
var visuallyHidden = {
position: 'absolute',
width: '1px',
height: '1px',
margin: '-1px',
border: '0',
padding: '0',
overflow: 'hidden',
clip: 'rect(0 0 0 0)',
'clip-path': 'inset(100%)'
};
var getId = function getId(contextId) {
return "rbd-announcement-" + contextId;
};
function useAnnouncer(contextId) {
var id = useMemo(function () {
return getId(contextId);
}, [contextId]);
var ref = Object(external_window_React_["useRef"])(null);
Object(external_window_React_["useEffect"])(function setup() {
var el = document.createElement('div');
ref.current = el;
el.id = id;
el.setAttribute('aria-live', 'assertive');
el.setAttribute('aria-atomic', 'true');
Object(esm_extends["a" /* default */])(el.style, visuallyHidden);
getBodyElement().appendChild(el);
return function cleanup() {
setTimeout(function remove() {
var body = getBodyElement();
if (body.contains(el)) {
body.removeChild(el);
}
if (el === ref.current) {
ref.current = null;
}
});
};
}, [id]);
var announce = useCallback(function (message) {
var el = ref.current;
if (el) {
el.textContent = message;
return;
}
false ? undefined : void 0;
}, []);
return announce;
}
var count = 0;
var defaults = {
separator: '::'
};
function react_beautiful_dnd_esm_reset() {
count = 0;
}
function useUniqueId(prefix, options) {
if (options === void 0) {
options = defaults;
}
return useMemo(function () {
return "" + prefix + options.separator + count++;
}, [options.separator, prefix]);
}
function getElementId(_ref) {
var contextId = _ref.contextId,
uniqueId = _ref.uniqueId;
return "rbd-hidden-text-" + contextId + "-" + uniqueId;
}
function useHiddenTextElement(_ref2) {
var contextId = _ref2.contextId,
text = _ref2.text;
var uniqueId = useUniqueId('hidden-text', {
separator: '-'
});
var id = useMemo(function () {
return getElementId({
contextId: contextId,
uniqueId: uniqueId
});
}, [uniqueId, contextId]);
Object(external_window_React_["useEffect"])(function mount() {
var el = document.createElement('div');
el.id = id;
el.textContent = text;
el.style.display = 'none';
getBodyElement().appendChild(el);
return function unmount() {
var body = getBodyElement();
if (body.contains(el)) {
body.removeChild(el);
}
};
}, [id, text]);
return id;
}
var AppContext = external_window_React_default.a.createContext(null);
var peerDependencies = {
react: "^16.8.5",
"react-dom": "^16.8.5"
};
var semver = /(\d+)\.(\d+)\.(\d+)/;
var getVersion = function getVersion(value) {
var result = semver.exec(value);
!(result != null) ? false ? undefined : invariant(false) : void 0;
var major = Number(result[1]);
var minor = Number(result[2]);
var patch = Number(result[3]);
return {
major: major,
minor: minor,
patch: patch,
raw: value
};
};
var isSatisfied = function isSatisfied(expected, actual) {
if (actual.major > expected.major) {
return true;
}
if (actual.major < expected.major) {
return false;
}
if (actual.minor > expected.minor) {
return true;
}
if (actual.minor < expected.minor) {
return false;
}
return actual.patch >= expected.patch;
};
var checkReactVersion = (function (peerDepValue, actualValue) {
var peerDep = getVersion(peerDepValue);
var actual = getVersion(actualValue);
if (isSatisfied(peerDep, actual)) {
return;
}
false ? undefined : void 0;
});
var react_beautiful_dnd_esm_suffix = "\n We expect a html5 doctype: \n This is to ensure consistent browser layout and measurement\n\n More information: https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/doctype.md\n";
var checkDoctype = (function (doc) {
var doctype = doc.doctype;
if (!doctype) {
false ? undefined : void 0;
return;
}
if (doctype.name.toLowerCase() !== 'html') {
false ? undefined : void 0;
}
if (doctype.publicId !== '') {
false ? undefined : void 0;
}
});
function useDev(useHook) {
if (false) {}
}
function useDevSetupWarning(fn, inputs) {
useDev(function () {
Object(external_window_React_["useEffect"])(function () {
try {
fn();
} catch (e) {
error("\n A setup problem was encountered.\n\n > " + e.message + "\n ");
}
}, inputs);
});
}
function useStartupValidation() {
useDevSetupWarning(function () {
checkReactVersion(peerDependencies.react, external_window_React_default.a.version);
checkDoctype(document);
}, []);
}
function usePrevious(current) {
var ref = Object(external_window_React_["useRef"])(current);
Object(external_window_React_["useEffect"])(function () {
ref.current = current;
});
return ref;
}
function create() {
var lock = null;
function isClaimed() {
return Boolean(lock);
}
function isActive(value) {
return value === lock;
}
function claim(abandon) {
!!lock ? false ? undefined : invariant(false) : void 0;
var newLock = {
abandon: abandon
};
lock = newLock;
return newLock;
}
function release() {
!lock ? false ? undefined : invariant(false) : void 0;
lock = null;
}
function tryAbandon() {
if (lock) {
lock.abandon();
release();
}
}
return {
isClaimed: isClaimed,
isActive: isActive,
claim: claim,
release: release,
tryAbandon: tryAbandon
};
}
var tab = 9;
var enter = 13;
var react_beautiful_dnd_esm_escape = 27;
var space = 32;
var pageUp = 33;
var pageDown = 34;
var end = 35;
var react_beautiful_dnd_esm_home = 36;
var arrowLeft = 37;
var arrowUp = 38;
var arrowRight = 39;
var arrowDown = 40;
var _preventedKeys;
var preventedKeys = (_preventedKeys = {}, _preventedKeys[enter] = true, _preventedKeys[tab] = true, _preventedKeys);
var preventStandardKeyEvents = (function (event) {
if (preventedKeys[event.keyCode]) {
event.preventDefault();
}
});
var supportedEventName = function () {
var base = 'visibilitychange';
if (typeof document === 'undefined') {
return base;
}
var candidates = [base, "ms" + base, "webkit" + base, "moz" + base, "o" + base];
var supported = find(candidates, function (eventName) {
return "on" + eventName in document;
});
return supported || base;
}();
var primaryButton = 0;
var sloppyClickThreshold = 5;
function isSloppyClickThresholdExceeded(original, current) {
return Math.abs(current.x - original.x) >= sloppyClickThreshold || Math.abs(current.y - original.y) >= sloppyClickThreshold;
}
var idle$1 = {
type: 'IDLE'
};
function getCaptureBindings(_ref) {
var cancel = _ref.cancel,
completed = _ref.completed,
getPhase = _ref.getPhase,
setPhase = _ref.setPhase;
return [{
eventName: 'mousemove',
fn: function fn(event) {
var button = event.button,
clientX = event.clientX,
clientY = event.clientY;
if (button !== primaryButton) {
return;
}
var point = {
x: clientX,
y: clientY
};
var phase = getPhase();
if (phase.type === 'DRAGGING') {
event.preventDefault();
phase.actions.move(point);
return;
}
!(phase.type === 'PENDING') ? false ? undefined : invariant(false) : void 0;
var pending = phase.point;
if (!isSloppyClickThresholdExceeded(pending, point)) {
return;
}
event.preventDefault();
var actions = phase.actions.fluidLift(point);
setPhase({
type: 'DRAGGING',
actions: actions
});
}
}, {
eventName: 'mouseup',
fn: function fn(event) {
var phase = getPhase();
if (phase.type !== 'DRAGGING') {
cancel();
return;
}
event.preventDefault();
phase.actions.drop({
shouldBlockNextClick: true
});
completed();
}
}, {
eventName: 'mousedown',
fn: function fn(event) {
if (getPhase().type === 'DRAGGING') {
event.preventDefault();
}
cancel();
}
}, {
eventName: 'keydown',
fn: function fn(event) {
var phase = getPhase();
if (phase.type === 'PENDING') {
cancel();
return;
}
if (event.keyCode === react_beautiful_dnd_esm_escape) {
event.preventDefault();
cancel();
return;
}
preventStandardKeyEvents(event);
}
}, {
eventName: 'resize',
fn: cancel
}, {
eventName: 'scroll',
options: {
passive: true,
capture: false
},
fn: function fn() {
if (getPhase().type === 'PENDING') {
cancel();
}
}
}, {
eventName: 'webkitmouseforcedown',
fn: function fn(event) {
var phase = getPhase();
!(phase.type !== 'IDLE') ? false ? undefined : invariant(false) : void 0;
if (phase.actions.shouldRespectForcePress()) {
cancel();
return;
}
event.preventDefault();
}
}, {
eventName: supportedEventName,
fn: cancel
}];
}
function useMouseSensor(api) {
var phaseRef = Object(external_window_React_["useRef"])(idle$1);
var unbindEventsRef = Object(external_window_React_["useRef"])(noop);
var startCaptureBinding = useMemo(function () {
return {
eventName: 'mousedown',
fn: function onMouseDown(event) {
if (event.defaultPrevented) {
return;
}
if (event.button !== primaryButton) {
return;
}
if (event.ctrlKey || event.metaKey || event.shiftKey || event.altKey) {
return;
}
var draggableId = api.findClosestDraggableId(event);
if (!draggableId) {
return;
}
var actions = api.tryGetLock(draggableId, stop, {
sourceEvent: event
});
if (!actions) {
return;
}
event.preventDefault();
var point = {
x: event.clientX,
y: event.clientY
};
unbindEventsRef.current();
startPendingDrag(actions, point);
}
};
}, [api]);
var preventForcePressBinding = useMemo(function () {
return {
eventName: 'webkitmouseforcewillbegin',
fn: function fn(event) {
if (event.defaultPrevented) {
return;
}
var id = api.findClosestDraggableId(event);
if (!id) {
return;
}
var options = api.findOptionsForDraggable(id);
if (!options) {
return;
}
if (options.shouldRespectForcePress) {
return;
}
if (!api.canGetLock(id)) {
return;
}
event.preventDefault();
}
};
}, [api]);
var listenForCapture = useCallback(function listenForCapture() {
var options = {
passive: false,
capture: true
};
unbindEventsRef.current = bindEvents(window, [preventForcePressBinding, startCaptureBinding], options);
}, [preventForcePressBinding, startCaptureBinding]);
var stop = useCallback(function () {
var current = phaseRef.current;
if (current.type === 'IDLE') {
return;
}
phaseRef.current = idle$1;
unbindEventsRef.current();
listenForCapture();
}, [listenForCapture]);
var cancel = useCallback(function () {
var phase = phaseRef.current;
stop();
if (phase.type === 'DRAGGING') {
phase.actions.cancel({
shouldBlockNextClick: true
});
}
if (phase.type === 'PENDING') {
phase.actions.abort();
}
}, [stop]);
var bindCapturingEvents = useCallback(function bindCapturingEvents() {
var options = {
capture: true,
passive: false
};
var bindings = getCaptureBindings({
cancel: cancel,
completed: stop,
getPhase: function getPhase() {
return phaseRef.current;
},
setPhase: function setPhase(phase) {
phaseRef.current = phase;
}
});
unbindEventsRef.current = bindEvents(window, bindings, options);
}, [cancel, stop]);
var startPendingDrag = useCallback(function startPendingDrag(actions, point) {
!(phaseRef.current.type === 'IDLE') ? false ? undefined : invariant(false) : void 0;
phaseRef.current = {
type: 'PENDING',
point: point,
actions: actions
};
bindCapturingEvents();
}, [bindCapturingEvents]);
useIsomorphicLayoutEffect(function mount() {
listenForCapture();
return function unmount() {
unbindEventsRef.current();
};
}, [listenForCapture]);
}
var _scrollJumpKeys;
function noop$1() {}
var scrollJumpKeys = (_scrollJumpKeys = {}, _scrollJumpKeys[pageDown] = true, _scrollJumpKeys[pageUp] = true, _scrollJumpKeys[react_beautiful_dnd_esm_home] = true, _scrollJumpKeys[end] = true, _scrollJumpKeys);
function getDraggingBindings(actions, stop) {
function cancel() {
stop();
actions.cancel();
}
function drop() {
stop();
actions.drop();
}
return [{
eventName: 'keydown',
fn: function fn(event) {
if (event.keyCode === react_beautiful_dnd_esm_escape) {
event.preventDefault();
cancel();
return;
}
if (event.keyCode === space) {
event.preventDefault();
drop();
return;
}
if (event.keyCode === arrowDown) {
event.preventDefault();
actions.moveDown();
return;
}
if (event.keyCode === arrowUp) {
event.preventDefault();
actions.moveUp();
return;
}
if (event.keyCode === arrowRight) {
event.preventDefault();
actions.moveRight();
return;
}
if (event.keyCode === arrowLeft) {
event.preventDefault();
actions.moveLeft();
return;
}
if (scrollJumpKeys[event.keyCode]) {
event.preventDefault();
return;
}
preventStandardKeyEvents(event);
}
}, {
eventName: 'mousedown',
fn: cancel
}, {
eventName: 'mouseup',
fn: cancel
}, {
eventName: 'click',
fn: cancel
}, {
eventName: 'touchstart',
fn: cancel
}, {
eventName: 'resize',
fn: cancel
}, {
eventName: 'wheel',
fn: cancel,
options: {
passive: true
}
}, {
eventName: supportedEventName,
fn: cancel
}];
}
function useKeyboardSensor(api) {
var unbindEventsRef = Object(external_window_React_["useRef"])(noop$1);
var startCaptureBinding = useMemo(function () {
return {
eventName: 'keydown',
fn: function onKeyDown(event) {
if (event.defaultPrevented) {
return;
}
if (event.keyCode !== space) {
return;
}
var draggableId = api.findClosestDraggableId(event);
if (!draggableId) {
return;
}
var preDrag = api.tryGetLock(draggableId, stop, {
sourceEvent: event
});
if (!preDrag) {
return;
}
event.preventDefault();
var isCapturing = true;
var actions = preDrag.snapLift();
unbindEventsRef.current();
function stop() {
!isCapturing ? false ? undefined : invariant(false) : void 0;
isCapturing = false;
unbindEventsRef.current();
listenForCapture();
}
unbindEventsRef.current = bindEvents(window, getDraggingBindings(actions, stop), {
capture: true,
passive: false
});
}
};
}, [api]);
var listenForCapture = useCallback(function tryStartCapture() {
var options = {
passive: false,
capture: true
};
unbindEventsRef.current = bindEvents(window, [startCaptureBinding], options);
}, [startCaptureBinding]);
useIsomorphicLayoutEffect(function mount() {
listenForCapture();
return function unmount() {
unbindEventsRef.current();
};
}, [listenForCapture]);
}
var idle$2 = {
type: 'IDLE'
};
var timeForLongPress = 120;
var forcePressThreshold = 0.15;
function getWindowBindings(_ref) {
var cancel = _ref.cancel,
getPhase = _ref.getPhase;
return [{
eventName: 'orientationchange',
fn: cancel
}, {
eventName: 'resize',
fn: cancel
}, {
eventName: 'contextmenu',
fn: function fn(event) {
event.preventDefault();
}
}, {
eventName: 'keydown',
fn: function fn(event) {
if (getPhase().type !== 'DRAGGING') {
cancel();
return;
}
if (event.keyCode === react_beautiful_dnd_esm_escape) {
event.preventDefault();
}
cancel();
}
}, {
eventName: supportedEventName,
fn: cancel
}];
}
function getHandleBindings(_ref2) {
var cancel = _ref2.cancel,
completed = _ref2.completed,
getPhase = _ref2.getPhase;
return [{
eventName: 'touchmove',
options: {
capture: false
},
fn: function fn(event) {
var phase = getPhase();
if (phase.type !== 'DRAGGING') {
cancel();
return;
}
phase.hasMoved = true;
var _event$touches$ = event.touches[0],
clientX = _event$touches$.clientX,
clientY = _event$touches$.clientY;
var point = {
x: clientX,
y: clientY
};
event.preventDefault();
phase.actions.move(point);
}
}, {
eventName: 'touchend',
fn: function fn(event) {
var phase = getPhase();
if (phase.type !== 'DRAGGING') {
cancel();
return;
}
event.preventDefault();
phase.actions.drop({
shouldBlockNextClick: true
});
completed();
}
}, {
eventName: 'touchcancel',
fn: function fn(event) {
if (getPhase().type !== 'DRAGGING') {
cancel();
return;
}
event.preventDefault();
cancel();
}
}, {
eventName: 'touchforcechange',
fn: function fn(event) {
var phase = getPhase();
!(phase.type !== 'IDLE') ? false ? undefined : invariant(false) : void 0;
var touch = event.touches[0];
if (!touch) {
return;
}
var isForcePress = touch.force >= forcePressThreshold;
if (!isForcePress) {
return;
}
var shouldRespect = phase.actions.shouldRespectForcePress();
if (phase.type === 'PENDING') {
if (shouldRespect) {
cancel();
}
return;
}
if (shouldRespect) {
if (phase.hasMoved) {
event.preventDefault();
return;
}
cancel();
return;
}
event.preventDefault();
}
}, {
eventName: supportedEventName,
fn: cancel
}];
}
function useMouseSensor$1(api) {
var phaseRef = Object(external_window_React_["useRef"])(idle$2);
var unbindEventsRef = Object(external_window_React_["useRef"])(noop);
var getPhase = useCallback(function getPhase() {
return phaseRef.current;
}, []);
var setPhase = useCallback(function setPhase(phase) {
phaseRef.current = phase;
}, []);
var startCaptureBinding = useMemo(function () {
return {
eventName: 'touchstart',
fn: function onTouchStart(event) {
if (event.defaultPrevented) {
return;
}
var draggableId = api.findClosestDraggableId(event);
if (!draggableId) {
return;
}
var actions = api.tryGetLock(draggableId, stop, {
sourceEvent: event
});
if (!actions) {
return;
}
var touch = event.touches[0];
var clientX = touch.clientX,
clientY = touch.clientY;
var point = {
x: clientX,
y: clientY
};
unbindEventsRef.current();
startPendingDrag(actions, point);
}
};
}, [api]);
var listenForCapture = useCallback(function listenForCapture() {
var options = {
capture: true,
passive: false
};
unbindEventsRef.current = bindEvents(window, [startCaptureBinding], options);
}, [startCaptureBinding]);
var stop = useCallback(function () {
var current = phaseRef.current;
if (current.type === 'IDLE') {
return;
}
if (current.type === 'PENDING') {
clearTimeout(current.longPressTimerId);
}
setPhase(idle$2);
unbindEventsRef.current();
listenForCapture();
}, [listenForCapture, setPhase]);
var cancel = useCallback(function () {
var phase = phaseRef.current;
stop();
if (phase.type === 'DRAGGING') {
phase.actions.cancel({
shouldBlockNextClick: true
});
}
if (phase.type === 'PENDING') {
phase.actions.abort();
}
}, [stop]);
var bindCapturingEvents = useCallback(function bindCapturingEvents() {
var options = {
capture: true,
passive: false
};
var args = {
cancel: cancel,
completed: stop,
getPhase: getPhase
};
var unbindTarget = bindEvents(window, getHandleBindings(args), options);
var unbindWindow = bindEvents(window, getWindowBindings(args), options);
unbindEventsRef.current = function unbindAll() {
unbindTarget();
unbindWindow();
};
}, [cancel, getPhase, stop]);
var startDragging = useCallback(function startDragging() {
var phase = getPhase();
!(phase.type === 'PENDING') ? false ? undefined : invariant(false) : void 0;
var actions = phase.actions.fluidLift(phase.point);
setPhase({
type: 'DRAGGING',
actions: actions,
hasMoved: false
});
}, [getPhase, setPhase]);
var startPendingDrag = useCallback(function startPendingDrag(actions, point) {
!(getPhase().type === 'IDLE') ? false ? undefined : invariant(false) : void 0;
var longPressTimerId = setTimeout(startDragging, timeForLongPress);
setPhase({
type: 'PENDING',
point: point,
actions: actions,
longPressTimerId: longPressTimerId
});
bindCapturingEvents();
}, [bindCapturingEvents, getPhase, setPhase, startDragging]);
useIsomorphicLayoutEffect(function mount() {
listenForCapture();
return function unmount() {
unbindEventsRef.current();
var phase = getPhase();
if (phase.type === 'PENDING') {
clearTimeout(phase.longPressTimerId);
setPhase(idle$2);
}
};
}, [getPhase, listenForCapture, setPhase]);
useIsomorphicLayoutEffect(function webkitHack() {
var unbind = bindEvents(window, [{
eventName: 'touchmove',
fn: function fn() {},
options: {
capture: false,
passive: false
}
}]);
return unbind;
}, []);
}
function useValidateSensorHooks(sensorHooks) {
useDev(function () {
var previousRef = usePrevious(sensorHooks);
useDevSetupWarning(function () {
!(previousRef.current.length === sensorHooks.length) ? false ? undefined : invariant(false) : void 0;
});
});
}
var interactiveTagNames = {
input: true,
button: true,
textarea: true,
select: true,
option: true,
optgroup: true,
video: true,
audio: true
};
function isAnInteractiveElement(parent, current) {
if (current == null) {
return false;
}
var hasAnInteractiveTag = Boolean(interactiveTagNames[current.tagName.toLowerCase()]);
if (hasAnInteractiveTag) {
return true;
}
var attribute = current.getAttribute('contenteditable');
if (attribute === 'true' || attribute === '') {
return true;
}
if (current === parent) {
return false;
}
return isAnInteractiveElement(parent, current.parentElement);
}
function isEventInInteractiveElement(draggable, event) {
var target = event.target;
if (!isHtmlElement(target)) {
return false;
}
return isAnInteractiveElement(draggable, target);
}
var getBorderBoxCenterPosition = (function (el) {
return getRect(el.getBoundingClientRect()).center;
});
function isElement(el) {
return el instanceof getWindowFromEl(el).Element;
}
var supportedMatchesName = function () {
var base = 'matches';
if (typeof document === 'undefined') {
return base;
}
var candidates = [base, 'msMatchesSelector', 'webkitMatchesSelector'];
var value = find(candidates, function (name) {
return name in Element.prototype;
});
return value || base;
}();
function closestPonyfill(el, selector) {
if (el == null) {
return null;
}
if (el[supportedMatchesName](selector)) {
return el;
}
return closestPonyfill(el.parentElement, selector);
}
function closest$1(el, selector) {
if (el.closest) {
return el.closest(selector);
}
return closestPonyfill(el, selector);
}
function getSelector(contextId) {
return "[" + dragHandle.contextId + "=\"" + contextId + "\"]";
}
function findClosestDragHandleFromEvent(contextId, event) {
var target = event.target;
if (!isElement(target)) {
false ? undefined : void 0;
return null;
}
var selector = getSelector(contextId);
var handle = closest$1(target, selector);
if (!handle) {
return null;
}
if (!isHtmlElement(handle)) {
false ? undefined : void 0;
return null;
}
return handle;
}
function tryGetClosestDraggableIdFromEvent(contextId, event) {
var handle = findClosestDragHandleFromEvent(contextId, event);
if (!handle) {
return null;
}
return handle.getAttribute(dragHandle.draggableId);
}
function findDraggable(contextId, draggableId) {
var selector = "[" + react_beautiful_dnd_esm_draggable.contextId + "=\"" + contextId + "\"]";
var possible = toArray(document.querySelectorAll(selector));
var draggable$1 = find(possible, function (el) {
return el.getAttribute(react_beautiful_dnd_esm_draggable.id) === draggableId;
});
if (!draggable$1) {
return null;
}
if (!isHtmlElement(draggable$1)) {
false ? undefined : void 0;
return null;
}
return draggable$1;
}
function preventDefault(event) {
event.preventDefault();
}
function _isActive(_ref) {
var expected = _ref.expected,
phase = _ref.phase,
isLockActive = _ref.isLockActive,
shouldWarn = _ref.shouldWarn;
if (!isLockActive()) {
if (shouldWarn) {
false ? undefined : void 0;
}
return false;
}
if (expected !== phase) {
if (shouldWarn) {
false ? undefined : void 0;
}
return false;
}
return true;
}
function canStart(_ref2) {
var lockAPI = _ref2.lockAPI,
store = _ref2.store,
registry = _ref2.registry,
draggableId = _ref2.draggableId;
if (lockAPI.isClaimed()) {
return false;
}
var entry = registry.draggable.findById(draggableId);
if (!entry) {
false ? undefined : void 0;
return false;
}
if (!entry.options.isEnabled) {
return false;
}
if (!canStartDrag(store.getState(), draggableId)) {
return false;
}
return true;
}
function tryStart(_ref3) {
var lockAPI = _ref3.lockAPI,
contextId = _ref3.contextId,
store = _ref3.store,
registry = _ref3.registry,
draggableId = _ref3.draggableId,
forceSensorStop = _ref3.forceSensorStop,
sourceEvent = _ref3.sourceEvent;
var shouldStart = canStart({
lockAPI: lockAPI,
store: store,
registry: registry,
draggableId: draggableId
});
if (!shouldStart) {
return null;
}
var entry = registry.draggable.getById(draggableId);
var el = findDraggable(contextId, entry.descriptor.id);
if (!el) {
false ? undefined : void 0;
return null;
}
if (sourceEvent && !entry.options.canDragInteractiveElements && isEventInInteractiveElement(el, sourceEvent)) {
return null;
}
var lock = lockAPI.claim(forceSensorStop || noop);
var phase = 'PRE_DRAG';
function getShouldRespectForcePress() {
return entry.options.shouldRespectForcePress;
}
function isLockActive() {
return lockAPI.isActive(lock);
}
function tryDispatch(expected, getAction) {
if (_isActive({
expected: expected,
phase: phase,
isLockActive: isLockActive,
shouldWarn: true
})) {
store.dispatch(getAction());
}
}
var tryDispatchWhenDragging = tryDispatch.bind(null, 'DRAGGING');
function lift$1(args) {
function completed() {
lockAPI.release();
phase = 'COMPLETED';
}
if (phase !== 'PRE_DRAG') {
completed();
!(phase === 'PRE_DRAG') ? false ? undefined : invariant(false) : void 0;
}
store.dispatch(lift(args.liftActionArgs));
phase = 'DRAGGING';
function finish(reason, options) {
if (options === void 0) {
options = {
shouldBlockNextClick: false
};
}
args.cleanup();
if (options.shouldBlockNextClick) {
var unbind = bindEvents(window, [{
eventName: 'click',
fn: preventDefault,
options: {
once: true,
passive: false,
capture: true
}
}]);
setTimeout(unbind);
}
completed();
store.dispatch(react_beautiful_dnd_esm_drop({
reason: reason
}));
}
return Object(esm_extends["a" /* default */])({
isActive: function isActive() {
return _isActive({
expected: 'DRAGGING',
phase: phase,
isLockActive: isLockActive,
shouldWarn: false
});
},
shouldRespectForcePress: getShouldRespectForcePress,
drop: function drop(options) {
return finish('DROP', options);
},
cancel: function cancel(options) {
return finish('CANCEL', options);
}
}, args.actions);
}
function fluidLift(clientSelection) {
var move$1 = raf_schd_esm(function (client) {
tryDispatchWhenDragging(function () {
return move({
client: client
});
});
});
var api = lift$1({
liftActionArgs: {
id: draggableId,
clientSelection: clientSelection,
movementMode: 'FLUID'
},
cleanup: function cleanup() {
return move$1.cancel();
},
actions: {
move: move$1
}
});
return Object(esm_extends["a" /* default */])({}, api, {
move: move$1
});
}
function snapLift() {
var actions = {
moveUp: function moveUp$1() {
return tryDispatchWhenDragging(moveUp);
},
moveRight: function moveRight$1() {
return tryDispatchWhenDragging(moveRight);
},
moveDown: function moveDown$1() {
return tryDispatchWhenDragging(moveDown);
},
moveLeft: function moveLeft$1() {
return tryDispatchWhenDragging(moveLeft);
}
};
return lift$1({
liftActionArgs: {
id: draggableId,
clientSelection: getBorderBoxCenterPosition(el),
movementMode: 'SNAP'
},
cleanup: noop,
actions: actions
});
}
function abortPreDrag() {
var shouldRelease = _isActive({
expected: 'PRE_DRAG',
phase: phase,
isLockActive: isLockActive,
shouldWarn: true
});
if (shouldRelease) {
lockAPI.release();
}
}
var preDrag = {
isActive: function isActive() {
return _isActive({
expected: 'PRE_DRAG',
phase: phase,
isLockActive: isLockActive,
shouldWarn: false
});
},
shouldRespectForcePress: getShouldRespectForcePress,
fluidLift: fluidLift,
snapLift: snapLift,
abort: abortPreDrag
};
return preDrag;
}
var defaultSensors = [useMouseSensor, useKeyboardSensor, useMouseSensor$1];
function useSensorMarshal(_ref4) {
var contextId = _ref4.contextId,
store = _ref4.store,
registry = _ref4.registry,
customSensors = _ref4.customSensors,
enableDefaultSensors = _ref4.enableDefaultSensors;
var useSensors = [].concat(enableDefaultSensors ? defaultSensors : [], customSensors || []);
var lockAPI = Object(external_window_React_["useState"])(function () {
return create();
})[0];
var tryAbandonLock = useCallback(function tryAbandonLock(previous, current) {
if (previous.isDragging && !current.isDragging) {
lockAPI.tryAbandon();
}
}, [lockAPI]);
useIsomorphicLayoutEffect(function listenToStore() {
var previous = store.getState();
var unsubscribe = store.subscribe(function () {
var current = store.getState();
tryAbandonLock(previous, current);
previous = current;
});
return unsubscribe;
}, [lockAPI, store, tryAbandonLock]);
useIsomorphicLayoutEffect(function () {
return lockAPI.tryAbandon;
}, [lockAPI.tryAbandon]);
var canGetLock = useCallback(function (draggableId) {
return canStart({
lockAPI: lockAPI,
registry: registry,
store: store,
draggableId: draggableId
});
}, [lockAPI, registry, store]);
var tryGetLock = useCallback(function (draggableId, forceStop, options) {
return tryStart({
lockAPI: lockAPI,
registry: registry,
contextId: contextId,
store: store,
draggableId: draggableId,
forceSensorStop: forceStop,
sourceEvent: options && options.sourceEvent ? options.sourceEvent : null
});
}, [contextId, lockAPI, registry, store]);
var findClosestDraggableId = useCallback(function (event) {
return tryGetClosestDraggableIdFromEvent(contextId, event);
}, [contextId]);
var findOptionsForDraggable = useCallback(function (id) {
var entry = registry.draggable.findById(id);
return entry ? entry.options : null;
}, [registry.draggable]);
var tryReleaseLock = useCallback(function tryReleaseLock() {
if (!lockAPI.isClaimed()) {
return;
}
lockAPI.tryAbandon();
if (store.getState().phase !== 'IDLE') {
store.dispatch(react_beautiful_dnd_esm_flush());
}
}, [lockAPI, store]);
var isLockClaimed = useCallback(lockAPI.isClaimed, [lockAPI]);
var api = useMemo(function () {
return {
canGetLock: canGetLock,
tryGetLock: tryGetLock,
findClosestDraggableId: findClosestDraggableId,
findOptionsForDraggable: findOptionsForDraggable,
tryReleaseLock: tryReleaseLock,
isLockClaimed: isLockClaimed
};
}, [canGetLock, tryGetLock, findClosestDraggableId, findOptionsForDraggable, tryReleaseLock, isLockClaimed]);
useValidateSensorHooks(useSensors);
for (var i = 0; i < useSensors.length; i++) {
useSensors[i](api);
}
}
var createResponders = function createResponders(props) {
return {
onBeforeCapture: props.onBeforeCapture,
onBeforeDragStart: props.onBeforeDragStart,
onDragStart: props.onDragStart,
onDragEnd: props.onDragEnd,
onDragUpdate: props.onDragUpdate
};
};
function getStore(lazyRef) {
!lazyRef.current ? false ? undefined : invariant(false) : void 0;
return lazyRef.current;
}
function App(props) {
var contextId = props.contextId,
setCallbacks = props.setCallbacks,
sensors = props.sensors,
nonce = props.nonce,
dragHandleUsageInstructions = props.dragHandleUsageInstructions;
var lazyStoreRef = Object(external_window_React_["useRef"])(null);
useStartupValidation();
var lastPropsRef = usePrevious(props);
var getResponders = useCallback(function () {
return createResponders(lastPropsRef.current);
}, [lastPropsRef]);
var announce = useAnnouncer(contextId);
var dragHandleUsageInstructionsId = useHiddenTextElement({
contextId: contextId,
text: dragHandleUsageInstructions
});
var styleMarshal = useStyleMarshal(contextId, nonce);
var lazyDispatch = useCallback(function (action) {
getStore(lazyStoreRef).dispatch(action);
}, []);
var marshalCallbacks = useMemo(function () {
return Object(redux["b" /* bindActionCreators */])({
publishWhileDragging: publishWhileDragging,
updateDroppableScroll: updateDroppableScroll,
updateDroppableIsEnabled: updateDroppableIsEnabled,
updateDroppableIsCombineEnabled: updateDroppableIsCombineEnabled,
collectionStarting: collectionStarting
}, lazyDispatch);
}, [lazyDispatch]);
var registry = useRegistry();
var dimensionMarshal = useMemo(function () {
return createDimensionMarshal(registry, marshalCallbacks);
}, [registry, marshalCallbacks]);
var autoScroller = useMemo(function () {
return createAutoScroller(Object(esm_extends["a" /* default */])({
scrollWindow: react_beautiful_dnd_esm_scrollWindow,
scrollDroppable: dimensionMarshal.scrollDroppable
}, Object(redux["b" /* bindActionCreators */])({
move: move
}, lazyDispatch)));
}, [dimensionMarshal.scrollDroppable, lazyDispatch]);
var focusMarshal = useFocusMarshal(contextId);
var store = useMemo(function () {
return createStore({
announce: announce,
autoScroller: autoScroller,
dimensionMarshal: dimensionMarshal,
focusMarshal: focusMarshal,
getResponders: getResponders,
styleMarshal: styleMarshal
});
}, [announce, autoScroller, dimensionMarshal, focusMarshal, getResponders, styleMarshal]);
if (false) {}
lazyStoreRef.current = store;
var tryResetStore = useCallback(function () {
var current = getStore(lazyStoreRef);
var state = current.getState();
if (state.phase !== 'IDLE') {
current.dispatch(react_beautiful_dnd_esm_flush());
}
}, []);
var isDragging = useCallback(function () {
var state = getStore(lazyStoreRef).getState();
return state.isDragging || state.phase === 'DROP_ANIMATING';
}, []);
var appCallbacks = useMemo(function () {
return {
isDragging: isDragging,
tryAbort: tryResetStore
};
}, [isDragging, tryResetStore]);
setCallbacks(appCallbacks);
var getCanLift = useCallback(function (id) {
return canStartDrag(getStore(lazyStoreRef).getState(), id);
}, []);
var getIsMovementAllowed = useCallback(function () {
return react_beautiful_dnd_esm_isMovementAllowed(getStore(lazyStoreRef).getState());
}, []);
var appContext = useMemo(function () {
return {
marshal: dimensionMarshal,
focus: focusMarshal,
contextId: contextId,
canLift: getCanLift,
isMovementAllowed: getIsMovementAllowed,
dragHandleUsageInstructionsId: dragHandleUsageInstructionsId,
registry: registry
};
}, [contextId, dimensionMarshal, dragHandleUsageInstructionsId, focusMarshal, getCanLift, getIsMovementAllowed, registry]);
useSensorMarshal({
contextId: contextId,
store: store,
registry: registry,
customSensors: sensors,
enableDefaultSensors: props.enableDefaultSensors !== false
});
Object(external_window_React_["useEffect"])(function () {
return tryResetStore;
}, [tryResetStore]);
return external_window_React_default.a.createElement(AppContext.Provider, {
value: appContext
}, external_window_React_default.a.createElement(es["a" /* Provider */], {
context: StoreContext,
store: store
}, props.children));
}
var count$1 = 0;
function reset$1() {
count$1 = 0;
}
function useInstanceCount() {
return useMemo(function () {
return "" + count$1++;
}, []);
}
function resetServerContext() {
reset$1();
react_beautiful_dnd_esm_reset();
}
function DragDropContext(props) {
var contextId = useInstanceCount();
var dragHandleUsageInstructions = props.dragHandleUsageInstructions || preset.dragHandleUsageInstructions;
return external_window_React_default.a.createElement(react_beautiful_dnd_esm_ErrorBoundary, null, function (setCallbacks) {
return external_window_React_default.a.createElement(App, {
nonce: props.nonce,
contextId: contextId,
setCallbacks: setCallbacks,
dragHandleUsageInstructions: dragHandleUsageInstructions,
enableDefaultSensors: props.enableDefaultSensors,
sensors: props.sensors,
onBeforeCapture: props.onBeforeCapture,
onBeforeDragStart: props.onBeforeDragStart,
onDragStart: props.onDragStart,
onDragUpdate: props.onDragUpdate,
onDragEnd: props.onDragEnd
}, props.children);
});
}
var isEqual$1 = function isEqual(base) {
return function (value) {
return base === value;
};
};
var isScroll = isEqual$1('scroll');
var isAuto = isEqual$1('auto');
var isVisible$1 = isEqual$1('visible');
var isEither = function isEither(overflow, fn) {
return fn(overflow.overflowX) || fn(overflow.overflowY);
};
var isBoth = function isBoth(overflow, fn) {
return fn(overflow.overflowX) && fn(overflow.overflowY);
};
var isElementScrollable = function isElementScrollable(el) {
var style = window.getComputedStyle(el);
var overflow = {
overflowX: style.overflowX,
overflowY: style.overflowY
};
return isEither(overflow, isScroll) || isEither(overflow, isAuto);
};
var isBodyScrollable = function isBodyScrollable() {
if (true) {
return false;
}
var body = getBodyElement();
var html = document.documentElement;
!html ? false ? undefined : invariant(false) : void 0;
if (!isElementScrollable(body)) {
return false;
}
var htmlStyle = window.getComputedStyle(html);
var htmlOverflow = {
overflowX: htmlStyle.overflowX,
overflowY: htmlStyle.overflowY
};
if (isBoth(htmlOverflow, isVisible$1)) {
return false;
}
false ? undefined : void 0;
return false;
};
var getClosestScrollable = function getClosestScrollable(el) {
if (el == null) {
return null;
}
if (el === document.body) {
return isBodyScrollable() ? el : null;
}
if (el === document.documentElement) {
return null;
}
if (!isElementScrollable(el)) {
return getClosestScrollable(el.parentElement);
}
return el;
};
var checkForNestedScrollContainers = (function (scrollable) {
if (!scrollable) {
return;
}
var anotherScrollParent = getClosestScrollable(scrollable.parentElement);
if (!anotherScrollParent) {
return;
}
false ? undefined : void 0;
});
var getScroll$1 = (function (el) {
return {
x: el.scrollLeft,
y: el.scrollTop
};
});
var getIsFixed = function getIsFixed(el) {
if (!el) {
return false;
}
var style = window.getComputedStyle(el);
if (style.position === 'fixed') {
return true;
}
return getIsFixed(el.parentElement);
};
var getEnv = (function (start) {
var closestScrollable = getClosestScrollable(start);
var isFixedOnPage = getIsFixed(start);
return {
closestScrollable: closestScrollable,
isFixedOnPage: isFixedOnPage
};
});
var getDroppableDimension = (function (_ref) {
var descriptor = _ref.descriptor,
isEnabled = _ref.isEnabled,
isCombineEnabled = _ref.isCombineEnabled,
isFixedOnPage = _ref.isFixedOnPage,
direction = _ref.direction,
client = _ref.client,
page = _ref.page,
closest = _ref.closest;
var frame = function () {
if (!closest) {
return null;
}
var scrollSize = closest.scrollSize,
frameClient = closest.client;
var maxScroll = getMaxScroll({
scrollHeight: scrollSize.scrollHeight,
scrollWidth: scrollSize.scrollWidth,
height: frameClient.paddingBox.height,
width: frameClient.paddingBox.width
});
return {
pageMarginBox: closest.page.marginBox,
frameClient: frameClient,
scrollSize: scrollSize,
shouldClipSubject: closest.shouldClipSubject,
scroll: {
initial: closest.scroll,
current: closest.scroll,
max: maxScroll,
diff: {
value: origin,
displacement: origin
}
}
};
}();
var axis = direction === 'vertical' ? vertical : horizontal;
var subject = getSubject({
page: page,
withPlaceholder: null,
axis: axis,
frame: frame
});
var dimension = {
descriptor: descriptor,
isCombineEnabled: isCombineEnabled,
isFixedOnPage: isFixedOnPage,
axis: axis,
isEnabled: isEnabled,
client: client,
page: page,
frame: frame,
subject: subject
};
return dimension;
});
var react_beautiful_dnd_esm_getClient = function getClient(targetRef, closestScrollable) {
var base = getBox(targetRef);
if (!closestScrollable) {
return base;
}
if (targetRef !== closestScrollable) {
return base;
}
var top = base.paddingBox.top - closestScrollable.scrollTop;
var left = base.paddingBox.left - closestScrollable.scrollLeft;
var bottom = top + closestScrollable.scrollHeight;
var right = left + closestScrollable.scrollWidth;
var paddingBox = {
top: top,
right: right,
bottom: bottom,
left: left
};
var borderBox = expand(paddingBox, base.border);
var client = createBox({
borderBox: borderBox,
margin: base.margin,
border: base.border,
padding: base.padding
});
return client;
};
var react_beautiful_dnd_esm_getDimension = (function (_ref) {
var ref = _ref.ref,
descriptor = _ref.descriptor,
env = _ref.env,
windowScroll = _ref.windowScroll,
direction = _ref.direction,
isDropDisabled = _ref.isDropDisabled,
isCombineEnabled = _ref.isCombineEnabled,
shouldClipSubject = _ref.shouldClipSubject;
var closestScrollable = env.closestScrollable;
var client = react_beautiful_dnd_esm_getClient(ref, closestScrollable);
var page = withScroll(client, windowScroll);
var closest = function () {
if (!closestScrollable) {
return null;
}
var frameClient = getBox(closestScrollable);
var scrollSize = {
scrollHeight: closestScrollable.scrollHeight,
scrollWidth: closestScrollable.scrollWidth
};
return {
client: frameClient,
page: withScroll(frameClient, windowScroll),
scroll: getScroll$1(closestScrollable),
scrollSize: scrollSize,
shouldClipSubject: shouldClipSubject
};
}();
var dimension = getDroppableDimension({
descriptor: descriptor,
isEnabled: !isDropDisabled,
isCombineEnabled: isCombineEnabled,
isFixedOnPage: env.isFixedOnPage,
direction: direction,
client: client,
page: page,
closest: closest
});
return dimension;
});
var immediate = {
passive: false
};
var delayed = {
passive: true
};
var getListenerOptions = (function (options) {
return options.shouldPublishImmediately ? immediate : delayed;
});
function useRequiredContext(Context) {
var result = Object(external_window_React_["useContext"])(Context);
!result ? false ? undefined : invariant(false) : void 0;
return result;
}
var getClosestScrollableFromDrag = function getClosestScrollableFromDrag(dragging) {
return dragging && dragging.env.closestScrollable || null;
};
function useDroppablePublisher(args) {
var whileDraggingRef = Object(external_window_React_["useRef"])(null);
var appContext = useRequiredContext(AppContext);
var uniqueId = useUniqueId('droppable');
var registry = appContext.registry,
marshal = appContext.marshal;
var previousRef = usePrevious(args);
var descriptor = useMemo(function () {
return {
id: args.droppableId,
type: args.type,
mode: args.mode
};
}, [args.droppableId, args.mode, args.type]);
var publishedDescriptorRef = Object(external_window_React_["useRef"])(descriptor);
var memoizedUpdateScroll = useMemo(function () {
return memoize_one_esm(function (x, y) {
!whileDraggingRef.current ? false ? undefined : invariant(false) : void 0;
var scroll = {
x: x,
y: y
};
marshal.updateDroppableScroll(descriptor.id, scroll);
});
}, [descriptor.id, marshal]);
var getClosestScroll = useCallback(function () {
var dragging = whileDraggingRef.current;
if (!dragging || !dragging.env.closestScrollable) {
return origin;
}
return getScroll$1(dragging.env.closestScrollable);
}, []);
var updateScroll = useCallback(function () {
var scroll = getClosestScroll();
memoizedUpdateScroll(scroll.x, scroll.y);
}, [getClosestScroll, memoizedUpdateScroll]);
var scheduleScrollUpdate = useMemo(function () {
return raf_schd_esm(updateScroll);
}, [updateScroll]);
var onClosestScroll = useCallback(function () {
var dragging = whileDraggingRef.current;
var closest = getClosestScrollableFromDrag(dragging);
!(dragging && closest) ? false ? undefined : invariant(false) : void 0;
var options = dragging.scrollOptions;
if (options.shouldPublishImmediately) {
updateScroll();
return;
}
scheduleScrollUpdate();
}, [scheduleScrollUpdate, updateScroll]);
var getDimensionAndWatchScroll = useCallback(function (windowScroll, options) {
!!whileDraggingRef.current ? false ? undefined : invariant(false) : void 0;
var previous = previousRef.current;
var ref = previous.getDroppableRef();
!ref ? false ? undefined : invariant(false) : void 0;
var env = getEnv(ref);
var dragging = {
ref: ref,
descriptor: descriptor,
env: env,
scrollOptions: options
};
whileDraggingRef.current = dragging;
var dimension = react_beautiful_dnd_esm_getDimension({
ref: ref,
descriptor: descriptor,
env: env,
windowScroll: windowScroll,
direction: previous.direction,
isDropDisabled: previous.isDropDisabled,
isCombineEnabled: previous.isCombineEnabled,
shouldClipSubject: !previous.ignoreContainerClipping
});
var scrollable = env.closestScrollable;
if (scrollable) {
scrollable.setAttribute(scrollContainer.contextId, appContext.contextId);
scrollable.addEventListener('scroll', onClosestScroll, getListenerOptions(dragging.scrollOptions));
if (false) {}
}
return dimension;
}, [appContext.contextId, descriptor, onClosestScroll, previousRef]);
var getScrollWhileDragging = useCallback(function () {
var dragging = whileDraggingRef.current;
var closest = getClosestScrollableFromDrag(dragging);
!(dragging && closest) ? false ? undefined : invariant(false) : void 0;
return getScroll$1(closest);
}, []);
var dragStopped = useCallback(function () {
var dragging = whileDraggingRef.current;
!dragging ? false ? undefined : invariant(false) : void 0;
var closest = getClosestScrollableFromDrag(dragging);
whileDraggingRef.current = null;
if (!closest) {
return;
}
scheduleScrollUpdate.cancel();
closest.removeAttribute(scrollContainer.contextId);
closest.removeEventListener('scroll', onClosestScroll, getListenerOptions(dragging.scrollOptions));
}, [onClosestScroll, scheduleScrollUpdate]);
var scroll = useCallback(function (change) {
var dragging = whileDraggingRef.current;
!dragging ? false ? undefined : invariant(false) : void 0;
var closest = getClosestScrollableFromDrag(dragging);
!closest ? false ? undefined : invariant(false) : void 0;
closest.scrollTop += change.y;
closest.scrollLeft += change.x;
}, []);
var callbacks = useMemo(function () {
return {
getDimensionAndWatchScroll: getDimensionAndWatchScroll,
getScrollWhileDragging: getScrollWhileDragging,
dragStopped: dragStopped,
scroll: scroll
};
}, [dragStopped, getDimensionAndWatchScroll, getScrollWhileDragging, scroll]);
var entry = useMemo(function () {
return {
uniqueId: uniqueId,
descriptor: descriptor,
callbacks: callbacks
};
}, [callbacks, descriptor, uniqueId]);
useIsomorphicLayoutEffect(function () {
publishedDescriptorRef.current = entry.descriptor;
registry.droppable.register(entry);
return function () {
if (whileDraggingRef.current) {
false ? undefined : void 0;
dragStopped();
}
registry.droppable.unregister(entry);
};
}, [callbacks, descriptor, dragStopped, entry, marshal, registry.droppable]);
useIsomorphicLayoutEffect(function () {
if (!whileDraggingRef.current) {
return;
}
marshal.updateDroppableIsEnabled(publishedDescriptorRef.current.id, !args.isDropDisabled);
}, [args.isDropDisabled, marshal]);
useIsomorphicLayoutEffect(function () {
if (!whileDraggingRef.current) {
return;
}
marshal.updateDroppableIsCombineEnabled(publishedDescriptorRef.current.id, args.isCombineEnabled);
}, [args.isCombineEnabled, marshal]);
}
function noop$2() {}
var empty = {
width: 0,
height: 0,
margin: react_beautiful_dnd_esm_noSpacing
};
var getSize = function getSize(_ref) {
var isAnimatingOpenOnMount = _ref.isAnimatingOpenOnMount,
placeholder = _ref.placeholder,
animate = _ref.animate;
if (isAnimatingOpenOnMount) {
return empty;
}
if (animate === 'close') {
return empty;
}
return {
height: placeholder.client.borderBox.height,
width: placeholder.client.borderBox.width,
margin: placeholder.client.margin
};
};
var getStyle = function getStyle(_ref2) {
var isAnimatingOpenOnMount = _ref2.isAnimatingOpenOnMount,
placeholder = _ref2.placeholder,
animate = _ref2.animate;
var size = getSize({
isAnimatingOpenOnMount: isAnimatingOpenOnMount,
placeholder: placeholder,
animate: animate
});
return {
display: placeholder.display,
boxSizing: 'border-box',
width: size.width,
height: size.height,
marginTop: size.margin.top,
marginRight: size.margin.right,
marginBottom: size.margin.bottom,
marginLeft: size.margin.left,
flexShrink: '0',
flexGrow: '0',
pointerEvents: 'none',
transition: animate !== 'none' ? transitions.placeholder : null
};
};
function Placeholder(props) {
var animateOpenTimerRef = Object(external_window_React_["useRef"])(null);
var tryClearAnimateOpenTimer = useCallback(function () {
if (!animateOpenTimerRef.current) {
return;
}
clearTimeout(animateOpenTimerRef.current);
animateOpenTimerRef.current = null;
}, []);
var animate = props.animate,
onTransitionEnd = props.onTransitionEnd,
onClose = props.onClose,
contextId = props.contextId;
var _useState = Object(external_window_React_["useState"])(props.animate === 'open'),
isAnimatingOpenOnMount = _useState[0],
setIsAnimatingOpenOnMount = _useState[1];
Object(external_window_React_["useEffect"])(function () {
if (!isAnimatingOpenOnMount) {
return noop$2;
}
if (animate !== 'open') {
tryClearAnimateOpenTimer();
setIsAnimatingOpenOnMount(false);
return noop$2;
}
if (animateOpenTimerRef.current) {
return noop$2;
}
animateOpenTimerRef.current = setTimeout(function () {
animateOpenTimerRef.current = null;
setIsAnimatingOpenOnMount(false);
});
return tryClearAnimateOpenTimer;
}, [animate, isAnimatingOpenOnMount, tryClearAnimateOpenTimer]);
var onSizeChangeEnd = useCallback(function (event) {
if (event.propertyName !== 'height') {
return;
}
onTransitionEnd();
if (animate === 'close') {
onClose();
}
}, [animate, onClose, onTransitionEnd]);
var style = getStyle({
isAnimatingOpenOnMount: isAnimatingOpenOnMount,
animate: props.animate,
placeholder: props.placeholder
});
return external_window_React_default.a.createElement(props.placeholder.tagName, {
style: style,
'data-rbd-placeholder-context-id': contextId,
onTransitionEnd: onSizeChangeEnd,
ref: props.innerRef
});
}
var Placeholder$1 = external_window_React_default.a.memo(Placeholder);
var DroppableContext = external_window_React_default.a.createContext(null);
function checkIsValidInnerRef(el) {
!(el && isHtmlElement(el)) ? false ? undefined : invariant(false) : void 0;
}
function isBoolean(value) {
return typeof value === 'boolean';
}
function runChecks(args, checks) {
checks.forEach(function (check) {
return check(args);
});
}
var react_beautiful_dnd_esm_shared = [function required(_ref) {
var props = _ref.props;
!props.droppableId ? false ? undefined : invariant(false) : void 0;
!(typeof props.droppableId === 'string') ? false ? undefined : invariant(false) : void 0;
}, function _boolean(_ref2) {
var props = _ref2.props;
!isBoolean(props.isDropDisabled) ? false ? undefined : invariant(false) : void 0;
!isBoolean(props.isCombineEnabled) ? false ? undefined : invariant(false) : void 0;
!isBoolean(props.ignoreContainerClipping) ? false ? undefined : invariant(false) : void 0;
}, function ref(_ref3) {
var getDroppableRef = _ref3.getDroppableRef;
checkIsValidInnerRef(getDroppableRef());
}];
var standard = [function placeholder(_ref4) {
var props = _ref4.props,
getPlaceholderRef = _ref4.getPlaceholderRef;
if (!props.placeholder) {
return;
}
var ref = getPlaceholderRef();
if (ref) {
return;
}
false ? undefined : void 0;
}];
var virtual = [function hasClone(_ref5) {
var props = _ref5.props;
!props.renderClone ? false ? undefined : invariant(false) : void 0;
}, function hasNoPlaceholder(_ref6) {
var getPlaceholderRef = _ref6.getPlaceholderRef;
!!getPlaceholderRef() ? false ? undefined : invariant(false) : void 0;
}];
function useValidation(args) {
useDevSetupWarning(function () {
runChecks(args, react_beautiful_dnd_esm_shared);
if (args.props.mode === 'standard') {
runChecks(args, standard);
}
if (args.props.mode === 'virtual') {
runChecks(args, virtual);
}
});
}
var react_beautiful_dnd_esm_AnimateInOut = function (_React$PureComponent) {
Object(inheritsLoose["a" /* default */])(AnimateInOut, _React$PureComponent);
function AnimateInOut() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _React$PureComponent.call.apply(_React$PureComponent, [this].concat(args)) || this;
_this.state = {
isVisible: Boolean(_this.props.on),
data: _this.props.on,
animate: _this.props.shouldAnimate && _this.props.on ? 'open' : 'none'
};
_this.onClose = function () {
if (_this.state.animate !== 'close') {
return;
}
_this.setState({
isVisible: false
});
};
return _this;
}
AnimateInOut.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
if (!props.shouldAnimate) {
return {
isVisible: Boolean(props.on),
data: props.on,
animate: 'none'
};
}
if (props.on) {
return {
isVisible: true,
data: props.on,
animate: 'open'
};
}
if (state.isVisible) {
return {
isVisible: true,
data: state.data,
animate: 'close'
};
}
return {
isVisible: false,
animate: 'close',
data: null
};
};
var _proto = AnimateInOut.prototype;
_proto.render = function render() {
if (!this.state.isVisible) {
return null;
}
var provided = {
onClose: this.onClose,
data: this.state.data,
animate: this.state.animate
};
return this.props.children(provided);
};
return AnimateInOut;
}(external_window_React_default.a.PureComponent);
var zIndexOptions = {
dragging: 5000,
dropAnimating: 4500
};
var getDraggingTransition = function getDraggingTransition(shouldAnimateDragMovement, dropping) {
if (dropping) {
return transitions.drop(dropping.duration);
}
if (shouldAnimateDragMovement) {
return transitions.snap;
}
return transitions.fluid;
};
var getDraggingOpacity = function getDraggingOpacity(isCombining, isDropAnimating) {
if (!isCombining) {
return null;
}
return isDropAnimating ? react_beautiful_dnd_esm_combine.opacity.drop : react_beautiful_dnd_esm_combine.opacity.combining;
};
var getShouldDraggingAnimate = function getShouldDraggingAnimate(dragging) {
if (dragging.forceShouldAnimate != null) {
return dragging.forceShouldAnimate;
}
return dragging.mode === 'SNAP';
};
function getDraggingStyle(dragging) {
var dimension = dragging.dimension;
var box = dimension.client;
var offset = dragging.offset,
combineWith = dragging.combineWith,
dropping = dragging.dropping;
var isCombining = Boolean(combineWith);
var shouldAnimate = getShouldDraggingAnimate(dragging);
var isDropAnimating = Boolean(dropping);
var transform = isDropAnimating ? transforms.drop(offset, isCombining) : transforms.moveTo(offset);
var style = {
position: 'fixed',
top: box.marginBox.top,
left: box.marginBox.left,
boxSizing: 'border-box',
width: box.borderBox.width,
height: box.borderBox.height,
transition: getDraggingTransition(shouldAnimate, dropping),
transform: transform,
opacity: getDraggingOpacity(isCombining, isDropAnimating),
zIndex: isDropAnimating ? zIndexOptions.dropAnimating : zIndexOptions.dragging,
pointerEvents: 'none'
};
return style;
}
function getSecondaryStyle(secondary) {
return {
transform: transforms.moveTo(secondary.offset),
transition: secondary.shouldAnimateDisplacement ? null : 'none'
};
}
function getStyle$1(mapped) {
return mapped.type === 'DRAGGING' ? getDraggingStyle(mapped) : getSecondaryStyle(mapped);
}
function getDimension$1(descriptor, el, windowScroll) {
if (windowScroll === void 0) {
windowScroll = origin;
}
var computedStyles = window.getComputedStyle(el);
var borderBox = el.getBoundingClientRect();
var client = calculateBox(borderBox, computedStyles);
var page = withScroll(client, windowScroll);
var placeholder = {
client: client,
tagName: el.tagName.toLowerCase(),
display: computedStyles.display
};
var displaceBy = {
x: client.marginBox.width,
y: client.marginBox.height
};
var dimension = {
descriptor: descriptor,
placeholder: placeholder,
displaceBy: displaceBy,
client: client,
page: page
};
return dimension;
}
function useDraggablePublisher(args) {
var uniqueId = useUniqueId('draggable');
var descriptor = args.descriptor,
registry = args.registry,
getDraggableRef = args.getDraggableRef,
canDragInteractiveElements = args.canDragInteractiveElements,
shouldRespectForcePress = args.shouldRespectForcePress,
isEnabled = args.isEnabled;
var options = useMemo(function () {
return {
canDragInteractiveElements: canDragInteractiveElements,
shouldRespectForcePress: shouldRespectForcePress,
isEnabled: isEnabled
};
}, [canDragInteractiveElements, isEnabled, shouldRespectForcePress]);
var getDimension = useCallback(function (windowScroll) {
var el = getDraggableRef();
!el ? false ? undefined : invariant(false) : void 0;
return getDimension$1(descriptor, el, windowScroll);
}, [descriptor, getDraggableRef]);
var entry = useMemo(function () {
return {
uniqueId: uniqueId,
descriptor: descriptor,
options: options,
getDimension: getDimension
};
}, [descriptor, getDimension, options, uniqueId]);
var publishedRef = Object(external_window_React_["useRef"])(entry);
var isFirstPublishRef = Object(external_window_React_["useRef"])(true);
useIsomorphicLayoutEffect(function () {
registry.draggable.register(publishedRef.current);
return function () {
return registry.draggable.unregister(publishedRef.current);
};
}, [registry.draggable]);
useIsomorphicLayoutEffect(function () {
if (isFirstPublishRef.current) {
isFirstPublishRef.current = false;
return;
}
var last = publishedRef.current;
publishedRef.current = entry;
registry.draggable.update(entry, last);
}, [entry, registry.draggable]);
}
function useValidation$1(props, contextId, getRef) {
useDevSetupWarning(function () {
function prefix(id) {
return "Draggable[id: " + id + "]: ";
}
var id = props.draggableId;
!id ? false ? undefined : invariant(false) : void 0;
!(typeof id === 'string') ? false ? undefined : invariant(false) : void 0;
!isInteger(props.index) ? false ? undefined : invariant(false) : void 0;
if (props.mapped.type === 'DRAGGING') {
return;
}
checkIsValidInnerRef(getRef());
if (props.isEnabled) {
!findDragHandle(contextId, id) ? false ? undefined : invariant(false) : void 0;
}
});
}
function useClonePropValidation(isClone) {
useDev(function () {
var initialRef = Object(external_window_React_["useRef"])(isClone);
useDevSetupWarning(function () {
!(isClone === initialRef.current) ? false ? undefined : invariant(false) : void 0;
}, [isClone]);
});
}
function preventHtml5Dnd(event) {
event.preventDefault();
}
function Draggable(props) {
var ref = Object(external_window_React_["useRef"])(null);
var setRef = useCallback(function (el) {
ref.current = el;
}, []);
var getRef = useCallback(function () {
return ref.current;
}, []);
var _useRequiredContext = useRequiredContext(AppContext),
contextId = _useRequiredContext.contextId,
dragHandleUsageInstructionsId = _useRequiredContext.dragHandleUsageInstructionsId,
registry = _useRequiredContext.registry;
var _useRequiredContext2 = useRequiredContext(DroppableContext),
type = _useRequiredContext2.type,
droppableId = _useRequiredContext2.droppableId;
var descriptor = useMemo(function () {
return {
id: props.draggableId,
index: props.index,
type: type,
droppableId: droppableId
};
}, [props.draggableId, props.index, type, droppableId]);
var children = props.children,
draggableId = props.draggableId,
isEnabled = props.isEnabled,
shouldRespectForcePress = props.shouldRespectForcePress,
canDragInteractiveElements = props.canDragInteractiveElements,
isClone = props.isClone,
mapped = props.mapped,
dropAnimationFinishedAction = props.dropAnimationFinished;
useValidation$1(props, contextId, getRef);
useClonePropValidation(isClone);
if (!isClone) {
var forPublisher = useMemo(function () {
return {
descriptor: descriptor,
registry: registry,
getDraggableRef: getRef,
canDragInteractiveElements: canDragInteractiveElements,
shouldRespectForcePress: shouldRespectForcePress,
isEnabled: isEnabled
};
}, [descriptor, registry, getRef, canDragInteractiveElements, shouldRespectForcePress, isEnabled]);
useDraggablePublisher(forPublisher);
}
var dragHandleProps = useMemo(function () {
return isEnabled ? {
tabIndex: 0,
role: 'button',
'aria-describedby': dragHandleUsageInstructionsId,
'data-rbd-drag-handle-draggable-id': draggableId,
'data-rbd-drag-handle-context-id': contextId,
draggable: false,
onDragStart: preventHtml5Dnd
} : null;
}, [contextId, dragHandleUsageInstructionsId, draggableId, isEnabled]);
var onMoveEnd = useCallback(function (event) {
if (mapped.type !== 'DRAGGING') {
return;
}
if (!mapped.dropping) {
return;
}
if (event.propertyName !== 'transform') {
return;
}
dropAnimationFinishedAction();
}, [dropAnimationFinishedAction, mapped]);
var provided = useMemo(function () {
var style = getStyle$1(mapped);
var onTransitionEnd = mapped.type === 'DRAGGING' && mapped.dropping ? onMoveEnd : null;
var result = {
innerRef: setRef,
draggableProps: {
'data-rbd-draggable-context-id': contextId,
'data-rbd-draggable-id': draggableId,
style: style,
onTransitionEnd: onTransitionEnd
},
dragHandleProps: dragHandleProps
};
return result;
}, [contextId, dragHandleProps, draggableId, mapped, onMoveEnd, setRef]);
var rubric = useMemo(function () {
return {
draggableId: descriptor.id,
type: descriptor.type,
source: {
index: descriptor.index,
droppableId: descriptor.droppableId
}
};
}, [descriptor.droppableId, descriptor.id, descriptor.index, descriptor.type]);
return children(provided, mapped.snapshot, rubric);
}
var isStrictEqual = (function (a, b) {
return a === b;
});
var whatIsDraggedOverFromResult = (function (result) {
var combine = result.combine,
destination = result.destination;
if (destination) {
return destination.droppableId;
}
if (combine) {
return combine.droppableId;
}
return null;
});
var getCombineWithFromResult = function getCombineWithFromResult(result) {
return result.combine ? result.combine.draggableId : null;
};
var getCombineWithFromImpact = function getCombineWithFromImpact(impact) {
return impact.at && impact.at.type === 'COMBINE' ? impact.at.combine.draggableId : null;
};
function getDraggableSelector() {
var memoizedOffset = memoize_one_esm(function (x, y) {
return {
x: x,
y: y
};
});
var getMemoizedSnapshot = memoize_one_esm(function (mode, isClone, draggingOver, combineWith, dropping) {
return {
isDragging: true,
isClone: isClone,
isDropAnimating: Boolean(dropping),
dropAnimation: dropping,
mode: mode,
draggingOver: draggingOver,
combineWith: combineWith,
combineTargetFor: null
};
});
var getMemoizedProps = memoize_one_esm(function (offset, mode, dimension, isClone, draggingOver, combineWith, forceShouldAnimate) {
return {
mapped: {
type: 'DRAGGING',
dropping: null,
draggingOver: draggingOver,
combineWith: combineWith,
mode: mode,
offset: offset,
dimension: dimension,
forceShouldAnimate: forceShouldAnimate,
snapshot: getMemoizedSnapshot(mode, isClone, draggingOver, combineWith, null)
}
};
});
var selector = function selector(state, ownProps) {
if (state.isDragging) {
if (state.critical.draggable.id !== ownProps.draggableId) {
return null;
}
var offset = state.current.client.offset;
var dimension = state.dimensions.draggables[ownProps.draggableId];
var draggingOver = whatIsDraggedOver(state.impact);
var combineWith = getCombineWithFromImpact(state.impact);
var forceShouldAnimate = state.forceShouldAnimate;
return getMemoizedProps(memoizedOffset(offset.x, offset.y), state.movementMode, dimension, ownProps.isClone, draggingOver, combineWith, forceShouldAnimate);
}
if (state.phase === 'DROP_ANIMATING') {
var completed = state.completed;
if (completed.result.draggableId !== ownProps.draggableId) {
return null;
}
var isClone = ownProps.isClone;
var _dimension = state.dimensions.draggables[ownProps.draggableId];
var result = completed.result;
var mode = result.mode;
var _draggingOver = whatIsDraggedOverFromResult(result);
var _combineWith = getCombineWithFromResult(result);
var duration = state.dropDuration;
var dropping = {
duration: duration,
curve: curves.drop,
moveTo: state.newHomeClientOffset,
opacity: _combineWith ? react_beautiful_dnd_esm_combine.opacity.drop : null,
scale: _combineWith ? react_beautiful_dnd_esm_combine.scale.drop : null
};
return {
mapped: {
type: 'DRAGGING',
offset: state.newHomeClientOffset,
dimension: _dimension,
dropping: dropping,
draggingOver: _draggingOver,
combineWith: _combineWith,
mode: mode,
forceShouldAnimate: null,
snapshot: getMemoizedSnapshot(mode, isClone, _draggingOver, _combineWith, dropping)
}
};
}
return null;
};
return selector;
}
function getSecondarySnapshot(combineTargetFor) {
return {
isDragging: false,
isDropAnimating: false,
isClone: false,
dropAnimation: null,
mode: null,
draggingOver: null,
combineTargetFor: combineTargetFor,
combineWith: null
};
}
var atRest = {
mapped: {
type: 'SECONDARY',
offset: origin,
combineTargetFor: null,
shouldAnimateDisplacement: true,
snapshot: getSecondarySnapshot(null)
}
};
function getSecondarySelector() {
var memoizedOffset = memoize_one_esm(function (x, y) {
return {
x: x,
y: y
};
});
var getMemoizedSnapshot = memoize_one_esm(getSecondarySnapshot);
var getMemoizedProps = memoize_one_esm(function (offset, combineTargetFor, shouldAnimateDisplacement) {
if (combineTargetFor === void 0) {
combineTargetFor = null;
}
return {
mapped: {
type: 'SECONDARY',
offset: offset,
combineTargetFor: combineTargetFor,
shouldAnimateDisplacement: shouldAnimateDisplacement,
snapshot: getMemoizedSnapshot(combineTargetFor)
}
};
});
var getFallback = function getFallback(combineTargetFor) {
return combineTargetFor ? getMemoizedProps(origin, combineTargetFor, true) : null;
};
var getProps = function getProps(ownId, draggingId, impact, afterCritical) {
var visualDisplacement = impact.displaced.visible[ownId];
var isAfterCriticalInVirtualList = Boolean(afterCritical.inVirtualList && afterCritical.effected[ownId]);
var combine = tryGetCombine(impact);
var combineTargetFor = combine && combine.draggableId === ownId ? draggingId : null;
if (!visualDisplacement) {
if (!isAfterCriticalInVirtualList) {
return getFallback(combineTargetFor);
}
if (impact.displaced.invisible[ownId]) {
return null;
}
var change = negate(afterCritical.displacedBy.point);
var _offset = memoizedOffset(change.x, change.y);
return getMemoizedProps(_offset, combineTargetFor, true);
}
if (isAfterCriticalInVirtualList) {
return getFallback(combineTargetFor);
}
var displaceBy = impact.displacedBy.point;
var offset = memoizedOffset(displaceBy.x, displaceBy.y);
return getMemoizedProps(offset, combineTargetFor, visualDisplacement.shouldAnimate);
};
var selector = function selector(state, ownProps) {
if (state.isDragging) {
if (state.critical.draggable.id === ownProps.draggableId) {
return null;
}
return getProps(ownProps.draggableId, state.critical.draggable.id, state.impact, state.afterCritical);
}
if (state.phase === 'DROP_ANIMATING') {
var completed = state.completed;
if (completed.result.draggableId === ownProps.draggableId) {
return null;
}
return getProps(ownProps.draggableId, completed.result.draggableId, completed.impact, completed.afterCritical);
}
return null;
};
return selector;
}
var react_beautiful_dnd_esm_makeMapStateToProps = function makeMapStateToProps() {
var draggingSelector = getDraggableSelector();
var secondarySelector = getSecondarySelector();
var selector = function selector(state, ownProps) {
return draggingSelector(state, ownProps) || secondarySelector(state, ownProps) || atRest;
};
return selector;
};
var mapDispatchToProps = {
dropAnimationFinished: dropAnimationFinished
};
var ConnectedDraggable = Object(es["c" /* connect */])(react_beautiful_dnd_esm_makeMapStateToProps, mapDispatchToProps, null, {
context: StoreContext,
pure: true,
areStatePropsEqual: isStrictEqual
})(Draggable);
function PrivateDraggable(props) {
var droppableContext = useRequiredContext(DroppableContext);
var isUsingCloneFor = droppableContext.isUsingCloneFor;
if (isUsingCloneFor === props.draggableId && !props.isClone) {
return null;
}
return external_window_React_default.a.createElement(ConnectedDraggable, props);
}
function PublicDraggable(props) {
var isEnabled = typeof props.isDragDisabled === 'boolean' ? !props.isDragDisabled : true;
var canDragInteractiveElements = Boolean(props.disableInteractiveElementBlocking);
var shouldRespectForcePress = Boolean(props.shouldRespectForcePress);
return external_window_React_default.a.createElement(PrivateDraggable, Object(esm_extends["a" /* default */])({}, props, {
isClone: false,
isEnabled: isEnabled,
canDragInteractiveElements: canDragInteractiveElements,
shouldRespectForcePress: shouldRespectForcePress
}));
}
function Droppable(props) {
var appContext = Object(external_window_React_["useContext"])(AppContext);
!appContext ? false ? undefined : invariant(false) : void 0;
var contextId = appContext.contextId,
isMovementAllowed = appContext.isMovementAllowed;
var droppableRef = Object(external_window_React_["useRef"])(null);
var placeholderRef = Object(external_window_React_["useRef"])(null);
var children = props.children,
droppableId = props.droppableId,
type = props.type,
mode = props.mode,
direction = props.direction,
ignoreContainerClipping = props.ignoreContainerClipping,
isDropDisabled = props.isDropDisabled,
isCombineEnabled = props.isCombineEnabled,
snapshot = props.snapshot,
useClone = props.useClone,
updateViewportMaxScroll = props.updateViewportMaxScroll,
getContainerForClone = props.getContainerForClone;
var getDroppableRef = useCallback(function () {
return droppableRef.current;
}, []);
var setDroppableRef = useCallback(function (value) {
droppableRef.current = value;
}, []);
var getPlaceholderRef = useCallback(function () {
return placeholderRef.current;
}, []);
var setPlaceholderRef = useCallback(function (value) {
placeholderRef.current = value;
}, []);
useValidation({
props: props,
getDroppableRef: getDroppableRef,
getPlaceholderRef: getPlaceholderRef
});
var onPlaceholderTransitionEnd = useCallback(function () {
if (isMovementAllowed()) {
updateViewportMaxScroll({
maxScroll: getMaxWindowScroll()
});
}
}, [isMovementAllowed, updateViewportMaxScroll]);
useDroppablePublisher({
droppableId: droppableId,
type: type,
mode: mode,
direction: direction,
isDropDisabled: isDropDisabled,
isCombineEnabled: isCombineEnabled,
ignoreContainerClipping: ignoreContainerClipping,
getDroppableRef: getDroppableRef
});
var placeholder = external_window_React_default.a.createElement(react_beautiful_dnd_esm_AnimateInOut, {
on: props.placeholder,
shouldAnimate: props.shouldAnimatePlaceholder
}, function (_ref) {
var onClose = _ref.onClose,
data = _ref.data,
animate = _ref.animate;
return external_window_React_default.a.createElement(Placeholder$1, {
placeholder: data,
onClose: onClose,
innerRef: setPlaceholderRef,
animate: animate,
contextId: contextId,
onTransitionEnd: onPlaceholderTransitionEnd
});
});
var provided = useMemo(function () {
return {
innerRef: setDroppableRef,
placeholder: placeholder,
droppableProps: {
'data-rbd-droppable-id': droppableId,
'data-rbd-droppable-context-id': contextId
}
};
}, [contextId, droppableId, placeholder, setDroppableRef]);
var isUsingCloneFor = useClone ? useClone.dragging.draggableId : null;
var droppableContext = useMemo(function () {
return {
droppableId: droppableId,
type: type,
isUsingCloneFor: isUsingCloneFor
};
}, [droppableId, isUsingCloneFor, type]);
function getClone() {
if (!useClone) {
return null;
}
var dragging = useClone.dragging,
render = useClone.render;
var node = external_window_React_default.a.createElement(PrivateDraggable, {
draggableId: dragging.draggableId,
index: dragging.source.index,
isClone: true,
isEnabled: true,
shouldRespectForcePress: false,
canDragInteractiveElements: true
}, function (draggableProvided, draggableSnapshot) {
return render(draggableProvided, draggableSnapshot, dragging);
});
return external_window_ReactDOM_default.a.createPortal(node, getContainerForClone());
}
return external_window_React_default.a.createElement(DroppableContext.Provider, {
value: droppableContext
}, children(provided, snapshot), getClone());
}
var isMatchingType = function isMatchingType(type, critical) {
return type === critical.droppable.type;
};
var getDraggable = function getDraggable(critical, dimensions) {
return dimensions.draggables[critical.draggable.id];
};
var makeMapStateToProps$1 = function makeMapStateToProps() {
var idleWithAnimation = {
placeholder: null,
shouldAnimatePlaceholder: true,
snapshot: {
isDraggingOver: false,
draggingOverWith: null,
draggingFromThisWith: null,
isUsingPlaceholder: false
},
useClone: null
};
var idleWithoutAnimation = Object(esm_extends["a" /* default */])({}, idleWithAnimation, {
shouldAnimatePlaceholder: false
});
var getDraggableRubric = memoize_one_esm(function (descriptor) {
return {
draggableId: descriptor.id,
type: descriptor.type,
source: {
index: descriptor.index,
droppableId: descriptor.droppableId
}
};
});
var getMapProps = memoize_one_esm(function (id, isEnabled, isDraggingOverForConsumer, isDraggingOverForImpact, dragging, renderClone) {
var draggableId = dragging.descriptor.id;
var isHome = dragging.descriptor.droppableId === id;
if (isHome) {
var useClone = renderClone ? {
render: renderClone,
dragging: getDraggableRubric(dragging.descriptor)
} : null;
var _snapshot = {
isDraggingOver: isDraggingOverForConsumer,
draggingOverWith: isDraggingOverForConsumer ? draggableId : null,
draggingFromThisWith: draggableId,
isUsingPlaceholder: true
};
return {
placeholder: dragging.placeholder,
shouldAnimatePlaceholder: false,
snapshot: _snapshot,
useClone: useClone
};
}
if (!isEnabled) {
return idleWithoutAnimation;
}
if (!isDraggingOverForImpact) {
return idleWithAnimation;
}
var snapshot = {
isDraggingOver: isDraggingOverForConsumer,
draggingOverWith: draggableId,
draggingFromThisWith: null,
isUsingPlaceholder: true
};
return {
placeholder: dragging.placeholder,
shouldAnimatePlaceholder: true,
snapshot: snapshot,
useClone: null
};
});
var selector = function selector(state, ownProps) {
var id = ownProps.droppableId;
var type = ownProps.type;
var isEnabled = !ownProps.isDropDisabled;
var renderClone = ownProps.renderClone;
if (state.isDragging) {
var critical = state.critical;
if (!isMatchingType(type, critical)) {
return idleWithoutAnimation;
}
var dragging = getDraggable(critical, state.dimensions);
var isDraggingOver = whatIsDraggedOver(state.impact) === id;
return getMapProps(id, isEnabled, isDraggingOver, isDraggingOver, dragging, renderClone);
}
if (state.phase === 'DROP_ANIMATING') {
var completed = state.completed;
if (!isMatchingType(type, completed.critical)) {
return idleWithoutAnimation;
}
var _dragging = getDraggable(completed.critical, state.dimensions);
return getMapProps(id, isEnabled, whatIsDraggedOverFromResult(completed.result) === id, whatIsDraggedOver(completed.impact) === id, _dragging, renderClone);
}
if (state.phase === 'IDLE' && state.completed && !state.shouldFlush) {
var _completed = state.completed;
if (!isMatchingType(type, _completed.critical)) {
return idleWithoutAnimation;
}
var wasOver = whatIsDraggedOver(_completed.impact) === id;
var wasCombining = Boolean(_completed.impact.at && _completed.impact.at.type === 'COMBINE');
var isHome = _completed.critical.droppable.id === id;
if (wasOver) {
return wasCombining ? idleWithAnimation : idleWithoutAnimation;
}
if (isHome) {
return idleWithAnimation;
}
return idleWithoutAnimation;
}
return idleWithoutAnimation;
};
return selector;
};
var mapDispatchToProps$1 = {
updateViewportMaxScroll: react_beautiful_dnd_esm_updateViewportMaxScroll
};
function getBody() {
!document.body ? false ? undefined : invariant(false) : void 0;
return document.body;
}
var defaultProps = {
mode: 'standard',
type: 'DEFAULT',
direction: 'vertical',
isDropDisabled: false,
isCombineEnabled: false,
ignoreContainerClipping: false,
renderClone: null,
getContainerForClone: getBody
};
var ConnectedDroppable = Object(es["c" /* connect */])(makeMapStateToProps$1, mapDispatchToProps$1, null, {
context: StoreContext,
pure: true,
areStatePropsEqual: isStrictEqual
})(Droppable);
ConnectedDroppable.defaultProps = defaultProps;
/***/ }),
/***/ "tKIZ":
/*!*********************************************************!*\
!*** ./src/pages/Problemset/Preview/index.less?modules ***!
\*********************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
module.exports = {"bg":"bg___1GOV5","wrap":"wrap___J6vaJ","flexRow":"flexRow___unGFp","flexColumn":"flexColumn___3FCv8","flexJustifyBetween":"flexJustifyBetween___1tvRX","relative":"relative___2tGdE","questionNumber":"questionNumber___2RbSA","score":"score___31L41","selectTopicButton":"selectTopicButton___ic3uu","line":"line___2kJQN","dragTip":"dragTip___3pvU9","typeActive":"typeActive___3yJ9J","mouseTypeActive":"mouseTypeActive___2H9Th","typeName":"typeName___3wa5X","typeNumber":"typeNumber___1LJJb","typeAction":"typeAction___20qxC","setScore":"setScore___1-dVI","delete":"delete___3XQMr","modal":"modal___1GZ8w","modalColumn":"modalColumn___2Pxg5","shixunModal":"shixunModal___3b9yL","shixunScore":"shixunScore___1-hSe"};
/***/ })
}]);