You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

7342 lines
202 KiB

  1. (function webpackUniversalModuleDefinition(root, factory) {
  2. if(typeof exports === 'object' && typeof module === 'object')
  3. module.exports = factory(require("react"));
  4. else if(typeof define === 'function' && define.amd)
  5. define(["react"], factory);
  6. else if(typeof exports === 'object')
  7. exports["ReactDnD"] = factory(require("react"));
  8. else
  9. root["ReactDnD"] = factory(root["React"]);
  10. })(this, function(__WEBPACK_EXTERNAL_MODULE_2__) {
  11. return /******/ (function(modules) { // webpackBootstrap
  12. /******/ // The module cache
  13. /******/ var installedModules = {};
  14. /******/
  15. /******/ // The require function
  16. /******/ function __webpack_require__(moduleId) {
  17. /******/
  18. /******/ // Check if module is in cache
  19. /******/ if(installedModules[moduleId]) {
  20. /******/ return installedModules[moduleId].exports;
  21. /******/ }
  22. /******/ // Create a new module (and put it into the cache)
  23. /******/ var module = installedModules[moduleId] = {
  24. /******/ i: moduleId,
  25. /******/ l: false,
  26. /******/ exports: {}
  27. /******/ };
  28. /******/
  29. /******/ // Execute the module function
  30. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  31. /******/
  32. /******/ // Flag the module as loaded
  33. /******/ module.l = true;
  34. /******/
  35. /******/ // Return the exports of the module
  36. /******/ return module.exports;
  37. /******/ }
  38. /******/
  39. /******/
  40. /******/ // expose the modules object (__webpack_modules__)
  41. /******/ __webpack_require__.m = modules;
  42. /******/
  43. /******/ // expose the module cache
  44. /******/ __webpack_require__.c = installedModules;
  45. /******/
  46. /******/ // define getter function for harmony exports
  47. /******/ __webpack_require__.d = function(exports, name, getter) {
  48. /******/ if(!__webpack_require__.o(exports, name)) {
  49. /******/ Object.defineProperty(exports, name, {
  50. /******/ configurable: false,
  51. /******/ enumerable: true,
  52. /******/ get: getter
  53. /******/ });
  54. /******/ }
  55. /******/ };
  56. /******/
  57. /******/ // getDefaultExport function for compatibility with non-harmony modules
  58. /******/ __webpack_require__.n = function(module) {
  59. /******/ var getter = module && module.__esModule ?
  60. /******/ function getDefault() { return module['default']; } :
  61. /******/ function getModuleExports() { return module; };
  62. /******/ __webpack_require__.d(getter, 'a', getter);
  63. /******/ return getter;
  64. /******/ };
  65. /******/
  66. /******/ // Object.prototype.hasOwnProperty.call
  67. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  68. /******/
  69. /******/ // __webpack_public_path__
  70. /******/ __webpack_require__.p = "";
  71. /******/
  72. /******/ // Load entry module and return exports
  73. /******/ return __webpack_require__(__webpack_require__.s = 43);
  74. /******/ })
  75. /************************************************************************/
  76. /******/ ([
  77. /* 0 */
  78. /***/ (function(module, exports, __webpack_require__) {
  79. "use strict";
  80. /**
  81. * Copyright (c) 2013-present, Facebook, Inc.
  82. *
  83. * This source code is licensed under the MIT license found in the
  84. * LICENSE file in the root directory of this source tree.
  85. */
  86. /**
  87. * Use invariant() to assert state which your program assumes to be true.
  88. *
  89. * Provide sprintf-style format (only %s is supported) and arguments
  90. * to provide information about what broke and what you were
  91. * expecting.
  92. *
  93. * The invariant message will be stripped in production, but the invariant
  94. * will remain to ensure logic does not differ in production.
  95. */
  96. var invariant = function(condition, format, a, b, c, d, e, f) {
  97. if (false) {
  98. if (format === undefined) {
  99. throw new Error('invariant requires an error message argument');
  100. }
  101. }
  102. if (!condition) {
  103. var error;
  104. if (format === undefined) {
  105. error = new Error(
  106. 'Minified exception occurred; use the non-minified dev environment ' +
  107. 'for the full error message and additional helpful warnings.'
  108. );
  109. } else {
  110. var args = [a, b, c, d, e, f];
  111. var argIndex = 0;
  112. error = new Error(
  113. format.replace(/%s/g, function() { return args[argIndex++]; })
  114. );
  115. error.name = 'Invariant Violation';
  116. }
  117. error.framesToPop = 1; // we don't care about invariant's own frame
  118. throw error;
  119. }
  120. };
  121. module.exports = invariant;
  122. /***/ }),
  123. /* 1 */
  124. /***/ (function(module, exports, __webpack_require__) {
  125. var baseGetTag = __webpack_require__(14),
  126. getPrototype = __webpack_require__(54),
  127. isObjectLike = __webpack_require__(6);
  128. /** `Object#toString` result references. */
  129. var objectTag = '[object Object]';
  130. /** Used for built-in method references. */
  131. var funcProto = Function.prototype,
  132. objectProto = Object.prototype;
  133. /** Used to resolve the decompiled source of functions. */
  134. var funcToString = funcProto.toString;
  135. /** Used to check objects for own properties. */
  136. var hasOwnProperty = objectProto.hasOwnProperty;
  137. /** Used to infer the `Object` constructor. */
  138. var objectCtorString = funcToString.call(Object);
  139. /**
  140. * Checks if `value` is a plain object, that is, an object created by the
  141. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  142. *
  143. * @static
  144. * @memberOf _
  145. * @since 0.8.0
  146. * @category Lang
  147. * @param {*} value The value to check.
  148. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  149. * @example
  150. *
  151. * function Foo() {
  152. * this.a = 1;
  153. * }
  154. *
  155. * _.isPlainObject(new Foo);
  156. * // => false
  157. *
  158. * _.isPlainObject([1, 2, 3]);
  159. * // => false
  160. *
  161. * _.isPlainObject({ 'x': 0, 'y': 0 });
  162. * // => true
  163. *
  164. * _.isPlainObject(Object.create(null));
  165. * // => true
  166. */
  167. function isPlainObject(value) {
  168. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  169. return false;
  170. }
  171. var proto = getPrototype(value);
  172. if (proto === null) {
  173. return true;
  174. }
  175. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  176. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  177. funcToString.call(Ctor) == objectCtorString;
  178. }
  179. module.exports = isPlainObject;
  180. /***/ }),
  181. /* 2 */
  182. /***/ (function(module, exports) {
  183. module.exports = __WEBPACK_EXTERNAL_MODULE_2__;
  184. /***/ }),
  185. /* 3 */
  186. /***/ (function(module, exports) {
  187. /**
  188. * Checks if `value` is classified as an `Array` object.
  189. *
  190. * @static
  191. * @memberOf _
  192. * @since 0.1.0
  193. * @category Lang
  194. * @param {*} value The value to check.
  195. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  196. * @example
  197. *
  198. * _.isArray([1, 2, 3]);
  199. * // => true
  200. *
  201. * _.isArray(document.body.children);
  202. * // => false
  203. *
  204. * _.isArray('abc');
  205. * // => false
  206. *
  207. * _.isArray(_.noop);
  208. * // => false
  209. */
  210. var isArray = Array.isArray;
  211. module.exports = isArray;
  212. /***/ }),
  213. /* 4 */
  214. /***/ (function(module, exports, __webpack_require__) {
  215. /**
  216. * Copyright (c) 2013-present, Facebook, Inc.
  217. *
  218. * This source code is licensed under the MIT license found in the
  219. * LICENSE file in the root directory of this source tree.
  220. */
  221. if (false) {
  222. var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&
  223. Symbol.for &&
  224. Symbol.for('react.element')) ||
  225. 0xeac7;
  226. var isValidElement = function(object) {
  227. return typeof object === 'object' &&
  228. object !== null &&
  229. object.$$typeof === REACT_ELEMENT_TYPE;
  230. };
  231. // By explicitly using `prop-types` you are opting into new development behavior.
  232. // http://fb.me/prop-types-in-prod
  233. var throwOnDirectAccess = true;
  234. module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);
  235. } else {
  236. // By explicitly using `prop-types` you are opting into new production behavior.
  237. // http://fb.me/prop-types-in-prod
  238. module.exports = __webpack_require__(44)();
  239. }
  240. /***/ }),
  241. /* 5 */
  242. /***/ (function(module, exports, __webpack_require__) {
  243. var freeGlobal = __webpack_require__(51);
  244. /** Detect free variable `self`. */
  245. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  246. /** Used as a reference to the global object. */
  247. var root = freeGlobal || freeSelf || Function('return this')();
  248. module.exports = root;
  249. /***/ }),
  250. /* 6 */
  251. /***/ (function(module, exports) {
  252. /**
  253. * Checks if `value` is object-like. A value is object-like if it's not `null`
  254. * and has a `typeof` result of "object".
  255. *
  256. * @static
  257. * @memberOf _
  258. * @since 4.0.0
  259. * @category Lang
  260. * @param {*} value The value to check.
  261. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  262. * @example
  263. *
  264. * _.isObjectLike({});
  265. * // => true
  266. *
  267. * _.isObjectLike([1, 2, 3]);
  268. * // => true
  269. *
  270. * _.isObjectLike(_.noop);
  271. * // => false
  272. *
  273. * _.isObjectLike(null);
  274. * // => false
  275. */
  276. function isObjectLike(value) {
  277. return value != null && typeof value == 'object';
  278. }
  279. module.exports = isObjectLike;
  280. /***/ }),
  281. /* 7 */
  282. /***/ (function(module, exports, __webpack_require__) {
  283. "use strict";
  284. Object.defineProperty(exports, "__esModule", {
  285. value: true
  286. });
  287. exports.END_DRAG = exports.DROP = exports.HOVER = exports.PUBLISH_DRAG_SOURCE = exports.BEGIN_DRAG = undefined;
  288. var _extends = Object.assign || function (target) {
  289. for (var i = 1; i < arguments.length; i++) {
  290. var source = arguments[i];for (var key in source) {
  291. if (Object.prototype.hasOwnProperty.call(source, key)) {
  292. target[key] = source[key];
  293. }
  294. }
  295. }return target;
  296. };
  297. exports.beginDrag = beginDrag;
  298. exports.publishDragSource = publishDragSource;
  299. exports.hover = hover;
  300. exports.drop = drop;
  301. exports.endDrag = endDrag;
  302. var _invariant = __webpack_require__(0);
  303. var _invariant2 = _interopRequireDefault(_invariant);
  304. var _isArray = __webpack_require__(3);
  305. var _isArray2 = _interopRequireDefault(_isArray);
  306. var _isObject = __webpack_require__(17);
  307. var _isObject2 = _interopRequireDefault(_isObject);
  308. var _matchesType = __webpack_require__(30);
  309. var _matchesType2 = _interopRequireDefault(_matchesType);
  310. function _interopRequireDefault(obj) {
  311. return obj && obj.__esModule ? obj : { default: obj };
  312. }
  313. var BEGIN_DRAG = exports.BEGIN_DRAG = 'dnd-core/BEGIN_DRAG';
  314. var PUBLISH_DRAG_SOURCE = exports.PUBLISH_DRAG_SOURCE = 'dnd-core/PUBLISH_DRAG_SOURCE';
  315. var HOVER = exports.HOVER = 'dnd-core/HOVER';
  316. var DROP = exports.DROP = 'dnd-core/DROP';
  317. var END_DRAG = exports.END_DRAG = 'dnd-core/END_DRAG';
  318. function beginDrag(sourceIds) {
  319. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { publishSource: true, clientOffset: null };
  320. var publishSource = options.publishSource,
  321. clientOffset = options.clientOffset,
  322. getSourceClientOffset = options.getSourceClientOffset;
  323. (0, _invariant2.default)((0, _isArray2.default)(sourceIds), 'Expected sourceIds to be an array.');
  324. var monitor = this.getMonitor();
  325. var registry = this.getRegistry();
  326. (0, _invariant2.default)(!monitor.isDragging(), 'Cannot call beginDrag while dragging.');
  327. for (var i = 0; i < sourceIds.length; i++) {
  328. (0, _invariant2.default)(registry.getSource(sourceIds[i]), 'Expected sourceIds to be registered.');
  329. }
  330. var sourceId = null;
  331. for (var _i = sourceIds.length - 1; _i >= 0; _i--) {
  332. if (monitor.canDragSource(sourceIds[_i])) {
  333. sourceId = sourceIds[_i];
  334. break;
  335. }
  336. }
  337. if (sourceId === null) {
  338. return;
  339. }
  340. var sourceClientOffset = null;
  341. if (clientOffset) {
  342. (0, _invariant2.default)(typeof getSourceClientOffset === 'function', 'When clientOffset is provided, getSourceClientOffset must be a function.');
  343. sourceClientOffset = getSourceClientOffset(sourceId);
  344. }
  345. var source = registry.getSource(sourceId);
  346. var item = source.beginDrag(monitor, sourceId);
  347. (0, _invariant2.default)((0, _isObject2.default)(item), 'Item must be an object.');
  348. registry.pinSource(sourceId);
  349. var itemType = registry.getSourceType(sourceId);
  350. return {
  351. type: BEGIN_DRAG,
  352. itemType: itemType,
  353. item: item,
  354. sourceId: sourceId,
  355. clientOffset: clientOffset,
  356. sourceClientOffset: sourceClientOffset,
  357. isSourcePublic: publishSource
  358. };
  359. }
  360. function publishDragSource() {
  361. var monitor = this.getMonitor();
  362. if (!monitor.isDragging()) {
  363. return;
  364. }
  365. return { type: PUBLISH_DRAG_SOURCE };
  366. }
  367. function hover(targetIdsArg) {
  368. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  369. _ref$clientOffset = _ref.clientOffset,
  370. clientOffset = _ref$clientOffset === undefined ? null : _ref$clientOffset;
  371. (0, _invariant2.default)((0, _isArray2.default)(targetIdsArg), 'Expected targetIds to be an array.');
  372. var targetIds = targetIdsArg.slice(0);
  373. var monitor = this.getMonitor();
  374. var registry = this.getRegistry();
  375. (0, _invariant2.default)(monitor.isDragging(), 'Cannot call hover while not dragging.');
  376. (0, _invariant2.default)(!monitor.didDrop(), 'Cannot call hover after drop.');
  377. // First check invariants.
  378. for (var i = 0; i < targetIds.length; i++) {
  379. var targetId = targetIds[i];
  380. (0, _invariant2.default)(targetIds.lastIndexOf(targetId) === i, 'Expected targetIds to be unique in the passed array.');
  381. var target = registry.getTarget(targetId);
  382. (0, _invariant2.default)(target, 'Expected targetIds to be registered.');
  383. }
  384. var draggedItemType = monitor.getItemType();
  385. // Remove those targetIds that don't match the targetType. This
  386. // fixes shallow isOver which would only be non-shallow because of
  387. // non-matching targets.
  388. for (var _i2 = targetIds.length - 1; _i2 >= 0; _i2--) {
  389. var _targetId = targetIds[_i2];
  390. var targetType = registry.getTargetType(_targetId);
  391. if (!(0, _matchesType2.default)(targetType, draggedItemType)) {
  392. targetIds.splice(_i2, 1);
  393. }
  394. }
  395. // Finally call hover on all matching targets.
  396. for (var _i3 = 0; _i3 < targetIds.length; _i3++) {
  397. var _targetId2 = targetIds[_i3];
  398. var _target = registry.getTarget(_targetId2);
  399. _target.hover(monitor, _targetId2);
  400. }
  401. return {
  402. type: HOVER,
  403. targetIds: targetIds,
  404. clientOffset: clientOffset
  405. };
  406. }
  407. function drop() {
  408. var _this = this;
  409. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  410. var monitor = this.getMonitor();
  411. var registry = this.getRegistry();
  412. (0, _invariant2.default)(monitor.isDragging(), 'Cannot call drop while not dragging.');
  413. (0, _invariant2.default)(!monitor.didDrop(), 'Cannot call drop twice during one drag operation.');
  414. var targetIds = monitor.getTargetIds().filter(monitor.canDropOnTarget, monitor);
  415. targetIds.reverse();
  416. targetIds.forEach(function (targetId, index) {
  417. var target = registry.getTarget(targetId);
  418. var dropResult = target.drop(monitor, targetId);
  419. (0, _invariant2.default)(typeof dropResult === 'undefined' || (0, _isObject2.default)(dropResult), 'Drop result must either be an object or undefined.');
  420. if (typeof dropResult === 'undefined') {
  421. dropResult = index === 0 ? {} : monitor.getDropResult();
  422. }
  423. _this.store.dispatch({
  424. type: DROP,
  425. dropResult: _extends({}, options, dropResult)
  426. });
  427. });
  428. }
  429. function endDrag() {
  430. var monitor = this.getMonitor();
  431. var registry = this.getRegistry();
  432. (0, _invariant2.default)(monitor.isDragging(), 'Cannot call endDrag while not dragging.');
  433. var sourceId = monitor.getSourceId();
  434. var source = registry.getSource(sourceId, true);
  435. source.endDrag(monitor, sourceId);
  436. registry.unpinSource();
  437. return { type: END_DRAG };
  438. }
  439. /***/ }),
  440. /* 8 */
  441. /***/ (function(module, exports, __webpack_require__) {
  442. var getNative = __webpack_require__(9);
  443. /* Built-in method references that are verified to be native. */
  444. var nativeCreate = getNative(Object, 'create');
  445. module.exports = nativeCreate;
  446. /***/ }),
  447. /* 9 */
  448. /***/ (function(module, exports, __webpack_require__) {
  449. var baseIsNative = __webpack_require__(67),
  450. getValue = __webpack_require__(71);
  451. /**
  452. * Gets the native function at `key` of `object`.
  453. *
  454. * @private
  455. * @param {Object} object The object to query.
  456. * @param {string} key The key of the method to get.
  457. * @returns {*} Returns the function if it's native, else `undefined`.
  458. */
  459. function getNative(object, key) {
  460. var value = getValue(object, key);
  461. return baseIsNative(value) ? value : undefined;
  462. }
  463. module.exports = getNative;
  464. /***/ }),
  465. /* 10 */
  466. /***/ (function(module, exports, __webpack_require__) {
  467. var eq = __webpack_require__(79);
  468. /**
  469. * Gets the index at which the `key` is found in `array` of key-value pairs.
  470. *
  471. * @private
  472. * @param {Array} array The array to inspect.
  473. * @param {*} key The key to search for.
  474. * @returns {number} Returns the index of the matched value, else `-1`.
  475. */
  476. function assocIndexOf(array, key) {
  477. var length = array.length;
  478. while (length--) {
  479. if (eq(array[length][0], key)) {
  480. return length;
  481. }
  482. }
  483. return -1;
  484. }
  485. module.exports = assocIndexOf;
  486. /***/ }),
  487. /* 11 */
  488. /***/ (function(module, exports, __webpack_require__) {
  489. var isKeyable = __webpack_require__(85);
  490. /**
  491. * Gets the data for `map`.
  492. *
  493. * @private
  494. * @param {Object} map The map to query.
  495. * @param {string} key The reference key.
  496. * @returns {*} Returns the map data.
  497. */
  498. function getMapData(map, key) {
  499. var data = map.__data__;
  500. return isKeyable(key)
  501. ? data[typeof key == 'string' ? 'string' : 'hash']
  502. : data.map;
  503. }
  504. module.exports = getMapData;
  505. /***/ }),
  506. /* 12 */
  507. /***/ (function(module, exports, __webpack_require__) {
  508. "use strict";
  509. Object.defineProperty(exports, "__esModule", {
  510. value: true
  511. });
  512. exports.addSource = addSource;
  513. exports.addTarget = addTarget;
  514. exports.removeSource = removeSource;
  515. exports.removeTarget = removeTarget;
  516. var ADD_SOURCE = exports.ADD_SOURCE = 'dnd-core/ADD_SOURCE';
  517. var ADD_TARGET = exports.ADD_TARGET = 'dnd-core/ADD_TARGET';
  518. var REMOVE_SOURCE = exports.REMOVE_SOURCE = 'dnd-core/REMOVE_SOURCE';
  519. var REMOVE_TARGET = exports.REMOVE_TARGET = 'dnd-core/REMOVE_TARGET';
  520. function addSource(sourceId) {
  521. return {
  522. type: ADD_SOURCE,
  523. sourceId: sourceId
  524. };
  525. }
  526. function addTarget(targetId) {
  527. return {
  528. type: ADD_TARGET,
  529. targetId: targetId
  530. };
  531. }
  532. function removeSource(sourceId) {
  533. return {
  534. type: REMOVE_SOURCE,
  535. sourceId: sourceId
  536. };
  537. }
  538. function removeTarget(targetId) {
  539. return {
  540. type: REMOVE_TARGET,
  541. targetId: targetId
  542. };
  543. }
  544. /***/ }),
  545. /* 13 */
  546. /***/ (function(module, exports, __webpack_require__) {
  547. "use strict";
  548. Object.defineProperty(exports, "__esModule", {
  549. value: true
  550. });
  551. exports.default = checkDecoratorArguments;
  552. function checkDecoratorArguments(functionName, signature) {
  553. if (false) {
  554. for (var i = 0; i < (arguments.length <= 2 ? 0 : arguments.length - 2); i += 1) {
  555. var arg = arguments.length <= i + 2 ? undefined : arguments[i + 2];
  556. if (arg && arg.prototype && arg.prototype.render) {
  557. // eslint-disable-next-line no-console
  558. console.error('You seem to be applying the arguments in the wrong order. ' + ('It should be ' + functionName + '(' + signature + ')(Component), not the other way around. ') + 'Read more: http://react-dnd.github.io/react-dnd/docs-troubleshooting.html#you-seem-to-be-applying-the-arguments-in-the-wrong-order');
  559. return;
  560. }
  561. }
  562. }
  563. }
  564. /***/ }),
  565. /* 14 */
  566. /***/ (function(module, exports, __webpack_require__) {
  567. var Symbol = __webpack_require__(15),
  568. getRawTag = __webpack_require__(52),
  569. objectToString = __webpack_require__(53);
  570. /** `Object#toString` result references. */
  571. var nullTag = '[object Null]',
  572. undefinedTag = '[object Undefined]';
  573. /** Built-in value references. */
  574. var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  575. /**
  576. * The base implementation of `getTag` without fallbacks for buggy environments.
  577. *
  578. * @private
  579. * @param {*} value The value to query.
  580. * @returns {string} Returns the `toStringTag`.
  581. */
  582. function baseGetTag(value) {
  583. if (value == null) {
  584. return value === undefined ? undefinedTag : nullTag;
  585. }
  586. return (symToStringTag && symToStringTag in Object(value))
  587. ? getRawTag(value)
  588. : objectToString(value);
  589. }
  590. module.exports = baseGetTag;
  591. /***/ }),
  592. /* 15 */
  593. /***/ (function(module, exports, __webpack_require__) {
  594. var root = __webpack_require__(5);
  595. /** Built-in value references. */
  596. var Symbol = root.Symbol;
  597. module.exports = Symbol;
  598. /***/ }),
  599. /* 16 */
  600. /***/ (function(module, exports) {
  601. var g;
  602. // This works in non-strict mode
  603. g = (function() {
  604. return this;
  605. })();
  606. try {
  607. // This works if eval is allowed (see CSP)
  608. g = g || Function("return this")() || (1,eval)("this");
  609. } catch(e) {
  610. // This works if the window reference is available
  611. if(typeof window === "object")
  612. g = window;
  613. }
  614. // g can still be undefined, but nothing to do about it...
  615. // We return undefined, instead of nothing here, so it's
  616. // easier to handle this case. if(!global) { ...}
  617. module.exports = g;
  618. /***/ }),
  619. /* 17 */
  620. /***/ (function(module, exports) {
  621. /**
  622. * Checks if `value` is the
  623. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  624. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  625. *
  626. * @static
  627. * @memberOf _
  628. * @since 0.1.0
  629. * @category Lang
  630. * @param {*} value The value to check.
  631. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  632. * @example
  633. *
  634. * _.isObject({});
  635. * // => true
  636. *
  637. * _.isObject([1, 2, 3]);
  638. * // => true
  639. *
  640. * _.isObject(_.noop);
  641. * // => true
  642. *
  643. * _.isObject(null);
  644. * // => false
  645. */
  646. function isObject(value) {
  647. var type = typeof value;
  648. return value != null && (type == 'object' || type == 'function');
  649. }
  650. module.exports = isObject;
  651. /***/ }),
  652. /* 18 */
  653. /***/ (function(module, exports, __webpack_require__) {
  654. var MapCache = __webpack_require__(63),
  655. setCacheAdd = __webpack_require__(89),
  656. setCacheHas = __webpack_require__(90);
  657. /**
  658. *
  659. * Creates an array cache object to store unique values.
  660. *
  661. * @private
  662. * @constructor
  663. * @param {Array} [values] The values to cache.
  664. */
  665. function SetCache(values) {
  666. var index = -1,
  667. length = values == null ? 0 : values.length;
  668. this.__data__ = new MapCache;
  669. while (++index < length) {
  670. this.add(values[index]);
  671. }
  672. }
  673. // Add methods to `SetCache`.
  674. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  675. SetCache.prototype.has = setCacheHas;
  676. module.exports = SetCache;
  677. /***/ }),
  678. /* 19 */
  679. /***/ (function(module, exports, __webpack_require__) {
  680. var baseIndexOf = __webpack_require__(91);
  681. /**
  682. * A specialized version of `_.includes` for arrays without support for
  683. * specifying an index to search from.
  684. *
  685. * @private
  686. * @param {Array} [array] The array to inspect.
  687. * @param {*} target The value to search for.
  688. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  689. */
  690. function arrayIncludes(array, value) {
  691. var length = array == null ? 0 : array.length;
  692. return !!length && baseIndexOf(array, value, 0) > -1;
  693. }
  694. module.exports = arrayIncludes;
  695. /***/ }),
  696. /* 20 */
  697. /***/ (function(module, exports) {
  698. /**
  699. * This function is like `arrayIncludes` except that it accepts a comparator.
  700. *
  701. * @private
  702. * @param {Array} [array] The array to inspect.
  703. * @param {*} target The value to search for.
  704. * @param {Function} comparator The comparator invoked per element.
  705. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  706. */
  707. function arrayIncludesWith(array, value, comparator) {
  708. var index = -1,
  709. length = array == null ? 0 : array.length;
  710. while (++index < length) {
  711. if (comparator(value, array[index])) {
  712. return true;
  713. }
  714. }
  715. return false;
  716. }
  717. module.exports = arrayIncludesWith;
  718. /***/ }),
  719. /* 21 */
  720. /***/ (function(module, exports) {
  721. /**
  722. * A specialized version of `_.map` for arrays without support for iteratee
  723. * shorthands.
  724. *
  725. * @private
  726. * @param {Array} [array] The array to iterate over.
  727. * @param {Function} iteratee The function invoked per iteration.
  728. * @returns {Array} Returns the new mapped array.
  729. */
  730. function arrayMap(array, iteratee) {
  731. var index = -1,
  732. length = array == null ? 0 : array.length,
  733. result = Array(length);
  734. while (++index < length) {
  735. result[index] = iteratee(array[index], index, array);
  736. }
  737. return result;
  738. }
  739. module.exports = arrayMap;
  740. /***/ }),
  741. /* 22 */
  742. /***/ (function(module, exports) {
  743. /**
  744. * Checks if a `cache` value for `key` exists.
  745. *
  746. * @private
  747. * @param {Object} cache The cache to query.
  748. * @param {string} key The key of the entry to check.
  749. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  750. */
  751. function cacheHas(cache, key) {
  752. return cache.has(key);
  753. }
  754. module.exports = cacheHas;
  755. /***/ }),
  756. /* 23 */
  757. /***/ (function(module, exports, __webpack_require__) {
  758. var identity = __webpack_require__(34),
  759. overRest = __webpack_require__(95),
  760. setToString = __webpack_require__(97);
  761. /**
  762. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  763. *
  764. * @private
  765. * @param {Function} func The function to apply a rest parameter to.
  766. * @param {number} [start=func.length-1] The start position of the rest parameter.
  767. * @returns {Function} Returns the new function.
  768. */
  769. function baseRest(func, start) {
  770. return setToString(overRest(func, start, identity), func + '');
  771. }
  772. module.exports = baseRest;
  773. /***/ }),
  774. /* 24 */
  775. /***/ (function(module, exports, __webpack_require__) {
  776. var isArrayLike = __webpack_require__(102),
  777. isObjectLike = __webpack_require__(6);
  778. /**
  779. * This method is like `_.isArrayLike` except that it also checks if `value`
  780. * is an object.
  781. *
  782. * @static
  783. * @memberOf _
  784. * @since 4.0.0
  785. * @category Lang
  786. * @param {*} value The value to check.
  787. * @returns {boolean} Returns `true` if `value` is an array-like object,
  788. * else `false`.
  789. * @example
  790. *
  791. * _.isArrayLikeObject([1, 2, 3]);
  792. * // => true
  793. *
  794. * _.isArrayLikeObject(document.body.children);
  795. * // => true
  796. *
  797. * _.isArrayLikeObject('abc');
  798. * // => false
  799. *
  800. * _.isArrayLikeObject(_.noop);
  801. * // => false
  802. */
  803. function isArrayLikeObject(value) {
  804. return isObjectLike(value) && isArrayLike(value);
  805. }
  806. module.exports = isArrayLikeObject;
  807. /***/ }),
  808. /* 25 */
  809. /***/ (function(module, exports, __webpack_require__) {
  810. /**
  811. * Copyright 2015, Yahoo! Inc.
  812. * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
  813. */
  814. (function (global, factory) {
  815. true ? module.exports = factory() :
  816. typeof define === 'function' && define.amd ? define(factory) :
  817. (global.hoistNonReactStatics = factory());
  818. }(this, (function () {
  819. 'use strict';
  820. var REACT_STATICS = {
  821. childContextTypes: true,
  822. contextTypes: true,
  823. defaultProps: true,
  824. displayName: true,
  825. getDefaultProps: true,
  826. getDerivedStateFromProps: true,
  827. mixins: true,
  828. propTypes: true,
  829. type: true
  830. };
  831. var KNOWN_STATICS = {
  832. name: true,
  833. length: true,
  834. prototype: true,
  835. caller: true,
  836. callee: true,
  837. arguments: true,
  838. arity: true
  839. };
  840. var defineProperty = Object.defineProperty;
  841. var getOwnPropertyNames = Object.getOwnPropertyNames;
  842. var getOwnPropertySymbols = Object.getOwnPropertySymbols;
  843. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  844. var getPrototypeOf = Object.getPrototypeOf;
  845. var objectPrototype = getPrototypeOf && getPrototypeOf(Object);
  846. return function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
  847. if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components
  848. if (objectPrototype) {
  849. var inheritedComponent = getPrototypeOf(sourceComponent);
  850. if (inheritedComponent && inheritedComponent !== objectPrototype) {
  851. hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
  852. }
  853. }
  854. var keys = getOwnPropertyNames(sourceComponent);
  855. if (getOwnPropertySymbols) {
  856. keys = keys.concat(getOwnPropertySymbols(sourceComponent));
  857. }
  858. for (var i = 0; i < keys.length; ++i) {
  859. var key = keys[i];
  860. if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {
  861. var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
  862. try { // Avoid failures from read-only properties
  863. defineProperty(targetComponent, key, descriptor);
  864. } catch (e) {}
  865. }
  866. }
  867. return targetComponent;
  868. }
  869. return targetComponent;
  870. };
  871. })));
  872. /***/ }),
  873. /* 26 */
  874. /***/ (function(module, exports, __webpack_require__) {
  875. "use strict";
  876. Object.defineProperty(exports, "__esModule", {
  877. value: true
  878. });
  879. exports.default = shallowEqual;
  880. function shallowEqual(objA, objB) {
  881. if (objA === objB) {
  882. return true;
  883. }
  884. var keysA = Object.keys(objA);
  885. var keysB = Object.keys(objB);
  886. if (keysA.length !== keysB.length) {
  887. return false;
  888. }
  889. // Test for A's keys different from B.
  890. var hasOwn = Object.prototype.hasOwnProperty;
  891. for (var i = 0; i < keysA.length; i += 1) {
  892. if (!hasOwn.call(objB, keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) {
  893. return false;
  894. }
  895. var valA = objA[keysA[i]];
  896. var valB = objB[keysA[i]];
  897. if (valA !== valB) {
  898. return false;
  899. }
  900. }
  901. return true;
  902. }
  903. /***/ }),
  904. /* 27 */
  905. /***/ (function(module, exports, __webpack_require__) {
  906. "use strict";
  907. exports.__esModule = true;
  908. exports['default'] = isDisposable;
  909. function isDisposable(obj) {
  910. return Boolean(obj && typeof obj.dispose === 'function');
  911. }
  912. module.exports = exports['default'];
  913. /***/ }),
  914. /* 28 */
  915. /***/ (function(module, exports, __webpack_require__) {
  916. "use strict";
  917. Object.defineProperty(exports, "__esModule", {
  918. value: true
  919. });
  920. exports.unpackBackendForEs5Users = exports.createChildContext = exports.CHILD_CONTEXT_TYPES = undefined;
  921. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  922. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  923. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  924. exports.default = DragDropContext;
  925. var _react = __webpack_require__(2);
  926. var _react2 = _interopRequireDefault(_react);
  927. var _propTypes = __webpack_require__(4);
  928. var _propTypes2 = _interopRequireDefault(_propTypes);
  929. var _dndCore = __webpack_require__(48);
  930. var _invariant = __webpack_require__(0);
  931. var _invariant2 = _interopRequireDefault(_invariant);
  932. var _hoistNonReactStatics = __webpack_require__(25);
  933. var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics);
  934. var _checkDecoratorArguments = __webpack_require__(13);
  935. var _checkDecoratorArguments2 = _interopRequireDefault(_checkDecoratorArguments);
  936. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  937. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  938. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  939. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  940. var CHILD_CONTEXT_TYPES = exports.CHILD_CONTEXT_TYPES = {
  941. dragDropManager: _propTypes2.default.object.isRequired
  942. };
  943. var createChildContext = exports.createChildContext = function createChildContext(backend, context) {
  944. return {
  945. dragDropManager: new _dndCore.DragDropManager(backend, context)
  946. };
  947. };
  948. var unpackBackendForEs5Users = exports.unpackBackendForEs5Users = function unpackBackendForEs5Users(backendOrModule) {
  949. // Auto-detect ES6 default export for people still using ES5
  950. var backend = backendOrModule;
  951. if ((typeof backend === 'undefined' ? 'undefined' : _typeof(backend)) === 'object' && typeof backend.default === 'function') {
  952. backend = backend.default;
  953. }
  954. (0, _invariant2.default)(typeof backend === 'function', 'Expected the backend to be a function or an ES6 module exporting a default function. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-drop-context.html');
  955. return backend;
  956. };
  957. function DragDropContext(backendOrModule) {
  958. _checkDecoratorArguments2.default.apply(undefined, ['DragDropContext', 'backend'].concat(Array.prototype.slice.call(arguments))); // eslint-disable-line prefer-rest-params
  959. var backend = unpackBackendForEs5Users(backendOrModule);
  960. var childContext = createChildContext(backend);
  961. return function decorateContext(DecoratedComponent) {
  962. var _class, _temp;
  963. var displayName = DecoratedComponent.displayName || DecoratedComponent.name || 'Component';
  964. var DragDropContextContainer = (_temp = _class = function (_Component) {
  965. _inherits(DragDropContextContainer, _Component);
  966. function DragDropContextContainer() {
  967. _classCallCheck(this, DragDropContextContainer);
  968. return _possibleConstructorReturn(this, (DragDropContextContainer.__proto__ || Object.getPrototypeOf(DragDropContextContainer)).apply(this, arguments));
  969. }
  970. _createClass(DragDropContextContainer, [{
  971. key: 'getDecoratedComponentInstance',
  972. value: function getDecoratedComponentInstance() {
  973. (0, _invariant2.default)(this.child, 'In order to access an instance of the decorated component it can not be a stateless component.');
  974. return this.child;
  975. }
  976. }, {
  977. key: 'getManager',
  978. value: function getManager() {
  979. return childContext.dragDropManager;
  980. }
  981. }, {
  982. key: 'getChildContext',
  983. value: function getChildContext() {
  984. return childContext;
  985. }
  986. }, {
  987. key: 'render',
  988. value: function render() {
  989. var _this2 = this;
  990. return _react2.default.createElement(DecoratedComponent, _extends({}, this.props, {
  991. ref: function ref(child) {
  992. _this2.child = child;
  993. }
  994. }));
  995. }
  996. }]);
  997. return DragDropContextContainer;
  998. }(_react.Component), _class.DecoratedComponent = DecoratedComponent, _class.displayName = 'DragDropContext(' + displayName + ')', _class.childContextTypes = CHILD_CONTEXT_TYPES, _temp);
  999. return (0, _hoistNonReactStatics2.default)(DragDropContextContainer, DecoratedComponent);
  1000. };
  1001. }
  1002. /***/ }),
  1003. /* 29 */
  1004. /***/ (function(module, exports, __webpack_require__) {
  1005. "use strict";
  1006. Object.defineProperty(exports, "__esModule", {
  1007. value: true
  1008. });
  1009. var _extends = Object.assign || function (target) {
  1010. for (var i = 1; i < arguments.length; i++) {
  1011. var source = arguments[i];for (var key in source) {
  1012. if (Object.prototype.hasOwnProperty.call(source, key)) {
  1013. target[key] = source[key];
  1014. }
  1015. }
  1016. }return target;
  1017. };
  1018. exports.default = dragOffset;
  1019. exports.getSourceClientOffset = getSourceClientOffset;
  1020. exports.getDifferenceFromInitialOffset = getDifferenceFromInitialOffset;
  1021. var _dragDrop = __webpack_require__(7);
  1022. var initialState = {
  1023. initialSourceClientOffset: null,
  1024. initialClientOffset: null,
  1025. clientOffset: null
  1026. };
  1027. function areOffsetsEqual(offsetA, offsetB) {
  1028. if (offsetA === offsetB) {
  1029. return true;
  1030. }
  1031. return offsetA && offsetB && offsetA.x === offsetB.x && offsetA.y === offsetB.y;
  1032. }
  1033. function dragOffset() {
  1034. var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
  1035. var action = arguments[1];
  1036. switch (action.type) {
  1037. case _dragDrop.BEGIN_DRAG:
  1038. return {
  1039. initialSourceClientOffset: action.sourceClientOffset,
  1040. initialClientOffset: action.clientOffset,
  1041. clientOffset: action.clientOffset
  1042. };
  1043. case _dragDrop.HOVER:
  1044. if (areOffsetsEqual(state.clientOffset, action.clientOffset)) {
  1045. return state;
  1046. }
  1047. return _extends({}, state, {
  1048. clientOffset: action.clientOffset
  1049. });
  1050. case _dragDrop.END_DRAG:
  1051. case _dragDrop.DROP:
  1052. return initialState;
  1053. default:
  1054. return state;
  1055. }
  1056. }
  1057. function getSourceClientOffset(state) {
  1058. var clientOffset = state.clientOffset,
  1059. initialClientOffset = state.initialClientOffset,
  1060. initialSourceClientOffset = state.initialSourceClientOffset;
  1061. if (!clientOffset || !initialClientOffset || !initialSourceClientOffset) {
  1062. return null;
  1063. }
  1064. return {
  1065. x: clientOffset.x + initialSourceClientOffset.x - initialClientOffset.x,
  1066. y: clientOffset.y + initialSourceClientOffset.y - initialClientOffset.y
  1067. };
  1068. }
  1069. function getDifferenceFromInitialOffset(state) {
  1070. var clientOffset = state.clientOffset,
  1071. initialClientOffset = state.initialClientOffset;
  1072. if (!clientOffset || !initialClientOffset) {
  1073. return null;
  1074. }
  1075. return {
  1076. x: clientOffset.x - initialClientOffset.x,
  1077. y: clientOffset.y - initialClientOffset.y
  1078. };
  1079. }
  1080. /***/ }),
  1081. /* 30 */
  1082. /***/ (function(module, exports, __webpack_require__) {
  1083. "use strict";
  1084. Object.defineProperty(exports, "__esModule", {
  1085. value: true
  1086. });
  1087. exports.default = matchesType;
  1088. var _isArray = __webpack_require__(3);
  1089. var _isArray2 = _interopRequireDefault(_isArray);
  1090. function _interopRequireDefault(obj) {
  1091. return obj && obj.__esModule ? obj : { default: obj };
  1092. }
  1093. function matchesType(targetType, draggedItemType) {
  1094. if ((0, _isArray2.default)(targetType)) {
  1095. return targetType.some(function (t) {
  1096. return t === draggedItemType;
  1097. });
  1098. } else {
  1099. return targetType === draggedItemType;
  1100. }
  1101. }
  1102. /***/ }),
  1103. /* 31 */
  1104. /***/ (function(module, exports, __webpack_require__) {
  1105. var SetCache = __webpack_require__(18),
  1106. arrayIncludes = __webpack_require__(19),
  1107. arrayIncludesWith = __webpack_require__(20),
  1108. arrayMap = __webpack_require__(21),
  1109. baseUnary = __webpack_require__(33),
  1110. cacheHas = __webpack_require__(22);
  1111. /** Used as the size to enable large array optimizations. */
  1112. var LARGE_ARRAY_SIZE = 200;
  1113. /**
  1114. * The base implementation of methods like `_.difference` without support
  1115. * for excluding multiple arrays or iteratee shorthands.
  1116. *
  1117. * @private
  1118. * @param {Array} array The array to inspect.
  1119. * @param {Array} values The values to exclude.
  1120. * @param {Function} [iteratee] The iteratee invoked per element.
  1121. * @param {Function} [comparator] The comparator invoked per element.
  1122. * @returns {Array} Returns the new array of filtered values.
  1123. */
  1124. function baseDifference(array, values, iteratee, comparator) {
  1125. var index = -1,
  1126. includes = arrayIncludes,
  1127. isCommon = true,
  1128. length = array.length,
  1129. result = [],
  1130. valuesLength = values.length;
  1131. if (!length) {
  1132. return result;
  1133. }
  1134. if (iteratee) {
  1135. values = arrayMap(values, baseUnary(iteratee));
  1136. }
  1137. if (comparator) {
  1138. includes = arrayIncludesWith;
  1139. isCommon = false;
  1140. }
  1141. else if (values.length >= LARGE_ARRAY_SIZE) {
  1142. includes = cacheHas;
  1143. isCommon = false;
  1144. values = new SetCache(values);
  1145. }
  1146. outer:
  1147. while (++index < length) {
  1148. var value = array[index],
  1149. computed = iteratee == null ? value : iteratee(value);
  1150. value = (comparator || value !== 0) ? value : 0;
  1151. if (isCommon && computed === computed) {
  1152. var valuesIndex = valuesLength;
  1153. while (valuesIndex--) {
  1154. if (values[valuesIndex] === computed) {
  1155. continue outer;
  1156. }
  1157. }
  1158. result.push(value);
  1159. }
  1160. else if (!includes(values, computed, comparator)) {
  1161. result.push(value);
  1162. }
  1163. }
  1164. return result;
  1165. }
  1166. module.exports = baseDifference;
  1167. /***/ }),
  1168. /* 32 */
  1169. /***/ (function(module, exports, __webpack_require__) {
  1170. var baseGetTag = __webpack_require__(14),
  1171. isObject = __webpack_require__(17);
  1172. /** `Object#toString` result references. */
  1173. var asyncTag = '[object AsyncFunction]',
  1174. funcTag = '[object Function]',
  1175. genTag = '[object GeneratorFunction]',
  1176. proxyTag = '[object Proxy]';
  1177. /**
  1178. * Checks if `value` is classified as a `Function` object.
  1179. *
  1180. * @static
  1181. * @memberOf _
  1182. * @since 0.1.0
  1183. * @category Lang
  1184. * @param {*} value The value to check.
  1185. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  1186. * @example
  1187. *
  1188. * _.isFunction(_);
  1189. * // => true
  1190. *
  1191. * _.isFunction(/abc/);
  1192. * // => false
  1193. */
  1194. function isFunction(value) {
  1195. if (!isObject(value)) {
  1196. return false;
  1197. }
  1198. // The use of `Object#toString` avoids issues with the `typeof` operator
  1199. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  1200. var tag = baseGetTag(value);
  1201. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  1202. }
  1203. module.exports = isFunction;
  1204. /***/ }),
  1205. /* 33 */
  1206. /***/ (function(module, exports) {
  1207. /**
  1208. * The base implementation of `_.unary` without support for storing metadata.
  1209. *
  1210. * @private
  1211. * @param {Function} func The function to cap arguments for.
  1212. * @returns {Function} Returns the new capped function.
  1213. */
  1214. function baseUnary(func) {
  1215. return function(value) {
  1216. return func(value);
  1217. };
  1218. }
  1219. module.exports = baseUnary;
  1220. /***/ }),
  1221. /* 34 */
  1222. /***/ (function(module, exports) {
  1223. /**
  1224. * This method returns the first argument it receives.
  1225. *
  1226. * @static
  1227. * @since 0.1.0
  1228. * @memberOf _
  1229. * @category Util
  1230. * @param {*} value Any value.
  1231. * @returns {*} Returns `value`.
  1232. * @example
  1233. *
  1234. * var object = { 'a': 1 };
  1235. *
  1236. * console.log(_.identity(object) === object);
  1237. * // => true
  1238. */
  1239. function identity(value) {
  1240. return value;
  1241. }
  1242. module.exports = identity;
  1243. /***/ }),
  1244. /* 35 */
  1245. /***/ (function(module, exports, __webpack_require__) {
  1246. "use strict";
  1247. Object.defineProperty(exports, "__esModule", {
  1248. value: true
  1249. });
  1250. exports.default = dirtyHandlerIds;
  1251. exports.areDirty = areDirty;
  1252. var _xor = __webpack_require__(105);
  1253. var _xor2 = _interopRequireDefault(_xor);
  1254. var _intersection = __webpack_require__(116);
  1255. var _intersection2 = _interopRequireDefault(_intersection);
  1256. var _dragDrop = __webpack_require__(7);
  1257. var _registry = __webpack_require__(12);
  1258. function _interopRequireDefault(obj) {
  1259. return obj && obj.__esModule ? obj : { default: obj };
  1260. }
  1261. var NONE = [];
  1262. var ALL = [];
  1263. function dirtyHandlerIds() {
  1264. var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : NONE;
  1265. var action = arguments[1];
  1266. var dragOperation = arguments[2];
  1267. switch (action.type) {
  1268. case _dragDrop.HOVER:
  1269. break;
  1270. case _registry.ADD_SOURCE:
  1271. case _registry.ADD_TARGET:
  1272. case _registry.REMOVE_TARGET:
  1273. case _registry.REMOVE_SOURCE:
  1274. return NONE;
  1275. case _dragDrop.BEGIN_DRAG:
  1276. case _dragDrop.PUBLISH_DRAG_SOURCE:
  1277. case _dragDrop.END_DRAG:
  1278. case _dragDrop.DROP:
  1279. default:
  1280. return ALL;
  1281. }
  1282. var targetIds = action.targetIds;
  1283. var prevTargetIds = dragOperation.targetIds;
  1284. var result = (0, _xor2.default)(targetIds, prevTargetIds);
  1285. var didChange = false;
  1286. if (result.length === 0) {
  1287. for (var i = 0; i < targetIds.length; i++) {
  1288. if (targetIds[i] !== prevTargetIds[i]) {
  1289. didChange = true;
  1290. break;
  1291. }
  1292. }
  1293. } else {
  1294. didChange = true;
  1295. }
  1296. if (!didChange) {
  1297. return NONE;
  1298. }
  1299. var prevInnermostTargetId = prevTargetIds[prevTargetIds.length - 1];
  1300. var innermostTargetId = targetIds[targetIds.length - 1];
  1301. if (prevInnermostTargetId !== innermostTargetId) {
  1302. if (prevInnermostTargetId) {
  1303. result.push(prevInnermostTargetId);
  1304. }
  1305. if (innermostTargetId) {
  1306. result.push(innermostTargetId);
  1307. }
  1308. }
  1309. return result;
  1310. }
  1311. function areDirty(state, handlerIds) {
  1312. if (state === NONE) {
  1313. return false;
  1314. }
  1315. if (state === ALL || typeof handlerIds === 'undefined') {
  1316. return true;
  1317. }
  1318. return (0, _intersection2.default)(handlerIds, state).length > 0;
  1319. }
  1320. /***/ }),
  1321. /* 36 */
  1322. /***/ (function(module, exports) {
  1323. /**
  1324. * This method returns `undefined`.
  1325. *
  1326. * @static
  1327. * @memberOf _
  1328. * @since 2.3.0
  1329. * @category Util
  1330. * @example
  1331. *
  1332. * _.times(2, _.noop);
  1333. * // => [undefined, undefined]
  1334. */
  1335. function noop() {
  1336. // No operation performed.
  1337. }
  1338. module.exports = noop;
  1339. /***/ }),
  1340. /* 37 */
  1341. /***/ (function(module, exports) {
  1342. /**
  1343. * Converts `set` to an array of its values.
  1344. *
  1345. * @private
  1346. * @param {Object} set The set to convert.
  1347. * @returns {Array} Returns the values.
  1348. */
  1349. function setToArray(set) {
  1350. var index = -1,
  1351. result = Array(set.size);
  1352. set.forEach(function(value) {
  1353. result[++index] = value;
  1354. });
  1355. return result;
  1356. }
  1357. module.exports = setToArray;
  1358. /***/ }),
  1359. /* 38 */
  1360. /***/ (function(module, exports, __webpack_require__) {
  1361. "use strict";
  1362. Object.defineProperty(exports, "__esModule", {
  1363. value: true
  1364. });
  1365. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  1366. exports.default = shallowEqualScalar;
  1367. function shallowEqualScalar(objA, objB) {
  1368. if (objA === objB) {
  1369. return true;
  1370. }
  1371. if ((typeof objA === 'undefined' ? 'undefined' : _typeof(objA)) !== 'object' || objA === null || (typeof objB === 'undefined' ? 'undefined' : _typeof(objB)) !== 'object' || objB === null) {
  1372. return false;
  1373. }
  1374. var keysA = Object.keys(objA);
  1375. var keysB = Object.keys(objB);
  1376. if (keysA.length !== keysB.length) {
  1377. return false;
  1378. }
  1379. // Test for A's keys different from B.
  1380. var hasOwn = Object.prototype.hasOwnProperty;
  1381. for (var i = 0; i < keysA.length; i += 1) {
  1382. if (!hasOwn.call(objB, keysA[i])) {
  1383. return false;
  1384. }
  1385. var valA = objA[keysA[i]];
  1386. var valB = objB[keysA[i]];
  1387. if (valA !== valB || (typeof valA === 'undefined' ? 'undefined' : _typeof(valA)) === 'object' || (typeof valB === 'undefined' ? 'undefined' : _typeof(valB)) === 'object') {
  1388. return false;
  1389. }
  1390. }
  1391. return true;
  1392. }
  1393. /***/ }),
  1394. /* 39 */
  1395. /***/ (function(module, exports, __webpack_require__) {
  1396. "use strict";
  1397. Object.defineProperty(exports, "__esModule", {
  1398. value: true
  1399. });
  1400. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  1401. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  1402. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1403. exports.default = decorateHandler;
  1404. var _react = __webpack_require__(2);
  1405. var _react2 = _interopRequireDefault(_react);
  1406. var _propTypes = __webpack_require__(4);
  1407. var _propTypes2 = _interopRequireDefault(_propTypes);
  1408. var _disposables = __webpack_require__(131);
  1409. var _isPlainObject = __webpack_require__(1);
  1410. var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
  1411. var _invariant = __webpack_require__(0);
  1412. var _invariant2 = _interopRequireDefault(_invariant);
  1413. var _hoistNonReactStatics = __webpack_require__(25);
  1414. var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics);
  1415. var _shallowEqual = __webpack_require__(26);
  1416. var _shallowEqual2 = _interopRequireDefault(_shallowEqual);
  1417. var _shallowEqualScalar = __webpack_require__(38);
  1418. var _shallowEqualScalar2 = _interopRequireDefault(_shallowEqualScalar);
  1419. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  1420. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1421. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1422. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  1423. var isClassComponent = function isClassComponent(Comp) {
  1424. return Boolean(Comp && Comp.prototype && typeof Comp.prototype.render === 'function');
  1425. };
  1426. function decorateHandler(_ref) {
  1427. var _class, _temp;
  1428. var DecoratedComponent = _ref.DecoratedComponent,
  1429. createHandler = _ref.createHandler,
  1430. createMonitor = _ref.createMonitor,
  1431. createConnector = _ref.createConnector,
  1432. registerHandler = _ref.registerHandler,
  1433. containerDisplayName = _ref.containerDisplayName,
  1434. getType = _ref.getType,
  1435. collect = _ref.collect,
  1436. options = _ref.options;
  1437. var _options$arePropsEqua = options.arePropsEqual,
  1438. arePropsEqual = _options$arePropsEqua === undefined ? _shallowEqualScalar2.default : _options$arePropsEqua;
  1439. var displayName = DecoratedComponent.displayName || DecoratedComponent.name || 'Component';
  1440. var DragDropContainer = (_temp = _class = function (_Component) {
  1441. _inherits(DragDropContainer, _Component);
  1442. _createClass(DragDropContainer, [{
  1443. key: 'getHandlerId',
  1444. value: function getHandlerId() {
  1445. return this.handlerId;
  1446. }
  1447. }, {
  1448. key: 'getDecoratedComponentInstance',
  1449. value: function getDecoratedComponentInstance() {
  1450. return this.decoratedComponentInstance;
  1451. }
  1452. }, {
  1453. key: 'shouldComponentUpdate',
  1454. value: function shouldComponentUpdate(nextProps, nextState) {
  1455. return !arePropsEqual(nextProps, this.props) || !(0, _shallowEqual2.default)(nextState, this.state);
  1456. }
  1457. }]);
  1458. function DragDropContainer(props, context) {
  1459. _classCallCheck(this, DragDropContainer);
  1460. var _this = _possibleConstructorReturn(this, (DragDropContainer.__proto__ || Object.getPrototypeOf(DragDropContainer)).call(this, props, context));
  1461. _this.handleChange = _this.handleChange.bind(_this);
  1462. _this.handleChildRef = _this.handleChildRef.bind(_this);
  1463. (0, _invariant2.default)(_typeof(_this.context.dragDropManager) === 'object', 'Could not find the drag and drop manager in the context of %s. ' + 'Make sure to wrap the top-level component of your app with DragDropContext. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-troubleshooting.html#could-not-find-the-drag-and-drop-manager-in-the-context', displayName, displayName);
  1464. _this.manager = _this.context.dragDropManager;
  1465. _this.handlerMonitor = createMonitor(_this.manager);
  1466. _this.handlerConnector = createConnector(_this.manager.getBackend());
  1467. _this.handler = createHandler(_this.handlerMonitor);
  1468. _this.disposable = new _disposables.SerialDisposable();
  1469. _this.receiveProps(props);
  1470. _this.state = _this.getCurrentState();
  1471. _this.dispose();
  1472. return _this;
  1473. }
  1474. _createClass(DragDropContainer, [{
  1475. key: 'componentDidMount',
  1476. value: function componentDidMount() {
  1477. this.isCurrentlyMounted = true;
  1478. this.disposable = new _disposables.SerialDisposable();
  1479. this.currentType = null;
  1480. this.receiveProps(this.props);
  1481. this.handleChange();
  1482. }
  1483. }, {
  1484. key: 'componentWillReceiveProps',
  1485. value: function componentWillReceiveProps(nextProps) {
  1486. if (!arePropsEqual(nextProps, this.props)) {
  1487. this.receiveProps(nextProps);
  1488. this.handleChange();
  1489. }
  1490. }
  1491. }, {
  1492. key: 'componentWillUnmount',
  1493. value: function componentWillUnmount() {
  1494. this.dispose();
  1495. this.isCurrentlyMounted = false;
  1496. }
  1497. }, {
  1498. key: 'receiveProps',
  1499. value: function receiveProps(props) {
  1500. this.handler.receiveProps(props);
  1501. this.receiveType(getType(props));
  1502. }
  1503. }, {
  1504. key: 'receiveType',
  1505. value: function receiveType(type) {
  1506. if (type === this.currentType) {
  1507. return;
  1508. }
  1509. this.currentType = type;
  1510. var _registerHandler = registerHandler(type, this.handler, this.manager),
  1511. handlerId = _registerHandler.handlerId,
  1512. unregister = _registerHandler.unregister;
  1513. this.handlerId = handlerId;
  1514. this.handlerMonitor.receiveHandlerId(handlerId);
  1515. this.handlerConnector.receiveHandlerId(handlerId);
  1516. var globalMonitor = this.manager.getMonitor();
  1517. var unsubscribe = globalMonitor.subscribeToStateChange(this.handleChange, { handlerIds: [handlerId] });
  1518. this.disposable.setDisposable(new _disposables.CompositeDisposable(new _disposables.Disposable(unsubscribe), new _disposables.Disposable(unregister)));
  1519. }
  1520. }, {
  1521. key: 'handleChange',
  1522. value: function handleChange() {
  1523. if (!this.isCurrentlyMounted) {
  1524. return;
  1525. }
  1526. var nextState = this.getCurrentState();
  1527. if (!(0, _shallowEqual2.default)(nextState, this.state)) {
  1528. this.setState(nextState);
  1529. }
  1530. }
  1531. }, {
  1532. key: 'dispose',
  1533. value: function dispose() {
  1534. this.disposable.dispose();
  1535. this.handlerConnector.receiveHandlerId(null);
  1536. }
  1537. }, {
  1538. key: 'handleChildRef',
  1539. value: function handleChildRef(component) {
  1540. this.decoratedComponentInstance = component;
  1541. this.handler.receiveComponent(component);
  1542. }
  1543. }, {
  1544. key: 'getCurrentState',
  1545. value: function getCurrentState() {
  1546. var nextState = collect(this.handlerConnector.hooks, this.handlerMonitor);
  1547. if (false) {
  1548. (0, _invariant2.default)((0, _isPlainObject2.default)(nextState), 'Expected `collect` specified as the second argument to ' + '%s for %s to return a plain object of props to inject. ' + 'Instead, received %s.', containerDisplayName, displayName, nextState);
  1549. }
  1550. return nextState;
  1551. }
  1552. }, {
  1553. key: 'render',
  1554. value: function render() {
  1555. return _react2.default.createElement(DecoratedComponent, _extends({}, this.props, this.state, {
  1556. ref: isClassComponent(DecoratedComponent) ? this.handleChildRef : null
  1557. }));
  1558. }
  1559. }]);
  1560. return DragDropContainer;
  1561. }(_react.Component), _class.DecoratedComponent = DecoratedComponent, _class.displayName = containerDisplayName + '(' + displayName + ')', _class.contextTypes = {
  1562. dragDropManager: _propTypes2.default.object.isRequired
  1563. }, _temp);
  1564. return (0, _hoistNonReactStatics2.default)(DragDropContainer, DecoratedComponent);
  1565. }
  1566. /***/ }),
  1567. /* 40 */
  1568. /***/ (function(module, exports, __webpack_require__) {
  1569. "use strict";
  1570. Object.defineProperty(exports, "__esModule", {
  1571. value: true
  1572. });
  1573. exports.default = wrapConnectorHooks;
  1574. var _react = __webpack_require__(2);
  1575. var _cloneWithRef = __webpack_require__(139);
  1576. var _cloneWithRef2 = _interopRequireDefault(_cloneWithRef);
  1577. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  1578. function throwIfCompositeComponentElement(element) {
  1579. // Custom components can no longer be wrapped directly in React DnD 2.0
  1580. // so that we don't need to depend on findDOMNode() from react-dom.
  1581. if (typeof element.type === 'string') {
  1582. return;
  1583. }
  1584. var displayName = element.type.displayName || element.type.name || 'the component';
  1585. throw new Error('Only native element nodes can now be passed to React DnD connectors.' + ('You can either wrap ' + displayName + ' into a <div>, or turn it into a ') + 'drag source or a drop target itself.');
  1586. }
  1587. function wrapHookToRecognizeElement(hook) {
  1588. return function () {
  1589. var elementOrNode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  1590. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  1591. // When passed a node, call the hook straight away.
  1592. if (!(0, _react.isValidElement)(elementOrNode)) {
  1593. var node = elementOrNode;
  1594. hook(node, options);
  1595. return undefined;
  1596. }
  1597. // If passed a ReactElement, clone it and attach this function as a ref.
  1598. // This helps us achieve a neat API where user doesn't even know that refs
  1599. // are being used under the hood.
  1600. var element = elementOrNode;
  1601. throwIfCompositeComponentElement(element);
  1602. // When no options are passed, use the hook directly
  1603. var ref = options ? function (node) {
  1604. return hook(node, options);
  1605. } : hook;
  1606. return (0, _cloneWithRef2.default)(element, ref);
  1607. };
  1608. }
  1609. function wrapConnectorHooks(hooks) {
  1610. var wrappedHooks = {};
  1611. Object.keys(hooks).forEach(function (key) {
  1612. var hook = hooks[key];
  1613. var wrappedHook = wrapHookToRecognizeElement(hook);
  1614. wrappedHooks[key] = function () {
  1615. return wrappedHook;
  1616. };
  1617. });
  1618. return wrappedHooks;
  1619. }
  1620. /***/ }),
  1621. /* 41 */
  1622. /***/ (function(module, exports, __webpack_require__) {
  1623. "use strict";
  1624. Object.defineProperty(exports, "__esModule", {
  1625. value: true
  1626. });
  1627. exports.default = areOptionsEqual;
  1628. var _shallowEqual = __webpack_require__(26);
  1629. var _shallowEqual2 = _interopRequireDefault(_shallowEqual);
  1630. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  1631. function areOptionsEqual(nextOptions, currentOptions) {
  1632. if (currentOptions === nextOptions) {
  1633. return true;
  1634. }
  1635. return currentOptions !== null && nextOptions !== null && (0, _shallowEqual2.default)(currentOptions, nextOptions);
  1636. }
  1637. /***/ }),
  1638. /* 42 */
  1639. /***/ (function(module, exports, __webpack_require__) {
  1640. "use strict";
  1641. Object.defineProperty(exports, "__esModule", {
  1642. value: true
  1643. });
  1644. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  1645. exports.default = isValidType;
  1646. var _isArray = __webpack_require__(3);
  1647. var _isArray2 = _interopRequireDefault(_isArray);
  1648. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  1649. function isValidType(type, allowArray) {
  1650. return typeof type === 'string' || (typeof type === 'undefined' ? 'undefined' : _typeof(type)) === 'symbol' || allowArray && (0, _isArray2.default)(type) && type.every(function (t) {
  1651. return isValidType(t, false);
  1652. });
  1653. }
  1654. /***/ }),
  1655. /* 43 */
  1656. /***/ (function(module, exports, __webpack_require__) {
  1657. "use strict";
  1658. Object.defineProperty(exports, "__esModule", {
  1659. value: true
  1660. });
  1661. var _DragDropContext = __webpack_require__(28);
  1662. Object.defineProperty(exports, 'DragDropContext', {
  1663. enumerable: true,
  1664. get: function get() {
  1665. return _interopRequireDefault(_DragDropContext).default;
  1666. }
  1667. });
  1668. var _DragDropContextProvider = __webpack_require__(128);
  1669. Object.defineProperty(exports, 'DragDropContextProvider', {
  1670. enumerable: true,
  1671. get: function get() {
  1672. return _interopRequireDefault(_DragDropContextProvider).default;
  1673. }
  1674. });
  1675. var _DragLayer = __webpack_require__(129);
  1676. Object.defineProperty(exports, 'DragLayer', {
  1677. enumerable: true,
  1678. get: function get() {
  1679. return _interopRequireDefault(_DragLayer).default;
  1680. }
  1681. });
  1682. var _DragSource = __webpack_require__(130);
  1683. Object.defineProperty(exports, 'DragSource', {
  1684. enumerable: true,
  1685. get: function get() {
  1686. return _interopRequireDefault(_DragSource).default;
  1687. }
  1688. });
  1689. var _DropTarget = __webpack_require__(140);
  1690. Object.defineProperty(exports, 'DropTarget', {
  1691. enumerable: true,
  1692. get: function get() {
  1693. return _interopRequireDefault(_DropTarget).default;
  1694. }
  1695. });
  1696. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  1697. /***/ }),
  1698. /* 44 */
  1699. /***/ (function(module, exports, __webpack_require__) {
  1700. "use strict";
  1701. /**
  1702. * Copyright (c) 2013-present, Facebook, Inc.
  1703. *
  1704. * This source code is licensed under the MIT license found in the
  1705. * LICENSE file in the root directory of this source tree.
  1706. */
  1707. var emptyFunction = __webpack_require__(45);
  1708. var invariant = __webpack_require__(46);
  1709. var ReactPropTypesSecret = __webpack_require__(47);
  1710. module.exports = function() {
  1711. function shim(props, propName, componentName, location, propFullName, secret) {
  1712. if (secret === ReactPropTypesSecret) {
  1713. // It is still safe when called from React.
  1714. return;
  1715. }
  1716. invariant(
  1717. false,
  1718. 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
  1719. 'Use PropTypes.checkPropTypes() to call them. ' +
  1720. 'Read more at http://fb.me/use-check-prop-types'
  1721. );
  1722. };
  1723. shim.isRequired = shim;
  1724. function getShim() {
  1725. return shim;
  1726. };
  1727. // Important!
  1728. // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
  1729. var ReactPropTypes = {
  1730. array: shim,
  1731. bool: shim,
  1732. func: shim,
  1733. number: shim,
  1734. object: shim,
  1735. string: shim,
  1736. symbol: shim,
  1737. any: shim,
  1738. arrayOf: getShim,
  1739. element: shim,
  1740. instanceOf: getShim,
  1741. node: shim,
  1742. objectOf: getShim,
  1743. oneOf: getShim,
  1744. oneOfType: getShim,
  1745. shape: getShim,
  1746. exact: getShim
  1747. };
  1748. ReactPropTypes.checkPropTypes = emptyFunction;
  1749. ReactPropTypes.PropTypes = ReactPropTypes;
  1750. return ReactPropTypes;
  1751. };
  1752. /***/ }),
  1753. /* 45 */
  1754. /***/ (function(module, exports, __webpack_require__) {
  1755. "use strict";
  1756. /**
  1757. * Copyright (c) 2013-present, Facebook, Inc.
  1758. *
  1759. * This source code is licensed under the MIT license found in the
  1760. * LICENSE file in the root directory of this source tree.
  1761. *
  1762. *
  1763. */
  1764. function makeEmptyFunction(arg) {
  1765. return function () {
  1766. return arg;
  1767. };
  1768. }
  1769. /**
  1770. * This function accepts and discards inputs; it has no side effects. This is
  1771. * primarily useful idiomatically for overridable function endpoints which
  1772. * always need to be callable, since JS lacks a null-call idiom ala Cocoa.
  1773. */
  1774. var emptyFunction = function emptyFunction() {};
  1775. emptyFunction.thatReturns = makeEmptyFunction;
  1776. emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
  1777. emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
  1778. emptyFunction.thatReturnsNull = makeEmptyFunction(null);
  1779. emptyFunction.thatReturnsThis = function () {
  1780. return this;
  1781. };
  1782. emptyFunction.thatReturnsArgument = function (arg) {
  1783. return arg;
  1784. };
  1785. module.exports = emptyFunction;
  1786. /***/ }),
  1787. /* 46 */
  1788. /***/ (function(module, exports, __webpack_require__) {
  1789. "use strict";
  1790. /**
  1791. * Copyright (c) 2013-present, Facebook, Inc.
  1792. *
  1793. * This source code is licensed under the MIT license found in the
  1794. * LICENSE file in the root directory of this source tree.
  1795. *
  1796. */
  1797. /**
  1798. * Use invariant() to assert state which your program assumes to be true.
  1799. *
  1800. * Provide sprintf-style format (only %s is supported) and arguments
  1801. * to provide information about what broke and what you were
  1802. * expecting.
  1803. *
  1804. * The invariant message will be stripped in production, but the invariant
  1805. * will remain to ensure logic does not differ in production.
  1806. */
  1807. var validateFormat = function validateFormat(format) {};
  1808. if (false) {
  1809. validateFormat = function validateFormat(format) {
  1810. if (format === undefined) {
  1811. throw new Error('invariant requires an error message argument');
  1812. }
  1813. };
  1814. }
  1815. function invariant(condition, format, a, b, c, d, e, f) {
  1816. validateFormat(format);
  1817. if (!condition) {
  1818. var error;
  1819. if (format === undefined) {
  1820. error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
  1821. } else {
  1822. var args = [a, b, c, d, e, f];
  1823. var argIndex = 0;
  1824. error = new Error(format.replace(/%s/g, function () {
  1825. return args[argIndex++];
  1826. }));
  1827. error.name = 'Invariant Violation';
  1828. }
  1829. error.framesToPop = 1; // we don't care about invariant's own frame
  1830. throw error;
  1831. }
  1832. }
  1833. module.exports = invariant;
  1834. /***/ }),
  1835. /* 47 */
  1836. /***/ (function(module, exports, __webpack_require__) {
  1837. "use strict";
  1838. /**
  1839. * Copyright (c) 2013-present, Facebook, Inc.
  1840. *
  1841. * This source code is licensed under the MIT license found in the
  1842. * LICENSE file in the root directory of this source tree.
  1843. */
  1844. var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
  1845. module.exports = ReactPropTypesSecret;
  1846. /***/ }),
  1847. /* 48 */
  1848. /***/ (function(module, exports, __webpack_require__) {
  1849. "use strict";
  1850. Object.defineProperty(exports, "__esModule", {
  1851. value: true
  1852. });
  1853. var _DragDropManager = __webpack_require__(49);
  1854. Object.defineProperty(exports, 'DragDropManager', {
  1855. enumerable: true,
  1856. get: function get() {
  1857. return _interopRequireDefault(_DragDropManager).default;
  1858. }
  1859. });
  1860. var _DragSource = __webpack_require__(125);
  1861. Object.defineProperty(exports, 'DragSource', {
  1862. enumerable: true,
  1863. get: function get() {
  1864. return _interopRequireDefault(_DragSource).default;
  1865. }
  1866. });
  1867. var _DropTarget = __webpack_require__(126);
  1868. Object.defineProperty(exports, 'DropTarget', {
  1869. enumerable: true,
  1870. get: function get() {
  1871. return _interopRequireDefault(_DropTarget).default;
  1872. }
  1873. });
  1874. var _createTestBackend = __webpack_require__(127);
  1875. Object.defineProperty(exports, 'createTestBackend', {
  1876. enumerable: true,
  1877. get: function get() {
  1878. return _interopRequireDefault(_createTestBackend).default;
  1879. }
  1880. });
  1881. function _interopRequireDefault(obj) {
  1882. return obj && obj.__esModule ? obj : { default: obj };
  1883. }
  1884. /***/ }),
  1885. /* 49 */
  1886. /***/ (function(module, exports, __webpack_require__) {
  1887. "use strict";
  1888. Object.defineProperty(exports, "__esModule", {
  1889. value: true
  1890. });
  1891. var _createClass = function () {
  1892. function defineProperties(target, props) {
  1893. for (var i = 0; i < props.length; i++) {
  1894. var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
  1895. }
  1896. }return function (Constructor, protoProps, staticProps) {
  1897. if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
  1898. };
  1899. }();
  1900. var _createStore = __webpack_require__(50);
  1901. var _createStore2 = _interopRequireDefault(_createStore);
  1902. var _reducers = __webpack_require__(60);
  1903. var _reducers2 = _interopRequireDefault(_reducers);
  1904. var _dragDrop = __webpack_require__(7);
  1905. var dragDropActions = _interopRequireWildcard(_dragDrop);
  1906. var _DragDropMonitor = __webpack_require__(120);
  1907. var _DragDropMonitor2 = _interopRequireDefault(_DragDropMonitor);
  1908. function _interopRequireWildcard(obj) {
  1909. if (obj && obj.__esModule) {
  1910. return obj;
  1911. } else {
  1912. var newObj = {};if (obj != null) {
  1913. for (var key in obj) {
  1914. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  1915. }
  1916. }newObj.default = obj;return newObj;
  1917. }
  1918. }
  1919. function _interopRequireDefault(obj) {
  1920. return obj && obj.__esModule ? obj : { default: obj };
  1921. }
  1922. function _classCallCheck(instance, Constructor) {
  1923. if (!(instance instanceof Constructor)) {
  1924. throw new TypeError("Cannot call a class as a function");
  1925. }
  1926. }
  1927. var DragDropManager = function () {
  1928. function DragDropManager(createBackend) {
  1929. var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  1930. _classCallCheck(this, DragDropManager);
  1931. var store = (0, _createStore2.default)(_reducers2.default);
  1932. this.context = context;
  1933. this.store = store;
  1934. this.monitor = new _DragDropMonitor2.default(store);
  1935. this.registry = this.monitor.registry;
  1936. this.backend = createBackend(this);
  1937. store.subscribe(this.handleRefCountChange.bind(this));
  1938. }
  1939. _createClass(DragDropManager, [{
  1940. key: 'handleRefCountChange',
  1941. value: function handleRefCountChange() {
  1942. var shouldSetUp = this.store.getState().refCount > 0;
  1943. if (shouldSetUp && !this.isSetUp) {
  1944. this.backend.setup();
  1945. this.isSetUp = true;
  1946. } else if (!shouldSetUp && this.isSetUp) {
  1947. this.backend.teardown();
  1948. this.isSetUp = false;
  1949. }
  1950. }
  1951. }, {
  1952. key: 'getContext',
  1953. value: function getContext() {
  1954. return this.context;
  1955. }
  1956. }, {
  1957. key: 'getMonitor',
  1958. value: function getMonitor() {
  1959. return this.monitor;
  1960. }
  1961. }, {
  1962. key: 'getBackend',
  1963. value: function getBackend() {
  1964. return this.backend;
  1965. }
  1966. }, {
  1967. key: 'getRegistry',
  1968. value: function getRegistry() {
  1969. return this.registry;
  1970. }
  1971. }, {
  1972. key: 'getActions',
  1973. value: function getActions() {
  1974. var manager = this;
  1975. var dispatch = this.store.dispatch;
  1976. function bindActionCreator(actionCreator) {
  1977. return function () {
  1978. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  1979. args[_key] = arguments[_key];
  1980. }
  1981. var action = actionCreator.apply(manager, args);
  1982. if (typeof action !== 'undefined') {
  1983. dispatch(action);
  1984. }
  1985. };
  1986. }
  1987. return Object.keys(dragDropActions).filter(function (key) {
  1988. return typeof dragDropActions[key] === 'function';
  1989. }).reduce(function (boundActions, key) {
  1990. var action = dragDropActions[key];
  1991. boundActions[key] = bindActionCreator(action); // eslint-disable-line no-param-reassign
  1992. return boundActions;
  1993. }, {});
  1994. }
  1995. }]);
  1996. return DragDropManager;
  1997. }();
  1998. exports.default = DragDropManager;
  1999. /***/ }),
  2000. /* 50 */
  2001. /***/ (function(module, exports, __webpack_require__) {
  2002. "use strict";
  2003. exports.__esModule = true;
  2004. exports.ActionTypes = undefined;
  2005. exports['default'] = createStore;
  2006. var _isPlainObject = __webpack_require__(1);
  2007. var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
  2008. var _symbolObservable = __webpack_require__(56);
  2009. var _symbolObservable2 = _interopRequireDefault(_symbolObservable);
  2010. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  2011. /**
  2012. * These are private action types reserved by Redux.
  2013. * For any unknown actions, you must return the current state.
  2014. * If the current state is undefined, you must return the initial state.
  2015. * Do not reference these action types directly in your code.
  2016. */
  2017. var ActionTypes = exports.ActionTypes = {
  2018. INIT: '@@redux/INIT'
  2019. /**
  2020. * Creates a Redux store that holds the state tree.
  2021. * The only way to change the data in the store is to call `dispatch()` on it.
  2022. *
  2023. * There should only be a single store in your app. To specify how different
  2024. * parts of the state tree respond to actions, you may combine several reducers
  2025. * into a single reducer function by using `combineReducers`.
  2026. *
  2027. * @param {Function} reducer A function that returns the next state tree, given
  2028. * the current state tree and the action to handle.
  2029. *
  2030. * @param {any} [preloadedState] The initial state. You may optionally specify it
  2031. * to hydrate the state from the server in universal apps, or to restore a
  2032. * previously serialized user session.
  2033. * If you use `combineReducers` to produce the root reducer function, this must be
  2034. * an object with the same shape as `combineReducers` keys.
  2035. *
  2036. * @param {Function} [enhancer] The store enhancer. You may optionally specify it
  2037. * to enhance the store with third-party capabilities such as middleware,
  2038. * time travel, persistence, etc. The only store enhancer that ships with Redux
  2039. * is `applyMiddleware()`.
  2040. *
  2041. * @returns {Store} A Redux store that lets you read the state, dispatch actions
  2042. * and subscribe to changes.
  2043. */
  2044. };function createStore(reducer, preloadedState, enhancer) {
  2045. var _ref2;
  2046. if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
  2047. enhancer = preloadedState;
  2048. preloadedState = undefined;
  2049. }
  2050. if (typeof enhancer !== 'undefined') {
  2051. if (typeof enhancer !== 'function') {
  2052. throw new Error('Expected the enhancer to be a function.');
  2053. }
  2054. return enhancer(createStore)(reducer, preloadedState);
  2055. }
  2056. if (typeof reducer !== 'function') {
  2057. throw new Error('Expected the reducer to be a function.');
  2058. }
  2059. var currentReducer = reducer;
  2060. var currentState = preloadedState;
  2061. var currentListeners = [];
  2062. var nextListeners = currentListeners;
  2063. var isDispatching = false;
  2064. function ensureCanMutateNextListeners() {
  2065. if (nextListeners === currentListeners) {
  2066. nextListeners = currentListeners.slice();
  2067. }
  2068. }
  2069. /**
  2070. * Reads the state tree managed by the store.
  2071. *
  2072. * @returns {any} The current state tree of your application.
  2073. */
  2074. function getState() {
  2075. return currentState;
  2076. }
  2077. /**
  2078. * Adds a change listener. It will be called any time an action is dispatched,
  2079. * and some part of the state tree may potentially have changed. You may then
  2080. * call `getState()` to read the current state tree inside the callback.
  2081. *
  2082. * You may call `dispatch()` from a change listener, with the following
  2083. * caveats:
  2084. *
  2085. * 1. The subscriptions are snapshotted just before every `dispatch()` call.
  2086. * If you subscribe or unsubscribe while the listeners are being invoked, this
  2087. * will not have any effect on the `dispatch()` that is currently in progress.
  2088. * However, the next `dispatch()` call, whether nested or not, will use a more
  2089. * recent snapshot of the subscription list.
  2090. *
  2091. * 2. The listener should not expect to see all state changes, as the state
  2092. * might have been updated multiple times during a nested `dispatch()` before
  2093. * the listener is called. It is, however, guaranteed that all subscribers
  2094. * registered before the `dispatch()` started will be called with the latest
  2095. * state by the time it exits.
  2096. *
  2097. * @param {Function} listener A callback to be invoked on every dispatch.
  2098. * @returns {Function} A function to remove this change listener.
  2099. */
  2100. function subscribe(listener) {
  2101. if (typeof listener !== 'function') {
  2102. throw new Error('Expected listener to be a function.');
  2103. }
  2104. var isSubscribed = true;
  2105. ensureCanMutateNextListeners();
  2106. nextListeners.push(listener);
  2107. return function unsubscribe() {
  2108. if (!isSubscribed) {
  2109. return;
  2110. }
  2111. isSubscribed = false;
  2112. ensureCanMutateNextListeners();
  2113. var index = nextListeners.indexOf(listener);
  2114. nextListeners.splice(index, 1);
  2115. };
  2116. }
  2117. /**
  2118. * Dispatches an action. It is the only way to trigger a state change.
  2119. *
  2120. * The `reducer` function, used to create the store, will be called with the
  2121. * current state tree and the given `action`. Its return value will
  2122. * be considered the **next** state of the tree, and the change listeners
  2123. * will be notified.
  2124. *
  2125. * The base implementation only supports plain object actions. If you want to
  2126. * dispatch a Promise, an Observable, a thunk, or something else, you need to
  2127. * wrap your store creating function into the corresponding middleware. For
  2128. * example, see the documentation for the `redux-thunk` package. Even the
  2129. * middleware will eventually dispatch plain object actions using this method.
  2130. *
  2131. * @param {Object} action A plain object representing “what changed”. It is
  2132. * a good idea to keep actions serializable so you can record and replay user
  2133. * sessions, or use the time travelling `redux-devtools`. An action must have
  2134. * a `type` property which may not be `undefined`. It is a good idea to use
  2135. * string constants for action types.
  2136. *
  2137. * @returns {Object} For convenience, the same action object you dispatched.
  2138. *
  2139. * Note that, if you use a custom middleware, it may wrap `dispatch()` to
  2140. * return something else (for example, a Promise you can await).
  2141. */
  2142. function dispatch(action) {
  2143. if (!(0, _isPlainObject2['default'])(action)) {
  2144. throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');
  2145. }
  2146. if (typeof action.type === 'undefined') {
  2147. throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?');
  2148. }
  2149. if (isDispatching) {
  2150. throw new Error('Reducers may not dispatch actions.');
  2151. }
  2152. try {
  2153. isDispatching = true;
  2154. currentState = currentReducer(currentState, action);
  2155. } finally {
  2156. isDispatching = false;
  2157. }
  2158. var listeners = currentListeners = nextListeners;
  2159. for (var i = 0; i < listeners.length; i++) {
  2160. var listener = listeners[i];
  2161. listener();
  2162. }
  2163. return action;
  2164. }
  2165. /**
  2166. * Replaces the reducer currently used by the store to calculate the state.
  2167. *
  2168. * You might need this if your app implements code splitting and you want to
  2169. * load some of the reducers dynamically. You might also need this if you
  2170. * implement a hot reloading mechanism for Redux.
  2171. *
  2172. * @param {Function} nextReducer The reducer for the store to use instead.
  2173. * @returns {void}
  2174. */
  2175. function replaceReducer(nextReducer) {
  2176. if (typeof nextReducer !== 'function') {
  2177. throw new Error('Expected the nextReducer to be a function.');
  2178. }
  2179. currentReducer = nextReducer;
  2180. dispatch({ type: ActionTypes.INIT });
  2181. }
  2182. /**
  2183. * Interoperability point for observable/reactive libraries.
  2184. * @returns {observable} A minimal observable of state changes.
  2185. * For more information, see the observable proposal:
  2186. * https://github.com/tc39/proposal-observable
  2187. */
  2188. function observable() {
  2189. var _ref;
  2190. var outerSubscribe = subscribe;
  2191. return _ref = {
  2192. /**
  2193. * The minimal observable subscription method.
  2194. * @param {Object} observer Any object that can be used as an observer.
  2195. * The observer object should have a `next` method.
  2196. * @returns {subscription} An object with an `unsubscribe` method that can
  2197. * be used to unsubscribe the observable from the store, and prevent further
  2198. * emission of values from the observable.
  2199. */
  2200. subscribe: function subscribe(observer) {
  2201. if (typeof observer !== 'object') {
  2202. throw new TypeError('Expected the observer to be an object.');
  2203. }
  2204. function observeState() {
  2205. if (observer.next) {
  2206. observer.next(getState());
  2207. }
  2208. }
  2209. observeState();
  2210. var unsubscribe = outerSubscribe(observeState);
  2211. return { unsubscribe: unsubscribe };
  2212. }
  2213. }, _ref[_symbolObservable2['default']] = function () {
  2214. return this;
  2215. }, _ref;
  2216. }
  2217. // When a store is created, an "INIT" action is dispatched so that every
  2218. // reducer returns their initial state. This effectively populates
  2219. // the initial state tree.
  2220. dispatch({ type: ActionTypes.INIT });
  2221. return _ref2 = {
  2222. dispatch: dispatch,
  2223. subscribe: subscribe,
  2224. getState: getState,
  2225. replaceReducer: replaceReducer
  2226. }, _ref2[_symbolObservable2['default']] = observable, _ref2;
  2227. }
  2228. /***/ }),
  2229. /* 51 */
  2230. /***/ (function(module, exports, __webpack_require__) {
  2231. /* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
  2232. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  2233. module.exports = freeGlobal;
  2234. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)))
  2235. /***/ }),
  2236. /* 52 */
  2237. /***/ (function(module, exports, __webpack_require__) {
  2238. var Symbol = __webpack_require__(15);
  2239. /** Used for built-in method references. */
  2240. var objectProto = Object.prototype;
  2241. /** Used to check objects for own properties. */
  2242. var hasOwnProperty = objectProto.hasOwnProperty;
  2243. /**
  2244. * Used to resolve the
  2245. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2246. * of values.
  2247. */
  2248. var nativeObjectToString = objectProto.toString;
  2249. /** Built-in value references. */
  2250. var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2251. /**
  2252. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  2253. *
  2254. * @private
  2255. * @param {*} value The value to query.
  2256. * @returns {string} Returns the raw `toStringTag`.
  2257. */
  2258. function getRawTag(value) {
  2259. var isOwn = hasOwnProperty.call(value, symToStringTag),
  2260. tag = value[symToStringTag];
  2261. try {
  2262. value[symToStringTag] = undefined;
  2263. var unmasked = true;
  2264. } catch (e) {}
  2265. var result = nativeObjectToString.call(value);
  2266. if (unmasked) {
  2267. if (isOwn) {
  2268. value[symToStringTag] = tag;
  2269. } else {
  2270. delete value[symToStringTag];
  2271. }
  2272. }
  2273. return result;
  2274. }
  2275. module.exports = getRawTag;
  2276. /***/ }),
  2277. /* 53 */
  2278. /***/ (function(module, exports) {
  2279. /** Used for built-in method references. */
  2280. var objectProto = Object.prototype;
  2281. /**
  2282. * Used to resolve the
  2283. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2284. * of values.
  2285. */
  2286. var nativeObjectToString = objectProto.toString;
  2287. /**
  2288. * Converts `value` to a string using `Object.prototype.toString`.
  2289. *
  2290. * @private
  2291. * @param {*} value The value to convert.
  2292. * @returns {string} Returns the converted string.
  2293. */
  2294. function objectToString(value) {
  2295. return nativeObjectToString.call(value);
  2296. }
  2297. module.exports = objectToString;
  2298. /***/ }),
  2299. /* 54 */
  2300. /***/ (function(module, exports, __webpack_require__) {
  2301. var overArg = __webpack_require__(55);
  2302. /** Built-in value references. */
  2303. var getPrototype = overArg(Object.getPrototypeOf, Object);
  2304. module.exports = getPrototype;
  2305. /***/ }),
  2306. /* 55 */
  2307. /***/ (function(module, exports) {
  2308. /**
  2309. * Creates a unary function that invokes `func` with its argument transformed.
  2310. *
  2311. * @private
  2312. * @param {Function} func The function to wrap.
  2313. * @param {Function} transform The argument transform.
  2314. * @returns {Function} Returns the new function.
  2315. */
  2316. function overArg(func, transform) {
  2317. return function(arg) {
  2318. return func(transform(arg));
  2319. };
  2320. }
  2321. module.exports = overArg;
  2322. /***/ }),
  2323. /* 56 */
  2324. /***/ (function(module, exports, __webpack_require__) {
  2325. module.exports = __webpack_require__(57);
  2326. /***/ }),
  2327. /* 57 */
  2328. /***/ (function(module, exports, __webpack_require__) {
  2329. "use strict";
  2330. /* WEBPACK VAR INJECTION */(function(global, module) {
  2331. Object.defineProperty(exports, "__esModule", {
  2332. value: true
  2333. });
  2334. var _ponyfill = __webpack_require__(59);
  2335. var _ponyfill2 = _interopRequireDefault(_ponyfill);
  2336. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  2337. var root; /* global window */
  2338. if (typeof self !== 'undefined') {
  2339. root = self;
  2340. } else if (typeof window !== 'undefined') {
  2341. root = window;
  2342. } else if (typeof global !== 'undefined') {
  2343. root = global;
  2344. } else if (true) {
  2345. root = module;
  2346. } else {
  2347. root = Function('return this')();
  2348. }
  2349. var result = (0, _ponyfill2['default'])(root);
  2350. exports['default'] = result;
  2351. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16), __webpack_require__(58)(module)))
  2352. /***/ }),
  2353. /* 58 */
  2354. /***/ (function(module, exports) {
  2355. module.exports = function(module) {
  2356. if(!module.webpackPolyfill) {
  2357. module.deprecate = function() {};
  2358. module.paths = [];
  2359. // module.parent = undefined by default
  2360. if(!module.children) module.children = [];
  2361. Object.defineProperty(module, "loaded", {
  2362. enumerable: true,
  2363. get: function() {
  2364. return module.l;
  2365. }
  2366. });
  2367. Object.defineProperty(module, "id", {
  2368. enumerable: true,
  2369. get: function() {
  2370. return module.i;
  2371. }
  2372. });
  2373. module.webpackPolyfill = 1;
  2374. }
  2375. return module;
  2376. };
  2377. /***/ }),
  2378. /* 59 */
  2379. /***/ (function(module, exports, __webpack_require__) {
  2380. "use strict";
  2381. Object.defineProperty(exports, "__esModule", {
  2382. value: true
  2383. });
  2384. exports['default'] = symbolObservablePonyfill;
  2385. function symbolObservablePonyfill(root) {
  2386. var result;
  2387. var _Symbol = root.Symbol;
  2388. if (typeof _Symbol === 'function') {
  2389. if (_Symbol.observable) {
  2390. result = _Symbol.observable;
  2391. } else {
  2392. result = _Symbol('observable');
  2393. _Symbol.observable = result;
  2394. }
  2395. } else {
  2396. result = '@@observable';
  2397. }
  2398. return result;
  2399. };
  2400. /***/ }),
  2401. /* 60 */
  2402. /***/ (function(module, exports, __webpack_require__) {
  2403. "use strict";
  2404. Object.defineProperty(exports, "__esModule", {
  2405. value: true
  2406. });
  2407. exports.default = reduce;
  2408. var _dragOffset = __webpack_require__(29);
  2409. var _dragOffset2 = _interopRequireDefault(_dragOffset);
  2410. var _dragOperation = __webpack_require__(61);
  2411. var _dragOperation2 = _interopRequireDefault(_dragOperation);
  2412. var _refCount = __webpack_require__(104);
  2413. var _refCount2 = _interopRequireDefault(_refCount);
  2414. var _dirtyHandlerIds = __webpack_require__(35);
  2415. var _dirtyHandlerIds2 = _interopRequireDefault(_dirtyHandlerIds);
  2416. var _stateId = __webpack_require__(119);
  2417. var _stateId2 = _interopRequireDefault(_stateId);
  2418. function _interopRequireDefault(obj) {
  2419. return obj && obj.__esModule ? obj : { default: obj };
  2420. }
  2421. function reduce() {
  2422. var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2423. var action = arguments[1];
  2424. return {
  2425. dirtyHandlerIds: (0, _dirtyHandlerIds2.default)(state.dirtyHandlerIds, action, state.dragOperation),
  2426. dragOffset: (0, _dragOffset2.default)(state.dragOffset, action),
  2427. refCount: (0, _refCount2.default)(state.refCount, action),
  2428. dragOperation: (0, _dragOperation2.default)(state.dragOperation, action),
  2429. stateId: (0, _stateId2.default)(state.stateId)
  2430. };
  2431. }
  2432. /***/ }),
  2433. /* 61 */
  2434. /***/ (function(module, exports, __webpack_require__) {
  2435. "use strict";
  2436. Object.defineProperty(exports, "__esModule", {
  2437. value: true
  2438. });
  2439. var _extends = Object.assign || function (target) {
  2440. for (var i = 1; i < arguments.length; i++) {
  2441. var source = arguments[i];for (var key in source) {
  2442. if (Object.prototype.hasOwnProperty.call(source, key)) {
  2443. target[key] = source[key];
  2444. }
  2445. }
  2446. }return target;
  2447. };
  2448. exports.default = dragOperation;
  2449. var _without = __webpack_require__(62);
  2450. var _without2 = _interopRequireDefault(_without);
  2451. var _dragDrop = __webpack_require__(7);
  2452. var _registry = __webpack_require__(12);
  2453. function _interopRequireDefault(obj) {
  2454. return obj && obj.__esModule ? obj : { default: obj };
  2455. }
  2456. var initialState = {
  2457. itemType: null,
  2458. item: null,
  2459. sourceId: null,
  2460. targetIds: [],
  2461. dropResult: null,
  2462. didDrop: false,
  2463. isSourcePublic: null
  2464. };
  2465. function dragOperation() {
  2466. var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
  2467. var action = arguments[1];
  2468. switch (action.type) {
  2469. case _dragDrop.BEGIN_DRAG:
  2470. return _extends({}, state, {
  2471. itemType: action.itemType,
  2472. item: action.item,
  2473. sourceId: action.sourceId,
  2474. isSourcePublic: action.isSourcePublic,
  2475. dropResult: null,
  2476. didDrop: false
  2477. });
  2478. case _dragDrop.PUBLISH_DRAG_SOURCE:
  2479. return _extends({}, state, {
  2480. isSourcePublic: true
  2481. });
  2482. case _dragDrop.HOVER:
  2483. return _extends({}, state, {
  2484. targetIds: action.targetIds
  2485. });
  2486. case _registry.REMOVE_TARGET:
  2487. if (state.targetIds.indexOf(action.targetId) === -1) {
  2488. return state;
  2489. }
  2490. return _extends({}, state, {
  2491. targetIds: (0, _without2.default)(state.targetIds, action.targetId)
  2492. });
  2493. case _dragDrop.DROP:
  2494. return _extends({}, state, {
  2495. dropResult: action.dropResult,
  2496. didDrop: true,
  2497. targetIds: []
  2498. });
  2499. case _dragDrop.END_DRAG:
  2500. return _extends({}, state, {
  2501. itemType: null,
  2502. item: null,
  2503. sourceId: null,
  2504. dropResult: null,
  2505. didDrop: false,
  2506. isSourcePublic: null,
  2507. targetIds: []
  2508. });
  2509. default:
  2510. return state;
  2511. }
  2512. }
  2513. /***/ }),
  2514. /* 62 */
  2515. /***/ (function(module, exports, __webpack_require__) {
  2516. var baseDifference = __webpack_require__(31),
  2517. baseRest = __webpack_require__(23),
  2518. isArrayLikeObject = __webpack_require__(24);
  2519. /**
  2520. * Creates an array excluding all given values using
  2521. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  2522. * for equality comparisons.
  2523. *
  2524. * **Note:** Unlike `_.pull`, this method returns a new array.
  2525. *
  2526. * @static
  2527. * @memberOf _
  2528. * @since 0.1.0
  2529. * @category Array
  2530. * @param {Array} array The array to inspect.
  2531. * @param {...*} [values] The values to exclude.
  2532. * @returns {Array} Returns the new array of filtered values.
  2533. * @see _.difference, _.xor
  2534. * @example
  2535. *
  2536. * _.without([2, 1, 2, 3], 1, 2);
  2537. * // => [3]
  2538. */
  2539. var without = baseRest(function(array, values) {
  2540. return isArrayLikeObject(array)
  2541. ? baseDifference(array, values)
  2542. : [];
  2543. });
  2544. module.exports = without;
  2545. /***/ }),
  2546. /* 63 */
  2547. /***/ (function(module, exports, __webpack_require__) {
  2548. var mapCacheClear = __webpack_require__(64),
  2549. mapCacheDelete = __webpack_require__(84),
  2550. mapCacheGet = __webpack_require__(86),
  2551. mapCacheHas = __webpack_require__(87),
  2552. mapCacheSet = __webpack_require__(88);
  2553. /**
  2554. * Creates a map cache object to store key-value pairs.
  2555. *
  2556. * @private
  2557. * @constructor
  2558. * @param {Array} [entries] The key-value pairs to cache.
  2559. */
  2560. function MapCache(entries) {
  2561. var index = -1,
  2562. length = entries == null ? 0 : entries.length;
  2563. this.clear();
  2564. while (++index < length) {
  2565. var entry = entries[index];
  2566. this.set(entry[0], entry[1]);
  2567. }
  2568. }
  2569. // Add methods to `MapCache`.
  2570. MapCache.prototype.clear = mapCacheClear;
  2571. MapCache.prototype['delete'] = mapCacheDelete;
  2572. MapCache.prototype.get = mapCacheGet;
  2573. MapCache.prototype.has = mapCacheHas;
  2574. MapCache.prototype.set = mapCacheSet;
  2575. module.exports = MapCache;
  2576. /***/ }),
  2577. /* 64 */
  2578. /***/ (function(module, exports, __webpack_require__) {
  2579. var Hash = __webpack_require__(65),
  2580. ListCache = __webpack_require__(76),
  2581. Map = __webpack_require__(83);
  2582. /**
  2583. * Removes all key-value entries from the map.
  2584. *
  2585. * @private
  2586. * @name clear
  2587. * @memberOf MapCache
  2588. */
  2589. function mapCacheClear() {
  2590. this.size = 0;
  2591. this.__data__ = {
  2592. 'hash': new Hash,
  2593. 'map': new (Map || ListCache),
  2594. 'string': new Hash
  2595. };
  2596. }
  2597. module.exports = mapCacheClear;
  2598. /***/ }),
  2599. /* 65 */
  2600. /***/ (function(module, exports, __webpack_require__) {
  2601. var hashClear = __webpack_require__(66),
  2602. hashDelete = __webpack_require__(72),
  2603. hashGet = __webpack_require__(73),
  2604. hashHas = __webpack_require__(74),
  2605. hashSet = __webpack_require__(75);
  2606. /**
  2607. * Creates a hash object.
  2608. *
  2609. * @private
  2610. * @constructor
  2611. * @param {Array} [entries] The key-value pairs to cache.
  2612. */
  2613. function Hash(entries) {
  2614. var index = -1,
  2615. length = entries == null ? 0 : entries.length;
  2616. this.clear();
  2617. while (++index < length) {
  2618. var entry = entries[index];
  2619. this.set(entry[0], entry[1]);
  2620. }
  2621. }
  2622. // Add methods to `Hash`.
  2623. Hash.prototype.clear = hashClear;
  2624. Hash.prototype['delete'] = hashDelete;
  2625. Hash.prototype.get = hashGet;
  2626. Hash.prototype.has = hashHas;
  2627. Hash.prototype.set = hashSet;
  2628. module.exports = Hash;
  2629. /***/ }),
  2630. /* 66 */
  2631. /***/ (function(module, exports, __webpack_require__) {
  2632. var nativeCreate = __webpack_require__(8);
  2633. /**
  2634. * Removes all key-value entries from the hash.
  2635. *
  2636. * @private
  2637. * @name clear
  2638. * @memberOf Hash
  2639. */
  2640. function hashClear() {
  2641. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2642. this.size = 0;
  2643. }
  2644. module.exports = hashClear;
  2645. /***/ }),
  2646. /* 67 */
  2647. /***/ (function(module, exports, __webpack_require__) {
  2648. var isFunction = __webpack_require__(32),
  2649. isMasked = __webpack_require__(68),
  2650. isObject = __webpack_require__(17),
  2651. toSource = __webpack_require__(70);
  2652. /**
  2653. * Used to match `RegExp`
  2654. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  2655. */
  2656. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  2657. /** Used to detect host constructors (Safari). */
  2658. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  2659. /** Used for built-in method references. */
  2660. var funcProto = Function.prototype,
  2661. objectProto = Object.prototype;
  2662. /** Used to resolve the decompiled source of functions. */
  2663. var funcToString = funcProto.toString;
  2664. /** Used to check objects for own properties. */
  2665. var hasOwnProperty = objectProto.hasOwnProperty;
  2666. /** Used to detect if a method is native. */
  2667. var reIsNative = RegExp('^' +
  2668. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2669. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2670. );
  2671. /**
  2672. * The base implementation of `_.isNative` without bad shim checks.
  2673. *
  2674. * @private
  2675. * @param {*} value The value to check.
  2676. * @returns {boolean} Returns `true` if `value` is a native function,
  2677. * else `false`.
  2678. */
  2679. function baseIsNative(value) {
  2680. if (!isObject(value) || isMasked(value)) {
  2681. return false;
  2682. }
  2683. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  2684. return pattern.test(toSource(value));
  2685. }
  2686. module.exports = baseIsNative;
  2687. /***/ }),
  2688. /* 68 */
  2689. /***/ (function(module, exports, __webpack_require__) {
  2690. var coreJsData = __webpack_require__(69);
  2691. /** Used to detect methods masquerading as native. */
  2692. var maskSrcKey = (function() {
  2693. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2694. return uid ? ('Symbol(src)_1.' + uid) : '';
  2695. }());
  2696. /**
  2697. * Checks if `func` has its source masked.
  2698. *
  2699. * @private
  2700. * @param {Function} func The function to check.
  2701. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  2702. */
  2703. function isMasked(func) {
  2704. return !!maskSrcKey && (maskSrcKey in func);
  2705. }
  2706. module.exports = isMasked;
  2707. /***/ }),
  2708. /* 69 */
  2709. /***/ (function(module, exports, __webpack_require__) {
  2710. var root = __webpack_require__(5);
  2711. /** Used to detect overreaching core-js shims. */
  2712. var coreJsData = root['__core-js_shared__'];
  2713. module.exports = coreJsData;
  2714. /***/ }),
  2715. /* 70 */
  2716. /***/ (function(module, exports) {
  2717. /** Used for built-in method references. */
  2718. var funcProto = Function.prototype;
  2719. /** Used to resolve the decompiled source of functions. */
  2720. var funcToString = funcProto.toString;
  2721. /**
  2722. * Converts `func` to its source code.
  2723. *
  2724. * @private
  2725. * @param {Function} func The function to convert.
  2726. * @returns {string} Returns the source code.
  2727. */
  2728. function toSource(func) {
  2729. if (func != null) {
  2730. try {
  2731. return funcToString.call(func);
  2732. } catch (e) {}
  2733. try {
  2734. return (func + '');
  2735. } catch (e) {}
  2736. }
  2737. return '';
  2738. }
  2739. module.exports = toSource;
  2740. /***/ }),
  2741. /* 71 */
  2742. /***/ (function(module, exports) {
  2743. /**
  2744. * Gets the value at `key` of `object`.
  2745. *
  2746. * @private
  2747. * @param {Object} [object] The object to query.
  2748. * @param {string} key The key of the property to get.
  2749. * @returns {*} Returns the property value.
  2750. */
  2751. function getValue(object, key) {
  2752. return object == null ? undefined : object[key];
  2753. }
  2754. module.exports = getValue;
  2755. /***/ }),
  2756. /* 72 */
  2757. /***/ (function(module, exports) {
  2758. /**
  2759. * Removes `key` and its value from the hash.
  2760. *
  2761. * @private
  2762. * @name delete
  2763. * @memberOf Hash
  2764. * @param {Object} hash The hash to modify.
  2765. * @param {string} key The key of the value to remove.
  2766. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2767. */
  2768. function hashDelete(key) {
  2769. var result = this.has(key) && delete this.__data__[key];
  2770. this.size -= result ? 1 : 0;
  2771. return result;
  2772. }
  2773. module.exports = hashDelete;
  2774. /***/ }),
  2775. /* 73 */
  2776. /***/ (function(module, exports, __webpack_require__) {
  2777. var nativeCreate = __webpack_require__(8);
  2778. /** Used to stand-in for `undefined` hash values. */
  2779. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  2780. /** Used for built-in method references. */
  2781. var objectProto = Object.prototype;
  2782. /** Used to check objects for own properties. */
  2783. var hasOwnProperty = objectProto.hasOwnProperty;
  2784. /**
  2785. * Gets the hash value for `key`.
  2786. *
  2787. * @private
  2788. * @name get
  2789. * @memberOf Hash
  2790. * @param {string} key The key of the value to get.
  2791. * @returns {*} Returns the entry value.
  2792. */
  2793. function hashGet(key) {
  2794. var data = this.__data__;
  2795. if (nativeCreate) {
  2796. var result = data[key];
  2797. return result === HASH_UNDEFINED ? undefined : result;
  2798. }
  2799. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  2800. }
  2801. module.exports = hashGet;
  2802. /***/ }),
  2803. /* 74 */
  2804. /***/ (function(module, exports, __webpack_require__) {
  2805. var nativeCreate = __webpack_require__(8);
  2806. /** Used for built-in method references. */
  2807. var objectProto = Object.prototype;
  2808. /** Used to check objects for own properties. */
  2809. var hasOwnProperty = objectProto.hasOwnProperty;
  2810. /**
  2811. * Checks if a hash value for `key` exists.
  2812. *
  2813. * @private
  2814. * @name has
  2815. * @memberOf Hash
  2816. * @param {string} key The key of the entry to check.
  2817. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2818. */
  2819. function hashHas(key) {
  2820. var data = this.__data__;
  2821. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  2822. }
  2823. module.exports = hashHas;
  2824. /***/ }),
  2825. /* 75 */
  2826. /***/ (function(module, exports, __webpack_require__) {
  2827. var nativeCreate = __webpack_require__(8);
  2828. /** Used to stand-in for `undefined` hash values. */
  2829. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  2830. /**
  2831. * Sets the hash `key` to `value`.
  2832. *
  2833. * @private
  2834. * @name set
  2835. * @memberOf Hash
  2836. * @param {string} key The key of the value to set.
  2837. * @param {*} value The value to set.
  2838. * @returns {Object} Returns the hash instance.
  2839. */
  2840. function hashSet(key, value) {
  2841. var data = this.__data__;
  2842. this.size += this.has(key) ? 0 : 1;
  2843. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  2844. return this;
  2845. }
  2846. module.exports = hashSet;
  2847. /***/ }),
  2848. /* 76 */
  2849. /***/ (function(module, exports, __webpack_require__) {
  2850. var listCacheClear = __webpack_require__(77),
  2851. listCacheDelete = __webpack_require__(78),
  2852. listCacheGet = __webpack_require__(80),
  2853. listCacheHas = __webpack_require__(81),
  2854. listCacheSet = __webpack_require__(82);
  2855. /**
  2856. * Creates an list cache object.
  2857. *
  2858. * @private
  2859. * @constructor
  2860. * @param {Array} [entries] The key-value pairs to cache.
  2861. */
  2862. function ListCache(entries) {
  2863. var index = -1,
  2864. length = entries == null ? 0 : entries.length;
  2865. this.clear();
  2866. while (++index < length) {
  2867. var entry = entries[index];
  2868. this.set(entry[0], entry[1]);
  2869. }
  2870. }
  2871. // Add methods to `ListCache`.
  2872. ListCache.prototype.clear = listCacheClear;
  2873. ListCache.prototype['delete'] = listCacheDelete;
  2874. ListCache.prototype.get = listCacheGet;
  2875. ListCache.prototype.has = listCacheHas;
  2876. ListCache.prototype.set = listCacheSet;
  2877. module.exports = ListCache;
  2878. /***/ }),
  2879. /* 77 */
  2880. /***/ (function(module, exports) {
  2881. /**
  2882. * Removes all key-value entries from the list cache.
  2883. *
  2884. * @private
  2885. * @name clear
  2886. * @memberOf ListCache
  2887. */
  2888. function listCacheClear() {
  2889. this.__data__ = [];
  2890. this.size = 0;
  2891. }
  2892. module.exports = listCacheClear;
  2893. /***/ }),
  2894. /* 78 */
  2895. /***/ (function(module, exports, __webpack_require__) {
  2896. var assocIndexOf = __webpack_require__(10);
  2897. /** Used for built-in method references. */
  2898. var arrayProto = Array.prototype;
  2899. /** Built-in value references. */
  2900. var splice = arrayProto.splice;
  2901. /**
  2902. * Removes `key` and its value from the list cache.
  2903. *
  2904. * @private
  2905. * @name delete
  2906. * @memberOf ListCache
  2907. * @param {string} key The key of the value to remove.
  2908. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2909. */
  2910. function listCacheDelete(key) {
  2911. var data = this.__data__,
  2912. index = assocIndexOf(data, key);
  2913. if (index < 0) {
  2914. return false;
  2915. }
  2916. var lastIndex = data.length - 1;
  2917. if (index == lastIndex) {
  2918. data.pop();
  2919. } else {
  2920. splice.call(data, index, 1);
  2921. }
  2922. --this.size;
  2923. return true;
  2924. }
  2925. module.exports = listCacheDelete;
  2926. /***/ }),
  2927. /* 79 */
  2928. /***/ (function(module, exports) {
  2929. /**
  2930. * Performs a
  2931. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  2932. * comparison between two values to determine if they are equivalent.
  2933. *
  2934. * @static
  2935. * @memberOf _
  2936. * @since 4.0.0
  2937. * @category Lang
  2938. * @param {*} value The value to compare.
  2939. * @param {*} other The other value to compare.
  2940. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  2941. * @example
  2942. *
  2943. * var object = { 'a': 1 };
  2944. * var other = { 'a': 1 };
  2945. *
  2946. * _.eq(object, object);
  2947. * // => true
  2948. *
  2949. * _.eq(object, other);
  2950. * // => false
  2951. *
  2952. * _.eq('a', 'a');
  2953. * // => true
  2954. *
  2955. * _.eq('a', Object('a'));
  2956. * // => false
  2957. *
  2958. * _.eq(NaN, NaN);
  2959. * // => true
  2960. */
  2961. function eq(value, other) {
  2962. return value === other || (value !== value && other !== other);
  2963. }
  2964. module.exports = eq;
  2965. /***/ }),
  2966. /* 80 */
  2967. /***/ (function(module, exports, __webpack_require__) {
  2968. var assocIndexOf = __webpack_require__(10);
  2969. /**
  2970. * Gets the list cache value for `key`.
  2971. *
  2972. * @private
  2973. * @name get
  2974. * @memberOf ListCache
  2975. * @param {string} key The key of the value to get.
  2976. * @returns {*} Returns the entry value.
  2977. */
  2978. function listCacheGet(key) {
  2979. var data = this.__data__,
  2980. index = assocIndexOf(data, key);
  2981. return index < 0 ? undefined : data[index][1];
  2982. }
  2983. module.exports = listCacheGet;
  2984. /***/ }),
  2985. /* 81 */
  2986. /***/ (function(module, exports, __webpack_require__) {
  2987. var assocIndexOf = __webpack_require__(10);
  2988. /**
  2989. * Checks if a list cache value for `key` exists.
  2990. *
  2991. * @private
  2992. * @name has
  2993. * @memberOf ListCache
  2994. * @param {string} key The key of the entry to check.
  2995. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2996. */
  2997. function listCacheHas(key) {
  2998. return assocIndexOf(this.__data__, key) > -1;
  2999. }
  3000. module.exports = listCacheHas;
  3001. /***/ }),
  3002. /* 82 */
  3003. /***/ (function(module, exports, __webpack_require__) {
  3004. var assocIndexOf = __webpack_require__(10);
  3005. /**
  3006. * Sets the list cache `key` to `value`.
  3007. *
  3008. * @private
  3009. * @name set
  3010. * @memberOf ListCache
  3011. * @param {string} key The key of the value to set.
  3012. * @param {*} value The value to set.
  3013. * @returns {Object} Returns the list cache instance.
  3014. */
  3015. function listCacheSet(key, value) {
  3016. var data = this.__data__,
  3017. index = assocIndexOf(data, key);
  3018. if (index < 0) {
  3019. ++this.size;
  3020. data.push([key, value]);
  3021. } else {
  3022. data[index][1] = value;
  3023. }
  3024. return this;
  3025. }
  3026. module.exports = listCacheSet;
  3027. /***/ }),
  3028. /* 83 */
  3029. /***/ (function(module, exports, __webpack_require__) {
  3030. var getNative = __webpack_require__(9),
  3031. root = __webpack_require__(5);
  3032. /* Built-in method references that are verified to be native. */
  3033. var Map = getNative(root, 'Map');
  3034. module.exports = Map;
  3035. /***/ }),
  3036. /* 84 */
  3037. /***/ (function(module, exports, __webpack_require__) {
  3038. var getMapData = __webpack_require__(11);
  3039. /**
  3040. * Removes `key` and its value from the map.
  3041. *
  3042. * @private
  3043. * @name delete
  3044. * @memberOf MapCache
  3045. * @param {string} key The key of the value to remove.
  3046. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3047. */
  3048. function mapCacheDelete(key) {
  3049. var result = getMapData(this, key)['delete'](key);
  3050. this.size -= result ? 1 : 0;
  3051. return result;
  3052. }
  3053. module.exports = mapCacheDelete;
  3054. /***/ }),
  3055. /* 85 */
  3056. /***/ (function(module, exports) {
  3057. /**
  3058. * Checks if `value` is suitable for use as unique object key.
  3059. *
  3060. * @private
  3061. * @param {*} value The value to check.
  3062. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  3063. */
  3064. function isKeyable(value) {
  3065. var type = typeof value;
  3066. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  3067. ? (value !== '__proto__')
  3068. : (value === null);
  3069. }
  3070. module.exports = isKeyable;
  3071. /***/ }),
  3072. /* 86 */
  3073. /***/ (function(module, exports, __webpack_require__) {
  3074. var getMapData = __webpack_require__(11);
  3075. /**
  3076. * Gets the map value for `key`.
  3077. *
  3078. * @private
  3079. * @name get
  3080. * @memberOf MapCache
  3081. * @param {string} key The key of the value to get.
  3082. * @returns {*} Returns the entry value.
  3083. */
  3084. function mapCacheGet(key) {
  3085. return getMapData(this, key).get(key);
  3086. }
  3087. module.exports = mapCacheGet;
  3088. /***/ }),
  3089. /* 87 */
  3090. /***/ (function(module, exports, __webpack_require__) {
  3091. var getMapData = __webpack_require__(11);
  3092. /**
  3093. * Checks if a map value for `key` exists.
  3094. *
  3095. * @private
  3096. * @name has
  3097. * @memberOf MapCache
  3098. * @param {string} key The key of the entry to check.
  3099. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3100. */
  3101. function mapCacheHas(key) {
  3102. return getMapData(this, key).has(key);
  3103. }
  3104. module.exports = mapCacheHas;
  3105. /***/ }),
  3106. /* 88 */
  3107. /***/ (function(module, exports, __webpack_require__) {
  3108. var getMapData = __webpack_require__(11);
  3109. /**
  3110. * Sets the map `key` to `value`.
  3111. *
  3112. * @private
  3113. * @name set
  3114. * @memberOf MapCache
  3115. * @param {string} key The key of the value to set.
  3116. * @param {*} value The value to set.
  3117. * @returns {Object} Returns the map cache instance.
  3118. */
  3119. function mapCacheSet(key, value) {
  3120. var data = getMapData(this, key),
  3121. size = data.size;
  3122. data.set(key, value);
  3123. this.size += data.size == size ? 0 : 1;
  3124. return this;
  3125. }
  3126. module.exports = mapCacheSet;
  3127. /***/ }),
  3128. /* 89 */
  3129. /***/ (function(module, exports) {
  3130. /** Used to stand-in for `undefined` hash values. */
  3131. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  3132. /**
  3133. * Adds `value` to the array cache.
  3134. *
  3135. * @private
  3136. * @name add
  3137. * @memberOf SetCache
  3138. * @alias push
  3139. * @param {*} value The value to cache.
  3140. * @returns {Object} Returns the cache instance.
  3141. */
  3142. function setCacheAdd(value) {
  3143. this.__data__.set(value, HASH_UNDEFINED);
  3144. return this;
  3145. }
  3146. module.exports = setCacheAdd;
  3147. /***/ }),
  3148. /* 90 */
  3149. /***/ (function(module, exports) {
  3150. /**
  3151. * Checks if `value` is in the array cache.
  3152. *
  3153. * @private
  3154. * @name has
  3155. * @memberOf SetCache
  3156. * @param {*} value The value to search for.
  3157. * @returns {number} Returns `true` if `value` is found, else `false`.
  3158. */
  3159. function setCacheHas(value) {
  3160. return this.__data__.has(value);
  3161. }
  3162. module.exports = setCacheHas;
  3163. /***/ }),
  3164. /* 91 */
  3165. /***/ (function(module, exports, __webpack_require__) {
  3166. var baseFindIndex = __webpack_require__(92),
  3167. baseIsNaN = __webpack_require__(93),
  3168. strictIndexOf = __webpack_require__(94);
  3169. /**
  3170. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  3171. *
  3172. * @private
  3173. * @param {Array} array The array to inspect.
  3174. * @param {*} value The value to search for.
  3175. * @param {number} fromIndex The index to search from.
  3176. * @returns {number} Returns the index of the matched value, else `-1`.
  3177. */
  3178. function baseIndexOf(array, value, fromIndex) {
  3179. return value === value
  3180. ? strictIndexOf(array, value, fromIndex)
  3181. : baseFindIndex(array, baseIsNaN, fromIndex);
  3182. }
  3183. module.exports = baseIndexOf;
  3184. /***/ }),
  3185. /* 92 */
  3186. /***/ (function(module, exports) {
  3187. /**
  3188. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  3189. * support for iteratee shorthands.
  3190. *
  3191. * @private
  3192. * @param {Array} array The array to inspect.
  3193. * @param {Function} predicate The function invoked per iteration.
  3194. * @param {number} fromIndex The index to search from.
  3195. * @param {boolean} [fromRight] Specify iterating from right to left.
  3196. * @returns {number} Returns the index of the matched value, else `-1`.
  3197. */
  3198. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  3199. var length = array.length,
  3200. index = fromIndex + (fromRight ? 1 : -1);
  3201. while ((fromRight ? index-- : ++index < length)) {
  3202. if (predicate(array[index], index, array)) {
  3203. return index;
  3204. }
  3205. }
  3206. return -1;
  3207. }
  3208. module.exports = baseFindIndex;
  3209. /***/ }),
  3210. /* 93 */
  3211. /***/ (function(module, exports) {
  3212. /**
  3213. * The base implementation of `_.isNaN` without support for number objects.
  3214. *
  3215. * @private
  3216. * @param {*} value The value to check.
  3217. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  3218. */
  3219. function baseIsNaN(value) {
  3220. return value !== value;
  3221. }
  3222. module.exports = baseIsNaN;
  3223. /***/ }),
  3224. /* 94 */
  3225. /***/ (function(module, exports) {
  3226. /**
  3227. * A specialized version of `_.indexOf` which performs strict equality
  3228. * comparisons of values, i.e. `===`.
  3229. *
  3230. * @private
  3231. * @param {Array} array The array to inspect.
  3232. * @param {*} value The value to search for.
  3233. * @param {number} fromIndex The index to search from.
  3234. * @returns {number} Returns the index of the matched value, else `-1`.
  3235. */
  3236. function strictIndexOf(array, value, fromIndex) {
  3237. var index = fromIndex - 1,
  3238. length = array.length;
  3239. while (++index < length) {
  3240. if (array[index] === value) {
  3241. return index;
  3242. }
  3243. }
  3244. return -1;
  3245. }
  3246. module.exports = strictIndexOf;
  3247. /***/ }),
  3248. /* 95 */
  3249. /***/ (function(module, exports, __webpack_require__) {
  3250. var apply = __webpack_require__(96);
  3251. /* Built-in method references for those with the same name as other `lodash` methods. */
  3252. var nativeMax = Math.max;
  3253. /**
  3254. * A specialized version of `baseRest` which transforms the rest array.
  3255. *
  3256. * @private
  3257. * @param {Function} func The function to apply a rest parameter to.
  3258. * @param {number} [start=func.length-1] The start position of the rest parameter.
  3259. * @param {Function} transform The rest array transform.
  3260. * @returns {Function} Returns the new function.
  3261. */
  3262. function overRest(func, start, transform) {
  3263. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  3264. return function() {
  3265. var args = arguments,
  3266. index = -1,
  3267. length = nativeMax(args.length - start, 0),
  3268. array = Array(length);
  3269. while (++index < length) {
  3270. array[index] = args[start + index];
  3271. }
  3272. index = -1;
  3273. var otherArgs = Array(start + 1);
  3274. while (++index < start) {
  3275. otherArgs[index] = args[index];
  3276. }
  3277. otherArgs[start] = transform(array);
  3278. return apply(func, this, otherArgs);
  3279. };
  3280. }
  3281. module.exports = overRest;
  3282. /***/ }),
  3283. /* 96 */
  3284. /***/ (function(module, exports) {
  3285. /**
  3286. * A faster alternative to `Function#apply`, this function invokes `func`
  3287. * with the `this` binding of `thisArg` and the arguments of `args`.
  3288. *
  3289. * @private
  3290. * @param {Function} func The function to invoke.
  3291. * @param {*} thisArg The `this` binding of `func`.
  3292. * @param {Array} args The arguments to invoke `func` with.
  3293. * @returns {*} Returns the result of `func`.
  3294. */
  3295. function apply(func, thisArg, args) {
  3296. switch (args.length) {
  3297. case 0: return func.call(thisArg);
  3298. case 1: return func.call(thisArg, args[0]);
  3299. case 2: return func.call(thisArg, args[0], args[1]);
  3300. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  3301. }
  3302. return func.apply(thisArg, args);
  3303. }
  3304. module.exports = apply;
  3305. /***/ }),
  3306. /* 97 */
  3307. /***/ (function(module, exports, __webpack_require__) {
  3308. var baseSetToString = __webpack_require__(98),
  3309. shortOut = __webpack_require__(101);
  3310. /**
  3311. * Sets the `toString` method of `func` to return `string`.
  3312. *
  3313. * @private
  3314. * @param {Function} func The function to modify.
  3315. * @param {Function} string The `toString` result.
  3316. * @returns {Function} Returns `func`.
  3317. */
  3318. var setToString = shortOut(baseSetToString);
  3319. module.exports = setToString;
  3320. /***/ }),
  3321. /* 98 */
  3322. /***/ (function(module, exports, __webpack_require__) {
  3323. var constant = __webpack_require__(99),
  3324. defineProperty = __webpack_require__(100),
  3325. identity = __webpack_require__(34);
  3326. /**
  3327. * The base implementation of `setToString` without support for hot loop shorting.
  3328. *
  3329. * @private
  3330. * @param {Function} func The function to modify.
  3331. * @param {Function} string The `toString` result.
  3332. * @returns {Function} Returns `func`.
  3333. */
  3334. var baseSetToString = !defineProperty ? identity : function(func, string) {
  3335. return defineProperty(func, 'toString', {
  3336. 'configurable': true,
  3337. 'enumerable': false,
  3338. 'value': constant(string),
  3339. 'writable': true
  3340. });
  3341. };
  3342. module.exports = baseSetToString;
  3343. /***/ }),
  3344. /* 99 */
  3345. /***/ (function(module, exports) {
  3346. /**
  3347. * Creates a function that returns `value`.
  3348. *
  3349. * @static
  3350. * @memberOf _
  3351. * @since 2.4.0
  3352. * @category Util
  3353. * @param {*} value The value to return from the new function.
  3354. * @returns {Function} Returns the new constant function.
  3355. * @example
  3356. *
  3357. * var objects = _.times(2, _.constant({ 'a': 1 }));
  3358. *
  3359. * console.log(objects);
  3360. * // => [{ 'a': 1 }, { 'a': 1 }]
  3361. *
  3362. * console.log(objects[0] === objects[1]);
  3363. * // => true
  3364. */
  3365. function constant(value) {
  3366. return function() {
  3367. return value;
  3368. };
  3369. }
  3370. module.exports = constant;
  3371. /***/ }),
  3372. /* 100 */
  3373. /***/ (function(module, exports, __webpack_require__) {
  3374. var getNative = __webpack_require__(9);
  3375. var defineProperty = (function() {
  3376. try {
  3377. var func = getNative(Object, 'defineProperty');
  3378. func({}, '', {});
  3379. return func;
  3380. } catch (e) {}
  3381. }());
  3382. module.exports = defineProperty;
  3383. /***/ }),
  3384. /* 101 */
  3385. /***/ (function(module, exports) {
  3386. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  3387. var HOT_COUNT = 800,
  3388. HOT_SPAN = 16;
  3389. /* Built-in method references for those with the same name as other `lodash` methods. */
  3390. var nativeNow = Date.now;
  3391. /**
  3392. * Creates a function that'll short out and invoke `identity` instead
  3393. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  3394. * milliseconds.
  3395. *
  3396. * @private
  3397. * @param {Function} func The function to restrict.
  3398. * @returns {Function} Returns the new shortable function.
  3399. */
  3400. function shortOut(func) {
  3401. var count = 0,
  3402. lastCalled = 0;
  3403. return function() {
  3404. var stamp = nativeNow(),
  3405. remaining = HOT_SPAN - (stamp - lastCalled);
  3406. lastCalled = stamp;
  3407. if (remaining > 0) {
  3408. if (++count >= HOT_COUNT) {
  3409. return arguments[0];
  3410. }
  3411. } else {
  3412. count = 0;
  3413. }
  3414. return func.apply(undefined, arguments);
  3415. };
  3416. }
  3417. module.exports = shortOut;
  3418. /***/ }),
  3419. /* 102 */
  3420. /***/ (function(module, exports, __webpack_require__) {
  3421. var isFunction = __webpack_require__(32),
  3422. isLength = __webpack_require__(103);
  3423. /**
  3424. * Checks if `value` is array-like. A value is considered array-like if it's
  3425. * not a function and has a `value.length` that's an integer greater than or
  3426. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  3427. *
  3428. * @static
  3429. * @memberOf _
  3430. * @since 4.0.0
  3431. * @category Lang
  3432. * @param {*} value The value to check.
  3433. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  3434. * @example
  3435. *
  3436. * _.isArrayLike([1, 2, 3]);
  3437. * // => true
  3438. *
  3439. * _.isArrayLike(document.body.children);
  3440. * // => true
  3441. *
  3442. * _.isArrayLike('abc');
  3443. * // => true
  3444. *
  3445. * _.isArrayLike(_.noop);
  3446. * // => false
  3447. */
  3448. function isArrayLike(value) {
  3449. return value != null && isLength(value.length) && !isFunction(value);
  3450. }
  3451. module.exports = isArrayLike;
  3452. /***/ }),
  3453. /* 103 */
  3454. /***/ (function(module, exports) {
  3455. /** Used as references for various `Number` constants. */
  3456. var MAX_SAFE_INTEGER = 9007199254740991;
  3457. /**
  3458. * Checks if `value` is a valid array-like length.
  3459. *
  3460. * **Note:** This method is loosely based on
  3461. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  3462. *
  3463. * @static
  3464. * @memberOf _
  3465. * @since 4.0.0
  3466. * @category Lang
  3467. * @param {*} value The value to check.
  3468. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  3469. * @example
  3470. *
  3471. * _.isLength(3);
  3472. * // => true
  3473. *
  3474. * _.isLength(Number.MIN_VALUE);
  3475. * // => false
  3476. *
  3477. * _.isLength(Infinity);
  3478. * // => false
  3479. *
  3480. * _.isLength('3');
  3481. * // => false
  3482. */
  3483. function isLength(value) {
  3484. return typeof value == 'number' &&
  3485. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  3486. }
  3487. module.exports = isLength;
  3488. /***/ }),
  3489. /* 104 */
  3490. /***/ (function(module, exports, __webpack_require__) {
  3491. "use strict";
  3492. Object.defineProperty(exports, "__esModule", {
  3493. value: true
  3494. });
  3495. exports.default = refCount;
  3496. var _registry = __webpack_require__(12);
  3497. function refCount() {
  3498. var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  3499. var action = arguments[1];
  3500. switch (action.type) {
  3501. case _registry.ADD_SOURCE:
  3502. case _registry.ADD_TARGET:
  3503. return state + 1;
  3504. case _registry.REMOVE_SOURCE:
  3505. case _registry.REMOVE_TARGET:
  3506. return state - 1;
  3507. default:
  3508. return state;
  3509. }
  3510. }
  3511. /***/ }),
  3512. /* 105 */
  3513. /***/ (function(module, exports, __webpack_require__) {
  3514. var arrayFilter = __webpack_require__(106),
  3515. baseRest = __webpack_require__(23),
  3516. baseXor = __webpack_require__(107),
  3517. isArrayLikeObject = __webpack_require__(24);
  3518. /**
  3519. * Creates an array of unique values that is the
  3520. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  3521. * of the given arrays. The order of result values is determined by the order
  3522. * they occur in the arrays.
  3523. *
  3524. * @static
  3525. * @memberOf _
  3526. * @since 2.4.0
  3527. * @category Array
  3528. * @param {...Array} [arrays] The arrays to inspect.
  3529. * @returns {Array} Returns the new array of filtered values.
  3530. * @see _.difference, _.without
  3531. * @example
  3532. *
  3533. * _.xor([2, 1], [2, 3]);
  3534. * // => [1, 3]
  3535. */
  3536. var xor = baseRest(function(arrays) {
  3537. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  3538. });
  3539. module.exports = xor;
  3540. /***/ }),
  3541. /* 106 */
  3542. /***/ (function(module, exports) {
  3543. /**
  3544. * A specialized version of `_.filter` for arrays without support for
  3545. * iteratee shorthands.
  3546. *
  3547. * @private
  3548. * @param {Array} [array] The array to iterate over.
  3549. * @param {Function} predicate The function invoked per iteration.
  3550. * @returns {Array} Returns the new filtered array.
  3551. */
  3552. function arrayFilter(array, predicate) {
  3553. var index = -1,
  3554. length = array == null ? 0 : array.length,
  3555. resIndex = 0,
  3556. result = [];
  3557. while (++index < length) {
  3558. var value = array[index];
  3559. if (predicate(value, index, array)) {
  3560. result[resIndex++] = value;
  3561. }
  3562. }
  3563. return result;
  3564. }
  3565. module.exports = arrayFilter;
  3566. /***/ }),
  3567. /* 107 */
  3568. /***/ (function(module, exports, __webpack_require__) {
  3569. var baseDifference = __webpack_require__(31),
  3570. baseFlatten = __webpack_require__(108),
  3571. baseUniq = __webpack_require__(113);
  3572. /**
  3573. * The base implementation of methods like `_.xor`, without support for
  3574. * iteratee shorthands, that accepts an array of arrays to inspect.
  3575. *
  3576. * @private
  3577. * @param {Array} arrays The arrays to inspect.
  3578. * @param {Function} [iteratee] The iteratee invoked per element.
  3579. * @param {Function} [comparator] The comparator invoked per element.
  3580. * @returns {Array} Returns the new array of values.
  3581. */
  3582. function baseXor(arrays, iteratee, comparator) {
  3583. var length = arrays.length;
  3584. if (length < 2) {
  3585. return length ? baseUniq(arrays[0]) : [];
  3586. }
  3587. var index = -1,
  3588. result = Array(length);
  3589. while (++index < length) {
  3590. var array = arrays[index],
  3591. othIndex = -1;
  3592. while (++othIndex < length) {
  3593. if (othIndex != index) {
  3594. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  3595. }
  3596. }
  3597. }
  3598. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  3599. }
  3600. module.exports = baseXor;
  3601. /***/ }),
  3602. /* 108 */
  3603. /***/ (function(module, exports, __webpack_require__) {
  3604. var arrayPush = __webpack_require__(109),
  3605. isFlattenable = __webpack_require__(110);
  3606. /**
  3607. * The base implementation of `_.flatten` with support for restricting flattening.
  3608. *
  3609. * @private
  3610. * @param {Array} array The array to flatten.
  3611. * @param {number} depth The maximum recursion depth.
  3612. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3613. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3614. * @param {Array} [result=[]] The initial result value.
  3615. * @returns {Array} Returns the new flattened array.
  3616. */
  3617. function baseFlatten(array, depth, predicate, isStrict, result) {
  3618. var index = -1,
  3619. length = array.length;
  3620. predicate || (predicate = isFlattenable);
  3621. result || (result = []);
  3622. while (++index < length) {
  3623. var value = array[index];
  3624. if (depth > 0 && predicate(value)) {
  3625. if (depth > 1) {
  3626. // Recursively flatten arrays (susceptible to call stack limits).
  3627. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3628. } else {
  3629. arrayPush(result, value);
  3630. }
  3631. } else if (!isStrict) {
  3632. result[result.length] = value;
  3633. }
  3634. }
  3635. return result;
  3636. }
  3637. module.exports = baseFlatten;
  3638. /***/ }),
  3639. /* 109 */
  3640. /***/ (function(module, exports) {
  3641. /**
  3642. * Appends the elements of `values` to `array`.
  3643. *
  3644. * @private
  3645. * @param {Array} array The array to modify.
  3646. * @param {Array} values The values to append.
  3647. * @returns {Array} Returns `array`.
  3648. */
  3649. function arrayPush(array, values) {
  3650. var index = -1,
  3651. length = values.length,
  3652. offset = array.length;
  3653. while (++index < length) {
  3654. array[offset + index] = values[index];
  3655. }
  3656. return array;
  3657. }
  3658. module.exports = arrayPush;
  3659. /***/ }),
  3660. /* 110 */
  3661. /***/ (function(module, exports, __webpack_require__) {
  3662. var Symbol = __webpack_require__(15),
  3663. isArguments = __webpack_require__(111),
  3664. isArray = __webpack_require__(3);
  3665. /** Built-in value references. */
  3666. var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
  3667. /**
  3668. * Checks if `value` is a flattenable `arguments` object or array.
  3669. *
  3670. * @private
  3671. * @param {*} value The value to check.
  3672. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  3673. */
  3674. function isFlattenable(value) {
  3675. return isArray(value) || isArguments(value) ||
  3676. !!(spreadableSymbol && value && value[spreadableSymbol]);
  3677. }
  3678. module.exports = isFlattenable;
  3679. /***/ }),
  3680. /* 111 */
  3681. /***/ (function(module, exports, __webpack_require__) {
  3682. var baseIsArguments = __webpack_require__(112),
  3683. isObjectLike = __webpack_require__(6);
  3684. /** Used for built-in method references. */
  3685. var objectProto = Object.prototype;
  3686. /** Used to check objects for own properties. */
  3687. var hasOwnProperty = objectProto.hasOwnProperty;
  3688. /** Built-in value references. */
  3689. var propertyIsEnumerable = objectProto.propertyIsEnumerable;
  3690. /**
  3691. * Checks if `value` is likely an `arguments` object.
  3692. *
  3693. * @static
  3694. * @memberOf _
  3695. * @since 0.1.0
  3696. * @category Lang
  3697. * @param {*} value The value to check.
  3698. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  3699. * else `false`.
  3700. * @example
  3701. *
  3702. * _.isArguments(function() { return arguments; }());
  3703. * // => true
  3704. *
  3705. * _.isArguments([1, 2, 3]);
  3706. * // => false
  3707. */
  3708. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  3709. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  3710. !propertyIsEnumerable.call(value, 'callee');
  3711. };
  3712. module.exports = isArguments;
  3713. /***/ }),
  3714. /* 112 */
  3715. /***/ (function(module, exports, __webpack_require__) {
  3716. var baseGetTag = __webpack_require__(14),
  3717. isObjectLike = __webpack_require__(6);
  3718. /** `Object#toString` result references. */
  3719. var argsTag = '[object Arguments]';
  3720. /**
  3721. * The base implementation of `_.isArguments`.
  3722. *
  3723. * @private
  3724. * @param {*} value The value to check.
  3725. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  3726. */
  3727. function baseIsArguments(value) {
  3728. return isObjectLike(value) && baseGetTag(value) == argsTag;
  3729. }
  3730. module.exports = baseIsArguments;
  3731. /***/ }),
  3732. /* 113 */
  3733. /***/ (function(module, exports, __webpack_require__) {
  3734. var SetCache = __webpack_require__(18),
  3735. arrayIncludes = __webpack_require__(19),
  3736. arrayIncludesWith = __webpack_require__(20),
  3737. cacheHas = __webpack_require__(22),
  3738. createSet = __webpack_require__(114),
  3739. setToArray = __webpack_require__(37);
  3740. /** Used as the size to enable large array optimizations. */
  3741. var LARGE_ARRAY_SIZE = 200;
  3742. /**
  3743. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  3744. *
  3745. * @private
  3746. * @param {Array} array The array to inspect.
  3747. * @param {Function} [iteratee] The iteratee invoked per element.
  3748. * @param {Function} [comparator] The comparator invoked per element.
  3749. * @returns {Array} Returns the new duplicate free array.
  3750. */
  3751. function baseUniq(array, iteratee, comparator) {
  3752. var index = -1,
  3753. includes = arrayIncludes,
  3754. length = array.length,
  3755. isCommon = true,
  3756. result = [],
  3757. seen = result;
  3758. if (comparator) {
  3759. isCommon = false;
  3760. includes = arrayIncludesWith;
  3761. }
  3762. else if (length >= LARGE_ARRAY_SIZE) {
  3763. var set = iteratee ? null : createSet(array);
  3764. if (set) {
  3765. return setToArray(set);
  3766. }
  3767. isCommon = false;
  3768. includes = cacheHas;
  3769. seen = new SetCache;
  3770. }
  3771. else {
  3772. seen = iteratee ? [] : result;
  3773. }
  3774. outer:
  3775. while (++index < length) {
  3776. var value = array[index],
  3777. computed = iteratee ? iteratee(value) : value;
  3778. value = (comparator || value !== 0) ? value : 0;
  3779. if (isCommon && computed === computed) {
  3780. var seenIndex = seen.length;
  3781. while (seenIndex--) {
  3782. if (seen[seenIndex] === computed) {
  3783. continue outer;
  3784. }
  3785. }
  3786. if (iteratee) {
  3787. seen.push(computed);
  3788. }
  3789. result.push(value);
  3790. }
  3791. else if (!includes(seen, computed, comparator)) {
  3792. if (seen !== result) {
  3793. seen.push(computed);
  3794. }
  3795. result.push(value);
  3796. }
  3797. }
  3798. return result;
  3799. }
  3800. module.exports = baseUniq;
  3801. /***/ }),
  3802. /* 114 */
  3803. /***/ (function(module, exports, __webpack_require__) {
  3804. var Set = __webpack_require__(115),
  3805. noop = __webpack_require__(36),
  3806. setToArray = __webpack_require__(37);
  3807. /** Used as references for various `Number` constants. */
  3808. var INFINITY = 1 / 0;
  3809. /**
  3810. * Creates a set object of `values`.
  3811. *
  3812. * @private
  3813. * @param {Array} values The values to add to the set.
  3814. * @returns {Object} Returns the new set.
  3815. */
  3816. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  3817. return new Set(values);
  3818. };
  3819. module.exports = createSet;
  3820. /***/ }),
  3821. /* 115 */
  3822. /***/ (function(module, exports, __webpack_require__) {
  3823. var getNative = __webpack_require__(9),
  3824. root = __webpack_require__(5);
  3825. /* Built-in method references that are verified to be native. */
  3826. var Set = getNative(root, 'Set');
  3827. module.exports = Set;
  3828. /***/ }),
  3829. /* 116 */
  3830. /***/ (function(module, exports, __webpack_require__) {
  3831. var arrayMap = __webpack_require__(21),
  3832. baseIntersection = __webpack_require__(117),
  3833. baseRest = __webpack_require__(23),
  3834. castArrayLikeObject = __webpack_require__(118);
  3835. /**
  3836. * Creates an array of unique values that are included in all given arrays
  3837. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3838. * for equality comparisons. The order and references of result values are
  3839. * determined by the first array.
  3840. *
  3841. * @static
  3842. * @memberOf _
  3843. * @since 0.1.0
  3844. * @category Array
  3845. * @param {...Array} [arrays] The arrays to inspect.
  3846. * @returns {Array} Returns the new array of intersecting values.
  3847. * @example
  3848. *
  3849. * _.intersection([2, 1], [2, 3]);
  3850. * // => [2]
  3851. */
  3852. var intersection = baseRest(function(arrays) {
  3853. var mapped = arrayMap(arrays, castArrayLikeObject);
  3854. return (mapped.length && mapped[0] === arrays[0])
  3855. ? baseIntersection(mapped)
  3856. : [];
  3857. });
  3858. module.exports = intersection;
  3859. /***/ }),
  3860. /* 117 */
  3861. /***/ (function(module, exports, __webpack_require__) {
  3862. var SetCache = __webpack_require__(18),
  3863. arrayIncludes = __webpack_require__(19),
  3864. arrayIncludesWith = __webpack_require__(20),
  3865. arrayMap = __webpack_require__(21),
  3866. baseUnary = __webpack_require__(33),
  3867. cacheHas = __webpack_require__(22);
  3868. /* Built-in method references for those with the same name as other `lodash` methods. */
  3869. var nativeMin = Math.min;
  3870. /**
  3871. * The base implementation of methods like `_.intersection`, without support
  3872. * for iteratee shorthands, that accepts an array of arrays to inspect.
  3873. *
  3874. * @private
  3875. * @param {Array} arrays The arrays to inspect.
  3876. * @param {Function} [iteratee] The iteratee invoked per element.
  3877. * @param {Function} [comparator] The comparator invoked per element.
  3878. * @returns {Array} Returns the new array of shared values.
  3879. */
  3880. function baseIntersection(arrays, iteratee, comparator) {
  3881. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  3882. length = arrays[0].length,
  3883. othLength = arrays.length,
  3884. othIndex = othLength,
  3885. caches = Array(othLength),
  3886. maxLength = Infinity,
  3887. result = [];
  3888. while (othIndex--) {
  3889. var array = arrays[othIndex];
  3890. if (othIndex && iteratee) {
  3891. array = arrayMap(array, baseUnary(iteratee));
  3892. }
  3893. maxLength = nativeMin(array.length, maxLength);
  3894. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  3895. ? new SetCache(othIndex && array)
  3896. : undefined;
  3897. }
  3898. array = arrays[0];
  3899. var index = -1,
  3900. seen = caches[0];
  3901. outer:
  3902. while (++index < length && result.length < maxLength) {
  3903. var value = array[index],
  3904. computed = iteratee ? iteratee(value) : value;
  3905. value = (comparator || value !== 0) ? value : 0;
  3906. if (!(seen
  3907. ? cacheHas(seen, computed)
  3908. : includes(result, computed, comparator)
  3909. )) {
  3910. othIndex = othLength;
  3911. while (--othIndex) {
  3912. var cache = caches[othIndex];
  3913. if (!(cache
  3914. ? cacheHas(cache, computed)
  3915. : includes(arrays[othIndex], computed, comparator))
  3916. ) {
  3917. continue outer;
  3918. }
  3919. }
  3920. if (seen) {
  3921. seen.push(computed);
  3922. }
  3923. result.push(value);
  3924. }
  3925. }
  3926. return result;
  3927. }
  3928. module.exports = baseIntersection;
  3929. /***/ }),
  3930. /* 118 */
  3931. /***/ (function(module, exports, __webpack_require__) {
  3932. var isArrayLikeObject = __webpack_require__(24);
  3933. /**
  3934. * Casts `value` to an empty array if it's not an array like object.
  3935. *
  3936. * @private
  3937. * @param {*} value The value to inspect.
  3938. * @returns {Array|Object} Returns the cast array-like object.
  3939. */
  3940. function castArrayLikeObject(value) {
  3941. return isArrayLikeObject(value) ? value : [];
  3942. }
  3943. module.exports = castArrayLikeObject;
  3944. /***/ }),
  3945. /* 119 */
  3946. /***/ (function(module, exports, __webpack_require__) {
  3947. "use strict";
  3948. Object.defineProperty(exports, "__esModule", {
  3949. value: true
  3950. });
  3951. exports.default = stateId;
  3952. function stateId() {
  3953. var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  3954. return state + 1;
  3955. }
  3956. /***/ }),
  3957. /* 120 */
  3958. /***/ (function(module, exports, __webpack_require__) {
  3959. "use strict";
  3960. Object.defineProperty(exports, "__esModule", {
  3961. value: true
  3962. });
  3963. var _createClass = function () {
  3964. function defineProperties(target, props) {
  3965. for (var i = 0; i < props.length; i++) {
  3966. var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
  3967. }
  3968. }return function (Constructor, protoProps, staticProps) {
  3969. if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
  3970. };
  3971. }();
  3972. var _invariant = __webpack_require__(0);
  3973. var _invariant2 = _interopRequireDefault(_invariant);
  3974. var _isArray = __webpack_require__(3);
  3975. var _isArray2 = _interopRequireDefault(_isArray);
  3976. var _matchesType = __webpack_require__(30);
  3977. var _matchesType2 = _interopRequireDefault(_matchesType);
  3978. var _HandlerRegistry = __webpack_require__(121);
  3979. var _HandlerRegistry2 = _interopRequireDefault(_HandlerRegistry);
  3980. var _dragOffset = __webpack_require__(29);
  3981. var _dirtyHandlerIds = __webpack_require__(35);
  3982. function _interopRequireDefault(obj) {
  3983. return obj && obj.__esModule ? obj : { default: obj };
  3984. }
  3985. function _classCallCheck(instance, Constructor) {
  3986. if (!(instance instanceof Constructor)) {
  3987. throw new TypeError("Cannot call a class as a function");
  3988. }
  3989. }
  3990. var DragDropMonitor = function () {
  3991. function DragDropMonitor(store) {
  3992. _classCallCheck(this, DragDropMonitor);
  3993. this.store = store;
  3994. this.registry = new _HandlerRegistry2.default(store);
  3995. }
  3996. _createClass(DragDropMonitor, [{
  3997. key: 'subscribeToStateChange',
  3998. value: function subscribeToStateChange(listener) {
  3999. var _this = this;
  4000. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  4001. var handlerIds = options.handlerIds;
  4002. (0, _invariant2.default)(typeof listener === 'function', 'listener must be a function.');
  4003. (0, _invariant2.default)(typeof handlerIds === 'undefined' || (0, _isArray2.default)(handlerIds), 'handlerIds, when specified, must be an array of strings.');
  4004. var prevStateId = this.store.getState().stateId;
  4005. var handleChange = function handleChange() {
  4006. var state = _this.store.getState();
  4007. var currentStateId = state.stateId;
  4008. try {
  4009. var canSkipListener = currentStateId === prevStateId || currentStateId === prevStateId + 1 && !(0, _dirtyHandlerIds.areDirty)(state.dirtyHandlerIds, handlerIds);
  4010. if (!canSkipListener) {
  4011. listener();
  4012. }
  4013. } finally {
  4014. prevStateId = currentStateId;
  4015. }
  4016. };
  4017. return this.store.subscribe(handleChange);
  4018. }
  4019. }, {
  4020. key: 'subscribeToOffsetChange',
  4021. value: function subscribeToOffsetChange(listener) {
  4022. var _this2 = this;
  4023. (0, _invariant2.default)(typeof listener === 'function', 'listener must be a function.');
  4024. var previousState = this.store.getState().dragOffset;
  4025. var handleChange = function handleChange() {
  4026. var nextState = _this2.store.getState().dragOffset;
  4027. if (nextState === previousState) {
  4028. return;
  4029. }
  4030. previousState = nextState;
  4031. listener();
  4032. };
  4033. return this.store.subscribe(handleChange);
  4034. }
  4035. }, {
  4036. key: 'canDragSource',
  4037. value: function canDragSource(sourceId) {
  4038. var source = this.registry.getSource(sourceId);
  4039. (0, _invariant2.default)(source, 'Expected to find a valid source.');
  4040. if (this.isDragging()) {
  4041. return false;
  4042. }
  4043. return source.canDrag(this, sourceId);
  4044. }
  4045. }, {
  4046. key: 'canDropOnTarget',
  4047. value: function canDropOnTarget(targetId) {
  4048. var target = this.registry.getTarget(targetId);
  4049. (0, _invariant2.default)(target, 'Expected to find a valid target.');
  4050. if (!this.isDragging() || this.didDrop()) {
  4051. return false;
  4052. }
  4053. var targetType = this.registry.getTargetType(targetId);
  4054. var draggedItemType = this.getItemType();
  4055. return (0, _matchesType2.default)(targetType, draggedItemType) && target.canDrop(this, targetId);
  4056. }
  4057. }, {
  4058. key: 'isDragging',
  4059. value: function isDragging() {
  4060. return Boolean(this.getItemType());
  4061. }
  4062. }, {
  4063. key: 'isDraggingSource',
  4064. value: function isDraggingSource(sourceId) {
  4065. var source = this.registry.getSource(sourceId, true);
  4066. (0, _invariant2.default)(source, 'Expected to find a valid source.');
  4067. if (!this.isDragging() || !this.isSourcePublic()) {
  4068. return false;
  4069. }
  4070. var sourceType = this.registry.getSourceType(sourceId);
  4071. var draggedItemType = this.getItemType();
  4072. if (sourceType !== draggedItemType) {
  4073. return false;
  4074. }
  4075. return source.isDragging(this, sourceId);
  4076. }
  4077. }, {
  4078. key: 'isOverTarget',
  4079. value: function isOverTarget(targetId) {
  4080. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { shallow: false };
  4081. var shallow = options.shallow;
  4082. if (!this.isDragging()) {
  4083. return false;
  4084. }
  4085. var targetType = this.registry.getTargetType(targetId);
  4086. var draggedItemType = this.getItemType();
  4087. if (!(0, _matchesType2.default)(targetType, draggedItemType)) {
  4088. return false;
  4089. }
  4090. var targetIds = this.getTargetIds();
  4091. if (!targetIds.length) {
  4092. return false;
  4093. }
  4094. var index = targetIds.indexOf(targetId);
  4095. if (shallow) {
  4096. return index === targetIds.length - 1;
  4097. } else {
  4098. return index > -1;
  4099. }
  4100. }
  4101. }, {
  4102. key: 'getItemType',
  4103. value: function getItemType() {
  4104. return this.store.getState().dragOperation.itemType;
  4105. }
  4106. }, {
  4107. key: 'getItem',
  4108. value: function getItem() {
  4109. return this.store.getState().dragOperation.item;
  4110. }
  4111. }, {
  4112. key: 'getSourceId',
  4113. value: function getSourceId() {
  4114. return this.store.getState().dragOperation.sourceId;
  4115. }
  4116. }, {
  4117. key: 'getTargetIds',
  4118. value: function getTargetIds() {
  4119. return this.store.getState().dragOperation.targetIds;
  4120. }
  4121. }, {
  4122. key: 'getDropResult',
  4123. value: function getDropResult() {
  4124. return this.store.getState().dragOperation.dropResult;
  4125. }
  4126. }, {
  4127. key: 'didDrop',
  4128. value: function didDrop() {
  4129. return this.store.getState().dragOperation.didDrop;
  4130. }
  4131. }, {
  4132. key: 'isSourcePublic',
  4133. value: function isSourcePublic() {
  4134. return this.store.getState().dragOperation.isSourcePublic;
  4135. }
  4136. }, {
  4137. key: 'getInitialClientOffset',
  4138. value: function getInitialClientOffset() {
  4139. return this.store.getState().dragOffset.initialClientOffset;
  4140. }
  4141. }, {
  4142. key: 'getInitialSourceClientOffset',
  4143. value: function getInitialSourceClientOffset() {
  4144. return this.store.getState().dragOffset.initialSourceClientOffset;
  4145. }
  4146. }, {
  4147. key: 'getClientOffset',
  4148. value: function getClientOffset() {
  4149. return this.store.getState().dragOffset.clientOffset;
  4150. }
  4151. }, {
  4152. key: 'getSourceClientOffset',
  4153. value: function getSourceClientOffset() {
  4154. return (0, _dragOffset.getSourceClientOffset)(this.store.getState().dragOffset);
  4155. }
  4156. }, {
  4157. key: 'getDifferenceFromInitialOffset',
  4158. value: function getDifferenceFromInitialOffset() {
  4159. return (0, _dragOffset.getDifferenceFromInitialOffset)(this.store.getState().dragOffset);
  4160. }
  4161. }]);
  4162. return DragDropMonitor;
  4163. }();
  4164. exports.default = DragDropMonitor;
  4165. /***/ }),
  4166. /* 121 */
  4167. /***/ (function(module, exports, __webpack_require__) {
  4168. "use strict";
  4169. var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  4170. Object.defineProperty(exports, "__esModule", {
  4171. value: true
  4172. });
  4173. var _createClass = function () {
  4174. function defineProperties(target, props) {
  4175. for (var i = 0; i < props.length; i++) {
  4176. var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
  4177. }
  4178. }return function (Constructor, protoProps, staticProps) {
  4179. if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
  4180. };
  4181. }();
  4182. var _typeof = typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol" ? function (obj) {
  4183. return typeof obj === "undefined" ? "undefined" : _typeof2(obj);
  4184. } : function (obj) {
  4185. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof2(obj);
  4186. };
  4187. var _invariant = __webpack_require__(0);
  4188. var _invariant2 = _interopRequireDefault(_invariant);
  4189. var _isArray = __webpack_require__(3);
  4190. var _isArray2 = _interopRequireDefault(_isArray);
  4191. var _asap = __webpack_require__(122);
  4192. var _asap2 = _interopRequireDefault(_asap);
  4193. var _registry = __webpack_require__(12);
  4194. var _getNextUniqueId = __webpack_require__(124);
  4195. var _getNextUniqueId2 = _interopRequireDefault(_getNextUniqueId);
  4196. function _interopRequireDefault(obj) {
  4197. return obj && obj.__esModule ? obj : { default: obj };
  4198. }
  4199. function _classCallCheck(instance, Constructor) {
  4200. if (!(instance instanceof Constructor)) {
  4201. throw new TypeError("Cannot call a class as a function");
  4202. }
  4203. }
  4204. var HandlerRoles = {
  4205. SOURCE: 'SOURCE',
  4206. TARGET: 'TARGET'
  4207. };
  4208. function validateSourceContract(source) {
  4209. (0, _invariant2.default)(typeof source.canDrag === 'function', 'Expected canDrag to be a function.');
  4210. (0, _invariant2.default)(typeof source.beginDrag === 'function', 'Expected beginDrag to be a function.');
  4211. (0, _invariant2.default)(typeof source.endDrag === 'function', 'Expected endDrag to be a function.');
  4212. }
  4213. function validateTargetContract(target) {
  4214. (0, _invariant2.default)(typeof target.canDrop === 'function', 'Expected canDrop to be a function.');
  4215. (0, _invariant2.default)(typeof target.hover === 'function', 'Expected hover to be a function.');
  4216. (0, _invariant2.default)(typeof target.drop === 'function', 'Expected beginDrag to be a function.');
  4217. }
  4218. function validateType(type, allowArray) {
  4219. if (allowArray && (0, _isArray2.default)(type)) {
  4220. type.forEach(function (t) {
  4221. return validateType(t, false);
  4222. });
  4223. return;
  4224. }
  4225. (0, _invariant2.default)(typeof type === 'string' || (typeof type === 'undefined' ? 'undefined' : _typeof(type)) === 'symbol', allowArray ? 'Type can only be a string, a symbol, or an array of either.' : 'Type can only be a string or a symbol.');
  4226. }
  4227. function getNextHandlerId(role) {
  4228. var id = (0, _getNextUniqueId2.default)().toString();
  4229. switch (role) {
  4230. case HandlerRoles.SOURCE:
  4231. return 'S' + id;
  4232. case HandlerRoles.TARGET:
  4233. return 'T' + id;
  4234. default:
  4235. (0, _invariant2.default)(false, 'Unknown role: ' + role);
  4236. }
  4237. }
  4238. function parseRoleFromHandlerId(handlerId) {
  4239. switch (handlerId[0]) {
  4240. case 'S':
  4241. return HandlerRoles.SOURCE;
  4242. case 'T':
  4243. return HandlerRoles.TARGET;
  4244. default:
  4245. (0, _invariant2.default)(false, 'Cannot parse handler ID: ' + handlerId);
  4246. }
  4247. }
  4248. var HandlerRegistry = function () {
  4249. function HandlerRegistry(store) {
  4250. _classCallCheck(this, HandlerRegistry);
  4251. this.store = store;
  4252. this.types = {};
  4253. this.handlers = {};
  4254. this.pinnedSourceId = null;
  4255. this.pinnedSource = null;
  4256. }
  4257. _createClass(HandlerRegistry, [{
  4258. key: 'addSource',
  4259. value: function addSource(type, source) {
  4260. validateType(type);
  4261. validateSourceContract(source);
  4262. var sourceId = this.addHandler(HandlerRoles.SOURCE, type, source);
  4263. this.store.dispatch((0, _registry.addSource)(sourceId));
  4264. return sourceId;
  4265. }
  4266. }, {
  4267. key: 'addTarget',
  4268. value: function addTarget(type, target) {
  4269. validateType(type, true);
  4270. validateTargetContract(target);
  4271. var targetId = this.addHandler(HandlerRoles.TARGET, type, target);
  4272. this.store.dispatch((0, _registry.addTarget)(targetId));
  4273. return targetId;
  4274. }
  4275. }, {
  4276. key: 'addHandler',
  4277. value: function addHandler(role, type, handler) {
  4278. var id = getNextHandlerId(role);
  4279. this.types[id] = type;
  4280. this.handlers[id] = handler;
  4281. return id;
  4282. }
  4283. }, {
  4284. key: 'containsHandler',
  4285. value: function containsHandler(handler) {
  4286. var _this = this;
  4287. return Object.keys(this.handlers).some(function (key) {
  4288. return _this.handlers[key] === handler;
  4289. });
  4290. }
  4291. }, {
  4292. key: 'getSource',
  4293. value: function getSource(sourceId, includePinned) {
  4294. (0, _invariant2.default)(this.isSourceId(sourceId), 'Expected a valid source ID.');
  4295. var isPinned = includePinned && sourceId === this.pinnedSourceId;
  4296. var source = isPinned ? this.pinnedSource : this.handlers[sourceId];
  4297. return source;
  4298. }
  4299. }, {
  4300. key: 'getTarget',
  4301. value: function getTarget(targetId) {
  4302. (0, _invariant2.default)(this.isTargetId(targetId), 'Expected a valid target ID.');
  4303. return this.handlers[targetId];
  4304. }
  4305. }, {
  4306. key: 'getSourceType',
  4307. value: function getSourceType(sourceId) {
  4308. (0, _invariant2.default)(this.isSourceId(sourceId), 'Expected a valid source ID.');
  4309. return this.types[sourceId];
  4310. }
  4311. }, {
  4312. key: 'getTargetType',
  4313. value: function getTargetType(targetId) {
  4314. (0, _invariant2.default)(this.isTargetId(targetId), 'Expected a valid target ID.');
  4315. return this.types[targetId];
  4316. }
  4317. }, {
  4318. key: 'isSourceId',
  4319. value: function isSourceId(handlerId) {
  4320. var role = parseRoleFromHandlerId(handlerId);
  4321. return role === HandlerRoles.SOURCE;
  4322. }
  4323. }, {
  4324. key: 'isTargetId',
  4325. value: function isTargetId(handlerId) {
  4326. var role = parseRoleFromHandlerId(handlerId);
  4327. return role === HandlerRoles.TARGET;
  4328. }
  4329. }, {
  4330. key: 'removeSource',
  4331. value: function removeSource(sourceId) {
  4332. var _this2 = this;
  4333. (0, _invariant2.default)(this.getSource(sourceId), 'Expected an existing source.');
  4334. this.store.dispatch((0, _registry.removeSource)(sourceId));
  4335. (0, _asap2.default)(function () {
  4336. delete _this2.handlers[sourceId];
  4337. delete _this2.types[sourceId];
  4338. });
  4339. }
  4340. }, {
  4341. key: 'removeTarget',
  4342. value: function removeTarget(targetId) {
  4343. var _this3 = this;
  4344. (0, _invariant2.default)(this.getTarget(targetId), 'Expected an existing target.');
  4345. this.store.dispatch((0, _registry.removeTarget)(targetId));
  4346. (0, _asap2.default)(function () {
  4347. delete _this3.handlers[targetId];
  4348. delete _this3.types[targetId];
  4349. });
  4350. }
  4351. }, {
  4352. key: 'pinSource',
  4353. value: function pinSource(sourceId) {
  4354. var source = this.getSource(sourceId);
  4355. (0, _invariant2.default)(source, 'Expected an existing source.');
  4356. this.pinnedSourceId = sourceId;
  4357. this.pinnedSource = source;
  4358. }
  4359. }, {
  4360. key: 'unpinSource',
  4361. value: function unpinSource() {
  4362. (0, _invariant2.default)(this.pinnedSource, 'No source is pinned at the time.');
  4363. this.pinnedSourceId = null;
  4364. this.pinnedSource = null;
  4365. }
  4366. }]);
  4367. return HandlerRegistry;
  4368. }();
  4369. exports.default = HandlerRegistry;
  4370. /***/ }),
  4371. /* 122 */
  4372. /***/ (function(module, exports, __webpack_require__) {
  4373. "use strict";
  4374. // rawAsap provides everything we need except exception management.
  4375. var rawAsap = __webpack_require__(123);
  4376. // RawTasks are recycled to reduce GC churn.
  4377. var freeTasks = [];
  4378. // We queue errors to ensure they are thrown in right order (FIFO).
  4379. // Array-as-queue is good enough here, since we are just dealing with exceptions.
  4380. var pendingErrors = [];
  4381. var requestErrorThrow = rawAsap.makeRequestCallFromTimer(throwFirstError);
  4382. function throwFirstError() {
  4383. if (pendingErrors.length) {
  4384. throw pendingErrors.shift();
  4385. }
  4386. }
  4387. /**
  4388. * Calls a task as soon as possible after returning, in its own event, with priority
  4389. * over other events like animation, reflow, and repaint. An error thrown from an
  4390. * event will not interrupt, nor even substantially slow down the processing of
  4391. * other events, but will be rather postponed to a lower priority event.
  4392. * @param {{call}} task A callable object, typically a function that takes no
  4393. * arguments.
  4394. */
  4395. module.exports = asap;
  4396. function asap(task) {
  4397. var rawTask;
  4398. if (freeTasks.length) {
  4399. rawTask = freeTasks.pop();
  4400. } else {
  4401. rawTask = new RawTask();
  4402. }
  4403. rawTask.task = task;
  4404. rawAsap(rawTask);
  4405. }
  4406. // We wrap tasks with recyclable task objects. A task object implements
  4407. // `call`, just like a function.
  4408. function RawTask() {
  4409. this.task = null;
  4410. }
  4411. // The sole purpose of wrapping the task is to catch the exception and recycle
  4412. // the task object after its single use.
  4413. RawTask.prototype.call = function () {
  4414. try {
  4415. this.task.call();
  4416. } catch (error) {
  4417. if (asap.onerror) {
  4418. // This hook exists purely for testing purposes.
  4419. // Its name will be periodically randomized to break any code that
  4420. // depends on its existence.
  4421. asap.onerror(error);
  4422. } else {
  4423. // In a web browser, exceptions are not fatal. However, to avoid
  4424. // slowing down the queue of pending tasks, we rethrow the error in a
  4425. // lower priority turn.
  4426. pendingErrors.push(error);
  4427. requestErrorThrow();
  4428. }
  4429. } finally {
  4430. this.task = null;
  4431. freeTasks[freeTasks.length] = this;
  4432. }
  4433. };
  4434. /***/ }),
  4435. /* 123 */
  4436. /***/ (function(module, exports, __webpack_require__) {
  4437. "use strict";
  4438. /* WEBPACK VAR INJECTION */(function(global) {
  4439. // Use the fastest means possible to execute a task in its own turn, with
  4440. // priority over other events including IO, animation, reflow, and redraw
  4441. // events in browsers.
  4442. //
  4443. // An exception thrown by a task will permanently interrupt the processing of
  4444. // subsequent tasks. The higher level `asap` function ensures that if an
  4445. // exception is thrown by a task, that the task queue will continue flushing as
  4446. // soon as possible, but if you use `rawAsap` directly, you are responsible to
  4447. // either ensure that no exceptions are thrown from your task, or to manually
  4448. // call `rawAsap.requestFlush` if an exception is thrown.
  4449. module.exports = rawAsap;
  4450. function rawAsap(task) {
  4451. if (!queue.length) {
  4452. requestFlush();
  4453. flushing = true;
  4454. }
  4455. // Equivalent to push, but avoids a function call.
  4456. queue[queue.length] = task;
  4457. }
  4458. var queue = [];
  4459. // Once a flush has been requested, no further calls to `requestFlush` are
  4460. // necessary until the next `flush` completes.
  4461. var flushing = false;
  4462. // `requestFlush` is an implementation-specific method that attempts to kick
  4463. // off a `flush` event as quickly as possible. `flush` will attempt to exhaust
  4464. // the event queue before yielding to the browser's own event loop.
  4465. var requestFlush;
  4466. // The position of the next task to execute in the task queue. This is
  4467. // preserved between calls to `flush` so that it can be resumed if
  4468. // a task throws an exception.
  4469. var index = 0;
  4470. // If a task schedules additional tasks recursively, the task queue can grow
  4471. // unbounded. To prevent memory exhaustion, the task queue will periodically
  4472. // truncate already-completed tasks.
  4473. var capacity = 1024;
  4474. // The flush function processes all tasks that have been scheduled with
  4475. // `rawAsap` unless and until one of those tasks throws an exception.
  4476. // If a task throws an exception, `flush` ensures that its state will remain
  4477. // consistent and will resume where it left off when called again.
  4478. // However, `flush` does not make any arrangements to be called again if an
  4479. // exception is thrown.
  4480. function flush() {
  4481. while (index < queue.length) {
  4482. var currentIndex = index;
  4483. // Advance the index before calling the task. This ensures that we will
  4484. // begin flushing on the next task the task throws an error.
  4485. index = index + 1;
  4486. queue[currentIndex].call();
  4487. // Prevent leaking memory for long chains of recursive calls to `asap`.
  4488. // If we call `asap` within tasks scheduled by `asap`, the queue will
  4489. // grow, but to avoid an O(n) walk for every task we execute, we don't
  4490. // shift tasks off the queue after they have been executed.
  4491. // Instead, we periodically shift 1024 tasks off the queue.
  4492. if (index > capacity) {
  4493. // Manually shift all values starting at the index back to the
  4494. // beginning of the queue.
  4495. for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {
  4496. queue[scan] = queue[scan + index];
  4497. }
  4498. queue.length -= index;
  4499. index = 0;
  4500. }
  4501. }
  4502. queue.length = 0;
  4503. index = 0;
  4504. flushing = false;
  4505. }
  4506. // `requestFlush` is implemented using a strategy based on data collected from
  4507. // every available SauceLabs Selenium web driver worker at time of writing.
  4508. // https://docs.google.com/spreadsheets/d/1mG-5UYGup5qxGdEMWkhP6BWCz053NUb2E1QoUTU16uA/edit#gid=783724593
  4509. // Safari 6 and 6.1 for desktop, iPad, and iPhone are the only browsers that
  4510. // have WebKitMutationObserver but not un-prefixed MutationObserver.
  4511. // Must use `global` or `self` instead of `window` to work in both frames and web
  4512. // workers. `global` is a provision of Browserify, Mr, Mrs, or Mop.
  4513. /* globals self */
  4514. var scope = typeof global !== "undefined" ? global : self;
  4515. var BrowserMutationObserver = scope.MutationObserver || scope.WebKitMutationObserver;
  4516. // MutationObservers are desirable because they have high priority and work
  4517. // reliably everywhere they are implemented.
  4518. // They are implemented in all modern browsers.
  4519. //
  4520. // - Android 4-4.3
  4521. // - Chrome 26-34
  4522. // - Firefox 14-29
  4523. // - Internet Explorer 11
  4524. // - iPad Safari 6-7.1
  4525. // - iPhone Safari 7-7.1
  4526. // - Safari 6-7
  4527. if (typeof BrowserMutationObserver === "function") {
  4528. requestFlush = makeRequestCallFromMutationObserver(flush);
  4529. // MessageChannels are desirable because they give direct access to the HTML
  4530. // task queue, are implemented in Internet Explorer 10, Safari 5.0-1, and Opera
  4531. // 11-12, and in web workers in many engines.
  4532. // Although message channels yield to any queued rendering and IO tasks, they
  4533. // would be better than imposing the 4ms delay of timers.
  4534. // However, they do not work reliably in Internet Explorer or Safari.
  4535. // Internet Explorer 10 is the only browser that has setImmediate but does
  4536. // not have MutationObservers.
  4537. // Although setImmediate yields to the browser's renderer, it would be
  4538. // preferrable to falling back to setTimeout since it does not have
  4539. // the minimum 4ms penalty.
  4540. // Unfortunately there appears to be a bug in Internet Explorer 10 Mobile (and
  4541. // Desktop to a lesser extent) that renders both setImmediate and
  4542. // MessageChannel useless for the purposes of ASAP.
  4543. // https://github.com/kriskowal/q/issues/396
  4544. // Timers are implemented universally.
  4545. // We fall back to timers in workers in most engines, and in foreground
  4546. // contexts in the following browsers.
  4547. // However, note that even this simple case requires nuances to operate in a
  4548. // broad spectrum of browsers.
  4549. //
  4550. // - Firefox 3-13
  4551. // - Internet Explorer 6-9
  4552. // - iPad Safari 4.3
  4553. // - Lynx 2.8.7
  4554. } else {
  4555. requestFlush = makeRequestCallFromTimer(flush);
  4556. }
  4557. // `requestFlush` requests that the high priority event queue be flushed as
  4558. // soon as possible.
  4559. // This is useful to prevent an error thrown in a task from stalling the event
  4560. // queue if the exception handled by Node.js’s
  4561. // `process.on("uncaughtException")` or by a domain.
  4562. rawAsap.requestFlush = requestFlush;
  4563. // To request a high priority event, we induce a mutation observer by toggling
  4564. // the text of a text node between "1" and "-1".
  4565. function makeRequestCallFromMutationObserver(callback) {
  4566. var toggle = 1;
  4567. var observer = new BrowserMutationObserver(callback);
  4568. var node = document.createTextNode("");
  4569. observer.observe(node, {characterData: true});
  4570. return function requestCall() {
  4571. toggle = -toggle;
  4572. node.data = toggle;
  4573. };
  4574. }
  4575. // The message channel technique was discovered by Malte Ubl and was the
  4576. // original foundation for this library.
  4577. // http://www.nonblocking.io/2011/06/windownexttick.html
  4578. // Safari 6.0.5 (at least) intermittently fails to create message ports on a
  4579. // page's first load. Thankfully, this version of Safari supports
  4580. // MutationObservers, so we don't need to fall back in that case.
  4581. // function makeRequestCallFromMessageChannel(callback) {
  4582. // var channel = new MessageChannel();
  4583. // channel.port1.onmessage = callback;
  4584. // return function requestCall() {
  4585. // channel.port2.postMessage(0);
  4586. // };
  4587. // }
  4588. // For reasons explained above, we are also unable to use `setImmediate`
  4589. // under any circumstances.
  4590. // Even if we were, there is another bug in Internet Explorer 10.
  4591. // It is not sufficient to assign `setImmediate` to `requestFlush` because
  4592. // `setImmediate` must be called *by name* and therefore must be wrapped in a
  4593. // closure.
  4594. // Never forget.
  4595. // function makeRequestCallFromSetImmediate(callback) {
  4596. // return function requestCall() {
  4597. // setImmediate(callback);
  4598. // };
  4599. // }
  4600. // Safari 6.0 has a problem where timers will get lost while the user is
  4601. // scrolling. This problem does not impact ASAP because Safari 6.0 supports
  4602. // mutation observers, so that implementation is used instead.
  4603. // However, if we ever elect to use timers in Safari, the prevalent work-around
  4604. // is to add a scroll event listener that calls for a flush.
  4605. // `setTimeout` does not call the passed callback if the delay is less than
  4606. // approximately 7 in web workers in Firefox 8 through 18, and sometimes not
  4607. // even then.
  4608. function makeRequestCallFromTimer(callback) {
  4609. return function requestCall() {
  4610. // We dispatch a timeout with a specified delay of 0 for engines that
  4611. // can reliably accommodate that request. This will usually be snapped
  4612. // to a 4 milisecond delay, but once we're flushing, there's no delay
  4613. // between events.
  4614. var timeoutHandle = setTimeout(handleTimer, 0);
  4615. // However, since this timer gets frequently dropped in Firefox
  4616. // workers, we enlist an interval handle that will try to fire
  4617. // an event 20 times per second until it succeeds.
  4618. var intervalHandle = setInterval(handleTimer, 50);
  4619. function handleTimer() {
  4620. // Whichever timer succeeds will cancel both timers and
  4621. // execute the callback.
  4622. clearTimeout(timeoutHandle);
  4623. clearInterval(intervalHandle);
  4624. callback();
  4625. }
  4626. };
  4627. }
  4628. // This is for `asap.js` only.
  4629. // Its name will be periodically randomized to break any code that depends on
  4630. // its existence.
  4631. rawAsap.makeRequestCallFromTimer = makeRequestCallFromTimer;
  4632. // ASAP was originally a nextTick shim included in Q. This was factored out
  4633. // into this ASAP package. It was later adapted to RSVP which made further
  4634. // amendments. These decisions, particularly to marginalize MessageChannel and
  4635. // to capture the MutationObserver implementation in a closure, were integrated
  4636. // back into ASAP proper.
  4637. // https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js
  4638. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)))
  4639. /***/ }),
  4640. /* 124 */
  4641. /***/ (function(module, exports, __webpack_require__) {
  4642. "use strict";
  4643. Object.defineProperty(exports, "__esModule", {
  4644. value: true
  4645. });
  4646. exports.default = getNextUniqueId;
  4647. var nextUniqueId = 0;
  4648. function getNextUniqueId() {
  4649. return nextUniqueId++;
  4650. }
  4651. /***/ }),
  4652. /* 125 */
  4653. /***/ (function(module, exports, __webpack_require__) {
  4654. "use strict";
  4655. Object.defineProperty(exports, "__esModule", {
  4656. value: true
  4657. });
  4658. var _createClass = function () {
  4659. function defineProperties(target, props) {
  4660. for (var i = 0; i < props.length; i++) {
  4661. var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
  4662. }
  4663. }return function (Constructor, protoProps, staticProps) {
  4664. if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
  4665. };
  4666. }();
  4667. function _classCallCheck(instance, Constructor) {
  4668. if (!(instance instanceof Constructor)) {
  4669. throw new TypeError("Cannot call a class as a function");
  4670. }
  4671. }
  4672. var DragSource = function () {
  4673. function DragSource() {
  4674. _classCallCheck(this, DragSource);
  4675. }
  4676. _createClass(DragSource, [{
  4677. key: "canDrag",
  4678. value: function canDrag() {
  4679. return true;
  4680. }
  4681. }, {
  4682. key: "isDragging",
  4683. value: function isDragging(monitor, handle) {
  4684. return handle === monitor.getSourceId();
  4685. }
  4686. }, {
  4687. key: "endDrag",
  4688. value: function endDrag() {}
  4689. }]);
  4690. return DragSource;
  4691. }();
  4692. exports.default = DragSource;
  4693. /***/ }),
  4694. /* 126 */
  4695. /***/ (function(module, exports, __webpack_require__) {
  4696. "use strict";
  4697. Object.defineProperty(exports, "__esModule", {
  4698. value: true
  4699. });
  4700. var _createClass = function () {
  4701. function defineProperties(target, props) {
  4702. for (var i = 0; i < props.length; i++) {
  4703. var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
  4704. }
  4705. }return function (Constructor, protoProps, staticProps) {
  4706. if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
  4707. };
  4708. }();
  4709. function _classCallCheck(instance, Constructor) {
  4710. if (!(instance instanceof Constructor)) {
  4711. throw new TypeError("Cannot call a class as a function");
  4712. }
  4713. }
  4714. var DropTarget = function () {
  4715. function DropTarget() {
  4716. _classCallCheck(this, DropTarget);
  4717. }
  4718. _createClass(DropTarget, [{
  4719. key: "canDrop",
  4720. value: function canDrop() {
  4721. return true;
  4722. }
  4723. }, {
  4724. key: "hover",
  4725. value: function hover() {}
  4726. }, {
  4727. key: "drop",
  4728. value: function drop() {}
  4729. }]);
  4730. return DropTarget;
  4731. }();
  4732. exports.default = DropTarget;
  4733. /***/ }),
  4734. /* 127 */
  4735. /***/ (function(module, exports, __webpack_require__) {
  4736. "use strict";
  4737. Object.defineProperty(exports, "__esModule", {
  4738. value: true
  4739. });
  4740. var _createClass = function () {
  4741. function defineProperties(target, props) {
  4742. for (var i = 0; i < props.length; i++) {
  4743. var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
  4744. }
  4745. }return function (Constructor, protoProps, staticProps) {
  4746. if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
  4747. };
  4748. }();
  4749. exports.default = createBackend;
  4750. var _noop = __webpack_require__(36);
  4751. var _noop2 = _interopRequireDefault(_noop);
  4752. function _interopRequireDefault(obj) {
  4753. return obj && obj.__esModule ? obj : { default: obj };
  4754. }
  4755. function _classCallCheck(instance, Constructor) {
  4756. if (!(instance instanceof Constructor)) {
  4757. throw new TypeError("Cannot call a class as a function");
  4758. }
  4759. }
  4760. var TestBackend = function () {
  4761. function TestBackend(manager) {
  4762. _classCallCheck(this, TestBackend);
  4763. this.actions = manager.getActions();
  4764. }
  4765. _createClass(TestBackend, [{
  4766. key: 'setup',
  4767. value: function setup() {
  4768. this.didCallSetup = true;
  4769. }
  4770. }, {
  4771. key: 'teardown',
  4772. value: function teardown() {
  4773. this.didCallTeardown = true;
  4774. }
  4775. }, {
  4776. key: 'connectDragSource',
  4777. value: function connectDragSource() {
  4778. return _noop2.default;
  4779. }
  4780. }, {
  4781. key: 'connectDragPreview',
  4782. value: function connectDragPreview() {
  4783. return _noop2.default;
  4784. }
  4785. }, {
  4786. key: 'connectDropTarget',
  4787. value: function connectDropTarget() {
  4788. return _noop2.default;
  4789. }
  4790. }, {
  4791. key: 'simulateBeginDrag',
  4792. value: function simulateBeginDrag(sourceIds, options) {
  4793. this.actions.beginDrag(sourceIds, options);
  4794. }
  4795. }, {
  4796. key: 'simulatePublishDragSource',
  4797. value: function simulatePublishDragSource() {
  4798. this.actions.publishDragSource();
  4799. }
  4800. }, {
  4801. key: 'simulateHover',
  4802. value: function simulateHover(targetIds, options) {
  4803. this.actions.hover(targetIds, options);
  4804. }
  4805. }, {
  4806. key: 'simulateDrop',
  4807. value: function simulateDrop() {
  4808. this.actions.drop();
  4809. }
  4810. }, {
  4811. key: 'simulateEndDrag',
  4812. value: function simulateEndDrag() {
  4813. this.actions.endDrag();
  4814. }
  4815. }]);
  4816. return TestBackend;
  4817. }();
  4818. function createBackend(manager) {
  4819. return new TestBackend(manager);
  4820. }
  4821. /***/ }),
  4822. /* 128 */
  4823. /***/ (function(module, exports, __webpack_require__) {
  4824. "use strict";
  4825. Object.defineProperty(exports, "__esModule", {
  4826. value: true
  4827. });
  4828. exports.default = undefined;
  4829. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4830. var _class, _temp;
  4831. var _react = __webpack_require__(2);
  4832. var _propTypes = __webpack_require__(4);
  4833. var _propTypes2 = _interopRequireDefault(_propTypes);
  4834. var _DragDropContext = __webpack_require__(28);
  4835. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4836. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4837. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  4838. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  4839. /**
  4840. * This class is a React-Component based version of the DragDropContext.
  4841. * This is an alternative to decorating an application component with an ES7 decorator.
  4842. */
  4843. var DragDropContextProvider = (_temp = _class = function (_Component) {
  4844. _inherits(DragDropContextProvider, _Component);
  4845. function DragDropContextProvider(props, context) {
  4846. _classCallCheck(this, DragDropContextProvider);
  4847. /**
  4848. * This property determines which window global to use for creating the DragDropManager.
  4849. * If a window has been injected explicitly via props, that is used first. If it is available
  4850. * as a context value, then use that, otherwise use the browser global.
  4851. */
  4852. var _this = _possibleConstructorReturn(this, (DragDropContextProvider.__proto__ || Object.getPrototypeOf(DragDropContextProvider)).call(this, props, context));
  4853. var getWindow = function getWindow() {
  4854. if (props && props.window) {
  4855. return props.window;
  4856. } else if (context && context.window) {
  4857. return context.window;
  4858. } else if (typeof window !== 'undefined') {
  4859. return window;
  4860. }
  4861. return undefined;
  4862. };
  4863. _this.backend = (0, _DragDropContext.unpackBackendForEs5Users)(props.backend);
  4864. _this.childContext = (0, _DragDropContext.createChildContext)(_this.backend, {
  4865. window: getWindow()
  4866. });
  4867. return _this;
  4868. }
  4869. _createClass(DragDropContextProvider, [{
  4870. key: 'componentWillReceiveProps',
  4871. value: function componentWillReceiveProps(nextProps) {
  4872. if (nextProps.backend !== this.props.backend || nextProps.window !== this.props.window) {
  4873. throw new Error('DragDropContextProvider backend and window props must not change.');
  4874. }
  4875. }
  4876. }, {
  4877. key: 'getChildContext',
  4878. value: function getChildContext() {
  4879. return this.childContext;
  4880. }
  4881. }, {
  4882. key: 'render',
  4883. value: function render() {
  4884. return _react.Children.only(this.props.children);
  4885. }
  4886. }]);
  4887. return DragDropContextProvider;
  4888. }(_react.Component), _class.propTypes = {
  4889. backend: _propTypes2.default.oneOfType([_propTypes2.default.func, _propTypes2.default.object]).isRequired,
  4890. children: _propTypes2.default.element.isRequired,
  4891. window: _propTypes2.default.object // eslint-disable-line react/forbid-prop-types
  4892. }, _class.defaultProps = {
  4893. window: undefined
  4894. }, _class.childContextTypes = _DragDropContext.CHILD_CONTEXT_TYPES, _class.displayName = 'DragDropContextProvider', _class.contextTypes = {
  4895. window: _propTypes2.default.object
  4896. }, _temp);
  4897. exports.default = DragDropContextProvider;
  4898. /***/ }),
  4899. /* 129 */
  4900. /***/ (function(module, exports, __webpack_require__) {
  4901. "use strict";
  4902. Object.defineProperty(exports, "__esModule", {
  4903. value: true
  4904. });
  4905. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  4906. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  4907. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4908. exports.default = DragLayer;
  4909. var _react = __webpack_require__(2);
  4910. var _react2 = _interopRequireDefault(_react);
  4911. var _propTypes = __webpack_require__(4);
  4912. var _propTypes2 = _interopRequireDefault(_propTypes);
  4913. var _hoistNonReactStatics = __webpack_require__(25);
  4914. var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics);
  4915. var _isPlainObject = __webpack_require__(1);
  4916. var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
  4917. var _invariant = __webpack_require__(0);
  4918. var _invariant2 = _interopRequireDefault(_invariant);
  4919. var _shallowEqual = __webpack_require__(26);
  4920. var _shallowEqual2 = _interopRequireDefault(_shallowEqual);
  4921. var _shallowEqualScalar = __webpack_require__(38);
  4922. var _shallowEqualScalar2 = _interopRequireDefault(_shallowEqualScalar);
  4923. var _checkDecoratorArguments = __webpack_require__(13);
  4924. var _checkDecoratorArguments2 = _interopRequireDefault(_checkDecoratorArguments);
  4925. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4926. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4927. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  4928. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  4929. function DragLayer(collect) {
  4930. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  4931. _checkDecoratorArguments2.default.apply(undefined, ['DragLayer', 'collect[, options]'].concat(Array.prototype.slice.call(arguments))); // eslint-disable-line prefer-rest-params
  4932. (0, _invariant2.default)(typeof collect === 'function', 'Expected "collect" provided as the first argument to DragLayer to be a function that collects props to inject into the component. ', 'Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-layer.html', collect);
  4933. (0, _invariant2.default)((0, _isPlainObject2.default)(options), 'Expected "options" provided as the second argument to DragLayer to be a plain object when specified. ' + 'Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-layer.html', options);
  4934. return function decorateLayer(DecoratedComponent) {
  4935. var _class, _temp;
  4936. var _options$arePropsEqua = options.arePropsEqual,
  4937. arePropsEqual = _options$arePropsEqua === undefined ? _shallowEqualScalar2.default : _options$arePropsEqua;
  4938. var displayName = DecoratedComponent.displayName || DecoratedComponent.name || 'Component';
  4939. var DragLayerContainer = (_temp = _class = function (_Component) {
  4940. _inherits(DragLayerContainer, _Component);
  4941. _createClass(DragLayerContainer, [{
  4942. key: 'getDecoratedComponentInstance',
  4943. value: function getDecoratedComponentInstance() {
  4944. (0, _invariant2.default)(this.child, 'In order to access an instance of the decorated component it can not be a stateless component.');
  4945. return this.child;
  4946. }
  4947. }, {
  4948. key: 'shouldComponentUpdate',
  4949. value: function shouldComponentUpdate(nextProps, nextState) {
  4950. return !arePropsEqual(nextProps, this.props) || !(0, _shallowEqual2.default)(nextState, this.state);
  4951. }
  4952. }]);
  4953. function DragLayerContainer(props, context) {
  4954. _classCallCheck(this, DragLayerContainer);
  4955. var _this = _possibleConstructorReturn(this, (DragLayerContainer.__proto__ || Object.getPrototypeOf(DragLayerContainer)).call(this, props));
  4956. _this.handleChange = _this.handleChange.bind(_this);
  4957. _this.manager = context.dragDropManager;
  4958. (0, _invariant2.default)(_typeof(_this.manager) === 'object', 'Could not find the drag and drop manager in the context of %s. ' + 'Make sure to wrap the top-level component of your app with DragDropContext. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-troubleshooting.html#could-not-find-the-drag-and-drop-manager-in-the-context', displayName, displayName);
  4959. _this.state = _this.getCurrentState();
  4960. return _this;
  4961. }
  4962. _createClass(DragLayerContainer, [{
  4963. key: 'componentDidMount',
  4964. value: function componentDidMount() {
  4965. this.isCurrentlyMounted = true;
  4966. var monitor = this.manager.getMonitor();
  4967. this.unsubscribeFromOffsetChange = monitor.subscribeToOffsetChange(this.handleChange);
  4968. this.unsubscribeFromStateChange = monitor.subscribeToStateChange(this.handleChange);
  4969. this.handleChange();
  4970. }
  4971. }, {
  4972. key: 'componentWillUnmount',
  4973. value: function componentWillUnmount() {
  4974. this.isCurrentlyMounted = false;
  4975. this.unsubscribeFromOffsetChange();
  4976. this.unsubscribeFromStateChange();
  4977. }
  4978. }, {
  4979. key: 'handleChange',
  4980. value: function handleChange() {
  4981. if (!this.isCurrentlyMounted) {
  4982. return;
  4983. }
  4984. var nextState = this.getCurrentState();
  4985. if (!(0, _shallowEqual2.default)(nextState, this.state)) {
  4986. this.setState(nextState);
  4987. }
  4988. }
  4989. }, {
  4990. key: 'getCurrentState',
  4991. value: function getCurrentState() {
  4992. var monitor = this.manager.getMonitor();
  4993. return collect(monitor, this.props);
  4994. }
  4995. }, {
  4996. key: 'render',
  4997. value: function render() {
  4998. var _this2 = this;
  4999. return _react2.default.createElement(DecoratedComponent, _extends({}, this.props, this.state, {
  5000. ref: function ref(child) {
  5001. _this2.child = child;
  5002. }
  5003. }));
  5004. }
  5005. }]);
  5006. return DragLayerContainer;
  5007. }(_react.Component), _class.DecoratedComponent = DecoratedComponent, _class.displayName = 'DragLayer(' + displayName + ')', _class.contextTypes = {
  5008. dragDropManager: _propTypes2.default.object.isRequired
  5009. }, _temp);
  5010. return (0, _hoistNonReactStatics2.default)(DragLayerContainer, DecoratedComponent);
  5011. };
  5012. }
  5013. /***/ }),
  5014. /* 130 */
  5015. /***/ (function(module, exports, __webpack_require__) {
  5016. "use strict";
  5017. Object.defineProperty(exports, "__esModule", {
  5018. value: true
  5019. });
  5020. exports.default = DragSource;
  5021. var _invariant = __webpack_require__(0);
  5022. var _invariant2 = _interopRequireDefault(_invariant);
  5023. var _isPlainObject = __webpack_require__(1);
  5024. var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
  5025. var _checkDecoratorArguments = __webpack_require__(13);
  5026. var _checkDecoratorArguments2 = _interopRequireDefault(_checkDecoratorArguments);
  5027. var _decorateHandler = __webpack_require__(39);
  5028. var _decorateHandler2 = _interopRequireDefault(_decorateHandler);
  5029. var _registerSource = __webpack_require__(135);
  5030. var _registerSource2 = _interopRequireDefault(_registerSource);
  5031. var _createSourceFactory = __webpack_require__(136);
  5032. var _createSourceFactory2 = _interopRequireDefault(_createSourceFactory);
  5033. var _createSourceMonitor = __webpack_require__(137);
  5034. var _createSourceMonitor2 = _interopRequireDefault(_createSourceMonitor);
  5035. var _createSourceConnector = __webpack_require__(138);
  5036. var _createSourceConnector2 = _interopRequireDefault(_createSourceConnector);
  5037. var _isValidType = __webpack_require__(42);
  5038. var _isValidType2 = _interopRequireDefault(_isValidType);
  5039. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  5040. function DragSource(type, spec, collect) {
  5041. var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  5042. _checkDecoratorArguments2.default.apply(undefined, ['DragSource', 'type, spec, collect[, options]'].concat(Array.prototype.slice.call(arguments)));
  5043. var getType = type;
  5044. if (typeof type !== 'function') {
  5045. (0, _invariant2.default)((0, _isValidType2.default)(type), 'Expected "type" provided as the first argument to DragSource to be ' + 'a string, or a function that returns a string given the current props. ' + 'Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html', type);
  5046. getType = function getType() {
  5047. return type;
  5048. };
  5049. }
  5050. (0, _invariant2.default)((0, _isPlainObject2.default)(spec), 'Expected "spec" provided as the second argument to DragSource to be ' + 'a plain object. Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html', spec);
  5051. var createSource = (0, _createSourceFactory2.default)(spec);
  5052. (0, _invariant2.default)(typeof collect === 'function', 'Expected "collect" provided as the third argument to DragSource to be ' + 'a function that returns a plain object of props to inject. ' + 'Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html', collect);
  5053. (0, _invariant2.default)((0, _isPlainObject2.default)(options), 'Expected "options" provided as the fourth argument to DragSource to be ' + 'a plain object when specified. ' + 'Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html', collect);
  5054. return function decorateSource(DecoratedComponent) {
  5055. return (0, _decorateHandler2.default)({
  5056. connectBackend: function connectBackend(backend, sourceId) {
  5057. return backend.connectDragSource(sourceId);
  5058. },
  5059. containerDisplayName: 'DragSource',
  5060. createHandler: createSource,
  5061. registerHandler: _registerSource2.default,
  5062. createMonitor: _createSourceMonitor2.default,
  5063. createConnector: _createSourceConnector2.default,
  5064. DecoratedComponent: DecoratedComponent,
  5065. getType: getType,
  5066. collect: collect,
  5067. options: options
  5068. });
  5069. };
  5070. }
  5071. /***/ }),
  5072. /* 131 */
  5073. /***/ (function(module, exports, __webpack_require__) {
  5074. "use strict";
  5075. exports.__esModule = true;
  5076. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  5077. var _isDisposable2 = __webpack_require__(27);
  5078. var _isDisposable3 = _interopRequireDefault(_isDisposable2);
  5079. exports.isDisposable = _isDisposable3['default'];
  5080. var _Disposable2 = __webpack_require__(132);
  5081. var _Disposable3 = _interopRequireDefault(_Disposable2);
  5082. exports.Disposable = _Disposable3['default'];
  5083. var _CompositeDisposable2 = __webpack_require__(133);
  5084. var _CompositeDisposable3 = _interopRequireDefault(_CompositeDisposable2);
  5085. exports.CompositeDisposable = _CompositeDisposable3['default'];
  5086. var _SerialDisposable2 = __webpack_require__(134);
  5087. var _SerialDisposable3 = _interopRequireDefault(_SerialDisposable2);
  5088. exports.SerialDisposable = _SerialDisposable3['default'];
  5089. /***/ }),
  5090. /* 132 */
  5091. /***/ (function(module, exports, __webpack_require__) {
  5092. "use strict";
  5093. exports.__esModule = true;
  5094. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  5095. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5096. var noop = function noop() {};
  5097. /**
  5098. * The basic disposable.
  5099. */
  5100. var Disposable = (function () {
  5101. _createClass(Disposable, null, [{
  5102. key: "empty",
  5103. value: { dispose: noop },
  5104. enumerable: true
  5105. }]);
  5106. function Disposable(action) {
  5107. _classCallCheck(this, Disposable);
  5108. this.isDisposed = false;
  5109. this.action = action || noop;
  5110. }
  5111. Disposable.prototype.dispose = function dispose() {
  5112. if (!this.isDisposed) {
  5113. this.action.call(null);
  5114. this.isDisposed = true;
  5115. }
  5116. };
  5117. return Disposable;
  5118. })();
  5119. exports["default"] = Disposable;
  5120. module.exports = exports["default"];
  5121. /***/ }),
  5122. /* 133 */
  5123. /***/ (function(module, exports, __webpack_require__) {
  5124. "use strict";
  5125. exports.__esModule = true;
  5126. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  5127. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
  5128. var _isDisposable = __webpack_require__(27);
  5129. var _isDisposable2 = _interopRequireDefault(_isDisposable);
  5130. /**
  5131. * Represents a group of disposable resources that are disposed together.
  5132. */
  5133. var CompositeDisposable = (function () {
  5134. function CompositeDisposable() {
  5135. for (var _len = arguments.length, disposables = Array(_len), _key = 0; _key < _len; _key++) {
  5136. disposables[_key] = arguments[_key];
  5137. }
  5138. _classCallCheck(this, CompositeDisposable);
  5139. if (Array.isArray(disposables[0]) && disposables.length === 1) {
  5140. disposables = disposables[0];
  5141. }
  5142. for (var i = 0; i < disposables.length; i++) {
  5143. if (!_isDisposable2['default'](disposables[i])) {
  5144. throw new Error('Expected a disposable');
  5145. }
  5146. }
  5147. this.disposables = disposables;
  5148. this.isDisposed = false;
  5149. }
  5150. /**
  5151. * Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed.
  5152. * @param {Disposable} item Disposable to add.
  5153. */
  5154. CompositeDisposable.prototype.add = function add(item) {
  5155. if (this.isDisposed) {
  5156. item.dispose();
  5157. } else {
  5158. this.disposables.push(item);
  5159. }
  5160. };
  5161. /**
  5162. * Removes and disposes the first occurrence of a disposable from the CompositeDisposable.
  5163. * @param {Disposable} item Disposable to remove.
  5164. * @returns {Boolean} true if found; false otherwise.
  5165. */
  5166. CompositeDisposable.prototype.remove = function remove(item) {
  5167. if (this.isDisposed) {
  5168. return false;
  5169. }
  5170. var index = this.disposables.indexOf(item);
  5171. if (index === -1) {
  5172. return false;
  5173. }
  5174. this.disposables.splice(index, 1);
  5175. item.dispose();
  5176. return true;
  5177. };
  5178. /**
  5179. * Disposes all disposables in the group and removes them from the group.
  5180. */
  5181. CompositeDisposable.prototype.dispose = function dispose() {
  5182. if (this.isDisposed) {
  5183. return;
  5184. }
  5185. var len = this.disposables.length;
  5186. var currentDisposables = new Array(len);
  5187. for (var i = 0; i < len; i++) {
  5188. currentDisposables[i] = this.disposables[i];
  5189. }
  5190. this.isDisposed = true;
  5191. this.disposables = [];
  5192. this.length = 0;
  5193. for (var i = 0; i < len; i++) {
  5194. currentDisposables[i].dispose();
  5195. }
  5196. };
  5197. return CompositeDisposable;
  5198. })();
  5199. exports['default'] = CompositeDisposable;
  5200. module.exports = exports['default'];
  5201. /***/ }),
  5202. /* 134 */
  5203. /***/ (function(module, exports, __webpack_require__) {
  5204. "use strict";
  5205. exports.__esModule = true;
  5206. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  5207. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
  5208. var _isDisposable = __webpack_require__(27);
  5209. var _isDisposable2 = _interopRequireDefault(_isDisposable);
  5210. var SerialDisposable = (function () {
  5211. function SerialDisposable() {
  5212. _classCallCheck(this, SerialDisposable);
  5213. this.isDisposed = false;
  5214. this.current = null;
  5215. }
  5216. /**
  5217. * Gets the underlying disposable.
  5218. * @return The underlying disposable.
  5219. */
  5220. SerialDisposable.prototype.getDisposable = function getDisposable() {
  5221. return this.current;
  5222. };
  5223. /**
  5224. * Sets the underlying disposable.
  5225. * @param {Disposable} value The new underlying disposable.
  5226. */
  5227. SerialDisposable.prototype.setDisposable = function setDisposable() {
  5228. var value = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0];
  5229. if (value != null && !_isDisposable2['default'](value)) {
  5230. throw new Error('Expected either an empty value or a valid disposable');
  5231. }
  5232. var isDisposed = this.isDisposed;
  5233. var previous = undefined;
  5234. if (!isDisposed) {
  5235. previous = this.current;
  5236. this.current = value;
  5237. }
  5238. if (previous) {
  5239. previous.dispose();
  5240. }
  5241. if (isDisposed && value) {
  5242. value.dispose();
  5243. }
  5244. };
  5245. /**
  5246. * Disposes the underlying disposable as well as all future replacements.
  5247. */
  5248. SerialDisposable.prototype.dispose = function dispose() {
  5249. if (this.isDisposed) {
  5250. return;
  5251. }
  5252. this.isDisposed = true;
  5253. var previous = this.current;
  5254. this.current = null;
  5255. if (previous) {
  5256. previous.dispose();
  5257. }
  5258. };
  5259. return SerialDisposable;
  5260. })();
  5261. exports['default'] = SerialDisposable;
  5262. module.exports = exports['default'];
  5263. /***/ }),
  5264. /* 135 */
  5265. /***/ (function(module, exports, __webpack_require__) {
  5266. "use strict";
  5267. Object.defineProperty(exports, "__esModule", {
  5268. value: true
  5269. });
  5270. exports.default = registerSource;
  5271. function registerSource(type, source, manager) {
  5272. var registry = manager.getRegistry();
  5273. var sourceId = registry.addSource(type, source);
  5274. function unregisterSource() {
  5275. registry.removeSource(sourceId);
  5276. }
  5277. return {
  5278. handlerId: sourceId,
  5279. unregister: unregisterSource
  5280. };
  5281. }
  5282. /***/ }),
  5283. /* 136 */
  5284. /***/ (function(module, exports, __webpack_require__) {
  5285. "use strict";
  5286. Object.defineProperty(exports, "__esModule", {
  5287. value: true
  5288. });
  5289. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5290. exports.default = createSourceFactory;
  5291. var _invariant = __webpack_require__(0);
  5292. var _invariant2 = _interopRequireDefault(_invariant);
  5293. var _isPlainObject = __webpack_require__(1);
  5294. var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
  5295. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  5296. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5297. var ALLOWED_SPEC_METHODS = ['canDrag', 'beginDrag', 'isDragging', 'endDrag'];
  5298. var REQUIRED_SPEC_METHODS = ['beginDrag'];
  5299. function createSourceFactory(spec) {
  5300. Object.keys(spec).forEach(function (key) {
  5301. (0, _invariant2.default)(ALLOWED_SPEC_METHODS.indexOf(key) > -1, 'Expected the drag source specification to only have ' + 'some of the following keys: %s. ' + 'Instead received a specification with an unexpected "%s" key. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html', ALLOWED_SPEC_METHODS.join(', '), key);
  5302. (0, _invariant2.default)(typeof spec[key] === 'function', 'Expected %s in the drag source specification to be a function. ' + 'Instead received a specification with %s: %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html', key, key, spec[key]);
  5303. });
  5304. REQUIRED_SPEC_METHODS.forEach(function (key) {
  5305. (0, _invariant2.default)(typeof spec[key] === 'function', 'Expected %s in the drag source specification to be a function. ' + 'Instead received a specification with %s: %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html', key, key, spec[key]);
  5306. });
  5307. var Source = function () {
  5308. function Source(monitor) {
  5309. _classCallCheck(this, Source);
  5310. this.monitor = monitor;
  5311. this.props = null;
  5312. this.component = null;
  5313. }
  5314. _createClass(Source, [{
  5315. key: 'receiveProps',
  5316. value: function receiveProps(props) {
  5317. this.props = props;
  5318. }
  5319. }, {
  5320. key: 'receiveComponent',
  5321. value: function receiveComponent(component) {
  5322. this.component = component;
  5323. }
  5324. }, {
  5325. key: 'canDrag',
  5326. value: function canDrag() {
  5327. if (!spec.canDrag) {
  5328. return true;
  5329. }
  5330. return spec.canDrag(this.props, this.monitor);
  5331. }
  5332. }, {
  5333. key: 'isDragging',
  5334. value: function isDragging(globalMonitor, sourceId) {
  5335. if (!spec.isDragging) {
  5336. return sourceId === globalMonitor.getSourceId();
  5337. }
  5338. return spec.isDragging(this.props, this.monitor);
  5339. }
  5340. }, {
  5341. key: 'beginDrag',
  5342. value: function beginDrag() {
  5343. var item = spec.beginDrag(this.props, this.monitor, this.component);
  5344. if (false) {
  5345. (0, _invariant2.default)((0, _isPlainObject2.default)(item), 'beginDrag() must return a plain object that represents the dragged item. ' + 'Instead received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html', item);
  5346. }
  5347. return item;
  5348. }
  5349. }, {
  5350. key: 'endDrag',
  5351. value: function endDrag() {
  5352. if (!spec.endDrag) {
  5353. return;
  5354. }
  5355. spec.endDrag(this.props, this.monitor, this.component);
  5356. }
  5357. }]);
  5358. return Source;
  5359. }();
  5360. return function createSource(monitor) {
  5361. return new Source(monitor);
  5362. };
  5363. }
  5364. /***/ }),
  5365. /* 137 */
  5366. /***/ (function(module, exports, __webpack_require__) {
  5367. "use strict";
  5368. Object.defineProperty(exports, "__esModule", {
  5369. value: true
  5370. });
  5371. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5372. exports.default = createSourceMonitor;
  5373. var _invariant = __webpack_require__(0);
  5374. var _invariant2 = _interopRequireDefault(_invariant);
  5375. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  5376. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5377. var isCallingCanDrag = false;
  5378. var isCallingIsDragging = false;
  5379. var SourceMonitor = function () {
  5380. function SourceMonitor(manager) {
  5381. _classCallCheck(this, SourceMonitor);
  5382. this.internalMonitor = manager.getMonitor();
  5383. }
  5384. _createClass(SourceMonitor, [{
  5385. key: 'receiveHandlerId',
  5386. value: function receiveHandlerId(sourceId) {
  5387. this.sourceId = sourceId;
  5388. }
  5389. }, {
  5390. key: 'canDrag',
  5391. value: function canDrag() {
  5392. (0, _invariant2.default)(!isCallingCanDrag, 'You may not call monitor.canDrag() inside your canDrag() implementation. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source-monitor.html');
  5393. try {
  5394. isCallingCanDrag = true;
  5395. return this.internalMonitor.canDragSource(this.sourceId);
  5396. } finally {
  5397. isCallingCanDrag = false;
  5398. }
  5399. }
  5400. }, {
  5401. key: 'isDragging',
  5402. value: function isDragging() {
  5403. (0, _invariant2.default)(!isCallingIsDragging, 'You may not call monitor.isDragging() inside your isDragging() implementation. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drag-source-monitor.html');
  5404. try {
  5405. isCallingIsDragging = true;
  5406. return this.internalMonitor.isDraggingSource(this.sourceId);
  5407. } finally {
  5408. isCallingIsDragging = false;
  5409. }
  5410. }
  5411. }, {
  5412. key: 'getItemType',
  5413. value: function getItemType() {
  5414. return this.internalMonitor.getItemType();
  5415. }
  5416. }, {
  5417. key: 'getItem',
  5418. value: function getItem() {
  5419. return this.internalMonitor.getItem();
  5420. }
  5421. }, {
  5422. key: 'getDropResult',
  5423. value: function getDropResult() {
  5424. return this.internalMonitor.getDropResult();
  5425. }
  5426. }, {
  5427. key: 'didDrop',
  5428. value: function didDrop() {
  5429. return this.internalMonitor.didDrop();
  5430. }
  5431. }, {
  5432. key: 'getInitialClientOffset',
  5433. value: function getInitialClientOffset() {
  5434. return this.internalMonitor.getInitialClientOffset();
  5435. }
  5436. }, {
  5437. key: 'getInitialSourceClientOffset',
  5438. value: function getInitialSourceClientOffset() {
  5439. return this.internalMonitor.getInitialSourceClientOffset();
  5440. }
  5441. }, {
  5442. key: 'getSourceClientOffset',
  5443. value: function getSourceClientOffset() {
  5444. return this.internalMonitor.getSourceClientOffset();
  5445. }
  5446. }, {
  5447. key: 'getClientOffset',
  5448. value: function getClientOffset() {
  5449. return this.internalMonitor.getClientOffset();
  5450. }
  5451. }, {
  5452. key: 'getDifferenceFromInitialOffset',
  5453. value: function getDifferenceFromInitialOffset() {
  5454. return this.internalMonitor.getDifferenceFromInitialOffset();
  5455. }
  5456. }]);
  5457. return SourceMonitor;
  5458. }();
  5459. function createSourceMonitor(manager) {
  5460. return new SourceMonitor(manager);
  5461. }
  5462. /***/ }),
  5463. /* 138 */
  5464. /***/ (function(module, exports, __webpack_require__) {
  5465. "use strict";
  5466. Object.defineProperty(exports, "__esModule", {
  5467. value: true
  5468. });
  5469. exports.default = createSourceConnector;
  5470. var _wrapConnectorHooks = __webpack_require__(40);
  5471. var _wrapConnectorHooks2 = _interopRequireDefault(_wrapConnectorHooks);
  5472. var _areOptionsEqual = __webpack_require__(41);
  5473. var _areOptionsEqual2 = _interopRequireDefault(_areOptionsEqual);
  5474. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  5475. function createSourceConnector(backend) {
  5476. var currentHandlerId = void 0;
  5477. var currentDragSourceNode = void 0;
  5478. var currentDragSourceOptions = void 0;
  5479. var disconnectCurrentDragSource = void 0;
  5480. var currentDragPreviewNode = void 0;
  5481. var currentDragPreviewOptions = void 0;
  5482. var disconnectCurrentDragPreview = void 0;
  5483. function reconnectDragSource() {
  5484. if (disconnectCurrentDragSource) {
  5485. disconnectCurrentDragSource();
  5486. disconnectCurrentDragSource = null;
  5487. }
  5488. if (currentHandlerId && currentDragSourceNode) {
  5489. disconnectCurrentDragSource = backend.connectDragSource(currentHandlerId, currentDragSourceNode, currentDragSourceOptions);
  5490. }
  5491. }
  5492. function reconnectDragPreview() {
  5493. if (disconnectCurrentDragPreview) {
  5494. disconnectCurrentDragPreview();
  5495. disconnectCurrentDragPreview = null;
  5496. }
  5497. if (currentHandlerId && currentDragPreviewNode) {
  5498. disconnectCurrentDragPreview = backend.connectDragPreview(currentHandlerId, currentDragPreviewNode, currentDragPreviewOptions);
  5499. }
  5500. }
  5501. function receiveHandlerId(handlerId) {
  5502. if (handlerId === currentHandlerId) {
  5503. return;
  5504. }
  5505. currentHandlerId = handlerId;
  5506. reconnectDragSource();
  5507. reconnectDragPreview();
  5508. }
  5509. var hooks = (0, _wrapConnectorHooks2.default)({
  5510. dragSource: function connectDragSource(node, options) {
  5511. if (node === currentDragSourceNode && (0, _areOptionsEqual2.default)(options, currentDragSourceOptions)) {
  5512. return;
  5513. }
  5514. currentDragSourceNode = node;
  5515. currentDragSourceOptions = options;
  5516. reconnectDragSource();
  5517. },
  5518. dragPreview: function connectDragPreview(node, options) {
  5519. if (node === currentDragPreviewNode && (0, _areOptionsEqual2.default)(options, currentDragPreviewOptions)) {
  5520. return;
  5521. }
  5522. currentDragPreviewNode = node;
  5523. currentDragPreviewOptions = options;
  5524. reconnectDragPreview();
  5525. }
  5526. });
  5527. return {
  5528. receiveHandlerId: receiveHandlerId,
  5529. hooks: hooks
  5530. };
  5531. }
  5532. /***/ }),
  5533. /* 139 */
  5534. /***/ (function(module, exports, __webpack_require__) {
  5535. "use strict";
  5536. Object.defineProperty(exports, "__esModule", {
  5537. value: true
  5538. });
  5539. exports.default = cloneWithRef;
  5540. var _invariant = __webpack_require__(0);
  5541. var _invariant2 = _interopRequireDefault(_invariant);
  5542. var _react = __webpack_require__(2);
  5543. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  5544. function cloneWithRef(element, newRef) {
  5545. var previousRef = element.ref;
  5546. (0, _invariant2.default)(typeof previousRef !== 'string', 'Cannot connect React DnD to an element with an existing string ref. ' + 'Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. ' + 'Read more: https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute');
  5547. if (!previousRef) {
  5548. // When there is no ref on the element, use the new ref directly
  5549. return (0, _react.cloneElement)(element, {
  5550. ref: newRef
  5551. });
  5552. }
  5553. return (0, _react.cloneElement)(element, {
  5554. ref: function ref(node) {
  5555. newRef(node);
  5556. if (previousRef) {
  5557. previousRef(node);
  5558. }
  5559. }
  5560. });
  5561. }
  5562. /***/ }),
  5563. /* 140 */
  5564. /***/ (function(module, exports, __webpack_require__) {
  5565. "use strict";
  5566. Object.defineProperty(exports, "__esModule", {
  5567. value: true
  5568. });
  5569. exports.default = DropTarget;
  5570. var _invariant = __webpack_require__(0);
  5571. var _invariant2 = _interopRequireDefault(_invariant);
  5572. var _isPlainObject = __webpack_require__(1);
  5573. var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
  5574. var _checkDecoratorArguments = __webpack_require__(13);
  5575. var _checkDecoratorArguments2 = _interopRequireDefault(_checkDecoratorArguments);
  5576. var _decorateHandler = __webpack_require__(39);
  5577. var _decorateHandler2 = _interopRequireDefault(_decorateHandler);
  5578. var _registerTarget = __webpack_require__(141);
  5579. var _registerTarget2 = _interopRequireDefault(_registerTarget);
  5580. var _createTargetFactory = __webpack_require__(142);
  5581. var _createTargetFactory2 = _interopRequireDefault(_createTargetFactory);
  5582. var _createTargetMonitor = __webpack_require__(143);
  5583. var _createTargetMonitor2 = _interopRequireDefault(_createTargetMonitor);
  5584. var _createTargetConnector = __webpack_require__(144);
  5585. var _createTargetConnector2 = _interopRequireDefault(_createTargetConnector);
  5586. var _isValidType = __webpack_require__(42);
  5587. var _isValidType2 = _interopRequireDefault(_isValidType);
  5588. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  5589. function DropTarget(type, spec, collect) {
  5590. var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  5591. _checkDecoratorArguments2.default.apply(undefined, ['DropTarget', 'type, spec, collect[, options]'].concat(Array.prototype.slice.call(arguments)));
  5592. var getType = type;
  5593. if (typeof type !== 'function') {
  5594. (0, _invariant2.default)((0, _isValidType2.default)(type, true), 'Expected "type" provided as the first argument to DropTarget to be ' + 'a string, an array of strings, or a function that returns either given ' + 'the current props. Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html', type);
  5595. getType = function getType() {
  5596. return type;
  5597. };
  5598. }
  5599. (0, _invariant2.default)((0, _isPlainObject2.default)(spec), 'Expected "spec" provided as the second argument to DropTarget to be ' + 'a plain object. Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html', spec);
  5600. var createTarget = (0, _createTargetFactory2.default)(spec);
  5601. (0, _invariant2.default)(typeof collect === 'function', 'Expected "collect" provided as the third argument to DropTarget to be ' + 'a function that returns a plain object of props to inject. ' + 'Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html', collect);
  5602. (0, _invariant2.default)((0, _isPlainObject2.default)(options), 'Expected "options" provided as the fourth argument to DropTarget to be ' + 'a plain object when specified. ' + 'Instead, received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html', collect);
  5603. return function decorateTarget(DecoratedComponent) {
  5604. return (0, _decorateHandler2.default)({
  5605. connectBackend: function connectBackend(backend, targetId) {
  5606. return backend.connectDropTarget(targetId);
  5607. },
  5608. containerDisplayName: 'DropTarget',
  5609. createHandler: createTarget,
  5610. registerHandler: _registerTarget2.default,
  5611. createMonitor: _createTargetMonitor2.default,
  5612. createConnector: _createTargetConnector2.default,
  5613. DecoratedComponent: DecoratedComponent,
  5614. getType: getType,
  5615. collect: collect,
  5616. options: options
  5617. });
  5618. };
  5619. }
  5620. /***/ }),
  5621. /* 141 */
  5622. /***/ (function(module, exports, __webpack_require__) {
  5623. "use strict";
  5624. Object.defineProperty(exports, "__esModule", {
  5625. value: true
  5626. });
  5627. exports.default = registerTarget;
  5628. function registerTarget(type, target, manager) {
  5629. var registry = manager.getRegistry();
  5630. var targetId = registry.addTarget(type, target);
  5631. function unregisterTarget() {
  5632. registry.removeTarget(targetId);
  5633. }
  5634. return {
  5635. handlerId: targetId,
  5636. unregister: unregisterTarget
  5637. };
  5638. }
  5639. /***/ }),
  5640. /* 142 */
  5641. /***/ (function(module, exports, __webpack_require__) {
  5642. "use strict";
  5643. Object.defineProperty(exports, "__esModule", {
  5644. value: true
  5645. });
  5646. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5647. exports.default = createTargetFactory;
  5648. var _invariant = __webpack_require__(0);
  5649. var _invariant2 = _interopRequireDefault(_invariant);
  5650. var _isPlainObject = __webpack_require__(1);
  5651. var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
  5652. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  5653. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5654. var ALLOWED_SPEC_METHODS = ['canDrop', 'hover', 'drop'];
  5655. function createTargetFactory(spec) {
  5656. Object.keys(spec).forEach(function (key) {
  5657. (0, _invariant2.default)(ALLOWED_SPEC_METHODS.indexOf(key) > -1, 'Expected the drop target specification to only have ' + 'some of the following keys: %s. ' + 'Instead received a specification with an unexpected "%s" key. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html', ALLOWED_SPEC_METHODS.join(', '), key);
  5658. (0, _invariant2.default)(typeof spec[key] === 'function', 'Expected %s in the drop target specification to be a function. ' + 'Instead received a specification with %s: %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html', key, key, spec[key]);
  5659. });
  5660. var Target = function () {
  5661. function Target(monitor) {
  5662. _classCallCheck(this, Target);
  5663. this.monitor = monitor;
  5664. this.props = null;
  5665. this.component = null;
  5666. }
  5667. _createClass(Target, [{
  5668. key: 'receiveProps',
  5669. value: function receiveProps(props) {
  5670. this.props = props;
  5671. }
  5672. }, {
  5673. key: 'receiveMonitor',
  5674. value: function receiveMonitor(monitor) {
  5675. this.monitor = monitor;
  5676. }
  5677. }, {
  5678. key: 'receiveComponent',
  5679. value: function receiveComponent(component) {
  5680. this.component = component;
  5681. }
  5682. }, {
  5683. key: 'canDrop',
  5684. value: function canDrop() {
  5685. if (!spec.canDrop) {
  5686. return true;
  5687. }
  5688. return spec.canDrop(this.props, this.monitor);
  5689. }
  5690. }, {
  5691. key: 'hover',
  5692. value: function hover() {
  5693. if (!spec.hover) {
  5694. return;
  5695. }
  5696. spec.hover(this.props, this.monitor, this.component);
  5697. }
  5698. }, {
  5699. key: 'drop',
  5700. value: function drop() {
  5701. if (!spec.drop) {
  5702. return undefined;
  5703. }
  5704. var dropResult = spec.drop(this.props, this.monitor, this.component);
  5705. if (false) {
  5706. (0, _invariant2.default)(typeof dropResult === 'undefined' || (0, _isPlainObject2.default)(dropResult), 'drop() must either return undefined, or an object that represents the drop result. ' + 'Instead received %s. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html', dropResult);
  5707. }
  5708. return dropResult;
  5709. }
  5710. }]);
  5711. return Target;
  5712. }();
  5713. return function createTarget(monitor) {
  5714. return new Target(monitor);
  5715. };
  5716. }
  5717. /***/ }),
  5718. /* 143 */
  5719. /***/ (function(module, exports, __webpack_require__) {
  5720. "use strict";
  5721. Object.defineProperty(exports, "__esModule", {
  5722. value: true
  5723. });
  5724. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5725. exports.default = createTargetMonitor;
  5726. var _invariant = __webpack_require__(0);
  5727. var _invariant2 = _interopRequireDefault(_invariant);
  5728. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  5729. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5730. var isCallingCanDrop = false;
  5731. var TargetMonitor = function () {
  5732. function TargetMonitor(manager) {
  5733. _classCallCheck(this, TargetMonitor);
  5734. this.internalMonitor = manager.getMonitor();
  5735. }
  5736. _createClass(TargetMonitor, [{
  5737. key: 'receiveHandlerId',
  5738. value: function receiveHandlerId(targetId) {
  5739. this.targetId = targetId;
  5740. }
  5741. }, {
  5742. key: 'canDrop',
  5743. value: function canDrop() {
  5744. (0, _invariant2.default)(!isCallingCanDrop, 'You may not call monitor.canDrop() inside your canDrop() implementation. ' + 'Read more: http://react-dnd.github.io/react-dnd/docs-drop-target-monitor.html');
  5745. try {
  5746. isCallingCanDrop = true;
  5747. return this.internalMonitor.canDropOnTarget(this.targetId);
  5748. } finally {
  5749. isCallingCanDrop = false;
  5750. }
  5751. }
  5752. }, {
  5753. key: 'isOver',
  5754. value: function isOver(options) {
  5755. return this.internalMonitor.isOverTarget(this.targetId, options);
  5756. }
  5757. }, {
  5758. key: 'getItemType',
  5759. value: function getItemType() {
  5760. return this.internalMonitor.getItemType();
  5761. }
  5762. }, {
  5763. key: 'getItem',
  5764. value: function getItem() {
  5765. return this.internalMonitor.getItem();
  5766. }
  5767. }, {
  5768. key: 'getDropResult',
  5769. value: function getDropResult() {
  5770. return this.internalMonitor.getDropResult();
  5771. }
  5772. }, {
  5773. key: 'didDrop',
  5774. value: function didDrop() {
  5775. return this.internalMonitor.didDrop();
  5776. }
  5777. }, {
  5778. key: 'getInitialClientOffset',
  5779. value: function getInitialClientOffset() {
  5780. return this.internalMonitor.getInitialClientOffset();
  5781. }
  5782. }, {
  5783. key: 'getInitialSourceClientOffset',
  5784. value: function getInitialSourceClientOffset() {
  5785. return this.internalMonitor.getInitialSourceClientOffset();
  5786. }
  5787. }, {
  5788. key: 'getSourceClientOffset',
  5789. value: function getSourceClientOffset() {
  5790. return this.internalMonitor.getSourceClientOffset();
  5791. }
  5792. }, {
  5793. key: 'getClientOffset',
  5794. value: function getClientOffset() {
  5795. return this.internalMonitor.getClientOffset();
  5796. }
  5797. }, {
  5798. key: 'getDifferenceFromInitialOffset',
  5799. value: function getDifferenceFromInitialOffset() {
  5800. return this.internalMonitor.getDifferenceFromInitialOffset();
  5801. }
  5802. }]);
  5803. return TargetMonitor;
  5804. }();
  5805. function createTargetMonitor(manager) {
  5806. return new TargetMonitor(manager);
  5807. }
  5808. /***/ }),
  5809. /* 144 */
  5810. /***/ (function(module, exports, __webpack_require__) {
  5811. "use strict";
  5812. Object.defineProperty(exports, "__esModule", {
  5813. value: true
  5814. });
  5815. exports.default = createTargetConnector;
  5816. var _wrapConnectorHooks = __webpack_require__(40);
  5817. var _wrapConnectorHooks2 = _interopRequireDefault(_wrapConnectorHooks);
  5818. var _areOptionsEqual = __webpack_require__(41);
  5819. var _areOptionsEqual2 = _interopRequireDefault(_areOptionsEqual);
  5820. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  5821. function createTargetConnector(backend) {
  5822. var currentHandlerId = void 0;
  5823. var currentDropTargetNode = void 0;
  5824. var currentDropTargetOptions = void 0;
  5825. var disconnectCurrentDropTarget = void 0;
  5826. function reconnectDropTarget() {
  5827. if (disconnectCurrentDropTarget) {
  5828. disconnectCurrentDropTarget();
  5829. disconnectCurrentDropTarget = null;
  5830. }
  5831. if (currentHandlerId && currentDropTargetNode) {
  5832. disconnectCurrentDropTarget = backend.connectDropTarget(currentHandlerId, currentDropTargetNode, currentDropTargetOptions);
  5833. }
  5834. }
  5835. function receiveHandlerId(handlerId) {
  5836. if (handlerId === currentHandlerId) {
  5837. return;
  5838. }
  5839. currentHandlerId = handlerId;
  5840. reconnectDropTarget();
  5841. }
  5842. var hooks = (0, _wrapConnectorHooks2.default)({
  5843. dropTarget: function connectDropTarget(node, options) {
  5844. if (node === currentDropTargetNode && (0, _areOptionsEqual2.default)(options, currentDropTargetOptions)) {
  5845. return;
  5846. }
  5847. currentDropTargetNode = node;
  5848. currentDropTargetOptions = options;
  5849. reconnectDropTarget();
  5850. }
  5851. });
  5852. return {
  5853. receiveHandlerId: receiveHandlerId,
  5854. hooks: hooks
  5855. };
  5856. }
  5857. /***/ })
  5858. /******/ ]);
  5859. });