WordPress/js/dist/components.js

38747 lines
1.5 MiB
JavaScript
Raw Normal View History

this["wp"] = this["wp"] || {}; this["wp"]["components"] =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = "./node_modules/@wordpress/components/build-module/index.js");
/******/ })
/************************************************************************/
/******/ ({
/***/ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js":
/*!**********************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
\**********************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
module.exports = _assertThisInitialized;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/defineProperty.js":
/*!***************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
module.exports = _defineProperty;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js":
/*!*******************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js ***!
\*******************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _arrayWithHoles; });
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js":
/*!**********************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js ***!
\**********************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _arrayWithoutHoles; });
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {
arr2[i] = arr[i];
}
return arr2;
}
}
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js":
/*!**************************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js ***!
\**************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _assertThisInitialized; });
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js":
/*!*******************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js ***!
\*******************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _classCallCheck; });
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/esm/createClass.js":
/*!****************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/esm/createClass.js ***!
\****************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _createClass; });
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);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
}
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js":
/*!*******************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/esm/defineProperty.js ***!
\*******************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _defineProperty; });
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/esm/extends.js":
/*!************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/esm/extends.js ***!
\************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _extends; });
function _extends() {
_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;
};
return _extends.apply(this, arguments);
}
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js":
/*!*******************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js ***!
\*******************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _getPrototypeOf; });
function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
return _getPrototypeOf(o);
}
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/esm/inherits.js":
/*!*************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/esm/inherits.js ***!
\*************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _inherits; });
/* harmony import */ var _setPrototypeOf__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./setPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js");
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
});
if (superClass) Object(_setPrototypeOf__WEBPACK_IMPORTED_MODULE_0__["default"])(subClass, superClass);
}
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/esm/iterableToArray.js":
/*!********************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js ***!
\********************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _iterableToArray; });
function _iterableToArray(iter) {
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
}
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js":
/*!*************************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js ***!
\*************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _iterableToArrayLimit; });
function _iterableToArrayLimit(arr, i) {
var _arr = [];
var _n = true;
var _d = false;
var _e = undefined;
try {
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
_arr.push(_s.value);
if (i && _arr.length === i) break;
}
} catch (err) {
_d = true;
_e = err;
} finally {
try {
if (!_n && _i["return"] != null) _i["return"]();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js":
/*!********************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js ***!
\********************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _nonIterableRest; });
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance");
}
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js":
/*!**********************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js ***!
\**********************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _nonIterableSpread; });
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance");
}
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js":
/*!*****************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/esm/objectSpread.js ***!
\*****************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _objectSpread; });
/* harmony import */ var _defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
var ownKeys = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === 'function') {
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
}));
}
ownKeys.forEach(function (key) {
Object(_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]);
});
}
return target;
}
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js":
/*!****************************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js ***!
\****************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _objectWithoutProperties; });
/* harmony import */ var _objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
function _objectWithoutProperties(source, excluded) {
if (source == null) return {};
var target = Object(_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(source, excluded);
var key, i;
if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
for (i = 0; i < sourceSymbolKeys.length; i++) {
key = sourceSymbolKeys[i];
if (excluded.indexOf(key) >= 0) continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
target[key] = source[key];
}
}
return target;
}
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js":
/*!*********************************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js ***!
\*********************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _objectWithoutPropertiesLoose; });
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js":
/*!******************************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js ***!
\******************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _possibleConstructorReturn; });
/* harmony import */ var _helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/esm/typeof */ "./node_modules/@babel/runtime/helpers/esm/typeof.js");
/* harmony import */ var _assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
function _possibleConstructorReturn(self, call) {
if (call && (Object(_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__["default"])(call) === "object" || typeof call === "function")) {
return call;
}
return Object(_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__["default"])(self);
}
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js":
/*!*******************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js ***!
\*******************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _setPrototypeOf; });
function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _setPrototypeOf(o, p);
}
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js":
/*!******************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js ***!
\******************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _slicedToArray; });
/* harmony import */ var _arrayWithHoles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayWithHoles */ "./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js");
/* harmony import */ var _iterableToArrayLimit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./iterableToArrayLimit */ "./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js");
/* harmony import */ var _nonIterableRest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./nonIterableRest */ "./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js");
function _slicedToArray(arr, i) {
return Object(_arrayWithHoles__WEBPACK_IMPORTED_MODULE_0__["default"])(arr) || Object(_iterableToArrayLimit__WEBPACK_IMPORTED_MODULE_1__["default"])(arr, i) || Object(_nonIterableRest__WEBPACK_IMPORTED_MODULE_2__["default"])();
}
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js":
/*!**********************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js ***!
\**********************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _toConsumableArray; });
/* harmony import */ var _arrayWithoutHoles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayWithoutHoles */ "./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js");
/* harmony import */ var _iterableToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./iterableToArray */ "./node_modules/@babel/runtime/helpers/esm/iterableToArray.js");
/* harmony import */ var _nonIterableSpread__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./nonIterableSpread */ "./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js");
function _toConsumableArray(arr) {
return Object(_arrayWithoutHoles__WEBPACK_IMPORTED_MODULE_0__["default"])(arr) || Object(_iterableToArray__WEBPACK_IMPORTED_MODULE_1__["default"])(arr) || Object(_nonIterableSpread__WEBPACK_IMPORTED_MODULE_2__["default"])();
}
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/esm/typeof.js":
/*!***********************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/esm/typeof.js ***!
\***********************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _typeof; });
function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); }
function _typeof(obj) {
if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") {
_typeof = function _typeof(obj) {
return _typeof2(obj);
};
} else {
_typeof = function _typeof(obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj);
};
}
return _typeof(obj);
}
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/extends.js":
/*!********************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/extends.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function _extends() {
module.exports = _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;
};
return _extends.apply(this, arguments);
}
module.exports = _extends;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/inheritsLoose.js":
/*!**************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/inheritsLoose.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function _inheritsLoose(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
subClass.__proto__ = superClass;
}
module.exports = _inheritsLoose;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js":
/*!*****************************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js ***!
\*****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
module.exports = _objectWithoutPropertiesLoose;
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/autocomplete/index.js":
/*!*******************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/autocomplete/index.js ***!
\*******************************************************************************/
/*! exports provided: Autocomplete, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Autocomplete", function() { return Autocomplete; });
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js");
/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_11__);
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes");
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_13__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_14__);
/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @wordpress/rich-text */ "@wordpress/rich-text");
/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_15__);
/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @wordpress/dom */ "@wordpress/dom");
/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_16__);
/* harmony import */ var _higher_order_with_focus_outside__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../higher-order/with-focus-outside */ "./node_modules/@wordpress/components/build-module/higher-order/with-focus-outside/index.js");
/* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../button */ "./node_modules/@wordpress/components/build-module/button/index.js");
/* harmony import */ var _popover__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../popover */ "./node_modules/@wordpress/components/build-module/popover/index.js");
/* harmony import */ var _higher_order_with_spoken_messages__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../higher-order/with-spoken-messages */ "./node_modules/@wordpress/components/build-module/higher-order/with-spoken-messages/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* A raw completer option.
* @typedef {*} CompleterOption
*/
/**
* @callback FnGetOptions
*
* @returns {(CompleterOption[]|Promise.<CompleterOption[]>)} The completer options or a promise for them.
*/
/**
* @callback FnGetOptionKeywords
* @param {CompleterOption} option a completer option.
*
* @returns {string[]} list of key words to search.
*/
/**
* @callback FnIsOptionDisabled
* @param {CompleterOption} option a completer option.
*
* @returns {string[]} whether or not the given option is disabled.
*/
/**
* @callback FnGetOptionLabel
* @param {CompleterOption} option a completer option.
*
* @returns {(string|Array.<(string|Component)>)} list of react components to render.
*/
/**
* @callback FnAllowNode
* @param {Node} textNode check if the completer can handle this text node.
*
* @returns {boolean} true if the completer can handle this text node.
*/
/**
* @callback FnAllowContext
* @param {Range} before the range before the auto complete trigger and query.
* @param {Range} after the range after the autocomplete trigger and query.
*
* @returns {boolean} true if the completer can handle these ranges.
*/
/**
* @typedef {Object} OptionCompletion
* @property {('insert-at-caret', 'replace')} action the intended placement of the completion.
* @property {OptionCompletionValue} value the completion value.
*/
/**
* A completion value.
* @typedef {(String|WPElement|Object)} OptionCompletionValue
*/
/**
* @callback FnGetOptionCompletion
* @param {CompleterOption} value the value of the completer option.
* @param {Range} range the nodes included in the autocomplete trigger and query.
* @param {String} query the text value of the autocomplete query.
*
* @returns {(OptionCompletion|OptionCompletionValue)} the completion for the given option. If an
* OptionCompletionValue is returned, the
* completion action defaults to `insert-at-caret`.
*/
/**
* @typedef {Object} Completer
* @property {String} name a way to identify a completer, useful for selective overriding.
* @property {?String} className A class to apply to the popup menu.
* @property {String} triggerPrefix the prefix that will display the menu.
* @property {(CompleterOption[]|FnGetOptions)} options the completer options or a function to get them.
* @property {?FnGetOptionKeywords} getOptionKeywords get the keywords for a given option.
* @property {?FnIsOptionDisabled} isOptionDisabled get whether or not the given option is disabled.
* @property {FnGetOptionLabel} getOptionLabel get the label for a given option.
* @property {?FnAllowNode} allowNode filter the allowed text nodes in the autocomplete.
* @property {?FnAllowContext} allowContext filter the context under which the autocomplete activates.
* @property {FnGetOptionCompletion} getOptionCompletion get the completion associated with a given option.
*/
function filterOptions(search) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
var maxResults = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
var filtered = [];
for (var i = 0; i < options.length; i++) {
var option = options[i]; // Merge label into keywords
var _option$keywords = option.keywords,
keywords = _option$keywords === void 0 ? [] : _option$keywords;
if ('string' === typeof option.label) {
keywords = Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_8__["default"])(keywords).concat([option.label]);
}
var isMatch = keywords.some(function (keyword) {
return search.test(keyword);
});
if (!isMatch) {
continue;
}
filtered.push(option); // Abort early if max reached
if (filtered.length === maxResults) {
break;
}
}
return filtered;
}
function getCaretRect() {
var range = window.getSelection().getRangeAt(0);
if (range) {
return Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_16__["getRectangleFromRange"])(range);
}
}
var Autocomplete =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(Autocomplete, _Component);
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_5__["default"])(Autocomplete, null, [{
key: "getInitialState",
value: function getInitialState() {
return {
search: /./,
selectedIndex: 0,
suppress: undefined,
open: undefined,
query: undefined,
filteredOptions: []
};
}
}]);
function Autocomplete() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Autocomplete);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(Autocomplete).apply(this, arguments));
_this.bindNode = _this.bindNode.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.select = _this.select.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.reset = _this.reset.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.resetWhenSuppressed = _this.resetWhenSuppressed.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.handleKeyDown = _this.handleKeyDown.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.debouncedLoadOptions = Object(lodash__WEBPACK_IMPORTED_MODULE_11__["debounce"])(_this.loadOptions, 250);
_this.state = _this.constructor.getInitialState();
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_5__["default"])(Autocomplete, [{
key: "bindNode",
value: function bindNode(node) {
this.node = node;
}
}, {
key: "insertCompletion",
value: function insertCompletion(replacement) {
var _this$state = this.state,
open = _this$state.open,
query = _this$state.query;
var _this$props = this.props,
record = _this$props.record,
onChange = _this$props.onChange;
var end = record.start;
var start = end - open.triggerPrefix.length - query.length;
var toInsert = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_15__["create"])({
html: Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["renderToString"])(replacement)
});
onChange(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_15__["insert"])(record, toInsert, start, end));
}
}, {
key: "select",
value: function select(option) {
var onReplace = this.props.onReplace;
var _this$state2 = this.state,
open = _this$state2.open,
query = _this$state2.query;
var _ref = open || {},
getOptionCompletion = _ref.getOptionCompletion;
if (option.isDisabled) {
return;
}
if (getOptionCompletion) {
var completion = getOptionCompletion(option.value, query);
var _ref2 = undefined === completion.action || undefined === completion.value ? {
action: 'insert-at-caret',
value: completion
} : completion,
action = _ref2.action,
value = _ref2.value;
if ('replace' === action) {
onReplace([value]);
} else if ('insert-at-caret' === action) {
this.insertCompletion(value);
}
} // Reset autocomplete state after insertion rather than before
// so insertion events don't cause the completion menu to redisplay.
this.reset();
}
}, {
key: "reset",
value: function reset() {
var isMounted = !!this.node; // Autocompletions may replace the block containing this component,
// so we make sure it is mounted before resetting the state.
if (isMounted) {
this.setState(this.constructor.getInitialState());
}
}
}, {
key: "resetWhenSuppressed",
value: function resetWhenSuppressed() {
var _this$state3 = this.state,
open = _this$state3.open,
suppress = _this$state3.suppress;
if (open && suppress === open.idx) {
this.reset();
}
}
}, {
key: "handleFocusOutside",
value: function handleFocusOutside() {
this.reset();
}
}, {
key: "announce",
value: function announce(filteredOptions) {
var debouncedSpeak = this.props.debouncedSpeak;
if (!debouncedSpeak) {
return;
}
if (!!filteredOptions.length) {
debouncedSpeak(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_13__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_13__["_n"])('%d result found, use up and down arrow keys to navigate.', '%d results found, use up and down arrow keys to navigate.', filteredOptions.length), filteredOptions.length), 'assertive');
} else {
debouncedSpeak(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_13__["__"])('No results.'), 'assertive');
}
}
/**
* Load options for an autocompleter.
*
* @param {Completer} completer The autocompleter.
* @param {string} query The query, if any.
*/
}, {
key: "loadOptions",
value: function loadOptions(completer, query) {
var _this2 = this;
var options = completer.options;
/*
* We support both synchronous and asynchronous retrieval of completer options
* but internally treat all as async so we maintain a single, consistent code path.
*
* Because networks can be slow, and the internet is wonderfully unpredictable,
* we don't want two promises updating the state at once. This ensures that only
* the most recent promise will act on `optionsData`. This doesn't use the state
* because `setState` is batched, and so there's no guarantee that setting
* `activePromise` in the state would result in it actually being in `this.state`
* before the promise resolves and we check to see if this is the active promise or not.
*/
var promise = this.activePromise = Promise.resolve(typeof options === 'function' ? options(query) : options).then(function (optionsData) {
var _this2$setState;
if (promise !== _this2.activePromise) {
// Another promise has become active since this one was asked to resolve, so do nothing,
// or else we might end triggering a race condition updating the state.
return;
}
var keyedOptions = optionsData.map(function (optionData, optionIndex) {
return {
key: "".concat(completer.idx, "-").concat(optionIndex),
value: optionData,
label: completer.getOptionLabel(optionData),
keywords: completer.getOptionKeywords ? completer.getOptionKeywords(optionData) : [],
isDisabled: completer.isOptionDisabled ? completer.isOptionDisabled(optionData) : false
};
});
var filteredOptions = filterOptions(_this2.state.search, keyedOptions);
var selectedIndex = filteredOptions.length === _this2.state.filteredOptions.length ? _this2.state.selectedIndex : 0;
_this2.setState((_this2$setState = {}, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_1__["default"])(_this2$setState, 'options_' + completer.idx, keyedOptions), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_1__["default"])(_this2$setState, "filteredOptions", filteredOptions), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_1__["default"])(_this2$setState, "selectedIndex", selectedIndex), _this2$setState));
_this2.announce(filteredOptions);
});
}
}, {
key: "handleKeyDown",
value: function handleKeyDown(event) {
var _this$state4 = this.state,
open = _this$state4.open,
suppress = _this$state4.suppress,
selectedIndex = _this$state4.selectedIndex,
filteredOptions = _this$state4.filteredOptions;
if (!open) {
return;
}
if (suppress === open.idx) {
switch (event.keyCode) {
// cancel popup suppression on CTRL+SPACE
case _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["SPACE"]:
var ctrlKey = event.ctrlKey,
shiftKey = event.shiftKey,
altKey = event.altKey,
metaKey = event.metaKey;
if (ctrlKey && !(shiftKey || altKey || metaKey)) {
this.setState({
suppress: undefined
});
event.preventDefault();
event.stopPropagation();
}
break;
// reset on cursor movement
case _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["UP"]:
case _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["DOWN"]:
case _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["LEFT"]:
case _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["RIGHT"]:
this.reset();
}
return;
}
if (filteredOptions.length === 0) {
return;
}
var nextSelectedIndex;
switch (event.keyCode) {
case _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["UP"]:
nextSelectedIndex = (selectedIndex === 0 ? filteredOptions.length : selectedIndex) - 1;
this.setState({
selectedIndex: nextSelectedIndex
});
break;
case _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["DOWN"]:
nextSelectedIndex = (selectedIndex + 1) % filteredOptions.length;
this.setState({
selectedIndex: nextSelectedIndex
});
break;
case _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["ESCAPE"]:
this.setState({
suppress: open.idx
});
break;
case _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["ENTER"]:
this.select(filteredOptions[selectedIndex]);
break;
case _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["LEFT"]:
case _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["RIGHT"]:
this.reset();
return;
default:
return;
} // Any handled keycode should prevent original behavior. This relies on
// the early return in the default case.
event.preventDefault();
event.stopPropagation();
}
}, {
key: "toggleKeyEvents",
value: function toggleKeyEvents(isListening) {
// This exists because we must capture ENTER key presses before RichText.
// It seems that react fires the simulated capturing events after the
// native browser event has already bubbled so we can't stopPropagation
// and avoid RichText getting the event from TinyMCE, hence we must
// register a native event handler.
var handler = isListening ? 'addEventListener' : 'removeEventListener';
this.node[handler]('keydown', this.handleKeyDown, true);
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps, prevState) {
var _this$props2 = this.props,
record = _this$props2.record,
completers = _this$props2.completers;
var prevRecord = prevProps.record;
var prevOpen = prevState.open;
if (!this.state.open !== !prevOpen) {
this.toggleKeyEvents(!!this.state.open);
}
if (Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_15__["isCollapsed"])(record)) {
var text = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_15__["getTextContent"])(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_15__["slice"])(record, 0));
var prevText = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_15__["getTextContent"])(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_15__["slice"])(prevRecord, 0));
if (text !== prevText) {
var textAfterSelection = Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_15__["getTextContent"])(Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_15__["slice"])(record, undefined, Object(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_15__["getTextContent"])(record).length));
var allCompleters = Object(lodash__WEBPACK_IMPORTED_MODULE_11__["map"])(completers, function (completer, idx) {
return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, completer, {
idx: idx
});
});
var open = Object(lodash__WEBPACK_IMPORTED_MODULE_11__["find"])(allCompleters, function (_ref3) {
var triggerPrefix = _ref3.triggerPrefix,
allowContext = _ref3.allowContext;
var index = text.lastIndexOf(triggerPrefix);
if (index === -1) {
return false;
}
if (allowContext && !allowContext(text.slice(0, index), textAfterSelection)) {
return false;
}
return /^\w*$/.test(text.slice(index + triggerPrefix.length));
});
if (!open) {
this.reset();
return;
}
var match = text.match(new RegExp("".concat(open.triggerPrefix, "(\\w*)$")));
var query = match && match[1];
var _this$state5 = this.state,
wasOpen = _this$state5.open,
wasSuppress = _this$state5.suppress,
wasQuery = _this$state5.query;
if (open && (!wasOpen || open.idx !== wasOpen.idx || query !== wasQuery)) {
if (open.isDebounced) {
this.debouncedLoadOptions(open, query);
} else {
this.loadOptions(open, query);
}
} // create a regular expression to filter the options
var search = open ? new RegExp('(?:\\b|\\s|^)' + Object(lodash__WEBPACK_IMPORTED_MODULE_11__["escapeRegExp"])(query), 'i') : /./; // filter the options we already have
var filteredOptions = open ? filterOptions(search, this.state['options_' + open.idx]) : []; // check if we should still suppress the popover
var suppress = open && wasSuppress === open.idx ? wasSuppress : undefined; // update the state
if (wasOpen || open) {
this.setState({
selectedIndex: 0,
filteredOptions: filteredOptions,
suppress: suppress,
search: search,
open: open,
query: query
});
} // announce the count of filtered options but only if they have loaded
if (open && this.state['options_' + open.idx]) {
this.announce(filteredOptions);
}
}
}
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.toggleKeyEvents(false);
this.debouncedLoadOptions.cancel();
}
}, {
key: "render",
value: function render() {
var _this3 = this;
var _this$props3 = this.props,
children = _this$props3.children,
instanceId = _this$props3.instanceId;
var _this$state6 = this.state,
open = _this$state6.open,
suppress = _this$state6.suppress,
selectedIndex = _this$state6.selectedIndex,
filteredOptions = _this$state6.filteredOptions;
var _ref4 = filteredOptions[selectedIndex] || {},
_ref4$key = _ref4.key,
selectedKey = _ref4$key === void 0 ? '' : _ref4$key;
var _ref5 = open || {},
className = _ref5.className,
idx = _ref5.idx;
var isExpanded = suppress !== idx && filteredOptions.length > 0;
var listBoxId = isExpanded ? "components-autocomplete-listbox-".concat(instanceId) : null;
var activeId = isExpanded ? "components-autocomplete-item-".concat(instanceId, "-").concat(selectedKey) : null; // Disable reason: Clicking the editor should reset the autocomplete when the menu is suppressed
/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/onclick-has-role, jsx-a11y/click-events-have-key-events */
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])("div", {
ref: this.bindNode,
onClick: this.resetWhenSuppressed,
className: "components-autocomplete"
}, children({
isExpanded: isExpanded,
listBoxId: listBoxId,
activeId: activeId
}), isExpanded && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])(_popover__WEBPACK_IMPORTED_MODULE_19__["default"], {
focusOnMount: false,
onClose: this.reset,
position: "top right",
className: "components-autocomplete__popover",
getAnchorRect: getCaretRect
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])("div", {
id: listBoxId,
role: "listbox",
className: "components-autocomplete__results"
}, isExpanded && Object(lodash__WEBPACK_IMPORTED_MODULE_11__["map"])(filteredOptions, function (option, index) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])(_button__WEBPACK_IMPORTED_MODULE_18__["default"], {
key: option.key,
id: "components-autocomplete-item-".concat(instanceId, "-").concat(option.key),
role: "option",
"aria-selected": index === selectedIndex,
disabled: option.isDisabled,
className: classnames__WEBPACK_IMPORTED_MODULE_10___default()('components-autocomplete__result', className, {
'is-selected': index === selectedIndex
}),
onClick: function onClick() {
return _this3.select(option);
}
}, option.label);
}))));
/* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/onclick-has-role, jsx-a11y/click-events-have-key-events */
}
}]);
return Autocomplete;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["Component"]);
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_14__["compose"])([_higher_order_with_spoken_messages__WEBPACK_IMPORTED_MODULE_20__["default"], _wordpress_compose__WEBPACK_IMPORTED_MODULE_14__["withInstanceId"], _higher_order_with_focus_outside__WEBPACK_IMPORTED_MODULE_17__["default"]])(Autocomplete));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/base-control/index.js":
/*!*******************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/base-control/index.js ***!
\*******************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
/**
* External dependencies
*/
function BaseControl(_ref) {
var id = _ref.id,
label = _ref.label,
help = _ref.help,
className = _ref.className,
children = _ref.children;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('components-base-control', className)
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
className: "components-base-control__field"
}, label && id && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("label", {
className: "components-base-control__label",
htmlFor: id
}, label), label && !id && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", {
className: "components-base-control__label"
}, label), children), !!help && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("p", {
id: id + '__help',
className: "components-base-control__help"
}, help));
}
/* harmony default export */ __webpack_exports__["default"] = (BaseControl);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/button-group/index.js":
/*!*******************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/button-group/index.js ***!
\*******************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
/**
* External dependencies
*/
function ButtonGroup(_ref) {
var className = _ref.className,
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["className"]);
var classes = classnames__WEBPACK_IMPORTED_MODULE_3___default()('components-button-group', className);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
className: classes,
role: "group"
}));
}
/* harmony default export */ __webpack_exports__["default"] = (ButtonGroup);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/button/index.js":
/*!*************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/button/index.js ***!
\*************************************************************************/
/*! exports provided: Button, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Button", function() { return Button; });
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
function Button(props, ref) {
var href = props.href,
target = props.target,
isPrimary = props.isPrimary,
isLarge = props.isLarge,
isSmall = props.isSmall,
isToggled = props.isToggled,
isBusy = props.isBusy,
isDefault = props.isDefault,
isLink = props.isLink,
isDestructive = props.isDestructive,
className = props.className,
disabled = props.disabled,
additionalProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(props, ["href", "target", "isPrimary", "isLarge", "isSmall", "isToggled", "isBusy", "isDefault", "isLink", "isDestructive", "className", "disabled"]);
var classes = classnames__WEBPACK_IMPORTED_MODULE_2___default()('components-button', className, {
'is-button': isDefault || isPrimary || isLarge || isSmall,
'is-default': isDefault || isLarge || isSmall,
'is-primary': isPrimary,
'is-large': isLarge,
'is-small': isSmall,
'is-toggled': isToggled,
'is-busy': isBusy,
'is-link': isLink,
'is-destructive': isDestructive
});
var tag = href !== undefined && !disabled ? 'a' : 'button';
var tagProps = tag === 'a' ? {
href: href,
target: target
} : {
type: 'button',
disabled: disabled
};
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(tag, Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, tagProps, additionalProps, {
className: classes,
ref: ref
}));
}
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["forwardRef"])(Button));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/checkbox-control/index.js":
/*!***********************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/checkbox-control/index.js ***!
\***********************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _base_control__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../base-control */ "./node_modules/@wordpress/components/build-module/base-control/index.js");
/**
* External dependencies
*/
/**
* Internal dependencies
*/
function CheckboxControl(_ref) {
var label = _ref.label,
className = _ref.className,
heading = _ref.heading,
checked = _ref.checked,
help = _ref.help,
instanceId = _ref.instanceId,
onChange = _ref.onChange,
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["label", "className", "heading", "checked", "help", "instanceId", "onChange"]);
var id = "inspector-checkbox-control-".concat(instanceId);
var onChangeValue = function onChangeValue(event) {
return onChange(event.target.checked);
};
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_base_control__WEBPACK_IMPORTED_MODULE_4__["default"], {
label: heading,
id: id,
help: help,
className: className
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("input", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
id: id,
className: "components-checkbox-control__input",
type: "checkbox",
value: "1",
onChange: onChangeValue,
checked: checked,
"aria-describedby": !!help ? id + '__help' : undefined
}, props)), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("label", {
className: "components-checkbox-control__label",
htmlFor: id
}, label));
}
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__["withInstanceId"])(CheckboxControl));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/clipboard-button/index.js":
/*!***********************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/clipboard-button/index.js ***!
\***********************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var clipboard__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! clipboard */ "./node_modules/clipboard/lib/clipboard.js");
/* harmony import */ var clipboard__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(clipboard__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var _icon_button__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../icon-button */ "./node_modules/@wordpress/components/build-module/icon-button/index.js");
/* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../button */ "./node_modules/@wordpress/components/build-module/button/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var ClipboardButton =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(ClipboardButton, _Component);
function ClipboardButton() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, ClipboardButton);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(ClipboardButton).apply(this, arguments));
_this.bindContainer = _this.bindContainer.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.onCopy = _this.onCopy.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.getText = _this.getText.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(ClipboardButton, [{
key: "componentDidMount",
value: function componentDidMount() {
var container = this.container,
getText = this.getText,
onCopy = this.onCopy;
var button = container.firstChild;
this.clipboard = new clipboard__WEBPACK_IMPORTED_MODULE_9___default.a(button, {
text: getText,
container: container
});
this.clipboard.on('success', onCopy);
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.clipboard.destroy();
delete this.clipboard;
clearTimeout(this.onCopyTimeout);
}
}, {
key: "bindContainer",
value: function bindContainer(container) {
this.container = container;
}
}, {
key: "onCopy",
value: function onCopy(args) {
// Clearing selection will move focus back to the triggering button,
// ensuring that it is not reset to the body, and further that it is
// kept within the rendered node.
args.clearSelection();
var _this$props = this.props,
onCopy = _this$props.onCopy,
onFinishCopy = _this$props.onFinishCopy;
if (onCopy) {
onCopy(); // For convenience and consistency, ClipboardButton offers to call
// a secondary callback with delay. This is useful to reset
// consumers' state, e.g. to revert a label from "Copied" to
// "Copy".
if (onFinishCopy) {
clearTimeout(this.onCopyTimeout);
this.onCopyTimeout = setTimeout(onFinishCopy, 4000);
}
}
}
}, {
key: "getText",
value: function getText() {
var text = this.props.text;
if ('function' === typeof text) {
text = text();
}
return text;
}
}, {
key: "render",
value: function render() {
// Disable reason: Exclude from spread props passed to Button
// eslint-disable-next-line no-unused-vars
var _this$props2 = this.props,
className = _this$props2.className,
children = _this$props2.children,
onCopy = _this$props2.onCopy,
onFinishCopy = _this$props2.onFinishCopy,
text = _this$props2.text,
buttonProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props2, ["className", "children", "onCopy", "onFinishCopy", "text"]);
var icon = buttonProps.icon;
var classes = classnames__WEBPACK_IMPORTED_MODULE_10___default()('components-clipboard-button', className);
var ComponentToUse = icon ? _icon_button__WEBPACK_IMPORTED_MODULE_11__["default"] : _button__WEBPACK_IMPORTED_MODULE_12__["default"]; // Workaround for inconsistent behavior in Safari, where <textarea> is not
// the document.activeElement at the moment when the copy event fires.
// This causes documentHasSelection() in the copy-handler component to
// mistakenly override the ClipboardButton, and copy a serialized string
// of the current block instead.
var focusOnCopyEventTarget = function focusOnCopyEventTarget(event) {
event.target.focus();
};
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("span", {
ref: this.bindContainer,
onCopy: focusOnCopyEventTarget
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(ComponentToUse, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, buttonProps, {
className: classes
}), children));
}
}]);
return ClipboardButton;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]);
/* harmony default export */ __webpack_exports__["default"] = (ClipboardButton);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/color-indicator/index.js":
/*!**********************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/color-indicator/index.js ***!
\**********************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
/**
* External dependencies
*/
var ColorIndicator = function ColorIndicator(_ref) {
var className = _ref.className,
colorValue = _ref.colorValue,
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["className", "colorValue"]);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("span", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
className: classnames__WEBPACK_IMPORTED_MODULE_3___default()('component-color-indicator', className),
style: {
background: colorValue
}
}, props));
};
/* harmony default export */ __webpack_exports__["default"] = (ColorIndicator);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/color-palette/index.js":
/*!********************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/color-palette/index.js ***!
\********************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ColorPalette; });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_color__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-color */ "./node_modules/react-color/lib/index.js");
/* harmony import */ var react_color__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_color__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../button */ "./node_modules/@wordpress/components/build-module/button/index.js");
/* harmony import */ var _dropdown__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../dropdown */ "./node_modules/@wordpress/components/build-module/dropdown/index.js");
/* harmony import */ var _tooltip__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../tooltip */ "./node_modules/@wordpress/components/build-module/tooltip/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function ColorPalette(_ref) {
var colors = _ref.colors,
_ref$disableCustomCol = _ref.disableCustomColors,
disableCustomColors = _ref$disableCustomCol === void 0 ? false : _ref$disableCustomCol,
value = _ref.value,
onChange = _ref.onChange,
className = _ref.className;
function applyOrUnset(color) {
return function () {
return onChange(value === color ? undefined : color);
};
}
var customColorPickerLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Custom color picker');
var classes = classnames__WEBPACK_IMPORTED_MODULE_1___default()('components-color-palette', className);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
className: classes
}, Object(lodash__WEBPACK_IMPORTED_MODULE_3__["map"])(colors, function (_ref2) {
var color = _ref2.color,
name = _ref2.name;
var style = {
color: color
};
var itemClasses = classnames__WEBPACK_IMPORTED_MODULE_1___default()('components-color-palette__item', {
'is-active': value === color
});
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
key: color,
className: "components-color-palette__item-wrapper"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_tooltip__WEBPACK_IMPORTED_MODULE_7__["default"], {
text: name || // translators: %s: color hex code e.g: "#f00".
Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Color code: %s'), color)
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("button", {
type: "button",
className: itemClasses,
style: style,
onClick: applyOrUnset(color),
"aria-label": name ? // translators: %s: The name of the color e.g: "vivid red".
Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Color: %s'), name) : // translators: %s: color hex code e.g: "#f00".
Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Color code: %s'), color),
"aria-pressed": value === color
})));
}), !disableCustomColors && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_dropdown__WEBPACK_IMPORTED_MODULE_6__["default"], {
className: "components-color-palette__item-wrapper components-color-palette__custom-color",
contentClassName: "components-color-palette__picker",
renderToggle: function renderToggle(_ref3) {
var isOpen = _ref3.isOpen,
onToggle = _ref3.onToggle;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_tooltip__WEBPACK_IMPORTED_MODULE_7__["default"], {
text: customColorPickerLabel
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("button", {
type: "button",
"aria-expanded": isOpen,
className: "components-color-palette__item",
onClick: onToggle,
"aria-label": customColorPickerLabel
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", {
className: "components-color-palette__custom-color-gradient"
})));
},
renderContent: function renderContent() {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(react_color__WEBPACK_IMPORTED_MODULE_2__["ChromePicker"], {
color: value,
onChangeComplete: function onChangeComplete(color) {
return onChange(color.hex);
},
disableAlpha: true
});
}
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_button__WEBPACK_IMPORTED_MODULE_5__["default"], {
className: "components-color-palette__clear",
type: "button",
onClick: function onClick() {
return onChange(undefined);
},
isSmall: true,
isDefault: true
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Clear')));
}
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/dashicon/index.js":
/*!***************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/dashicon/index.js ***!
\***************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Dashicon; });
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _primitives__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../primitives */ "./node_modules/@wordpress/components/build-module/primitives/index.js");
/* !!!
IF YOU ARE EDITING dashicon/index.jsx
THEN YOU ARE EDITING A FILE THAT GETS OUTPUT FROM THE DASHICONS REPO!
DO NOT EDIT THAT FILE! EDIT index-header.jsx and index-footer.jsx instead
OR if you're looking to change now SVGs get output, you'll need to edit strings in the Gruntfile :)
!!! */
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var Dashicon =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(Dashicon, _Component);
function Dashicon() {
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, Dashicon);
return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(Dashicon).apply(this, arguments));
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(Dashicon, [{
key: "shouldComponentUpdate",
value: function shouldComponentUpdate(nextProps) {
return this.props.icon !== nextProps.icon || this.props.size !== nextProps.size || this.props.className !== nextProps.className;
}
}, {
key: "render",
value: function render() {
var _this$props = this.props,
icon = _this$props.icon,
className = _this$props.className,
_this$props$size = _this$props.size,
size = _this$props$size === void 0 ? 20 : _this$props$size;
var path;
switch (icon) {
case 'admin-appearance':
path = 'M14.48 11.06L7.41 3.99l1.5-1.5c.5-.56 2.3-.47 3.51.32 1.21.8 1.43 1.28 2.91 2.1 1.18.64 2.45 1.26 4.45.85zm-.71.71L6.7 4.7 4.93 6.47c-.39.39-.39 1.02 0 1.41l1.06 1.06c.39.39.39 1.03 0 1.42-.6.6-1.43 1.11-2.21 1.69-.35.26-.7.53-1.01.84C1.43 14.23.4 16.08 1.4 17.07c.99 1 2.84-.03 4.18-1.36.31-.31.58-.66.85-1.02.57-.78 1.08-1.61 1.69-2.21.39-.39 1.02-.39 1.41 0l1.06 1.06c.39.39 1.02.39 1.41 0z';
break;
case 'admin-collapse':
path = 'M10 2.16c4.33 0 7.84 3.51 7.84 7.84s-3.51 7.84-7.84 7.84S2.16 14.33 2.16 10 5.71 2.16 10 2.16zm2 11.72V6.12L6.18 9.97z';
break;
case 'admin-comments':
path = 'M5 2h9c1.1 0 2 .9 2 2v7c0 1.1-.9 2-2 2h-2l-5 5v-5H5c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2z';
break;
case 'admin-customizer':
path = 'M18.33 3.57s.27-.8-.31-1.36c-.53-.52-1.22-.24-1.22-.24-.61.3-5.76 3.47-7.67 5.57-.86.96-2.06 3.79-1.09 4.82.92.98 3.96-.17 4.79-1 2.06-2.06 5.21-7.17 5.5-7.79zM1.4 17.65c2.37-1.56 1.46-3.41 3.23-4.64.93-.65 2.22-.62 3.08.29.63.67.8 2.57-.16 3.46-1.57 1.45-4 1.55-6.15.89z';
break;
case 'admin-generic':
path = 'M18 12h-2.18c-.17.7-.44 1.35-.81 1.93l1.54 1.54-2.1 2.1-1.54-1.54c-.58.36-1.23.63-1.91.79V19H8v-2.18c-.68-.16-1.33-.43-1.91-.79l-1.54 1.54-2.12-2.12 1.54-1.54c-.36-.58-.63-1.23-.79-1.91H1V9.03h2.17c.16-.7.44-1.35.8-1.94L2.43 5.55l2.1-2.1 1.54 1.54c.58-.37 1.24-.64 1.93-.81V2h3v2.18c.68.16 1.33.43 1.91.79l1.54-1.54 2.12 2.12-1.54 1.54c.36.59.64 1.24.8 1.94H18V12zm-8.5 1.5c1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3 1.34 3 3 3z';
break;
case 'admin-home':
path = 'M16 8.5l1.53 1.53-1.06 1.06L10 4.62l-6.47 6.47-1.06-1.06L10 2.5l4 4v-2h2v4zm-6-2.46l6 5.99V18H4v-5.97zM12 17v-5H8v5h4z';
break;
case 'admin-links':
path = 'M17.74 2.76c1.68 1.69 1.68 4.41 0 6.1l-1.53 1.52c-1.12 1.12-2.7 1.47-4.14 1.09l2.62-2.61.76-.77.76-.76c.84-.84.84-2.2 0-3.04-.84-.85-2.2-.85-3.04 0l-.77.76-3.38 3.38c-.37-1.44-.02-3.02 1.1-4.14l1.52-1.53c1.69-1.68 4.42-1.68 6.1 0zM8.59 13.43l5.34-5.34c.42-.42.42-1.1 0-1.52-.44-.43-1.13-.39-1.53 0l-5.33 5.34c-.42.42-.42 1.1 0 1.52.44.43 1.13.39 1.52 0zm-.76 2.29l4.14-4.15c.38 1.44.03 3.02-1.09 4.14l-1.52 1.53c-1.69 1.68-4.41 1.68-6.1 0-1.68-1.68-1.68-4.42 0-6.1l1.53-1.52c1.12-1.12 2.7-1.47 4.14-1.1l-4.14 4.15c-.85.84-.85 2.2 0 3.05.84.84 2.2.84 3.04 0z';
break;
case 'admin-media':
path = 'M13 11V4c0-.55-.45-1-1-1h-1.67L9 1H5L3.67 3H2c-.55 0-1 .45-1 1v7c0 .55.45 1 1 1h10c.55 0 1-.45 1-1zM7 4.5c1.38 0 2.5 1.12 2.5 2.5S8.38 9.5 7 9.5 4.5 8.38 4.5 7 5.62 4.5 7 4.5zM14 6h5v10.5c0 1.38-1.12 2.5-2.5 2.5S14 17.88 14 16.5s1.12-2.5 2.5-2.5c.17 0 .34.02.5.05V9h-3V6zm-4 8.05V13h2v3.5c0 1.38-1.12 2.5-2.5 2.5S7 17.88 7 16.5 8.12 14 9.5 14c.17 0 .34.02.5.05z';
break;
case 'admin-multisite':
path = 'M14.27 6.87L10 3.14 5.73 6.87 5 6.14l5-4.38 5 4.38zM14 8.42l-4.05 3.43L6 8.38v-.74l4-3.5 4 3.5v.78zM11 9.7V8H9v1.7h2zm-1.73 4.03L5 10 .73 13.73 0 13l5-4.38L10 13zm10 0L15 10l-4.27 3.73L10 13l5-4.38L20 13zM5 11l4 3.5V18H1v-3.5zm10 0l4 3.5V18h-8v-3.5zm-9 6v-2H4v2h2zm10 0v-2h-2v2h2z';
break;
case 'admin-network':
path = 'M16.95 2.58c1.96 1.95 1.96 5.12 0 7.07-1.51 1.51-3.75 1.84-5.59 1.01l-1.87 3.31-2.99.31L5 18H2l-1-2 7.95-7.69c-.92-1.87-.62-4.18.93-5.73 1.95-1.96 5.12-1.96 7.07 0zm-2.51 3.79c.74 0 1.33-.6 1.33-1.34 0-.73-.59-1.33-1.33-1.33-.73 0-1.33.6-1.33 1.33 0 .74.6 1.34 1.33 1.34z';
break;
case 'admin-page':
path = 'M6 15V2h10v13H6zm-1 1h8v2H3V5h2v11z';
break;
case 'admin-plugins':
path = 'M13.11 4.36L9.87 7.6 8 5.73l3.24-3.24c.35-.34 1.05-.2 1.56.32.52.51.66 1.21.31 1.55zm-8 1.77l.91-1.12 9.01 9.01-1.19.84c-.71.71-2.63 1.16-3.82 1.16H6.14L4.9 17.26c-.59.59-1.54.59-2.12 0-.59-.58-.59-1.53 0-2.12l1.24-1.24v-3.88c0-1.13.4-3.19 1.09-3.89zm7.26 3.97l3.24-3.24c.34-.35 1.04-.21 1.55.31.52.51.66 1.21.31 1.55l-3.24 3.25z';
break;
case 'admin-post':
path = 'M10.44 3.02l1.82-1.82 6.36 6.35-1.83 1.82c-1.05-.68-2.48-.57-3.41.36l-.75.75c-.92.93-1.04 2.35-.35 3.41l-1.83 1.82-2.41-2.41-2.8 2.79c-.42.42-3.38 2.71-3.8 2.29s1.86-3.39 2.28-3.81l2.79-2.79L4.1 9.36l1.83-1.82c1.05.69 2.48.57 3.4-.36l.75-.75c.93-.92 1.05-2.35.36-3.41z';
break;
case 'admin-settings':
path = 'M18 16V4c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h13c.55 0 1-.45 1-1zM8 11h1c.55 0 1 .45 1 1s-.45 1-1 1H8v1.5c0 .28-.22.5-.5.5s-.5-.22-.5-.5V13H6c-.55 0-1-.45-1-1s.45-1 1-1h1V5.5c0-.28.22-.5.5-.5s.5.22.5.5V11zm5-2h-1c-.55 0-1-.45-1-1s.45-1 1-1h1V5.5c0-.28.22-.5.5-.5s.5.22.5.5V7h1c.55 0 1 .45 1 1s-.45 1-1 1h-1v5.5c0 .28-.22.5-.5.5s-.5-.22-.5-.5V9z';
break;
case 'admin-site-alt':
path = 'M9 0C4.03 0 0 4.03 0 9s4.03 9 9 9 9-4.03 9-9-4.03-9-9-9zm7.5 6.48c-.274.896-.908 1.64-1.75 2.05-.45-1.69-1.658-3.074-3.27-3.75.13-.444.41-.83.79-1.09-.43-.28-1-.42-1.34.07-.53.69 0 1.61.21 2v.14c-.555-.337-.99-.84-1.24-1.44-.966-.03-1.922.208-2.76.69-.087-.565-.032-1.142.16-1.68.733.07 1.453-.23 1.92-.8.46-.52-.13-1.18-.59-1.58h.36c1.36-.01 2.702.335 3.89 1 1.36 1.005 2.194 2.57 2.27 4.26.24 0 .7-.55.91-.92.172.34.32.69.44 1.05zM9 16.84c-2.05-2.08.25-3.75-1-5.24-.92-.85-2.29-.26-3.11-1.23-.282-1.473.267-2.982 1.43-3.93.52-.44 4-1 5.42.22.83.715 1.415 1.674 1.67 2.74.46.035.918-.066 1.32-.29.41 2.98-3.15 6.74-5.73 7.73zM5.15 2.09c.786-.3 1.676-.028 2.16.66-.42.38-.94.63-1.5.72.02-.294.085-.584.19-.86l-.85-.52z';
break;
case 'admin-site-alt2':
path = 'M9 0C4.03 0 0 4.03 0 9s4.03 9 9 9 9-4.03 9-9-4.03-9-9-9zm2.92 12.34c0 .35.14.63.36.66.22.03.47-.22.58-.6l.2.08c.718.384 1.07 1.22.84 2-.15.69-.743 1.198-1.45 1.24-.49-1.21-2.11.06-3.56-.22-.612-.154-1.11-.6-1.33-1.19 1.19-.11 2.85-1.73 4.36-1.97zM8 11.27c.918 0 1.695-.68 1.82-1.59.44.54.41 1.324-.07 1.83-.255.223-.594.325-.93.28-.335-.047-.635-.236-.82-.52zm3-.76c.41.39 3-.06 3.52 1.09-.95-.2-2.95.61-3.47-1.08l-.05-.01zM9.73 5.45v.27c-.65-.77-1.33-1.07-1.61-.57-.28.5 1 1.11.76 1.88-.24.77-1.27.56-1.88 1.61-.61 1.05-.49 2.42 1.24 3.67-1.192-.132-2.19-.962-2.54-2.11-.4-1.2-.09-2.26-.78-2.46C4 7.46 3 8.71 3 9.8c-1.26-1.26.05-2.86-1.2-4.18C3.5 1.998 7.644.223 11.44 1.49c-1.1 1.02-1.722 2.458-1.71 3.96z';
break;
case 'admin-site-alt3':
path = 'M9 0C4.03 0 0 4.03 0 9s4.03 9 9 9 9-4.03 9-9-4.03-9-9-9zM1.11 9.68h2.51c.04.91.167 1.814.38 2.7H1.84c-.403-.85-.65-1.764-.73-2.7zm8.57-5.4V1.19c.964.366 1.756 1.08 2.22 2 .205.347.386.708.54 1.08l-2.76.01zm3.22 1.35c.232.883.37 1.788.41 2.7H9.68v-2.7h3.22zM8.32 1.19v3.09H5.56c.154-.372.335-.733.54-1.08.462-.924 1.255-1.64 2.22-2.01zm0 4.44v2.7H4.7c.04-.912.178-1.817.41-2.7h3.21zm-4.7 2.69H1.11c.08-.936.327-1.85.73-2.7H4c-.213.886-.34 1.79-.38 2.7zM4.7 9.68h3.62v2.7H5.11c-.232-.883-.37-1.788-.41-2.7zm3.63 4v3.09c-.964-.366-1.756-1.08-2.22-2-.205-.347-.386-.708-.54-1.08l2.76-.01zm1.35 3.09v-3.04h2.76c-.154.372-.335.733-.54 1.08-.464.92-1.256 1.634-2.22 2v-.04zm0-4.44v-2.7h3.62c-.04.912-.178 1.817-.41 2.7H9.68zm4.71-2.7h2.51c-.08.936-.327 1.85-.73 2.7H14c.21-.87.337-1.757.38-2.65l.01-.05zm0-1.35c-.046-.894-.176-1.78-.39-2.65h2.16c.403.85.65 1.764.73 2.7l-2.5-.05zm1-4H13.6c-.324-.91-.793-1.76-1.39-2.52 1.244.56 2.325 1.426 3.14 2.52h.04zm-9.6-2.52c-.597.76-1.066 1.61-1.39 2.52H2.65c.815-1.094 1.896-1.96 3.14-2.52zm-3.15 12H4.4c.324.91.793 1.76 1.39 2.52-1.248-.567-2.33-1.445-3.14-2.55l-.01.03zm9.56 2.52c.597-.76 1.066-1.61 1.39-2.52h1.76c-.82 1.08-1.9 1.933-3.14 2.48l-.01.04z';
break;
case 'admin-site':
path = 'M9 0C4.03 0 0 4.03 0 9s4.03 9 9 9 9-4.03 9-9-4.03-9-9-9zm3.46 11.95c0 1.47-.8 3.3-4.06 4.7.3-4.17-2.52-3.69-3.2-5 .126-1.1.804-2.063 1.8-2.55-1.552-.266-3-.96-4.18-2 .05.47.28.904.64 1.21-.782-.295-1.458-.817-1.94-1.5.977-3.225 3.883-5.482 7.25-5.63-.84 1.38-1.5 4.13 0 5.57C7.23 7 6.26 5 5.41 5.79c-1.13 1.06.33 2.51 3.42 3.08 3.29.59 3.66 1.58 3.63 3.08zm1.34-4c-.32-1.11.62-2.23 1.69-3.14 1.356 1.955 1.67 4.45.84 6.68-.77-1.89-2.17-2.32-2.53-3.57v.03z';
break;
case 'admin-tools':
path = 'M16.68 9.77c-1.34 1.34-3.3 1.67-4.95.99l-5.41 6.52c-.99.99-2.59.99-3.58 0s-.99-2.59 0-3.57l6.52-5.42c-.68-1.65-.35-3.61.99-4.95 1.28-1.28 3.12-1.62 4.72-1.06l-2.89 2.89 2.82 2.82 2.86-2.87c.53 1.58.18 3.39-1.08 4.65zM3.81 16.21c.4.39 1.04.39 1.43 0 .4-.4.4-1.04 0-1.43-.39-.4-1.03-.4-1.43 0-.39.39-.39 1.03 0 1.43z';
break;
case 'admin-users':
path = 'M10 9.25c-2.27 0-2.73-3.44-2.73-3.44C7 4.02 7.82 2 9.97 2c2.16 0 2.98 2.02 2.71 3.81 0 0-.41 3.44-2.68 3.44zm0 2.57L12.72 10c2.39 0 4.52 2.33 4.52 4.53v2.49s-3.65 1.13-7.24 1.13c-3.65 0-7.24-1.13-7.24-1.13v-2.49c0-2.25 1.94-4.48 4.47-4.48z';
break;
case 'album':
path = 'M0 18h10v-.26c1.52.4 3.17.35 4.76-.24 4.14-1.52 6.27-6.12 4.75-10.26-1.43-3.89-5.58-6-9.51-4.98V2H0v16zM9 3v14H1V3h8zm5.45 8.22c-.68 1.35-2.32 1.9-3.67 1.23-.31-.15-.57-.35-.78-.59V8.13c.8-.86 2.11-1.13 3.22-.58 1.35.68 1.9 2.32 1.23 3.67zm-2.75-.82c.22.16.53.12.7-.1.16-.22.12-.53-.1-.7s-.53-.12-.7.1c-.16.21-.12.53.1.7zm3.01 3.67c-1.17.78-2.56.99-3.83.69-.27-.06-.44-.34-.37-.61s.34-.43.62-.36l.17.04c.96.17 1.98-.01 2.86-.59.47-.32.86-.72 1.14-1.18.15-.23.45-.3.69-.16.23.15.3.46.16.69-.36.57-.84 1.08-1.44 1.48zm1.05 1.57c-1.48.99-3.21 1.32-4.84 1.06-.28-.05-.47-.32-.41-.6.05-.27.32-.45.61-.39l.22.04c1.31.15 2.68-.14 3.87-.94.71-.47 1.27-1.07 1.7-1.74.14-.24.45-.31.68-.16.24.14.31.45.16.69-.49.79-1.16 1.49-1.99 2.04z';
break;
case 'align-center':
path = 'M3 5h14V3H3v2zm12 8V7H5v6h10zM3 17h14v-2H3v2z';
break;
case 'align-full-width':
path = 'M17 13V3H3v10h14zM5 17h10v-2H5v2z';
break;
case 'align-left':
path = 'M3 5h14V3H3v2zm9 8V7H3v6h9zm2-4h3V7h-3v2zm0 4h3v-2h-3v2zM3 17h14v-2H3v2z';
break;
case 'align-none':
path = 'M3 5h14V3H3v2zm10 8V7H3v6h10zM3 17h14v-2H3v2z';
break;
case 'align-pull-left':
path = 'M9 16V4H3v12h6zm2-7h6V7h-6v2zm0 4h6v-2h-6v2z';
break;
case 'align-pull-right':
path = 'M17 16V4h-6v12h6zM9 7H3v2h6V7zm0 4H3v2h6v-2z';
break;
case 'align-right':
path = 'M3 5h14V3H3v2zm0 4h3V7H3v2zm14 4V7H8v6h9zM3 13h3v-2H3v2zm0 4h14v-2H3v2z';
break;
case 'align-wide':
path = 'M5 5h10V3H5v2zm12 8V7H3v6h14zM5 17h10v-2H5v2z';
break;
case 'analytics':
path = 'M18 18V2H2v16h16zM16 5H4V4h12v1zM7 7v3h3c0 1.66-1.34 3-3 3s-3-1.34-3-3 1.34-3 3-3zm1 2V7c1.1 0 2 .9 2 2H8zm8-1h-4V7h4v1zm0 3h-4V9h4v2zm0 2h-4v-1h4v1zm0 3H4v-1h12v1z';
break;
case 'archive':
path = 'M19 4v2H1V4h18zM2 7h16v10H2V7zm11 3V9H7v1h6z';
break;
case 'arrow-down-alt':
path = 'M9 2h2v12l4-4 2 1-7 7-7-7 2-1 4 4V2z';
break;
case 'arrow-down-alt2':
path = 'M5 6l5 5 5-5 2 1-7 7-7-7z';
break;
case 'arrow-down':
path = 'M15 8l-4.03 6L7 8h8z';
break;
case 'arrow-left-alt':
path = 'M18 9v2H6l4 4-1 2-7-7 7-7 1 2-4 4h12z';
break;
case 'arrow-left-alt2':
path = 'M14 5l-5 5 5 5-1 2-7-7 7-7z';
break;
case 'arrow-left':
path = 'M13 14L7 9.97 13 6v8z';
break;
case 'arrow-right-alt':
path = 'M2 11V9h12l-4-4 1-2 7 7-7 7-1-2 4-4H2z';
break;
case 'arrow-right-alt2':
path = 'M6 15l5-5-5-5 1-2 7 7-7 7z';
break;
case 'arrow-right':
path = 'M8 6l6 4.03L8 14V6z';
break;
case 'arrow-up-alt':
path = 'M11 18H9V6l-4 4-2-1 7-7 7 7-2 1-4-4v12z';
break;
case 'arrow-up-alt2':
path = 'M15 14l-5-5-5 5-2-1 7-7 7 7z';
break;
case 'arrow-up':
path = 'M7 13l4.03-6L15 13H7z';
break;
case 'art':
path = 'M8.55 3.06c1.01.34-1.95 2.01-.1 3.13 1.04.63 3.31-2.22 4.45-2.86.97-.54 2.67-.65 3.53 1.23 1.09 2.38.14 8.57-3.79 11.06-3.97 2.5-8.97 1.23-10.7-2.66-2.01-4.53 3.12-11.09 6.61-9.9zm1.21 6.45c.73 1.64 4.7-.5 3.79-2.8-.59-1.49-4.48 1.25-3.79 2.8z';
break;
case 'awards':
path = 'M4.46 5.16L5 7.46l-.54 2.29 2.01 1.24L7.7 13l2.3-.54 2.3.54 1.23-2.01 2.01-1.24L15 7.46l.54-2.3-2-1.24-1.24-2.01-2.3.55-2.29-.54-1.25 2zm5.55 6.34C7.79 11.5 6 9.71 6 7.49c0-2.2 1.79-3.99 4.01-3.99 2.2 0 3.99 1.79 3.99 3.99 0 2.22-1.79 4.01-3.99 4.01zm-.02-1C8.33 10.5 7 9.16 7 7.5c0-1.65 1.33-3 2.99-3S13 5.85 13 7.5c0 1.66-1.35 3-3.01 3zm3.84 1.1l-1.28 2.24-2.08-.47L13 19.2l1.4-2.2h2.5zm-7.7.07l1.25 2.25 2.13-.51L7 19.2 5.6 17H3.1z';
break;
case 'backup':
path = 'M13.65 2.88c3.93 2.01 5.48 6.84 3.47 10.77s-6.83 5.48-10.77 3.47c-1.87-.96-3.2-2.56-3.86-4.4l1.64-1.03c.45 1.57 1.52 2.95 3.08 3.76 3.01 1.54 6.69.35 8.23-2.66 1.55-3.01.36-6.69-2.65-8.24C9.78 3.01 6.1 4.2 4.56 7.21l1.88.97-4.95 3.08-.39-5.82 1.78.91C4.9 2.4 9.75.89 13.65 2.88zm-4.36 7.83C9.11 10.53 9 10.28 9 10c0-.07.03-.12.04-.19h-.01L10 5l.97 4.81L14 13l-4.5-2.12.02-.02c-.08-.04-.16-.09-.23-.15z';
break;
case 'block-default':
path = 'M15 6V4h-3v2H8V4H5v2H4c-.6 0-1 .4-1 1v8h14V7c0-.6-.4-1-1-1h-1z';
break;
case 'book-alt':
path = 'M5 17h13v2H5c-1.66 0-3-1.34-3-3V4c0-1.66 1.34-3 3-3h13v14H5c-.55 0-1 .45-1 1s.45 1 1 1zm2-3.5v-11c0-.28-.22-.5-.5-.5s-.5.22-.5.5v11c0 .28.22.5.5.5s.5-.22.5-.5z';
break;
case 'book':
path = 'M16 3h2v16H5c-1.66 0-3-1.34-3-3V4c0-1.66 1.34-3 3-3h9v14H5c-.55 0-1 .45-1 1s.45 1 1 1h11V3z';
break;
case 'buddicons-activity':
path = 'M8 1v7h2V6c0-1.52 1.45-3 3-3v.86c.55-.52 1.26-.86 2-.86v3h1c1.1 0 2 .9 2 2s-.9 2-2 2h-1v6c0 .55-.45 1-1 1s-1-.45-1-1v-2.18c-.31.11-.65.18-1 .18v2c0 .55-.45 1-1 1s-1-.45-1-1v-2H8v2c0 .55-.45 1-1 1s-1-.45-1-1v-2c-.35 0-.69-.07-1-.18V16c0 .55-.45 1-1 1s-1-.45-1-1v-4H2v-1c0-1.66 1.34-3 3-3h2V1h1zm5 7c.55 0 1-.45 1-1s-.45-1-1-1-1 .45-1 1 .45 1 1 1z';
break;
case 'buddicons-bbpress-logo':
path = 'M8.5 12.6c.3-1.3 0-2.3-1.1-2.3-.8 0-1.6.6-1.8 1.5l-.3 1.7c-.3 1 .3 1.5 1 1.5 1.2 0 1.9-1.1 2.2-2.4zm-4-6.4C3.7 7.3 3.3 8.6 3.3 10c0 1 .2 1.9.6 2.8l1-4.6c.3-1.7.4-2-.4-2zm9.3 6.4c.3-1.3 0-2.3-1.1-2.3-.8 0-1.6.6-1.8 1.5l-.4 1.7c-.2 1.1.4 1.6 1.1 1.6 1.1-.1 1.9-1.2 2.2-2.5zM10 3.3c-2 0-3.9.9-5.1 2.3.6-.1 1.4-.2 1.8-.3.2 0 .2.1.2.2 0 .2-1 4.8-1 4.8.5-.3 1.2-.7 1.8-.7.9 0 1.5.4 1.9.9l.5-2.4c.4-1.6.4-1.9-.4-1.9-.4 0-.4-.5 0-.6.6-.1 1.8-.2 2.3-.3.2 0 .2.1.2.2l-1 4.8c.5-.4 1.2-.7 1.9-.7 1.7 0 2.5 1.3 2.1 3-.3 1.7-2 3-3.8 3-1.3 0-2.1-.7-2.3-1.4-.7.8-1.7 1.3-2.8 1.4 1.1.7 2.4 1.1 3.7 1.1 3.7 0 6.7-3 6.7-6.7s-3-6.7-6.7-6.7zM10 2c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 15.5c-2.1 0-4-.8-5.3-2.2-.3-.4-.7-.8-1-1.2-.7-1.2-1.2-2.6-1.2-4.1 0-4.1 3.4-7.5 7.5-7.5s7.5 3.4 7.5 7.5-3.4 7.5-7.5 7.5z';
break;
case 'buddicons-buddypress-logo':
path = 'M10 0c5.52 0 10 4.48 10 10s-4.48 10-10 10S0 15.52 0 10 4.48 0 10 0zm0 .5C4.75.5.5 4.75.5 10s4.25 9.5 9.5 9.5 9.5-4.25 9.5-9.5S15.25.5 10 .5zm0 1c4.7 0 8.5 3.8 8.5 8.5s-3.8 8.5-8.5 8.5-8.5-3.8-8.5-8.5S5.3 1.5 10 1.5zm1.8 1.71c-.57 0-1.1.17-1.55.45 1.56.37 2.73 1.77 2.73 3.45 0 .69-.21 1.33-.55 1.87 1.31-.29 2.29-1.45 2.29-2.85 0-1.61-1.31-2.92-2.92-2.92zm-2.38 1c-1.61 0-2.92 1.31-2.92 2.93 0 1.61 1.31 2.92 2.92 2.92 1.62 0 2.93-1.31 2.93-2.92 0-1.62-1.31-2.93-2.93-2.93zm4.25 5.01l-.51.59c2.34.69 2.45 3.61 2.45 3.61h1.28c0-4.71-3.22-4.2-3.22-4.2zm-2.1.8l-2.12 2.09-2.12-2.09C3.12 10.24 3.89 15 3.89 15h11.08c.47-4.98-3.4-4.98-3.4-4.98z';
break;
case 'buddicons-community':
path = 'M9 3c0-.67-.47-1.43-1-2-.5.5-1 1.38-1 2 0 .48.45 1 1 1s1-.47 1-1zm4 0c0-.67-.47-1.43-1-2-.5.5-1 1.38-1 2 0 .48.45 1 1 1s1-.47 1-1zM9 9V5.5c0-.55-.45-1-1-1-.57 0-1 .49-1 1V9c0 .55.45 1 1 1 .57 0 1-.49 1-1zm4 0V5.5c0-.55-.45-1-1-1-.57 0-1 .49-1 1V9c0 .55.45 1 1 1 .57 0 1-.49 1-1zm4 1c0-1.48-1.41-2.77-3.5-3.46V9c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5V6.01c-.17 0-.33-.01-.5-.01s-.33.01-.5.01V9c0 .83-.67 1.5-1.5 1.5S6.5 9.83 6.5 9V6.54C4.41 7.23 3 8.52 3 10c0 1.41.95 2.65 3.21 3.37 1.11.35 2.39 1.12 3.79 1.12s2.69-.78 3.79-1.13C16.04 12.65 17 11.41 17 10zm-7 5.43c1.43 0 2.74-.79 3.88-1.11 1.9-.53 2.49-1.34 3.12-2.32v3c0 2.21-3.13 4-7 4s-7-1.79-7-4v-3c.64.99 1.32 1.8 3.15 2.33 1.13.33 2.44 1.1 3.85 1.1z';
break;
case 'buddicons-forums':
path = 'M13.5 7h-7C5.67 7 5 6.33 5 5.5S5.67 4 6.5 4h1.59C8.04 3.84 8 3.68 8 3.5 8 2.67 8.67 2 9.5 2h1c.83 0 1.5.67 1.5 1.5 0 .18-.04.34-.09.5h1.59c.83 0 1.5.67 1.5 1.5S14.33 7 13.5 7zM4 8h12c.55 0 1 .45 1 1s-.45 1-1 1H4c-.55 0-1-.45-1-1s.45-1 1-1zm1 3h10c.55 0 1 .45 1 1s-.45 1-1 1H5c-.55 0-1-.45-1-1s.45-1 1-1zm2 3h6c.55 0 1 .45 1 1s-.45 1-1 1h-1.09c.05.16.09.32.09.5 0 .83-.67 1.5-1.5 1.5h-1c-.83 0-1.5-.67-1.5-1.5 0-.18.04-.34.09-.5H7c-.55 0-1-.45-1-1s.45-1 1-1z';
break;
case 'buddicons-friends':
path = 'M8.75 5.77C8.75 4.39 7 2 7 2S5.25 4.39 5.25 5.77 5.9 7.5 7 7.5s1.75-.35 1.75-1.73zm6 0C14.75 4.39 13 2 13 2s-1.75 2.39-1.75 3.77S11.9 7.5 13 7.5s1.75-.35 1.75-1.73zM9 17V9c0-.55-.45-1-1-1H6c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1h2c.55 0 1-.45 1-1zm6 0V9c0-.55-.45-1-1-1h-2c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1h2c.55 0 1-.45 1-1zm-9-6l2-1v2l-2 1v-2zm6 0l2-1v2l-2 1v-2zm-6 3l2-1v2l-2 1v-2zm6 0l2-1v2l-2 1v-2z';
break;
case 'buddicons-groups':
path = 'M15.45 6.25c1.83.94 1.98 3.18.7 4.98-.8 1.12-2.33 1.88-3.46 1.78L10.05 18H9l-2.65-4.99c-1.13.16-2.73-.63-3.55-1.79-1.28-1.8-1.13-4.04.71-4.97.48-.24.96-.33 1.43-.31-.01.4.01.8.07 1.21.26 1.69 1.41 3.53 2.86 4.37-.19.55-.49.99-.88 1.25L9 16.58v-5.66C7.64 10.55 6.26 8.76 6 7c-.4-2.65 1-5 3.5-5s3.9 2.35 3.5 5c-.26 1.76-1.64 3.55-3 3.92v5.77l2.07-3.84c-.44-.23-.77-.71-.99-1.3 1.48-.83 2.65-2.69 2.91-4.4.06-.41.08-.82.07-1.22.46-.01.92.08 1.39.32z';
break;
case 'buddicons-pm':
path = 'M10 2c3 0 8 5 8 5v11H2V7s5-5 8-5zm7 14.72l-3.73-2.92L17 11l-.43-.37-2.26 1.3.24-4.31-8.77-.52-.46 4.54-1.99-.95L3 11l3.73 2.8-3.44 2.85.4.43L10 13l6.53 4.15z';
break;
case 'buddicons-replies':
path = 'M17.54 10.29c1.17 1.17 1.17 3.08 0 4.25-1.18 1.17-3.08 1.17-4.25 0l-.34-.52c0 3.66-2 4.38-2.95 4.98-.82-.6-2.95-1.28-2.95-4.98l-.34.52c-1.17 1.17-3.07 1.17-4.25 0-1.17-1.17-1.17-3.08 0-4.25 0 0 1.02-.67 2.1-1.3C3.71 7.84 3.2 6.42 3.2 4.88c0-.34.03-.67.08-1C3.53 5.66 4.47 7.22 5.8 8.3c.67-.35 1.85-.83 2.37-.92H8c-1.1 0-2-.9-2-2s.9-2 2-2v-.5c0-.28.22-.5.5-.5s.5.22.5.5v.5h2v-.5c0-.28.22-.5.5-.5s.5.22.5.5v.5c1.1 0 2 .9 2 2s-.9 2-2 2h-.17c.51.09 1.78.61 2.38.92 1.33-1.08 2.27-2.64 2.52-4.42.05.33.08.66.08 1 0 1.54-.51 2.96-1.36 4.11 1.08.63 2.09 1.3 2.09 1.3zM8.5 6.38c.5 0 1-.45 1-1s-.45-1-1-1-1 .45-1 1 .45 1 1 1zm3-2c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm-2.3 5.73c-.12.11-.19.26-.19.43.02.25.23.46.49.46h1c.26 0 .47-.21.49-.46 0-.15-.07-.29-.19-.43-.08-.06-.18-.11-.3-.11h-1c-.12 0-.22.05-.3.11zM12 12.5c0-.12-.06-.28-.19-.38-.09-.07-.19-.12-.31-.12h-3c-.12 0-.22.05-.31.12-.11.1-.19.25-.19.38 0 .28.22.5.5.5h3c.28 0 .5-.22.5-.5zM8.5 15h3c.28 0 .5-.22.5-.5s-.22-.5-.5-.5h-3c-.28 0-.5.22-.5.5s.22.5.5.5zm1 2h1c.28 0 .5-.22.5-.5s-.22-.5-.5-.5h-1c-.28 0-.5.22-.5.5s.22.5.5.5z';
break;
case 'buddicons-topics':
path = 'M10.44 1.66c-.59-.58-1.54-.58-2.12 0L2.66 7.32c-.58.58-.58 1.53 0 2.12.6.6 1.56.56 2.12 0l5.66-5.66c.58-.58.59-1.53 0-2.12zm2.83 2.83c-.59-.59-1.54-.59-2.12 0l-5.66 5.66c-.59.58-.59 1.53 0 2.12.6.6 1.56.55 2.12 0l5.66-5.66c.58-.58.58-1.53 0-2.12zm1.06 6.72l4.18 4.18c.59.58.59 1.53 0 2.12s-1.54.59-2.12 0l-4.18-4.18-1.77 1.77c-.59.58-1.54.58-2.12 0-.59-.59-.59-1.54 0-2.13l5.66-5.65c.58-.59 1.53-.59 2.12 0 .58.58.58 1.53 0 2.12zM5 15c0-1.59-1.66-4-1.66-4S2 13.78 2 15s.6 2 1.34 2h.32C4.4 17 5 16.59 5 15z';
break;
case 'buddicons-tracking':
path = 'M10.98 6.78L15.5 15c-1 2-3.5 3-5.5 3s-4.5-1-5.5-3L9 6.82c-.75-1.23-2.28-1.98-4.29-2.03l2.46-2.92c1.68 1.19 2.46 2.32 2.97 3.31.56-.87 1.2-1.68 2.7-2.12l1.83 2.86c-1.42-.34-2.64.08-3.69.86zM8.17 10.4l-.93 1.69c.49.11 1 .16 1.54.16 1.35 0 2.58-.36 3.55-.95l-1.01-1.82c-.87.53-1.96.86-3.15.92zm.86 5.38c1.99 0 3.73-.74 4.74-1.86l-.98-1.76c-1 1.12-2.74 1.87-4.74 1.87-.62 0-1.21-.08-1.76-.21l-.63 1.15c.94.5 2.1.81 3.37.81z';
break;
case 'building':
path = 'M3 20h14V0H3v20zM7 3H5V1h2v2zm4 0H9V1h2v2zm4 0h-2V1h2v2zM7 6H5V4h2v2zm4 0H9V4h2v2zm4 0h-2V4h2v2zM7 9H5V7h2v2zm4 0H9V7h2v2zm4 0h-2V7h2v2zm-8 3H5v-2h2v2zm4 0H9v-2h2v2zm4 0h-2v-2h2v2zm-4 7H5v-6h6v6zm4-4h-2v-2h2v2zm0 3h-2v-2h2v2z';
break;
case 'businessman':
path = 'M7.3 6l-.03-.19c-.04-.37-.05-.73-.03-1.08.02-.36.1-.71.25-1.04.14-.32.31-.61.52-.86s.49-.46.83-.6c.34-.15.72-.23 1.13-.23.69 0 1.26.2 1.71.59s.76.87.91 1.44.18 1.16.09 1.78l-.03.19c-.01.09-.05.25-.11.48-.05.24-.12.47-.2.69-.08.21-.19.45-.34.72-.14.27-.3.49-.47.69-.18.19-.4.34-.67.48-.27.13-.55.19-.86.19s-.59-.06-.87-.19c-.26-.13-.49-.29-.67-.5-.18-.2-.34-.42-.49-.66-.15-.25-.26-.49-.34-.73-.09-.25-.16-.47-.21-.67-.06-.21-.1-.37-.12-.5zm9.2 6.24c.41.7.5 1.41.5 2.14v2.49c0 .03-.12.08-.29.13-.18.04-.42.13-.97.27-.55.12-1.1.24-1.65.34s-1.19.19-1.95.27c-.75.08-1.46.12-2.13.12-.68 0-1.39-.04-2.14-.12-.75-.07-1.4-.17-1.98-.27-.58-.11-1.08-.23-1.56-.34-.49-.11-.8-.21-1.06-.29L3 16.87v-2.49c0-.75.07-1.46.46-2.15s.81-1.25 1.5-1.68C5.66 10.12 7.19 10 8 10l1.67 1.67L9 13v3l1.02 1.08L11 16v-3l-.68-1.33L11.97 10c.77 0 2.2.07 2.9.52.71.45 1.21 1.02 1.63 1.72z';
break;
case 'button':
path = 'M17 5H3c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm1 7c0 .6-.4 1-1 1H3c-.6 0-1-.4-1-1V7c0-.6.4-1 1-1h14c.6 0 1 .4 1 1v5z';
break;
case 'calendar-alt':
path = 'M15 4h3v15H2V4h3V3c0-.41.15-.76.44-1.06.29-.29.65-.44 1.06-.44s.77.15 1.06.44c.29.3.44.65.44 1.06v1h4V3c0-.41.15-.76.44-1.06.29-.29.65-.44 1.06-.44s.77.15 1.06.44c.29.3.44.65.44 1.06v1zM6 3v2.5c0 .14.05.26.15.36.09.09.21.14.35.14s.26-.05.35-.14c.1-.1.15-.22.15-.36V3c0-.14-.05-.26-.15-.35-.09-.1-.21-.15-.35-.15s-.26.05-.35.15c-.1.09-.15.21-.15.35zm7 0v2.5c0 .14.05.26.14.36.1.09.22.14.36.14s.26-.05.36-.14c.09-.1.14-.22.14-.36V3c0-.14-.05-.26-.14-.35-.1-.1-.22-.15-.36-.15s-.26.05-.36.15c-.09.09-.14.21-.14.35zm4 15V8H3v10h14zM7 9v2H5V9h2zm2 0h2v2H9V9zm4 2V9h2v2h-2zm-6 1v2H5v-2h2zm2 0h2v2H9v-2zm4 2v-2h2v2h-2zm-6 1v2H5v-2h2zm4 2H9v-2h2v2zm4 0h-2v-2h2v2z';
break;
case 'calendar':
path = 'M15 4h3v14H2V4h3V3c0-.83.67-1.5 1.5-1.5S8 2.17 8 3v1h4V3c0-.83.67-1.5 1.5-1.5S15 2.17 15 3v1zM6 3v2.5c0 .28.22.5.5.5s.5-.22.5-.5V3c0-.28-.22-.5-.5-.5S6 2.72 6 3zm7 0v2.5c0 .28.22.5.5.5s.5-.22.5-.5V3c0-.28-.22-.5-.5-.5s-.5.22-.5.5zm4 14V8H3v9h14zM7 16V9H5v7h2zm4 0V9H9v7h2zm4 0V9h-2v7h2z';
break;
case 'camera':
path = 'M6 5V3H3v2h3zm12 10V4H9L7 6H2v9h16zm-7-8c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3z';
break;
case 'carrot':
path = 'M2 18.43c1.51 1.36 11.64-4.67 13.14-7.21.72-1.22-.13-3.01-1.52-4.44C15.2 5.73 16.59 9 17.91 8.31c.6-.32.99-1.31.7-1.92-.52-1.08-2.25-1.08-3.42-1.21.83-.2 2.82-1.05 2.86-2.25.04-.92-1.13-1.97-2.05-1.86-1.21.14-1.65 1.88-2.06 3-.05-.71-.2-2.27-.98-2.95-1.04-.91-2.29-.05-2.32 1.05-.04 1.33 2.82 2.07 1.92 3.67C11.04 4.67 9.25 4.03 8.1 4.7c-.49.31-1.05.91-1.63 1.69.89.94 2.12 2.07 3.09 2.72.2.14.26.42.11.62-.14.21-.42.26-.62.12-.99-.67-2.2-1.78-3.1-2.71-.45.67-.91 1.43-1.34 2.23.85.86 1.93 1.83 2.79 2.41.2.14.25.42.11.62-.14.21-.42.26-.63.12-.85-.58-1.86-1.48-2.71-2.32C2.4 13.69 1.1 17.63 2 18.43z';
break;
case 'cart':
path = 'M6 13h9c.55 0 1 .45 1 1s-.45 1-1 1H5c-.55 0-1-.45-1-1V4H2c-.55 0-1-.45-1-1s.45-1 1-1h3c.55 0 1 .45 1 1v2h13l-4 7H6v1zm-.5 3c.83 0 1.5.67 1.5 1.5S6.33 19 5.5 19 4 18.33 4 17.5 4.67 16 5.5 16zm9 0c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5-1.5-.67-1.5-1.5.67-1.5 1.5-1.5z';
break;
case 'category':
path = 'M5 7h13v10H2V4h7l2 2H4v9h1V7z';
break;
case 'chart-area':
path = 'M18 18l.01-12.28c.59-.35.99-.99.99-1.72 0-1.1-.9-2-2-2s-2 .9-2 2c0 .8.47 1.48 1.14 1.8l-4.13 6.58c-.33-.24-.73-.38-1.16-.38-.84 0-1.55.51-1.85 1.24l-2.14-1.53c.09-.22.14-.46.14-.71 0-1.11-.89-2-2-2-1.1 0-2 .89-2 2 0 .73.4 1.36.98 1.71L1 18h17zM17 3c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zM5 10c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm5.85 3c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1z';
break;
case 'chart-bar':
path = 'M18 18V2h-4v16h4zm-6 0V7H8v11h4zm-6 0v-8H2v8h4z';
break;
case 'chart-line':
path = 'M18 3.5c0 .62-.38 1.16-.92 1.38v13.11H1.99l4.22-6.73c-.13-.23-.21-.48-.21-.76C6 9.67 6.67 9 7.5 9S9 9.67 9 10.5c0 .13-.02.25-.05.37l1.44.63c.27-.3.67-.5 1.11-.5.18 0 .35.04.51.09l3.58-6.41c-.36-.27-.59-.7-.59-1.18 0-.83.67-1.5 1.5-1.5.19 0 .36.04.53.1l.05-.09v.11c.54.22.92.76.92 1.38zm-1.92 13.49V5.85l-3.29 5.89c.13.23.21.48.21.76 0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5l.01-.07-1.63-.72c-.25.18-.55.29-.88.29-.18 0-.35-.04-.51-.1l-3.2 5.09h12.29z';
break;
case 'chart-pie':
path = 'M10 10V3c3.87 0 7 3.13 7 7h-7zM9 4v7h7c0 3.87-3.13 7-7 7s-7-3.13-7-7 3.13-7 7-7z';
break;
case 'clipboard':
path = 'M11.9.39l1.4 1.4c1.61.19 3.5-.74 4.61.37s.18 3 .37 4.61l1.4 1.4c.39.39.39 1.02 0 1.41l-9.19 9.2c-.4.39-1.03.39-1.42 0L1.29 11c-.39-.39-.39-1.02 0-1.42l9.2-9.19c.39-.39 1.02-.39 1.41 0zm.58 2.25l-.58.58 4.95 4.95.58-.58c-.19-.6-.2-1.22-.15-1.82.02-.31.05-.62.09-.92.12-1 .18-1.63-.17-1.98s-.98-.29-1.98-.17c-.3.04-.61.07-.92.09-.6.05-1.22.04-1.82-.15zm4.02.93c.39.39.39 1.03 0 1.42s-1.03.39-1.42 0-.39-1.03 0-1.42 1.03-.39 1.42 0zm-6.72.36l-.71.7L15.44 11l.7-.71zM8.36 5.34l-.7.71 6.36 6.36.71-.7zM6.95 6.76l-.71.7 6.37 6.37.7-.71zM5.54 8.17l-.71.71 6.36 6.36.71-.71zM4.12 9.58l-.71.71 6.37 6.37.71-.71z';
break;
case 'clock':
path = 'M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm0 14c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6zm-.71-5.29c.07.05.14.1.23.15l-.02.02L14 13l-3.03-3.19L10 5l-.97 4.81h.01c0 .02-.01.05-.02.09S9 9.97 9 10c0 .28.1.52.29.71z';
break;
case 'cloud-saved':
path = 'M14.8 9c.1-.3.2-.6.2-1 0-2.2-1.8-4-4-4-1.5 0-2.9.9-3.5 2.2-.3-.1-.7-.2-1-.2C5.1 6 4 7.1 4 8.5c0 .2 0 .4.1.5-1.8.3-3.1 1.7-3.1 3.5C1 14.4 2.6 16 4.5 16h10c1.9 0 3.5-1.6 3.5-3.5 0-1.8-1.4-3.3-3.2-3.5zm-6.3 5.9l-3.2-3.2 1.4-1.4 1.8 1.8 3.8-3.8 1.4 1.4-5.2 5.2z';
break;
case 'cloud-upload':
path = 'M14.8 9c.1-.3.2-.6.2-1 0-2.2-1.8-4-4-4-1.5 0-2.9.9-3.5 2.2-.3-.1-.7-.2-1-.2C5.1 6 4 7.1 4 8.5c0 .2 0 .4.1.5-1.8.3-3.1 1.7-3.1 3.5C1 14.4 2.6 16 4.5 16H8v-3H5l4.5-4.5L14 13h-3v3h3.5c1.9 0 3.5-1.6 3.5-3.5 0-1.8-1.4-3.3-3.2-3.5z';
break;
case 'cloud':
path = 'M14.9 9c1.8.2 3.1 1.7 3.1 3.5 0 1.9-1.6 3.5-3.5 3.5h-10C2.6 16 1 14.4 1 12.5 1 10.7 2.3 9.3 4.1 9 4 8.9 4 8.7 4 8.5 4 7.1 5.1 6 6.5 6c.3 0 .7.1.9.2C8.1 4.9 9.4 4 11 4c2.2 0 4 1.8 4 4 0 .4-.1.7-.1 1z';
break;
case 'columns':
path = 'M3 15h6V5H3v10zm8 0h6V5h-6v10z';
break;
case 'controls-back':
path = 'M2 10l10-6v3.6L18 4v12l-6-3.6V16z';
break;
case 'controls-forward':
path = 'M18 10L8 16v-3.6L2 16V4l6 3.6V4z';
break;
case 'controls-pause':
path = 'M5 16V4h3v12H5zm7-12h3v12h-3V4z';
break;
case 'controls-play':
path = 'M5 4l10 6-10 6V4z';
break;
case 'controls-repeat':
path = 'M5 7v3l-2 1.5V5h11V3l4 3.01L14 9V7H5zm10 6v-3l2-1.5V15H6v2l-4-3.01L6 11v2h9z';
break;
case 'controls-skipback':
path = 'M11.98 7.63l6-3.6v12l-6-3.6v3.6l-8-4.8v4.8h-2v-12h2v4.8l8-4.8v3.6z';
break;
case 'controls-skipforward':
path = 'M8 12.4L2 16V4l6 3.6V4l8 4.8V4h2v12h-2v-4.8L8 16v-3.6z';
break;
case 'controls-volumeoff':
path = 'M2 7h4l5-4v14l-5-4H2V7z';
break;
case 'controls-volumeon':
path = 'M2 7h4l5-4v14l-5-4H2V7zm12.69-2.46C14.82 4.59 18 5.92 18 10s-3.18 5.41-3.31 5.46c-.06.03-.13.04-.19.04-.2 0-.39-.12-.46-.31-.11-.26.02-.55.27-.65.11-.05 2.69-1.15 2.69-4.54 0-3.41-2.66-4.53-2.69-4.54-.25-.1-.38-.39-.27-.65.1-.25.39-.38.65-.27zM16 10c0 2.57-2.23 3.43-2.32 3.47-.06.02-.12.03-.18.03-.2 0-.39-.12-.47-.32-.1-.26.04-.55.29-.65.07-.02 1.68-.67 1.68-2.53s-1.61-2.51-1.68-2.53c-.25-.1-.38-.39-.29-.65.1-.25.39-.39.65-.29.09.04 2.32.9 2.32 3.47z';
break;
case 'cover-image':
path = 'M2.2 1h15.5c.7 0 1.3.6 1.3 1.2v11.5c0 .7-.6 1.2-1.2 1.2H2.2c-.6.1-1.2-.5-1.2-1.1V2.2C1 1.6 1.6 1 2.2 1zM17 13V3H3v10h14zm-4-4s0-5 3-5v7c0 .6-.4 1-1 1H5c-.6 0-1-.4-1-1V7c2 0 3 4 3 4s1-4 3-4 3 2 3 2zM4 17h12v2H4z';
break;
case 'dashboard':
path = 'M3.76 16h12.48c1.1-1.37 1.76-3.11 1.76-5 0-4.42-3.58-8-8-8s-8 3.58-8 8c0 1.89.66 3.63 1.76 5zM10 4c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zM6 6c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm8 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm-5.37 5.55L12 7v6c0 1.1-.9 2-2 2s-2-.9-2-2c0-.57.24-1.08.63-1.45zM4 10c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm12 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm-5 3c0-.55-.45-1-1-1s-1 .45-1 1 .45 1 1 1 1-.45 1-1z';
break;
case 'desktop':
path = 'M3 2h14c.55 0 1 .45 1 1v10c0 .55-.45 1-1 1h-5v2h2c.55 0 1 .45 1 1v1H5v-1c0-.55.45-1 1-1h2v-2H3c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1zm13 9V4H4v7h12zM5 5h9L5 9V5z';
break;
case 'dismiss':
path = 'M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm5 11l-3-3 3-3-2-2-3 3-3-3-2 2 3 3-3 3 2 2 3-3 3 3z';
break;
case 'download':
path = 'M14.01 4v6h2V2H4v8h2.01V4h8zm-2 2v6h3l-5 6-5-6h3V6h4z';
break;
case 'edit':
path = 'M13.89 3.39l2.71 2.72c.46.46.42 1.24.03 1.64l-8.01 8.02-5.56 1.16 1.16-5.58s7.6-7.63 7.99-8.03c.39-.39 1.22-.39 1.68.07zm-2.73 2.79l-5.59 5.61 1.11 1.11 5.54-5.65zm-2.97 8.23l5.58-5.6-1.07-1.08-5.59 5.6z';
break;
case 'editor-aligncenter':
path = 'M14 5V3H6v2h8zm3 4V7H3v2h14zm-3 4v-2H6v2h8zm3 4v-2H3v2h14z';
break;
case 'editor-alignleft':
path = 'M12 5V3H3v2h9zm5 4V7H3v2h14zm-5 4v-2H3v2h9zm5 4v-2H3v2h14z';
break;
case 'editor-alignright':
path = 'M17 5V3H8v2h9zm0 4V7H3v2h14zm0 4v-2H8v2h9zm0 4v-2H3v2h14z';
break;
case 'editor-bold':
path = 'M6 4v13h4.54c1.37 0 2.46-.33 3.26-1 .8-.66 1.2-1.58 1.2-2.77 0-.84-.17-1.51-.51-2.01s-.9-.85-1.67-1.03v-.09c.57-.1 1.02-.4 1.36-.9s.51-1.13.51-1.91c0-1.14-.39-1.98-1.17-2.5C12.75 4.26 11.5 4 9.78 4H6zm2.57 5.15V6.26h1.36c.73 0 1.27.11 1.61.32.34.22.51.58.51 1.07 0 .54-.16.92-.47 1.15s-.82.35-1.51.35h-1.5zm0 2.19h1.6c1.44 0 2.16.53 2.16 1.61 0 .6-.17 1.05-.51 1.34s-.86.43-1.57.43H8.57v-3.38z';
break;
case 'editor-break':
path = 'M16 4h2v9H7v3l-5-4 5-4v3h9V4z';
break;
case 'editor-code':
path = 'M9 6l-4 4 4 4-1 2-6-6 6-6zm2 8l4-4-4-4 1-2 6 6-6 6z';
break;
case 'editor-contract':
path = 'M15.75 6.75L18 3v14l-2.25-3.75L17 12h-4v4l1.25-1.25L18 17H2l3.75-2.25L7 16v-4H3l1.25 1.25L2 17V3l2.25 3.75L3 8h4V4L5.75 5.25 2 3h16l-3.75 2.25L13 4v4h4z';
break;
case 'editor-customchar':
path = 'M10 5.4c1.27 0 2.24.36 2.91 1.08.66.71 1 1.76 1 3.13 0 1.28-.23 2.37-.69 3.27-.47.89-1.27 1.52-2.22 2.12v2h6v-2h-3.69c.92-.64 1.62-1.34 2.12-2.34.49-1.01.74-2.13.74-3.35 0-1.78-.55-3.19-1.65-4.22S11.92 3.54 10 3.54s-3.43.53-4.52 1.57c-1.1 1.04-1.65 2.44-1.65 4.2 0 1.21.24 2.31.73 3.33.48 1.01 1.19 1.71 2.1 2.36H3v2h6v-2c-.98-.64-1.8-1.28-2.24-2.17-.45-.89-.67-1.96-.67-3.22 0-1.37.33-2.41 1-3.13C7.75 5.76 8.72 5.4 10 5.4z';
break;
case 'editor-expand':
path = 'M7 8h6v4H7zm-5 5v4h4l-1.2-1.2L7 12l-3.8 2.2M14 17h4v-4l-1.2 1.2L13 12l2.2 3.8M14 3l1.3 1.3L13 8l3.8-2.2L18 7V3M6 3H2v4l1.2-1.2L7 8 4.7 4.3';
break;
case 'editor-help':
path = 'M17 10c0-3.87-3.14-7-7-7-3.87 0-7 3.13-7 7s3.13 7 7 7c3.86 0 7-3.13 7-7zm-6.3 1.48H9.14v-.43c0-.38.08-.7.24-.98s.46-.57.88-.89c.41-.29.68-.53.81-.71.14-.18.2-.39.2-.62 0-.25-.09-.44-.28-.58-.19-.13-.45-.19-.79-.19-.58 0-1.25.19-2 .57l-.64-1.28c.87-.49 1.8-.74 2.77-.74.81 0 1.45.2 1.92.58.48.39.71.91.71 1.55 0 .43-.09.8-.29 1.11-.19.32-.57.67-1.11 1.06-.38.28-.61.49-.71.63-.1.15-.15.34-.15.57v.35zm-1.47 2.74c-.18-.17-.27-.42-.27-.73 0-.33.08-.58.26-.75s.43-.25.77-.25c.32 0 .57.09.75.26s.27.42.27.74c0 .3-.09.55-.27.72-.18.18-.43.27-.75.27-.33 0-.58-.09-.76-.26z';
break;
case 'editor-indent':
path = 'M3 5V3h9v2H3zm10-1V3h4v1h-4zm0 3h2V5l4 3.5-4 3.5v-2h-2V7zM3 8V6h9v2H3zm2 3V9h7v2H5zm-2 3v-2h9v2H3zm10 0v-1h4v1h-4zm-4 3v-2h3v2H9z';
break;
case 'editor-insertmore':
path = 'M17 7V3H3v4h14zM6 11V9H3v2h3zm6 0V9H8v2h4zm5 0V9h-3v2h3zm0 6v-4H3v4h14z';
break;
case 'editor-italic':
path = 'M14.78 6h-2.13l-2.8 9h2.12l-.62 2H4.6l.62-2h2.14l2.8-9H8.03l.62-2h6.75z';
break;
case 'editor-justify':
path = 'M2 3h16v2H2V3zm0 4h16v2H2V7zm0 4h16v2H2v-2zm0 4h16v2H2v-2z';
break;
case 'editor-kitchensink':
path = 'M19 2v6H1V2h18zm-1 5V3H2v4h16zM5 4v2H3V4h2zm3 0v2H6V4h2zm3 0v2H9V4h2zm3 0v2h-2V4h2zm3 0v2h-2V4h2zm2 5v9H1V9h18zm-1 8v-7H2v7h16zM5 11v2H3v-2h2zm3 0v2H6v-2h2zm3 0v2H9v-2h2zm6 0v2h-5v-2h5zm-6 3v2H3v-2h8zm3 0v2h-2v-2h2zm3 0v2h-2v-2h2z';
break;
case 'editor-ltr':
path = 'M5.52 2h7.43c.55 0 1 .45 1 1s-.45 1-1 1h-1v13c0 .55-.45 1-1 1s-1-.45-1-1V5c0-.55-.45-1-1-1s-1 .45-1 1v12c0 .55-.45 1-1 1s-1-.45-1-1v-5.96h-.43C3.02 11.04 1 9.02 1 6.52S3.02 2 5.52 2zM14 14l5-4-5-4v8z';
break;
case 'editor-ol-rtl':
path = 'M15.025 8.75a1.048 1.048 0 0 1 .45-.1.507.507 0 0 1 .35.11.455.455 0 0 1 .13.36.803.803 0 0 1-.06.3 1.448 1.448 0 0 1-.19.33c-.09.11-.29.32-.58.62l-.99 1v.58h2.76v-.7h-1.72v-.04l.51-.48a7.276 7.276 0 0 0 .7-.71 1.75 1.75 0 0 0 .3-.49 1.254 1.254 0 0 0 .1-.51.968.968 0 0 0-.16-.56 1.007 1.007 0 0 0-.44-.37 1.512 1.512 0 0 0-.65-.14 1.98 1.98 0 0 0-.51.06 1.9 1.9 0 0 0-.42.15 3.67 3.67 0 0 0-.48.35l.45.54a2.505 2.505 0 0 1 .45-.3zM16.695 15.29a1.29 1.29 0 0 0-.74-.3v-.02a1.203 1.203 0 0 0 .65-.37.973.973 0 0 0 .23-.65.81.81 0 0 0-.37-.71 1.72 1.72 0 0 0-1-.26 2.185 2.185 0 0 0-1.33.4l.4.6a1.79 1.79 0 0 1 .46-.23 1.18 1.18 0 0 1 .41-.07c.38 0 .58.15.58.46a.447.447 0 0 1-.22.43 1.543 1.543 0 0 1-.7.12h-.31v.66h.31a1.764 1.764 0 0 1 .75.12.433.433 0 0 1 .23.41.55.55 0 0 1-.2.47 1.084 1.084 0 0 1-.63.15 2.24 2.24 0 0 1-.57-.08 2.671 2.671 0 0 1-.52-.2v.74a2.923 2.923 0 0 0 1.18.22 1.948 1.948 0 0 0 1.22-.33 1.077 1.077 0 0 0 .43-.92.836.836 0 0 0-.26-.64zM15.005 4.17c.06-.05.16-.14.3-.28l-.02.42V7h.84V3h-.69l-1.29 1.03.4.51zM4.02 5h9v1h-9zM4.02 10h9v1h-9zM4.02 15h9v1h-9z';
break;
case 'editor-ol':
path = 'M6 7V3h-.69L4.02 4.03l.4.51.46-.37c.06-.05.16-.14.3-.28l-.02.42V7H6zm2-2h9v1H8V5zm-1.23 6.95v-.7H5.05v-.04l.51-.48c.33-.31.57-.54.7-.71.14-.17.24-.33.3-.49.07-.16.1-.33.1-.51 0-.21-.05-.4-.16-.56-.1-.16-.25-.28-.44-.37s-.41-.14-.65-.14c-.19 0-.36.02-.51.06-.15.03-.29.09-.42.15-.12.07-.29.19-.48.35l.45.54c.16-.13.31-.23.45-.3.15-.07.3-.1.45-.1.14 0 .26.03.35.11s.13.2.13.36c0 .1-.02.2-.06.3s-.1.21-.19.33c-.09.11-.29.32-.58.62l-.99 1v.58h2.76zM8 10h9v1H8v-1zm-1.29 3.95c0-.3-.12-.54-.37-.71-.24-.17-.58-.26-1-.26-.52 0-.96.13-1.33.4l.4.6c.17-.11.32-.19.46-.23.14-.05.27-.07.41-.07.38 0 .58.15.58.46 0 .2-.07.35-.22.43s-.38.12-.7.12h-.31v.66h.31c.34 0 .59.04.75.12.15.08.23.22.23.41 0 .22-.07.37-.2.47-.14.1-.35.15-.63.15-.19 0-.38-.03-.57-.08s-.36-.12-.52-.2v.74c.34.15.74.22 1.18.22.53 0 .94-.11 1.22-.33.29-.22.43-.52.43-.92 0-.27-.09-.48-.26-.64s-.42-.26-.74-.3v-.02c.27-.06.49-.19.65-.37.15-.18.23-.39.23-.65zM8 15h9v1H8v-1z';
break;
case 'editor-outdent':
path = 'M7 4V3H3v1h4zm10 1V3H8v2h9zM7 7H5V5L1 8.5 5 12v-2h2V7zm10 1V6H8v2h9zm-2 3V9H8v2h7zm2 3v-2H8v2h9zM7 14v-1H3v1h4zm4 3v-2H8v2h3z';
break;
case 'editor-paragraph':
path = 'M15 2H7.54c-.83 0-1.59.2-2.28.6-.7.41-1.25.96-1.65 1.65C3.2 4.94 3 5.7 3 6.52s.2 1.58.61 2.27c.4.69.95 1.24 1.65 1.64.69.41 1.45.61 2.28.61h.43V17c0 .27.1.51.29.71.2.19.44.29.71.29.28 0 .51-.1.71-.29.2-.2.3-.44.3-.71V5c0-.27.09-.51.29-.71.2-.19.44-.29.71-.29s.51.1.71.29c.19.2.29.44.29.71v12c0 .27.1.51.3.71.2.19.43.29.71.29.27 0 .51-.1.71-.29.19-.2.29-.44.29-.71V4H15c.27 0 .5-.1.7-.3.2-.19.3-.43.3-.7s-.1-.51-.3-.71C15.5 2.1 15.27 2 15 2z';
break;
case 'editor-paste-text':
path = 'M12.38 2L15 5v1H5V5l2.64-3h4.74zM10 5c.55 0 1-.44 1-1 0-.55-.45-1-1-1s-1 .45-1 1c0 .56.45 1 1 1zm5.45-1H17c.55 0 1 .45 1 1v12c0 .56-.45 1-1 1H3c-.55 0-1-.44-1-1V5c0-.55.45-1 1-1h1.55L4 4.63V7h12V4.63zM14 11V9H6v2h3v5h2v-5h3z';
break;
case 'editor-paste-word':
path = 'M12.38 2L15 5v1H5V5l2.64-3h4.74zM10 5c.55 0 1-.45 1-1s-.45-1-1-1-1 .45-1 1 .45 1 1 1zm8 12V5c0-.55-.45-1-1-1h-1.54l.54.63V7H4V4.62L4.55 4H3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h14c.55 0 1-.45 1-1zm-3-8l-2 7h-2l-1-5-1 5H6.92L5 9h2l1 5 1-5h2l1 5 1-5h2z';
break;
case 'editor-quote':
path = 'M9.49 13.22c0-.74-.2-1.38-.61-1.9-.62-.78-1.83-.88-2.53-.72-.29-1.65 1.11-3.75 2.92-4.65L7.88 4c-2.73 1.3-5.42 4.28-4.96 8.05C3.21 14.43 4.59 16 6.54 16c.85 0 1.56-.25 2.12-.75s.83-1.18.83-2.03zm8.05 0c0-.74-.2-1.38-.61-1.9-.63-.78-1.83-.88-2.53-.72-.29-1.65 1.11-3.75 2.92-4.65L15.93 4c-2.73 1.3-5.41 4.28-4.95 8.05.29 2.38 1.66 3.95 3.61 3.95.85 0 1.56-.25 2.12-.75s.83-1.18.83-2.03z';
break;
case 'editor-removeformatting':
path = 'M14.29 4.59l1.1 1.11c.41.4.61.94.61 1.47v2.12c0 .53-.2 1.07-.61 1.47l-6.63 6.63c-.4.41-.94.61-1.47.61s-1.07-.2-1.47-.61l-1.11-1.1-1.1-1.11c-.41-.4-.61-.94-.61-1.47v-2.12c0-.54.2-1.07.61-1.48l6.63-6.62c.4-.41.94-.61 1.47-.61s1.06.2 1.47.61zm-6.21 9.7l6.42-6.42c.39-.39.39-1.03 0-1.43L12.36 4.3c-.19-.19-.45-.29-.72-.29s-.52.1-.71.29l-6.42 6.42c-.39.4-.39 1.04 0 1.43l2.14 2.14c.38.38 1.04.38 1.43 0z';
break;
case 'editor-rtl':
path = 'M5.52 2h7.43c.55 0 1 .45 1 1s-.45 1-1 1h-1v13c0 .55-.45 1-1 1s-1-.45-1-1V5c0-.55-.45-1-1-1s-1 .45-1 1v12c0 .55-.45 1-1 1s-1-.45-1-1v-5.96h-.43C3.02 11.04 1 9.02 1 6.52S3.02 2 5.52 2zM19 6l-5 4 5 4V6z';
break;
case 'editor-spellcheck':
path = 'M15.84 2.76c.25 0 .49.04.71.11.23.07.44.16.64.25l.35-.81c-.52-.26-1.08-.39-1.69-.39-.58 0-1.09.13-1.52.37-.43.25-.76.61-.99 1.08C13.11 3.83 13 4.38 13 5c0 .99.23 1.75.7 2.28s1.15.79 2.02.79c.6 0 1.13-.09 1.6-.26v-.84c-.26.08-.51.14-.74.19-.24.05-.49.08-.74.08-.59 0-1.04-.19-1.34-.57-.32-.37-.47-.93-.47-1.66 0-.7.16-1.25.48-1.65.33-.4.77-.6 1.33-.6zM6.5 8h1.04L5.3 2H4.24L2 8h1.03l.58-1.66H5.9zM8 2v6h2.17c.67 0 1.19-.15 1.57-.46.38-.3.56-.72.56-1.26 0-.4-.1-.72-.3-.95-.19-.24-.5-.39-.93-.47v-.04c.35-.06.6-.21.78-.44.18-.24.28-.53.28-.88 0-.52-.19-.9-.56-1.14-.36-.24-.96-.36-1.79-.36H8zm.98 2.48V2.82h.85c.44 0 .77.06.97.19.21.12.31.33.31.61 0 .31-.1.53-.29.66-.18.13-.48.2-.89.2h-.95zM5.64 5.5H3.9l.54-1.56c.14-.4.25-.76.32-1.1l.15.52c.07.23.13.4.17.51zm3.34-.23h.99c.44 0 .76.08.98.23.21.15.32.38.32.69 0 .34-.11.59-.32.75s-.52.24-.93.24H8.98V5.27zM4 13l5 5 9-8-1-1-8 6-4-3z';
break;
case 'editor-strikethrough':
path = 'M15.82 12.25c.26 0 .5-.02.74-.07.23-.05.48-.12.73-.2v.84c-.46.17-.99.26-1.58.26-.88 0-1.54-.26-2.01-.79-.39-.44-.62-1.04-.68-1.79h-.94c.12.21.18.48.18.79 0 .54-.18.95-.55 1.26-.38.3-.9.45-1.56.45H8v-2.5H6.59l.93 2.5H6.49l-.59-1.67H3.62L3.04 13H2l.93-2.5H2v-1h1.31l.93-2.49H5.3l.92 2.49H8V7h1.77c1 0 1.41.17 1.77.41.37.24.55.62.55 1.13 0 .35-.09.64-.27.87l-.08.09h1.29c.05-.4.15-.77.31-1.1.23-.46.55-.82.98-1.06.43-.25.93-.37 1.51-.37.61 0 1.17.12 1.69.38l-.35.81c-.2-.1-.42-.18-.64-.25s-.46-.11-.71-.11c-.55 0-.99.2-1.31.59-.23.29-.38.66-.44 1.11H17v1h-2.95c.06.5.2.9.44 1.19.3.37.75.56 1.33.56zM4.44 8.96l-.18.54H5.3l-.22-.61c-.04-.11-.09-.28-.17-.51-.07-.24-.12-.41-.14-.51-.08.33-.18.69-.33 1.09zm4.53-1.09V9.5h1.19c.28-.02.49-.09.64-.18.19-.13.28-.35.28-.66 0-.28-.1-.48-.3-.61-.2-.12-.53-.18-.97-.18h-.84zm-3.33 2.64v-.01H3.91v.01h1.73zm5.28.01l-.03-.02H8.97v1.68h1.04c.4 0 .71-.08.92-.23.21-.16.31-.4.31-.74 0-.31-.11-.54-.32-.69z';
break;
case 'editor-table':
path = 'M18 17V3H2v14h16zM16 7H4V5h12v2zm-7 4H4V9h5v2zm7 0h-5V9h5v2zm-7 4H4v-2h5v2zm7 0h-5v-2h5v2z';
break;
case 'editor-textcolor':
path = 'M13.23 15h1.9L11 4H9L5 15h1.88l1.07-3h4.18zm-1.53-4.54H8.51L10 5.6z';
break;
case 'editor-ul':
path = 'M5.5 7C4.67 7 4 6.33 4 5.5 4 4.68 4.67 4 5.5 4 6.32 4 7 4.68 7 5.5 7 6.33 6.32 7 5.5 7zM8 5h9v1H8V5zm-2.5 7c-.83 0-1.5-.67-1.5-1.5C4 9.68 4.67 9 5.5 9c.82 0 1.5.68 1.5 1.5 0 .83-.68 1.5-1.5 1.5zM8 10h9v1H8v-1zm-2.5 7c-.83 0-1.5-.67-1.5-1.5 0-.82.67-1.5 1.5-1.5.82 0 1.5.68 1.5 1.5 0 .83-.68 1.5-1.5 1.5zM8 15h9v1H8v-1z';
break;
case 'editor-underline':
path = 'M14 5h-2v5.71c0 1.99-1.12 2.98-2.45 2.98-1.32 0-2.55-1-2.55-2.96V5H5v5.87c0 1.91 1 4.54 4.48 4.54 3.49 0 4.52-2.58 4.52-4.5V5zm0 13v-2H5v2h9z';
break;
case 'editor-unlink':
path = 'M17.74 2.26c1.68 1.69 1.68 4.41 0 6.1l-1.53 1.52c-.32.33-.69.58-1.08.77L13 10l1.69-1.64.76-.77.76-.76c.84-.84.84-2.2 0-3.04-.84-.85-2.2-.85-3.04 0l-.77.76-.76.76L10 7l-.65-2.14c.19-.38.44-.75.77-1.07l1.52-1.53c1.69-1.68 4.42-1.68 6.1 0zM2 4l8 6-6-8zm4-2l4 8-2-8H6zM2 6l8 4-8-2V6zm7.36 7.69L10 13l.74 2.35-1.38 1.39c-1.69 1.68-4.41 1.68-6.1 0-1.68-1.68-1.68-4.42 0-6.1l1.39-1.38L7 10l-.69.64-1.52 1.53c-.85.84-.85 2.2 0 3.04.84.85 2.2.85 3.04 0zM18 16l-8-6 6 8zm-4 2l-4-8 2 8h2zm4-4l-8-4 8 2v2z';
break;
case 'editor-video':
path = 'M16 2h-3v1H7V2H4v15h3v-1h6v1h3V2zM6 3v1H5V3h1zm9 0v1h-1V3h1zm-2 1v5H7V4h6zM6 5v1H5V5h1zm9 0v1h-1V5h1zM6 7v1H5V7h1zm9 0v1h-1V7h1zM6 9v1H5V9h1zm9 0v1h-1V9h1zm-2 1v5H7v-5h6zm-7 1v1H5v-1h1zm9 0v1h-1v-1h1zm-9 2v1H5v-1h1zm9 0v1h-1v-1h1zm-9 2v1H5v-1h1zm9 0v1h-1v-1h1z';
break;
case 'ellipsis':
path = 'M5 10c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm12-2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-7 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z';
break;
case 'email-alt':
path = 'M19 14.5v-9c0-.83-.67-1.5-1.5-1.5H3.49c-.83 0-1.5.67-1.5 1.5v9c0 .83.67 1.5 1.5 1.5H17.5c.83 0 1.5-.67 1.5-1.5zm-1.31-9.11c.33.33.15.67-.03.84L13.6 9.95l3.9 4.06c.12.14.2.36.06.51-.13.16-.43.15-.56.05l-4.37-3.73-2.14 1.95-2.13-1.95-4.37 3.73c-.13.1-.43.11-.56-.05-.14-.15-.06-.37.06-.51l3.9-4.06-4.06-3.72c-.18-.17-.36-.51-.03-.84s.67-.17.95.07l6.24 5.04 6.25-5.04c.28-.24.62-.4.95-.07z';
break;
case 'email-alt2':
path = 'M18.01 11.18V2.51c0-1.19-.9-1.81-2-1.37L4 5.91c-1.1.44-2 1.77-2 2.97v8.66c0 1.2.9 1.81 2 1.37l12.01-4.77c1.1-.44 2-1.76 2-2.96zm-1.43-7.46l-6.04 9.33-6.65-4.6c-.1-.07-.36-.32-.17-.64.21-.36.65-.21.65-.21l6.3 2.32s4.83-6.34 5.11-6.7c.13-.17.43-.34.73-.13.29.2.16.49.07.63z';
break;
case 'email':
path = 'M3.87 4h13.25C18.37 4 19 4.59 19 5.79v8.42c0 1.19-.63 1.79-1.88 1.79H3.87c-1.25 0-1.88-.6-1.88-1.79V5.79c0-1.2.63-1.79 1.88-1.79zm6.62 8.6l6.74-5.53c.24-.2.43-.66.13-1.07-.29-.41-.82-.42-1.17-.17l-5.7 3.86L4.8 5.83c-.35-.25-.88-.24-1.17.17-.3.41-.11.87.13 1.07z';
break;
case 'embed-audio':
path = 'M17 4H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-7 3H7v4c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2c.4 0 .7.1 1 .3V5h4v2zm4 3.5L12.5 12l1.5 1.5V15l-3-3 3-3v1.5zm1 4.5v-1.5l1.5-1.5-1.5-1.5V9l3 3-3 3z';
break;
case 'embed-generic':
path = 'M17 4H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-3 6.5L12.5 12l1.5 1.5V15l-3-3 3-3v1.5zm1 4.5v-1.5l1.5-1.5-1.5-1.5V9l3 3-3 3z';
break;
case 'embed-photo':
path = 'M17 4H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-7 8H3V6h7v6zm4-1.5L12.5 12l1.5 1.5V15l-3-3 3-3v1.5zm1 4.5v-1.5l1.5-1.5-1.5-1.5V9l3 3-3 3zm-6-4V8.5L7.2 10 6 9.2 4 11h5zM4.6 8.6c.6 0 1-.4 1-1s-.4-1-1-1-1 .4-1 1 .4 1 1 1z';
break;
case 'embed-post':
path = 'M17 4H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM8.6 9l-.4.3c-.4.4-.5 1.1-.2 1.6l-.8.8-1.1-1.1-1.3 1.3c-.2.2-1.6 1.3-1.8 1.1-.2-.2.9-1.6 1.1-1.8l1.3-1.3-1.1-1.1.8-.8c.5.3 1.2.3 1.6-.2l.3-.3c.5-.5.5-1.2.2-1.7L8 5l3 2.9-.8.8c-.5-.2-1.2-.2-1.6.3zm5.4 1.5L12.5 12l1.5 1.5V15l-3-3 3-3v1.5zm1 4.5v-1.5l1.5-1.5-1.5-1.5V9l3 3-3 3z';
break;
case 'embed-video':
path = 'M17 4H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-7 6.5L8 9.1V11H3V6h5v1.8l2-1.3v4zm4 0L12.5 12l1.5 1.5V15l-3-3 3-3v1.5zm1 4.5v-1.5l1.5-1.5-1.5-1.5V9l3 3-3 3z';
break;
case 'excerpt-view':
path = 'M19 18V2c0-.55-.45-1-1-1H2c-.55 0-1 .45-1 1v16c0 .55.45 1 1 1h16c.55 0 1-.45 1-1zM4 3c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm13 0v6H6V3h11zM4 11c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm13 0v6H6v-6h11z';
break;
case 'exit':
path = 'M13 3v2h2v10h-2v2h4V3h-4zm0 8V9H5.4l4.3-4.3-1.4-1.4L1.6 10l6.7 6.7 1.4-1.4L5.4 11H13z';
break;
case 'external':
path = 'M9 3h8v8l-2-1V6.92l-5.6 5.59-1.41-1.41L14.08 5H10zm3 12v-3l2-2v7H3V6h8L9 8H5v7h7z';
break;
case 'facebook-alt':
path = 'M8.46 18h2.93v-7.3h2.45l.37-2.84h-2.82V6.04c0-.82.23-1.38 1.41-1.38h1.51V2.11c-.26-.03-1.15-.11-2.19-.11-2.18 0-3.66 1.33-3.66 3.76v2.1H6v2.84h2.46V18z';
break;
case 'facebook':
path = 'M2.89 2h14.23c.49 0 .88.39.88.88v14.24c0 .48-.39.88-.88.88h-4.08v-6.2h2.08l.31-2.41h-2.39V7.85c0-.7.2-1.18 1.2-1.18h1.28V4.51c-.22-.03-.98-.09-1.86-.09-1.85 0-3.11 1.12-3.11 3.19v1.78H8.46v2.41h2.09V18H2.89c-.49 0-.89-.4-.89-.88V2.88c0-.49.4-.88.89-.88z';
break;
case 'feedback':
path = 'M2 2h16c.55 0 1 .45 1 1v14c0 .55-.45 1-1 1H2c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1zm15 14V7H3v9h14zM4 8v1h3V8H4zm4 0v3h8V8H8zm-4 4v1h3v-1H4zm4 0v3h8v-3H8z';
break;
case 'filter':
path = 'M3 4.5v-2s3.34-1 7-1 7 1 7 1v2l-5 7.03v6.97s-1.22-.09-2.25-.59S8 16.5 8 16.5v-4.97z';
break;
case 'flag':
path = 'M5 18V3H3v15h2zm1-6V4c3-1 7 1 11 0v8c-3 1.27-8-1-11 0z';
break;
case 'format-aside':
path = 'M1 1h18v12l-6 6H1V1zm3 3v1h12V4H4zm0 4v1h12V8H4zm6 5v-1H4v1h6zm2 4l5-5h-5v5z';
break;
case 'format-audio':
path = 'M6.99 3.08l11.02-2c.55-.08.99.45.99 1V14.5c0 1.94-1.57 3.5-3.5 3.5S12 16.44 12 14.5c0-1.93 1.57-3.5 3.5-3.5.54 0 1.04.14 1.5.35V5.08l-9 2V16c-.24 1.7-1.74 3-3.5 3C2.57 19 1 17.44 1 15.5 1 13.57 2.57 12 4.5 12c.54 0 1.04.14 1.5.35V4.08c0-.55.44-.91.99-1z';
break;
case 'format-chat':
path = 'M11 6h-.82C9.07 6 8 7.2 8 8.16V10l-3 3v-3H3c-1.1 0-2-.9-2-2V3c0-1.1.9-2 2-2h6c1.1 0 2 .9 2 2v3zm0 1h6c1.1 0 2 .9 2 2v5c0 1.1-.9 2-2 2h-2v3l-3-3h-1c-1.1 0-2-.9-2-2V9c0-1.1.9-2 2-2z';
break;
case 'format-gallery':
path = 'M16 4h1.96c.57 0 1.04.47 1.04 1.04v12.92c0 .57-.47 1.04-1.04 1.04H5.04C4.47 19 4 18.53 4 17.96V16H2.04C1.47 16 1 15.53 1 14.96V2.04C1 1.47 1.47 1 2.04 1h12.92c.57 0 1.04.47 1.04 1.04V4zM3 14h11V3H3v11zm5-8.5C8 4.67 7.33 4 6.5 4S5 4.67 5 5.5 5.67 7 6.5 7 8 6.33 8 5.5zm2 4.5s1-5 3-5v8H4V7c2 0 2 3 2 3s.33-2 2-2 2 2 2 2zm7 7V6h-1v8.96c0 .57-.47 1.04-1.04 1.04H6v1h11z';
break;
case 'format-image':
path = 'M2.25 1h15.5c.69 0 1.25.56 1.25 1.25v15.5c0 .69-.56 1.25-1.25 1.25H2.25C1.56 19 1 18.44 1 17.75V2.25C1 1.56 1.56 1 2.25 1zM17 17V3H3v14h14zM10 6c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2zm3 5s0-6 3-6v10c0 .55-.45 1-1 1H5c-.55 0-1-.45-1-1V8c2 0 3 4 3 4s1-3 3-3 3 2 3 2z';
break;
case 'format-quote':
path = 'M8.54 12.74c0-.87-.24-1.61-.72-2.22-.73-.92-2.14-1.03-2.96-.85-.34-1.93 1.3-4.39 3.42-5.45L6.65 1.94C3.45 3.46.31 6.96.85 11.37 1.19 14.16 2.8 16 5.08 16c1 0 1.83-.29 2.48-.88.66-.59.98-1.38.98-2.38zm9.43 0c0-.87-.24-1.61-.72-2.22-.73-.92-2.14-1.03-2.96-.85-.34-1.93 1.3-4.39 3.42-5.45l-1.63-2.28c-3.2 1.52-6.34 5.02-5.8 9.43.34 2.79 1.95 4.63 4.23 4.63 1 0 1.83-.29 2.48-.88.66-.59.98-1.38.98-2.38z';
break;
case 'format-status':
path = 'M10 1c7 0 9 2.91 9 6.5S17 14 10 14s-9-2.91-9-6.5S3 1 10 1zM5.5 9C6.33 9 7 8.33 7 7.5S6.33 6 5.5 6 4 6.67 4 7.5 4.67 9 5.5 9zM10 9c.83 0 1.5-.67 1.5-1.5S10.83 6 10 6s-1.5.67-1.5 1.5S9.17 9 10 9zm4.5 0c.83 0 1.5-.67 1.5-1.5S15.33 6 14.5 6 13 6.67 13 7.5 13.67 9 14.5 9zM6 14.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5-1.5-.67-1.5-1.5.67-1.5 1.5-1.5zm-3 2c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1z';
break;
case 'format-video':
path = 'M2 1h16c.55 0 1 .45 1 1v16l-18-.02V2c0-.55.45-1 1-1zm4 1L4 5h1l2-3H6zm4 0H9L7 5h1zm3 0h-1l-2 3h1zm3 0h-1l-2 3h1zm1 14V6H3v10h14zM8 7l6 4-6 4V7z';
break;
case 'forms':
path = 'M2 2h7v7H2V2zm9 0v7h7V2h-7zM5.5 4.5L7 3H4zM12 8V3h5v5h-5zM4.5 5.5L3 4v3zM8 4L6.5 5.5 8 7V4zM5.5 6.5L4 8h3zM9 18v-7H2v7h7zm9 0h-7v-7h7v7zM8 12v5H3v-5h5zm6.5 1.5L16 12h-3zM12 16l1.5-1.5L12 13v3zm3.5-1.5L17 16v-3zm-1 1L13 17h3z';
break;
case 'googleplus':
path = 'M6.73 10h5.4c.05.29.09.57.09.95 0 3.27-2.19 5.6-5.49 5.6-3.17 0-5.73-2.57-5.73-5.73 0-3.17 2.56-5.73 5.73-5.73 1.54 0 2.84.57 3.83 1.5l-1.55 1.5c-.43-.41-1.17-.89-2.28-.89-1.96 0-3.55 1.62-3.55 3.62 0 1.99 1.59 3.61 3.55 3.61 2.26 0 3.11-1.62 3.24-2.47H6.73V10zM19 10v1.64h-1.64v1.63h-1.63v-1.63h-1.64V10h1.64V8.36h1.63V10H19z';
break;
case 'grid-view':
path = 'M2 1h16c.55 0 1 .45 1 1v16c0 .55-.45 1-1 1H2c-.55 0-1-.45-1-1V2c0-.55.45-1 1-1zm7.01 7.99v-6H3v6h6.01zm8 0v-6h-6v6h6zm-8 8.01v-6H3v6h6.01zm8 0v-6h-6v6h6z';
break;
case 'groups':
path = 'M8.03 4.46c-.29 1.28.55 3.46 1.97 3.46 1.41 0 2.25-2.18 1.96-3.46-.22-.98-1.08-1.63-1.96-1.63-.89 0-1.74.65-1.97 1.63zm-4.13.9c-.25 1.08.47 2.93 1.67 2.93s1.92-1.85 1.67-2.93c-.19-.83-.92-1.39-1.67-1.39s-1.48.56-1.67 1.39zm8.86 0c-.25 1.08.47 2.93 1.66 2.93 1.2 0 1.92-1.85 1.67-2.93-.19-.83-.92-1.39-1.67-1.39-.74 0-1.47.56-1.66 1.39zm-.59 11.43l1.25-4.3C14.2 10 12.71 8.47 10 8.47c-2.72 0-4.21 1.53-3.44 4.02l1.26 4.3C8.05 17.51 9 18 10 18c.98 0 1.94-.49 2.17-1.21zm-6.1-7.63c-.49.67-.96 1.83-.42 3.59l1.12 3.79c-.34.2-.77.31-1.2.31-.85 0-1.65-.41-1.85-1.03l-1.07-3.65c-.65-2.11.61-3.4 2.92-3.4.27 0 .54.02.79.06-.1.1-.2.22-.29.33zm8.35-.39c2.31 0 3.58 1.29 2.92 3.4l-1.07 3.65c-.2.62-1 1.03-1.85 1.03-.43 0-.86-.11-1.2-.31l1.11-3.77c.55-1.78.08-2.94-.42-3.61-.08-.11-.18-.23-.28-.33.25-.04.51-.06.79-.06z';
break;
case 'hammer':
path = 'M17.7 6.32l1.41 1.42-3.47 3.41-1.42-1.42.84-.82c-.32-.76-.81-1.57-1.51-2.31l-4.61 6.59-5.26 4.7c-.39.39-1.02.39-1.42 0l-1.2-1.21c-.39-.39-.39-1.02 0-1.41l10.97-9.92c-1.37-.86-3.21-1.46-5.67-1.48 2.7-.82 4.95-.93 6.58-.3 1.7.66 2.82 2.2 3.91 3.58z';
break;
case 'heading':
path = 'M12.5 4v5.2h-5V4H5v13h2.5v-5.2h5V17H15V4';
break;
case 'heart':
path = 'M10 17.12c3.33-1.4 5.74-3.79 7.04-6.21 1.28-2.41 1.46-4.81.32-6.25-1.03-1.29-2.37-1.78-3.73-1.74s-2.68.63-3.63 1.46c-.95-.83-2.27-1.42-3.63-1.46s-2.7.45-3.73 1.74c-1.14 1.44-.96 3.84.34 6.25 1.28 2.42 3.69 4.81 7.02 6.21z';
break;
case 'hidden':
path = 'M17.2 3.3l.16.17c.39.39.39 1.02 0 1.41L4.55 17.7c-.39.39-1.03.39-1.41 0l-.17-.17c-.39-.39-.39-1.02 0-1.41l1.59-1.6c-1.57-1-2.76-2.3-3.56-3.93.81-1.65 2.03-2.98 3.64-3.99S8.04 5.09 10 5.09c1.2 0 2.33.21 3.4.6l2.38-2.39c.39-.39 1.03-.39 1.42 0zm-7.09 4.01c-.23.25-.34.54-.34.88 0 .31.12.58.31.81l1.8-1.79c-.13-.12-.28-.21-.45-.26-.11-.01-.28-.03-.49-.04-.33.03-.6.16-.83.4zM2.4 10.59c.69 1.23 1.71 2.25 3.05 3.05l1.28-1.28c-.51-.69-.77-1.47-.77-2.36 0-1.06.36-1.98 1.09-2.76-1.04.27-1.96.7-2.76 1.26-.8.58-1.43 1.27-1.89 2.09zm13.22-2.13l.96-.96c1.02.86 1.83 1.89 2.42 3.09-.81 1.65-2.03 2.98-3.64 3.99s-3.4 1.51-5.36 1.51c-.63 0-1.24-.07-1.83-.18l1.07-1.07c.25.02.5.05.76.05 1.63 0 3.13-.4 4.5-1.21s2.4-1.84 3.1-3.09c-.46-.82-1.09-1.51-1.89-2.09-.03-.01-.06-.03-.09-.04zm-5.58 5.58l4-4c-.01 1.1-.41 2.04-1.18 2.81-.78.78-1.72 1.18-2.82 1.19z';
break;
case 'html':
path = 'M4 16v-2H2v2H1v-5h1v2h2v-2h1v5H4zM7 16v-4H5.6v-1h3.7v1H8v4H7zM10 16v-5h1l1.4 3.4h.1L14 11h1v5h-1v-3.1h-.1l-1.1 2.5h-.6l-1.1-2.5H11V16h-1zM19 16h-3v-5h1v4h2v1zM9.4 4.2L7.1 6.5l2.3 2.3-.6 1.2-3.5-3.5L8.8 3l.6 1.2zm1.2 4.6l2.3-2.3-2.3-2.3.6-1.2 3.5 3.5-3.5 3.5-.6-1.2z';
break;
case 'id-alt':
path = 'M18 18H2V2h16v16zM8.05 7.53c.13-.07.24-.15.33-.24.09-.1.17-.21.24-.34.07-.14.13-.26.17-.37s.07-.22.1-.34L8.95 6c0-.04.01-.07.01-.09.05-.32.03-.61-.04-.9-.08-.28-.23-.52-.46-.72C8.23 4.1 7.95 4 7.6 4c-.2 0-.39.04-.56.11-.17.08-.31.18-.41.3-.11.13-.2.27-.27.44-.07.16-.11.33-.12.51s0 .36.01.55l.02.09c.01.06.03.15.06.25s.06.21.1.33.1.25.17.37c.08.12.16.23.25.33s.2.19.34.25c.13.06.28.09.43.09s.3-.03.43-.09zM16 5V4h-5v1h5zm0 2V6h-5v1h5zM7.62 8.83l-1.38-.88c-.41 0-.79.11-1.14.32-.35.22-.62.5-.81.85-.19.34-.29.7-.29 1.07v1.25l.2.05c.13.04.31.09.55.14.24.06.51.12.8.17.29.06.62.1 1 .14.37.04.73.06 1.07.06s.69-.02 1.07-.06.7-.09.98-.14c.27-.05.54-.1.82-.17.27-.06.45-.11.54-.13.09-.03.16-.05.21-.06v-1.25c0-.36-.1-.72-.31-1.07s-.49-.64-.84-.86-.72-.33-1.11-.33zM16 9V8h-3v1h3zm0 2v-1h-3v1h3zm0 3v-1H4v1h12zm0 2v-1H4v1h12z';
break;
case 'id':
path = 'M18 16H2V4h16v12zM7.05 8.53c.13-.07.24-.15.33-.24.09-.1.17-.21.24-.34.07-.14.13-.26.17-.37s.07-.22.1-.34L7.95 7c0-.04.01-.07.01-.09.05-.32.03-.61-.04-.9-.08-.28-.23-.52-.46-.72C7.23 5.1 6.95 5 6.6 5c-.2 0-.39.04-.56.11-.17.08-.31.18-.41.3-.11.13-.2.27-.27.44-.07.16-.11.33-.12.51s0 .36.01.55l.02.09c.01.06.03.15.06.25s.06.21.1.33.1.25.17.37c.08.12.16.23.25.33s.2.19.34.25c.13.06.28.09.43.09s.3-.03.43-.09zM17 9V5h-5v4h5zm-10.38.83l-1.38-.88c-.41 0-.79.11-1.14.32-.35.22-.62.5-.81.85-.19.34-.29.7-.29 1.07v1.25l.2.05c.13.04.31.09.55.14.24.06.51.12.8.17.29.06.62.1 1 .14.37.04.73.06 1.07.06s.69-.02 1.07-.06.7-.09.98-.14c.27-.05.54-.1.82-.17.27-.06.45-.11.54-.13.09-.03.16-.05.21-.06v-1.25c0-.36-.1-.72-.31-1.07s-.49-.64-.84-.86-.72-.33-1.11-.33zM17 11v-1h-5v1h5zm0 2v-1h-5v1h5zm0 2v-1H3v1h14z';
break;
case 'image-crop':
path = 'M19 12v3h-4v4h-3v-4H4V7H0V4h4V0h3v4h7l3-3 1 1-3 3v7h4zm-8-5H7v4zm-3 5h4V8z';
break;
case 'image-filter':
path = 'M14 5.87c0-2.2-1.79-4-4-4s-4 1.8-4 4c0 2.21 1.79 4 4 4s4-1.79 4-4zM3.24 10.66c-1.92 1.1-2.57 3.55-1.47 5.46 1.11 1.92 3.55 2.57 5.47 1.47 1.91-1.11 2.57-3.55 1.46-5.47-1.1-1.91-3.55-2.56-5.46-1.46zm9.52 6.93c1.92 1.1 4.36.45 5.47-1.46 1.1-1.92.45-4.36-1.47-5.47-1.91-1.1-4.36-.45-5.46 1.46-1.11 1.92-.45 4.36 1.46 5.47z';
break;
case 'image-flip-horizontal':
path = 'M19 3v14h-8v3H9v-3H1V3h8V0h2v3h8zm-8.5 14V3h-1v14h1zM7 6.5L3 10l4 3.5v-7zM17 10l-4-3.5v7z';
break;
case 'image-flip-vertical':
path = 'M20 9v2h-3v8H3v-8H0V9h3V1h14v8h3zM6.5 7h7L10 3zM17 9.5H3v1h14v-1zM13.5 13h-7l3.5 4z';
break;
case 'image-rotate-left':
path = 'M7 5H5.05c0-1.74.85-2.9 2.95-2.9V0C4.85 0 2.96 2.11 2.96 5H1.18L3.8 8.39zm13-4v14h-5v5H1V10h9V1h10zm-2 2h-6v7h3v3h3V3zm-5 9H3v6h10v-6z';
break;
case 'image-rotate-right':
path = 'M15.95 5H14l3.2 3.39L19.82 5h-1.78c0-2.89-1.89-5-5.04-5v2.1c2.1 0 2.95 1.16 2.95 2.9zM1 1h10v9h9v10H6v-5H1V1zm2 2v10h3v-3h3V3H3zm5 9v6h10v-6H8z';
break;
case 'image-rotate':
path = 'M10.25 1.02c5.1 0 8.75 4.04 8.75 9s-3.65 9-8.75 9c-3.2 0-6.02-1.59-7.68-3.99l2.59-1.52c1.1 1.5 2.86 2.51 4.84 2.51 3.3 0 6-2.79 6-6s-2.7-6-6-6c-1.97 0-3.72 1-4.82 2.49L7 8.02l-6 2v-7L2.89 4.6c1.69-2.17 4.36-3.58 7.36-3.58z';
break;
case 'images-alt':
path = 'M4 15v-3H2V2h12v3h2v3h2v10H6v-3H4zm7-12c-1.1 0-2 .9-2 2h4c0-1.1-.89-2-2-2zm-7 8V6H3v5h1zm7-3h4c0-1.1-.89-2-2-2-1.1 0-2 .9-2 2zm-5 6V9H5v5h1zm9-1c1.1 0 2-.89 2-2 0-1.1-.9-2-2-2s-2 .9-2 2c0 1.11.9 2 2 2zm2 4v-2c-5 0-5-3-10-3v5h10z';
break;
case 'images-alt2':
path = 'M5 3h14v11h-2v2h-2v2H1V7h2V5h2V3zm13 10V4H6v9h12zm-3-4c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm1 6v-1H5V6H4v9h12zM7 6l10 6H7V6zm7 11v-1H3V8H2v9h12z';
break;
case 'index-card':
path = 'M1 3.17V18h18V4H8v-.83c0-.32-.12-.6-.35-.83S7.14 2 6.82 2H2.18c-.33 0-.6.11-.83.34-.24.23-.35.51-.35.83zM10 6v2H3V6h7zm7 0v10h-5V6h5zm-7 4v2H3v-2h7zm0 4v2H3v-2h7z';
break;
case 'info-outline':
path = 'M9 15h2V9H9v6zm1-10c-.5 0-1 .5-1 1s.5 1 1 1 1-.5 1-1-.5-1-1-1zm0-4c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 16c-3.9 0-7-3.1-7-7s3.1-7 7-7 7 3.1 7 7-3.1 7-7 7z';
break;
case 'info':
path = 'M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm1 4c0-.55-.45-1-1-1s-1 .45-1 1 .45 1 1 1 1-.45 1-1zm0 9V9H9v6h2z';
break;
case 'insert-after':
path = 'M9 12h2v-2h2V8h-2V6H9v2H7v2h2v2zm1 4c3.9 0 7-3.1 7-7s-3.1-7-7-7-7 3.1-7 7 3.1 7 7 7zm0-12c2.8 0 5 2.2 5 5s-2.2 5-5 5-5-2.2-5-5 2.2-5 5-5zM3 19h14v-2H3v2z';
break;
case 'insert-before':
path = 'M11 8H9v2H7v2h2v2h2v-2h2v-2h-2V8zm-1-4c-3.9 0-7 3.1-7 7s3.1 7 7 7 7-3.1 7-7-3.1-7-7-7zm0 12c-2.8 0-5-2.2-5-5s2.2-5 5-5 5 2.2 5 5-2.2 5-5 5zM3 1v2h14V1H3z';
break;
case 'insert':
path = 'M10 1c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 16c-3.9 0-7-3.1-7-7s3.1-7 7-7 7 3.1 7 7-3.1 7-7 7zm1-11H9v3H6v2h3v3h2v-3h3V9h-3V6z';
break;
case 'instagram':
path = 'M12.67 10A2.67 2.67 0 1 0 10 12.67 2.68 2.68 0 0 0 12.67 10zm1.43 0A4.1 4.1 0 1 1 10 5.9a4.09 4.09 0 0 1 4.1 4.1zm1.13-4.27a1 1 0 1 1-1-1 1 1 0 0 1 1 1zM10 3.44c-1.17 0-3.67-.1-4.72.32a2.67 2.67 0 0 0-1.52 1.52c-.42 1-.32 3.55-.32 4.72s-.1 3.67.32 4.72a2.74 2.74 0 0 0 1.52 1.52c1 .42 3.55.32 4.72.32s3.67.1 4.72-.32a2.83 2.83 0 0 0 1.52-1.52c.42-1.05.32-3.55.32-4.72s.1-3.67-.32-4.72a2.74 2.74 0 0 0-1.52-1.52c-1.05-.42-3.55-.32-4.72-.32zM18 10c0 1.1 0 2.2-.05 3.3a4.84 4.84 0 0 1-1.29 3.36A4.8 4.8 0 0 1 13.3 18H6.7a4.84 4.84 0 0 1-3.36-1.29 4.84 4.84 0 0 1-1.29-3.41C2 12.2 2 11.1 2 10V6.7a4.84 4.84 0 0 1 1.34-3.36A4.8 4.8 0 0 1 6.7 2.05C7.8 2 8.9 2 10 2h3.3a4.84 4.84 0 0 1 3.36 1.29A4.8 4.8 0 0 1 18 6.7V10z';
break;
case 'laptop':
path = 'M3 3h14c.6 0 1 .4 1 1v10c0 .6-.4 1-1 1H3c-.6 0-1-.4-1-1V4c0-.6.4-1 1-1zm13 2H4v8h12V5zm-3 1H5v4zm6 11v-1H1v1c0 .6.5 1 1.1 1h15.8c.6 0 1.1-.4 1.1-1z';
break;
case 'layout':
path = 'M2 2h5v11H2V2zm6 0h5v5H8V2zm6 0h4v16h-4V2zM8 8h5v5H8V8zm-6 6h11v4H2v-4z';
break;
case 'leftright':
path = 'M3 10.03L9 6v8zM11 6l6 4.03L11 14V6z';
break;
case 'lightbulb':
path = 'M10 1c3.11 0 5.63 2.52 5.63 5.62 0 1.84-2.03 4.58-2.03 4.58-.33.44-.6 1.25-.6 1.8v1c0 .55-.45 1-1 1H8c-.55 0-1-.45-1-1v-1c0-.55-.27-1.36-.6-1.8 0 0-2.02-2.74-2.02-4.58C4.38 3.52 6.89 1 10 1zM7 16.87V16h6v.87c0 .62-.13 1.13-.75 1.13H12c0 .62-.4 1-1.02 1h-2c-.61 0-.98-.38-.98-1h-.25c-.62 0-.75-.51-.75-1.13z';
break;
case 'list-view':
path = 'M2 19h16c.55 0 1-.45 1-1V2c0-.55-.45-1-1-1H2c-.55 0-1 .45-1 1v16c0 .55.45 1 1 1zM4 3c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm13 0v2H6V3h11zM4 7c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm13 0v2H6V7h11zM4 11c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm13 0v2H6v-2h11zM4 15c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm13 0v2H6v-2h11z';
break;
case 'location-alt':
path = 'M13 13.14l1.17-5.94c.79-.43 1.33-1.25 1.33-2.2 0-1.38-1.12-2.5-2.5-2.5S10.5 3.62 10.5 5c0 .95.54 1.77 1.33 2.2zm0-9.64c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5-1.5-.67-1.5-1.5.67-1.5 1.5-1.5zm1.72 4.8L18 6.97v9L13.12 18 7 15.97l-5 2v-9l5-2 4.27 1.41 1.73 7.3z';
break;
case 'location':
path = 'M10 2C6.69 2 4 4.69 4 8c0 2.02 1.17 3.71 2.53 4.89.43.37 1.18.96 1.85 1.83.74.97 1.41 2.01 1.62 2.71.21-.7.88-1.74 1.62-2.71.67-.87 1.42-1.46 1.85-1.83C14.83 11.71 16 10.02 16 8c0-3.31-2.69-6-6-6zm0 2.56c1.9 0 3.44 1.54 3.44 3.44S11.9 11.44 10 11.44 6.56 9.9 6.56 8 8.1 4.56 10 4.56z';
break;
case 'lock':
path = 'M14 9h1c.55 0 1 .45 1 1v7c0 .55-.45 1-1 1H5c-.55 0-1-.45-1-1v-7c0-.55.45-1 1-1h1V6c0-2.21 1.79-4 4-4s4 1.79 4 4v3zm-2 0V6c0-1.1-.9-2-2-2s-2 .9-2 2v3h4zm-1 7l-.36-2.15c.51-.24.86-.75.86-1.35 0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5c0 .6.35 1.11.86 1.35L9 16h2z';
break;
case 'marker':
path = 'M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm0 13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5z';
break;
case 'media-archive':
path = 'M12 2l4 4v12H4V2h8zm0 4h3l-3-3v3zM8 3.5v2l1.8-1zM11 5L9.2 6 11 7V5zM8 6.5v2l1.8-1zM11 8L9.2 9l1.8 1V8zM8 9.5v2l1.8-1zm3 1.5l-1.8 1 1.8 1v-2zm-1.5 6c.83 0 1.62-.72 1.5-1.63-.05-.38-.49-1.61-.49-1.61l-1.99-1.1s-.45 1.95-.52 2.71c-.07.77.67 1.63 1.5 1.63zm0-2.39c.42 0 .76.34.76.76 0 .43-.34.77-.76.77s-.76-.34-.76-.77c0-.42.34-.76.76-.76z';
break;
case 'media-audio':
path = 'M12 2l4 4v12H4V2h8zm0 4h3l-3-3v3zm1 7.26V8.09c0-.11-.04-.21-.12-.29-.07-.08-.16-.11-.27-.1 0 0-3.97.71-4.25.78C8.07 8.54 8 8.8 8 9v3.37c-.2-.09-.42-.07-.6-.07-.38 0-.7.13-.96.39-.26.27-.4.58-.4.96 0 .37.14.69.4.95.26.27.58.4.96.4.34 0 .7-.04.96-.26.26-.23.64-.65.64-1.12V10.3l3-.6V12c-.67-.2-1.17.04-1.44.31-.26.26-.39.58-.39.95 0 .38.13.69.39.96.27.26.71.39 1.08.39.38 0 .7-.13.96-.39.26-.27.4-.58.4-.96z';
break;
case 'media-code':
path = 'M12 2l4 4v12H4V2h8zM9 13l-2-2 2-2-1-1-3 3 3 3zm3 1l3-3-3-3-1 1 2 2-2 2z';
break;
case 'media-default':
path = 'M12 2l4 4v12H4V2h8zm0 4h3l-3-3v3z';
break;
case 'media-document':
path = 'M12 2l4 4v12H4V2h8zM5 3v1h6V3H5zm7 3h3l-3-3v3zM5 5v1h6V5H5zm10 3V7H5v1h10zM5 9v1h4V9H5zm10 3V9h-5v3h5zM5 11v1h4v-1H5zm10 3v-1H5v1h10zm-3 2v-1H5v1h7z';
break;
case 'media-interactive':
path = 'M12 2l4 4v12H4V2h8zm0 4h3l-3-3v3zm2 8V8H6v6h3l-1 2h1l1-2 1 2h1l-1-2h3zm-6-3c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm5-2v2h-3V9h3zm0 3v1H7v-1h6z';
break;
case 'media-spreadsheet':
path = 'M12 2l4 4v12H4V2h8zm-1 4V3H5v3h6zM8 8V7H5v1h3zm3 0V7H9v1h2zm4 0V7h-3v1h3zm-7 2V9H5v1h3zm3 0V9H9v1h2zm4 0V9h-3v1h3zm-7 2v-1H5v1h3zm3 0v-1H9v1h2zm4 0v-1h-3v1h3zm-7 2v-1H5v1h3zm3 0v-1H9v1h2zm4 0v-1h-3v1h3zm-7 2v-1H5v1h3zm3 0v-1H9v1h2z';
break;
case 'media-text':
path = 'M12 2l4 4v12H4V2h8zM5 3v1h6V3H5zm7 3h3l-3-3v3zM5 5v1h6V5H5zm10 3V7H5v1h10zm0 2V9H5v1h10zm0 2v-1H5v1h10zm-4 2v-1H5v1h6z';
break;
case 'media-video':
path = 'M12 2l4 4v12H4V2h8zm0 4h3l-3-3v3zm-1 8v-3c0-.27-.1-.51-.29-.71-.2-.19-.44-.29-.71-.29H7c-.27 0-.51.1-.71.29-.19.2-.29.44-.29.71v3c0 .27.1.51.29.71.2.19.44.29.71.29h3c.27 0 .51-.1.71-.29.19-.2.29-.44.29-.71zm3 1v-5l-2 2v1z';
break;
case 'megaphone':
path = 'M18.15 5.94c.46 1.62.38 3.22-.02 4.48-.42 1.28-1.26 2.18-2.3 2.48-.16.06-.26.06-.4.06-.06.02-.12.02-.18.02-.06.02-.14.02-.22.02h-6.8l2.22 5.5c.02.14-.06.26-.14.34-.08.1-.24.16-.34.16H6.95c-.1 0-.26-.06-.34-.16-.08-.08-.16-.2-.14-.34l-1-5.5H4.25l-.02-.02c-.5.06-1.08-.18-1.54-.62s-.88-1.08-1.06-1.88c-.24-.8-.2-1.56-.02-2.2.18-.62.58-1.08 1.06-1.3l.02-.02 9-5.4c.1-.06.18-.1.24-.16.06-.04.14-.08.24-.12.16-.08.28-.12.5-.18 1.04-.3 2.24.1 3.22.98s1.84 2.24 2.26 3.86zm-2.58 5.98h-.02c.4-.1.74-.34 1.04-.7.58-.7.86-1.76.86-3.04 0-.64-.1-1.3-.28-1.98-.34-1.36-1.02-2.5-1.78-3.24s-1.68-1.1-2.46-.88c-.82.22-1.4.96-1.7 2-.32 1.04-.28 2.36.06 3.72.38 1.36 1 2.5 1.8 3.24.78.74 1.62 1.1 2.48.88zm-2.54-7.08c.22-.04.42-.02.62.04.38.16.76.48 1.02 1s.42 1.2.42 1.78c0 .3-.04.56-.12.8-.18.48-.44.84-.86.94-.34.1-.8-.06-1.14-.4s-.64-.86-.78-1.5c-.18-.62-.12-1.24.02-1.72s.48-.84.82-.94z';
break;
case 'menu-alt':
path = 'M3 4h14v2H3V4zm0 5h14v2H3V9zm0 5h14v2H3v-2z';
break;
case 'menu':
path = 'M17 7V5H3v2h14zm0 4V9H3v2h14zm0 4v-2H3v2h14z';
break;
case 'microphone':
path = 'M12 9V3c0-1.1-.89-2-2-2-1.12 0-2 .94-2 2v6c0 1.1.9 2 2 2 1.13 0 2-.94 2-2zm4 0c0 2.97-2.16 5.43-5 5.91V17h2c.56 0 1 .45 1 1s-.44 1-1 1H7c-.55 0-1-.45-1-1s.45-1 1-1h2v-2.09C6.17 14.43 4 11.97 4 9c0-.55.45-1 1-1 .56 0 1 .45 1 1 0 2.21 1.8 4 4 4 2.21 0 4-1.79 4-4 0-.55.45-1 1-1 .56 0 1 .45 1 1z';
break;
case 'migrate':
path = 'M4 6h6V4H2v12.01h8V14H4V6zm2 2h6V5l6 5-6 5v-3H6V8z';
break;
case 'minus':
path = 'M4 9h12v2H4V9z';
break;
case 'money':
path = 'M0 3h20v12h-.75c0-1.79-1.46-3.25-3.25-3.25-1.31 0-2.42.79-2.94 1.91-.25-.1-.52-.16-.81-.16-.98 0-1.8.63-2.11 1.5H0V3zm8.37 3.11c-.06.15-.1.31-.11.47s-.01.33.01.5l.02.08c.01.06.02.14.05.23.02.1.06.2.1.31.03.11.09.22.15.33.07.12.15.22.23.31s.18.17.31.23c.12.06.25.09.4.09.14 0 .27-.03.39-.09s.22-.14.3-.22c.09-.09.16-.2.22-.32.07-.12.12-.23.16-.33s.07-.2.09-.31c.03-.11.04-.18.05-.22s.01-.07.01-.09c.05-.29.03-.56-.04-.82s-.21-.48-.41-.66c-.21-.18-.47-.27-.79-.27-.19 0-.36.03-.52.1-.15.07-.28.16-.38.28-.09.11-.17.25-.24.4zm4.48 6.04v-1.14c0-.33-.1-.66-.29-.98s-.45-.59-.77-.79c-.32-.21-.66-.31-1.02-.31l-1.24.84-1.28-.82c-.37 0-.72.1-1.04.3-.31.2-.56.46-.74.77-.18.32-.27.65-.27.99v1.14l.18.05c.12.04.29.08.51.14.23.05.47.1.74.15.26.05.57.09.91.13.34.03.67.05.99.05.3 0 .63-.02.98-.05.34-.04.64-.08.89-.13.25-.04.5-.1.76-.16l.5-.12c.08-.02.14-.04.19-.06zm3.15.1c1.52 0 2.75 1.23 2.75 2.75s-1.23 2.75-2.75 2.75c-.73 0-1.38-.3-1.87-.77.23-.35.37-.78.37-1.23 0-.77-.39-1.46-.99-1.86.43-.96 1.37-1.64 2.49-1.64zm-5.5 3.5c0-.96.79-1.75 1.75-1.75s1.75.79 1.75 1.75-.79 1.75-1.75 1.75-1.75-.79-1.75-1.75z';
break;
case 'move':
path = 'M19 10l-4 4v-3h-4v4h3l-4 4-4-4h3v-4H5v3l-4-4 4-4v3h4V5H6l4-4 4 4h-3v4h4V6z';
break;
case 'nametag':
path = 'M12 5V2c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1h2c.55 0 1-.45 1-1zm-2-3c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm8 13V7c0-1.1-.9-2-2-2h-3v.33C13 6.25 12.25 7 11.33 7H8.67C7.75 7 7 6.25 7 5.33V5H4c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-1-6v6H3V9h14zm-8 2c0-.55-.22-1-.5-1s-.5.45-.5 1 .22 1 .5 1 .5-.45.5-1zm3 0c0-.55-.22-1-.5-1s-.5.45-.5 1 .22 1 .5 1 .5-.45.5-1zm-5.96 1.21c.92.48 2.34.79 3.96.79s3.04-.31 3.96-.79c-.21 1-1.89 1.79-3.96 1.79s-3.75-.79-3.96-1.79z';
break;
case 'networking':
path = 'M18 13h1c.55 0 1 .45 1 1.01v2.98c0 .56-.45 1.01-1 1.01h-4c-.55 0-1-.45-1-1.01v-2.98c0-.56.45-1.01 1-1.01h1v-2h-5v2h1c.55 0 1 .45 1 1.01v2.98c0 .56-.45 1.01-1 1.01H8c-.55 0-1-.45-1-1.01v-2.98c0-.56.45-1.01 1-1.01h1v-2H4v2h1c.55 0 1 .45 1 1.01v2.98C6 17.55 5.55 18 5 18H1c-.55 0-1-.45-1-1.01v-2.98C0 13.45.45 13 1 13h1v-2c0-1.1.9-2 2-2h5V7H8c-.55 0-1-.45-1-1.01V3.01C7 2.45 7.45 2 8 2h4c.55 0 1 .45 1 1.01v2.98C13 6.55 12.55 7 12 7h-1v2h5c1.1 0 2 .9 2 2v2z';
break;
case 'no-alt':
path = 'M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z';
break;
case 'no':
path = 'M12.12 10l3.53 3.53-2.12 2.12L10 12.12l-3.54 3.54-2.12-2.12L7.88 10 4.34 6.46l2.12-2.12L10 7.88l3.54-3.53 2.12 2.12z';
break;
case 'palmtree':
path = 'M8.58 2.39c.32 0 .59.05.81.14 1.25.55 1.69 2.24 1.7 3.97.59-.82 2.15-2.29 3.41-2.29s2.94.73 3.53 3.55c-1.13-.65-2.42-.94-3.65-.94-1.26 0-2.45.32-3.29.89.4-.11.86-.16 1.33-.16 1.39 0 2.9.45 3.4 1.31.68 1.16.47 3.38-.76 4.14-.14-2.1-1.69-4.12-3.47-4.12-.44 0-.88.12-1.33.38C8 10.62 7 14.56 7 19H2c0-5.53 4.21-9.65 7.68-10.79-.56-.09-1.17-.15-1.82-.15C6.1 8.06 4.05 8.5 2 10c.76-2.96 2.78-4.1 4.69-4.1 1.25 0 2.45.5 3.2 1.29-.66-2.24-2.49-2.86-4.08-2.86-.8 0-1.55.16-2.05.35.91-1.29 3.31-2.29 4.82-2.29zM13 11.5c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5.67 1.5 1.5 1.5 1.5-.67 1.5-1.5z';
break;
case 'paperclip':
path = 'M17.05 2.7c1.93 1.94 1.93 5.13 0 7.07L10 16.84c-1.88 1.89-4.91 1.93-6.86.15-.06-.05-.13-.09-.19-.15-1.93-1.94-1.93-5.12 0-7.07l4.94-4.95c.91-.92 2.28-1.1 3.39-.58.3.15.59.33.83.58 1.17 1.17 1.17 3.07 0 4.24l-4.93 4.95c-.39.39-1.02.39-1.41 0s-.39-1.02 0-1.41l4.93-4.95c.39-.39.39-1.02 0-1.41-.38-.39-1.02-.39-1.4 0l-4.94 4.95c-.91.92-1.1 2.29-.57 3.4.14.3.32.59.57.84s.54.43.84.57c1.11.53 2.47.35 3.39-.57l7.05-7.07c1.16-1.17 1.16-3.08 0-4.25-.56-.55-1.28-.83-2-.86-.08.01-.16.01-.24 0-.22-.03-.43-.11-.6-.27-.39-.4-.38-1.05.02-1.45.16-.16.36-.24.56-.28.14-.02.27-.01.4.02 1.19.06 2.36.52 3.27 1.43z';
break;
case 'performance':
path = 'M3.76 17.01h12.48C17.34 15.63 18 13.9 18 12c0-4.41-3.58-8-8-8s-8 3.59-8 8c0 1.9.66 3.63 1.76 5.01zM9 6c0-.55.45-1 1-1s1 .45 1 1c0 .56-.45 1-1 1s-1-.44-1-1zM4 8c0-.55.45-1 1-1s1 .45 1 1c0 .56-.45 1-1 1s-1-.44-1-1zm4.52 3.4c.84-.83 6.51-3.5 6.51-3.5s-2.66 5.68-3.49 6.51c-.84.84-2.18.84-3.02 0-.83-.83-.83-2.18 0-3.01zM3 13c0-.55.45-1 1-1s1 .45 1 1c0 .56-.45 1-1 1s-1-.44-1-1zm6 0c0-.55.45-1 1-1s1 .45 1 1c0 .56-.45 1-1 1s-1-.44-1-1zm6 0c0-.55.45-1 1-1s1 .45 1 1c0 .56-.45 1-1 1s-1-.44-1-1z';
break;
case 'phone':
path = 'M12.06 6l-.21-.2c-.52-.54-.43-.79.08-1.3l2.72-2.75c.81-.82.96-1.21 1.73-.48l.21.2zm.53.45l4.4-4.4c.7.94 2.34 3.47 1.53 5.34-.73 1.67-1.09 1.75-2 3-1.85 2.11-4.18 4.37-6 6.07-1.26.91-1.31 1.33-3 2-1.8.71-4.4-.89-5.38-1.56l4.4-4.4 1.18 1.62c.34.46 1.2-.06 1.8-.66 1.04-1.05 3.18-3.18 4-4.07.59-.59 1.12-1.45.66-1.8zM1.57 16.5l-.21-.21c-.68-.74-.29-.9.52-1.7l2.74-2.72c.51-.49.75-.6 1.27-.11l.2.21z';
break;
case 'playlist-audio':
path = 'M17 3V1H2v2h15zm0 4V5H2v2h15zm-7 4V9H2v2h8zm7.45-1.96l-6 1.12c-.16.02-.19.03-.29.13-.11.09-.16.22-.16.37v4.59c-.29-.13-.66-.14-.93-.14-.54 0-1 .19-1.38.57s-.56.84-.56 1.38c0 .53.18.99.56 1.37s.84.57 1.38.57c.49 0 .92-.16 1.29-.48s.59-.71.65-1.19v-4.95L17 11.27v3.48c-.29-.13-.56-.19-.83-.19-.54 0-1.11.19-1.49.57-.38.37-.57.83-.57 1.37s.19.99.57 1.37.84.57 1.38.57c.53 0 .99-.19 1.37-.57s.57-.83.57-1.37V9.6c0-.16-.05-.3-.16-.41-.11-.12-.24-.17-.39-.15zM8 15v-2H2v2h6zm-2 4v-2H2v2h4z';
break;
case 'playlist-video':
path = 'M17 3V1H2v2h15zm0 4V5H2v2h15zM6 11V9H2v2h4zm2-2h9c.55 0 1 .45 1 1v8c0 .55-.45 1-1 1H8c-.55 0-1-.45-1-1v-8c0-.55.45-1 1-1zm3 7l3.33-2L11 12v4zm-5-1v-2H2v2h4zm0 4v-2H2v2h4z';
break;
case 'plus-alt':
path = 'M15.8 4.2c3.2 3.21 3.2 8.39 0 11.6-3.21 3.2-8.39 3.2-11.6 0C1 12.59 1 7.41 4.2 4.2 7.41 1 12.59 1 15.8 4.2zm-4.3 11.3v-4h4v-3h-4v-4h-3v4h-4v3h4v4h3z';
break;
case 'plus-light':
path = 'M17 9v2h-6v6H9v-6H3V9h6V3h2v6h6z';
break;
case 'plus':
path = 'M17 7v3h-5v5H9v-5H4V7h5V2h3v5h5z';
break;
case 'portfolio':
path = 'M4 5H.78c-.37 0-.74.32-.69.84l1.56 9.99S3.5 8.47 3.86 6.7c.11-.53.61-.7.98-.7H10s-.7-2.08-.77-2.31C9.11 3.25 8.89 3 8.45 3H5.14c-.36 0-.7.23-.8.64C4.25 4.04 4 5 4 5zm4.88 0h-4s.42-1 .87-1h2.13c.48 0 1 1 1 1zM2.67 16.25c-.31.47-.76.75-1.26.75h15.73c.54 0 .92-.31 1.03-.83.44-2.19 1.68-8.44 1.68-8.44.07-.5-.3-.73-.62-.73H16V5.53c0-.16-.26-.53-.66-.53h-3.76c-.52 0-.87.58-.87.58L10 7H5.59c-.32 0-.63.19-.69.5 0 0-1.59 6.7-1.72 7.33-.07.37-.22.99-.51 1.42zM15.38 7H11s.58-1 1.13-1h2.29c.71 0 .96 1 .96 1z';
break;
case 'post-status':
path = 'M14 6c0 1.86-1.28 3.41-3 3.86V16c0 1-2 2-2 2V9.86c-1.72-.45-3-2-3-3.86 0-2.21 1.79-4 4-4s4 1.79 4 4zM8 5c0 .55.45 1 1 1s1-.45 1-1-.45-1-1-1-1 .45-1 1z';
break;
case 'pressthis':
path = 'M14.76 1C16.55 1 18 2.46 18 4.25c0 1.78-1.45 3.24-3.24 3.24-.23 0-.47-.03-.7-.08L13 8.47V19H2V4h9.54c.13-2 1.52-3 3.22-3zm0 5.49C16 6.49 17 5.48 17 4.25 17 3.01 16 2 14.76 2s-2.24 1.01-2.24 2.25c0 .37.1.72.27 1.03L9.57 8.5c-.28.28-1.77 2.22-1.5 2.49.02.03.06.04.1.04.49 0 2.14-1.28 2.39-1.53l3.24-3.24c.29.14.61.23.96.23z';
break;
case 'products':
path = 'M17 8h1v11H2V8h1V6c0-2.76 2.24-5 5-5 .71 0 1.39.15 2 .42.61-.27 1.29-.42 2-.42 2.76 0 5 2.24 5 5v2zM5 6v2h2V6c0-1.13.39-2.16 1.02-3H8C6.35 3 5 4.35 5 6zm10 2V6c0-1.65-1.35-3-3-3h-.02c.63.84 1.02 1.87 1.02 3v2h2zm-5-4.22C9.39 4.33 9 5.12 9 6v2h2V6c0-.88-.39-1.67-1-2.22z';
break;
case 'randomize':
path = 'M18 6.01L14 9V7h-4l-5 8H2v-2h2l5-8h5V3zM2 5h3l1.15 2.17-1.12 1.8L4 7H2V5zm16 9.01L14 17v-2H9l-1.15-2.17 1.12-1.8L10 13h4v-2z';
break;
case 'redo':
path = 'M8 5h5V2l6 4-6 4V7H8c-2.2 0-4 1.8-4 4s1.8 4 4 4h5v2H8c-3.3 0-6-2.7-6-6s2.7-6 6-6z';
break;
case 'rest-api':
path = 'M3 4h2v12H3z';
break;
case 'rss':
path = 'M14.92 18H18C18 9.32 10.82 2.25 2 2.25v3.02c7.12 0 12.92 5.71 12.92 12.73zm-5.44 0h3.08C12.56 12.27 7.82 7.6 2 7.6v3.02c2 0 3.87.77 5.29 2.16C8.7 14.17 9.48 16.03 9.48 18zm-5.35-.02c1.17 0 2.13-.93 2.13-2.09 0-1.15-.96-2.09-2.13-2.09-1.18 0-2.13.94-2.13 2.09 0 1.16.95 2.09 2.13 2.09z';
break;
case 'saved':
path = 'M15.3 5.3l-6.8 6.8-2.8-2.8-1.4 1.4 4.2 4.2 8.2-8.2';
break;
case 'schedule':
path = 'M2 2h16v4H2V2zm0 10V8h4v4H2zm6-2V8h4v2H8zm6 3V8h4v5h-4zm-6 5v-6h4v6H8zm-6 0v-4h4v4H2zm12 0v-3h4v3h-4z';
break;
case 'screenoptions':
path = 'M9 9V3H3v6h6zm8 0V3h-6v6h6zm-8 8v-6H3v6h6zm8 0v-6h-6v6h6z';
break;
case 'search':
path = 'M12.14 4.18c1.87 1.87 2.11 4.75.72 6.89.12.1.22.21.36.31.2.16.47.36.81.59.34.24.56.39.66.47.42.31.73.57.94.78.32.32.6.65.84 1 .25.35.44.69.59 1.04.14.35.21.68.18 1-.02.32-.14.59-.36.81s-.49.34-.81.36c-.31.02-.65-.04-.99-.19-.35-.14-.7-.34-1.04-.59-.35-.24-.68-.52-1-.84-.21-.21-.47-.52-.77-.93-.1-.13-.25-.35-.47-.66-.22-.32-.4-.57-.56-.78-.16-.2-.29-.35-.44-.5-2.07 1.09-4.69.76-6.44-.98-2.14-2.15-2.14-5.64 0-7.78 2.15-2.15 5.63-2.15 7.78 0zm-1.41 6.36c1.36-1.37 1.36-3.58 0-4.95-1.37-1.37-3.59-1.37-4.95 0-1.37 1.37-1.37 3.58 0 4.95 1.36 1.37 3.58 1.37 4.95 0z';
break;
case 'share-alt':
path = 'M16.22 5.8c.47.69.29 1.62-.4 2.08-.69.47-1.62.29-2.08-.4-.16-.24-.35-.46-.55-.67-.21-.2-.43-.39-.67-.55s-.5-.3-.77-.41c-.27-.12-.55-.21-.84-.26-.59-.13-1.23-.13-1.82-.01-.29.06-.57.15-.84.27-.27.11-.53.25-.77.41s-.46.35-.66.55c-.21.21-.4.43-.56.67s-.3.5-.41.76c-.01.02-.01.03-.01.04-.1.24-.17.48-.23.72H1V6h2.66c.04-.07.07-.13.12-.2.27-.4.57-.77.91-1.11s.72-.65 1.11-.91c.4-.27.83-.51 1.28-.7s.93-.34 1.41-.43c.99-.21 2.03-.21 3.02 0 .48.09.96.24 1.41.43s.88.43 1.28.7c.39.26.77.57 1.11.91s.64.71.91 1.11zM12.5 10c0-1.38-1.12-2.5-2.5-2.5S7.5 8.62 7.5 10s1.12 2.5 2.5 2.5 2.5-1.12 2.5-2.5zm-8.72 4.2c-.47-.69-.29-1.62.4-2.09.69-.46 1.62-.28 2.08.41.16.24.35.46.55.67.21.2.43.39.67.55s.5.3.77.41c.27.12.55.2.84.26.59.13 1.23.12 1.82 0 .29-.06.57-.14.84-.26.27-.11.53-.25.77-.41s.46-.35.66-.55c.21-.21.4-.44.56-.67.16-.25.3-.5.41-.76.01-.02.01-.03.01-.04.1-.24.17-.48.23-.72H19v3h-2.66c-.04.06-.07.13-.12.2-.27.4-.57.77-.91 1.11s-.72.65-1.11.91c-.4.27-.83.51-1.28.7s-.93.33-1.41.43c-.99.21-2.03.21-3.02 0-.48-.1-.96-.24-1.41-.43s-.88-.43-1.28-.7c-.39-.26-.77-.57-1.11-.91s-.64-.71-.91-1.11z';
break;
case 'share-alt2':
path = 'M18 8l-5 4V9.01c-2.58.06-4.88.45-7 2.99.29-3.57 2.66-5.66 7-5.94V3zM4 14h11v-2l2-1.6V16H2V5h9.43c-1.83.32-3.31 1-4.41 2H4v7z';
break;
case 'share':
path = 'M14.5 12c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3c0-.24.03-.46.09-.69l-4.38-2.3c-.55.61-1.33.99-2.21.99-1.66 0-3-1.34-3-3s1.34-3 3-3c.88 0 1.66.39 2.21.99l4.38-2.3c-.06-.23-.09-.45-.09-.69 0-1.66 1.34-3 3-3s3 1.34 3 3-1.34 3-3 3c-.88 0-1.66-.39-2.21-.99l-4.38 2.3c.06.23.09.45.09.69s-.03.46-.09.69l4.38 2.3c.55-.61 1.33-.99 2.21-.99z';
break;
case 'shield-alt':
path = 'M10 2s3 2 7 2c0 11-7 14-7 14S3 15 3 4c4 0 7-2 7-2z';
break;
case 'shield':
path = 'M10 2s3 2 7 2c0 11-7 14-7 14S3 15 3 4c4 0 7-2 7-2zm0 8h5s1-1 1-5c0 0-5-1-6-2v7H5c1 4 5 7 5 7v-7z';
break;
case 'shortcode':
path = 'M6 14H4V6h2V4H2v12h4M7.1 17h2.1l3.7-14h-2.1M14 4v2h2v8h-2v2h4V4';
break;
case 'slides':
path = 'M5 14V6h10v8H5zm-3-1V7h2v6H2zm4-6v6h8V7H6zm10 0h2v6h-2V7zm-3 2V8H7v1h6zm0 3v-2H7v2h6z';
break;
case 'smartphone':
path = 'M6 2h8c.55 0 1 .45 1 1v14c0 .55-.45 1-1 1H6c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1zm7 12V4H7v10h6zM8 5h4l-4 5V5z';
break;
case 'smiley':
path = 'M7 5.2c1.1 0 2 .89 2 2 0 .37-.11.71-.28 1C8.72 8.2 8 8 7 8s-1.72.2-1.72.2c-.17-.29-.28-.63-.28-1 0-1.11.9-2 2-2zm6 0c1.11 0 2 .89 2 2 0 .37-.11.71-.28 1 0 0-.72-.2-1.72-.2s-1.72.2-1.72.2c-.17-.29-.28-.63-.28-1 0-1.11.89-2 2-2zm-3 13.7c3.72 0 7.03-2.36 8.23-5.88l-1.32-.46C15.9 15.52 13.12 17.5 10 17.5s-5.9-1.98-6.91-4.94l-1.32.46c1.2 3.52 4.51 5.88 8.23 5.88z';
break;
case 'sort':
path = 'M11 7H1l5 7zm-2 7h10l-5-7z';
break;
case 'sos':
path = 'M18 10c0-4.42-3.58-8-8-8s-8 3.58-8 8 3.58 8 8 8 8-3.58 8-8zM7.23 3.57L8.72 7.3c-.62.29-1.13.8-1.42 1.42L3.57 7.23c.71-1.64 2.02-2.95 3.66-3.66zm9.2 3.66L12.7 8.72c-.29-.62-.8-1.13-1.42-1.42l1.49-3.73c1.64.71 2.95 2.02 3.66 3.66zM10 12c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm-6.43.77l3.73-1.49c.29.62.8 1.13 1.42 1.42l-1.49 3.73c-1.64-.71-2.95-2.02-3.66-3.66zm9.2 3.66l-1.49-3.73c.62-.29 1.13-.8 1.42-1.42l3.73 1.49c-.71 1.64-2.02 2.95-3.66 3.66z';
break;
case 'star-empty':
path = 'M10 1L7 7l-6 .75 4.13 4.62L4 19l6-3 6 3-1.12-6.63L19 7.75 13 7zm0 2.24l2.34 4.69 4.65.58-3.18 3.56.87 5.15L10 14.88l-4.68 2.34.87-5.15-3.18-3.56 4.65-.58z';
break;
case 'star-filled':
path = 'M10 1l3 6 6 .75-4.12 4.62L16 19l-6-3-6 3 1.13-6.63L1 7.75 7 7z';
break;
case 'star-half':
path = 'M10 1L7 7l-6 .75 4.13 4.62L4 19l6-3 6 3-1.12-6.63L19 7.75 13 7zm0 2.24l2.34 4.69 4.65.58-3.18 3.56.87 5.15L10 14.88V3.24z';
break;
case 'sticky':
path = 'M5 3.61V1.04l8.99-.01-.01 2.58c-1.22.26-2.16 1.35-2.16 2.67v.5c.01 1.31.93 2.4 2.17 2.66l-.01 2.58h-3.41l-.01 2.57c0 .6-.47 4.41-1.06 4.41-.6 0-1.08-3.81-1.08-4.41v-2.56L5 12.02l.01-2.58c1.23-.25 2.15-1.35 2.15-2.66v-.5c0-1.31-.92-2.41-2.16-2.67z';
break;
case 'store':
path = 'M1 10c.41.29.96.43 1.5.43.55 0 1.09-.14 1.5-.43.62-.46 1-1.17 1-2 0 .83.37 1.54 1 2 .41.29.96.43 1.5.43.55 0 1.09-.14 1.5-.43.62-.46 1-1.17 1-2 0 .83.37 1.54 1 2 .41.29.96.43 1.51.43.54 0 1.08-.14 1.49-.43.62-.46 1-1.17 1-2 0 .83.37 1.54 1 2 .41.29.96.43 1.5.43.55 0 1.09-.14 1.5-.43.63-.46 1-1.17 1-2V7l-3-7H4L0 7v1c0 .83.37 1.54 1 2zm2 8.99h5v-5h4v5h5v-7c-.37-.05-.72-.22-1-.43-.63-.45-1-.73-1-1.56 0 .83-.38 1.11-1 1.56-.41.3-.95.43-1.49.44-.55 0-1.1-.14-1.51-.44-.63-.45-1-.73-1-1.56 0 .83-.38 1.11-1 1.56-.41.3-.95.43-1.5.44-.54 0-1.09-.14-1.5-.44-.63-.45-1-.73-1-1.57 0 .84-.38 1.12-1 1.57-.29.21-.63.38-1 .44v6.99z';
break;
case 'table-col-after':
path = 'M14.08 12.864V9.216h3.648V7.424H14.08V3.776h-1.728v3.648H8.64v1.792h3.712v3.648zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm0 5.12H1.28v3.84H6.4V6.4zm0 5.12H1.28v3.84H6.4v-3.84zM19.2 1.28H7.68v14.08H19.2V1.28z';
break;
case 'table-col-before':
path = 'M6.4 3.776v3.648H2.752v1.792H6.4v3.648h1.728V9.216h3.712V7.424H8.128V3.776zM0 17.92V0h20.48v17.92H0zM12.8 1.28H1.28v14.08H12.8V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.12h-5.12v3.84h5.12V6.4zm0 5.12h-5.12v3.84h5.12v-3.84z';
break;
case 'table-col-delete':
path = 'M6.4 9.98L7.68 8.7v-.256L6.4 7.164V9.98zm6.4-1.532l1.28-1.28V9.92L12.8 8.64v-.192zm7.68 9.472V0H0v17.92h20.48zm-1.28-2.56h-5.12v-1.024l-.256.256-1.024-1.024v1.792H7.68v-1.792l-1.024 1.024-.256-.256v1.024H1.28V1.28H6.4v2.368l.704-.704.576.576V1.216h5.12V3.52l.96-.96.32.32V1.216h5.12V15.36zm-5.76-2.112l-3.136-3.136-3.264 3.264-1.536-1.536 3.264-3.264L5.632 5.44l1.536-1.536 3.136 3.136 3.2-3.2 1.536 1.536-3.2 3.2 3.136 3.136-1.536 1.536z';
break;
case 'table-row-after':
path = 'M13.824 10.176h-2.88v-2.88H9.536v2.88h-2.88v1.344h2.88v2.88h1.408v-2.88h2.88zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm6.4 0H7.68v3.84h5.12V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.056H1.28v9.024H19.2V6.336z';
break;
case 'table-row-before':
path = 'M6.656 6.464h2.88v2.88h1.408v-2.88h2.88V5.12h-2.88V2.24H9.536v2.88h-2.88zM0 17.92V0h20.48v17.92H0zm7.68-2.56h5.12v-3.84H7.68v3.84zm-6.4 0H6.4v-3.84H1.28v3.84zM19.2 1.28H1.28v9.024H19.2V1.28zm0 10.24h-5.12v3.84h5.12v-3.84z';
break;
case 'table-row-delete':
path = 'M17.728 11.456L14.592 8.32l3.2-3.2-1.536-1.536-3.2 3.2L9.92 3.648 8.384 5.12l3.2 3.2-3.264 3.264 1.536 1.536 3.264-3.264 3.136 3.136 1.472-1.536zM0 17.92V0h20.48v17.92H0zm19.2-6.4h-.448l-1.28-1.28H19.2V6.4h-1.792l1.28-1.28h.512V1.28H1.28v3.84h6.208l1.28 1.28H1.28v3.84h7.424l-1.28 1.28H1.28v3.84H19.2v-3.84z';
break;
case 'tablet':
path = 'M4 2h12c.55 0 1 .45 1 1v14c0 .55-.45 1-1 1H4c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1zm11 14V4H5v12h10zM6 5h6l-6 5V5z';
break;
case 'tag':
path = 'M11 2h7v7L8 19l-7-7zm3 6c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z';
break;
case 'tagcloud':
path = 'M11 3v4H1V3h10zm8 0v4h-7V3h7zM7 8v3H1V8h6zm12 0v3H8V8h11zM9 12v2H1v-2h8zm10 0v2h-9v-2h9zM6 15v1H1v-1h5zm5 0v1H7v-1h4zm3 0v1h-2v-1h2zm5 0v1h-4v-1h4z';
break;
case 'testimonial':
path = 'M4 3h12c.55 0 1.02.2 1.41.59S18 4.45 18 5v7c0 .55-.2 1.02-.59 1.41S16.55 14 16 14h-1l-5 5v-5H4c-.55 0-1.02-.2-1.41-.59S2 12.55 2 12V5c0-.55.2-1.02.59-1.41S3.45 3 4 3zm11 2H4v1h11V5zm1 3H4v1h12V8zm-3 3H4v1h9v-1z';
break;
case 'text':
path = 'M18 3v2H2V3h16zm-6 4v2H2V7h10zm6 0v2h-4V7h4zM8 11v2H2v-2h6zm10 0v2h-8v-2h8zm-4 4v2H2v-2h12z';
break;
case 'thumbs-down':
path = 'M7.28 18c-.15.02-.26-.02-.41-.07-.56-.19-.83-.79-.66-1.35.17-.55 1-3.04 1-3.58 0-.53-.75-1-1.35-1h-3c-.6 0-1-.4-1-1s2-7 2-7c.17-.39.55-1 1-1H14v9h-2.14c-.41.41-3.3 4.71-3.58 5.27-.21.41-.6.68-1 .73zM18 12h-2V3h2v9z';
break;
case 'thumbs-up':
path = 'M12.72 2c.15-.02.26.02.41.07.56.19.83.79.66 1.35-.17.55-1 3.04-1 3.58 0 .53.75 1 1.35 1h3c.6 0 1 .4 1 1s-2 7-2 7c-.17.39-.55 1-1 1H6V8h2.14c.41-.41 3.3-4.71 3.58-5.27.21-.41.6-.68 1-.73zM2 8h2v9H2V8z';
break;
case 'tickets-alt':
path = 'M20 6.38L18.99 9.2v-.01c-.52-.19-1.03-.16-1.53.08s-.85.62-1.04 1.14-.16 1.03.07 1.53c.24.5.62.84 1.15 1.03v.01l-1.01 2.82-15.06-5.38.99-2.79c.52.19 1.03.16 1.53-.08.5-.23.84-.61 1.03-1.13s.16-1.03-.08-1.53c-.23-.49-.61-.83-1.13-1.02L4.93 1zm-4.97 5.69l1.37-3.76c.12-.31.1-.65-.04-.95s-.39-.53-.7-.65L8.14 3.98c-.64-.23-1.37.12-1.6.74L5.17 8.48c-.24.65.1 1.37.74 1.6l7.52 2.74c.14.05.28.08.43.08.52 0 1-.33 1.17-.83zM7.97 4.45l7.51 2.73c.19.07.34.21.43.39.08.18.09.38.02.57l-1.37 3.76c-.13.38-.58.59-.96.45L6.09 9.61c-.39-.14-.59-.57-.45-.96l1.37-3.76c.1-.29.39-.49.7-.49.09 0 .17.02.26.05zm6.82 12.14c.35.27.75.41 1.2.41H16v3H0v-2.96c.55 0 1.03-.2 1.41-.59.39-.38.59-.86.59-1.41s-.2-1.02-.59-1.41-.86-.59-1.41-.59V10h1.05l-.28.8 2.87 1.02c-.51.16-.89.62-.89 1.18v4c0 .69.56 1.25 1.25 1.25h8c.69 0 1.25-.56 1.25-1.25v-1.75l.83.3c.12.43.36.78.71 1.04zM3.25 17v-4c0-.41.34-.75.75-.75h.83l7.92 2.83V17c0 .41-.34.75-.75.75H4c-.41 0-.75-.34-.75-.75z';
break;
case 'tickets':
path = 'M20 5.38L18.99 8.2v-.01c-1.04-.37-2.19.18-2.57 1.22-.37 1.04.17 2.19 1.22 2.56v.01l-1.01 2.82L1.57 9.42l.99-2.79c1.04.38 2.19-.17 2.56-1.21s-.17-2.18-1.21-2.55L4.93 0zm-5.45 3.37c.74-2.08-.34-4.37-2.42-5.12-2.08-.74-4.37.35-5.11 2.42-.74 2.08.34 4.38 2.42 5.12 2.07.74 4.37-.35 5.11-2.42zm-2.56-4.74c.89.32 1.57.94 1.97 1.71-.01-.01-.02-.01-.04-.02-.33-.12-.67.09-.78.4-.1.28-.03.57.05.91.04.27.09.62-.06 1.04-.1.29-.33.58-.65 1l-.74 1.01.08-4.08.4.11c.19.04.26-.24.08-.29 0 0-.57-.15-.92-.28-.34-.12-.88-.36-.88-.36-.18-.08-.3.19-.12.27 0 0 .16.08.34.16l.01 1.63L9.2 9.18l.08-4.11c.2.06.4.11.4.11.19.04.26-.23.07-.29 0 0-.56-.15-.91-.28-.07-.02-.14-.05-.22-.08.93-.7 2.19-.94 3.37-.52zM7.4 6.19c.17-.49.44-.92.78-1.27l.04 5c-.94-.95-1.3-2.39-.82-3.73zm4.04 4.75l2.1-2.63c.37-.41.57-.77.69-1.12.05-.12.08-.24.11-.35.09.57.04 1.18-.17 1.77-.45 1.25-1.51 2.1-2.73 2.33zm-.7-3.22l.02 3.22c0 .02 0 .04.01.06-.4 0-.8-.07-1.2-.21-.33-.12-.63-.28-.9-.48zm1.24 6.08l2.1.75c.24.84 1 1.45 1.91 1.45H16v3H0v-2.96c1.1 0 2-.89 2-2 0-1.1-.9-2-2-2V9h1.05l-.28.8 4.28 1.52C4.4 12.03 4 12.97 4 14c0 2.21 1.79 4 4 4s4-1.79 4-4c0-.07-.02-.13-.02-.2zm-6.53-2.33l1.48.53c-.14.04-.15.27.03.28 0 0 .18.02.37.03l.56 1.54-.78 2.36-1.31-3.9c.21-.01.41-.03.41-.03.19-.02.17-.31-.02-.3 0 0-.59.05-.96.05-.07 0-.15 0-.23-.01.13-.2.28-.38.45-.55zM4.4 14c0-.52.12-1.02.32-1.46l1.71 4.7C5.23 16.65 4.4 15.42 4.4 14zm4.19-1.41l1.72.62c.07.17.12.37.12.61 0 .31-.12.66-.28 1.16l-.35 1.2zM11.6 14c0 1.33-.72 2.49-1.79 3.11l1.1-3.18c.06-.17.1-.31.14-.46l.52.19c.02.11.03.22.03.34zm-4.62 3.45l1.08-3.14 1.11 3.03c.01.02.01.04.02.05-.37.13-.77.21-1.19.21-.35 0-.69-.06-1.02-.15z';
break;
case 'tide':
path = 'M17 7.2V3H3v7.1c2.6-.5 4.5-1.5 6.4-2.6.2-.2.4-.3.6-.5v3c-1.9 1.1-4 2.2-7 2.8V17h14V9.9c-2.6.5-4.4 1.5-6.2 2.6-.3.1-.5.3-.8.4V10c2-1.1 4-2.2 7-2.8z';
break;
case 'translation':
path = 'M11 7H9.49c-.63 0-1.25.3-1.59.7L7 5H4.13l-2.39 7h1.69l.74-2H7v4H2c-1.1 0-2-.9-2-2V5c0-1.1.9-2 2-2h7c1.1 0 2 .9 2 2v2zM6.51 9H4.49l1-2.93zM10 8h7c1.1 0 2 .9 2 2v7c0 1.1-.9 2-2 2h-7c-1.1 0-2-.9-2-2v-7c0-1.1.9-2 2-2zm7.25 5v-1.08h-3.17V9.75h-1.16v2.17H9.75V13h1.28c.11.85.56 1.85 1.28 2.62-.87.36-1.89.62-2.31.62-.01.02.22.97.2 1.46.84 0 2.21-.5 3.28-1.15 1.09.65 2.48 1.15 3.34 1.15-.02-.49.2-1.44.2-1.46-.43 0-1.49-.27-2.38-.63.7-.77 1.14-1.77 1.25-2.61h1.36zm-3.81 1.93c-.5-.46-.85-1.13-1.01-1.93h2.09c-.17.8-.51 1.47-1 1.93l-.04.03s-.03-.02-.04-.03z';
break;
case 'trash':
path = 'M12 4h3c.6 0 1 .4 1 1v1H3V5c0-.6.5-1 1-1h3c.2-1.1 1.3-2 2.5-2s2.3.9 2.5 2zM8 4h3c-.2-.6-.9-1-1.5-1S8.2 3.4 8 4zM4 7h11l-.9 10.1c0 .5-.5.9-1 .9H5.9c-.5 0-.9-.4-1-.9L4 7z';
break;
case 'twitter':
path = 'M18.94 4.46c-.49.73-1.11 1.38-1.83 1.9.01.15.01.31.01.47 0 4.85-3.69 10.44-10.43 10.44-2.07 0-4-.61-5.63-1.65.29.03.58.05.88.05 1.72 0 3.3-.59 4.55-1.57-1.6-.03-2.95-1.09-3.42-2.55.22.04.45.07.69.07.33 0 .66-.05.96-.13-1.67-.34-2.94-1.82-2.94-3.6v-.04c.5.27 1.06.44 1.66.46-.98-.66-1.63-1.78-1.63-3.06 0-.67.18-1.3.5-1.84 1.81 2.22 4.51 3.68 7.56 3.83-.06-.27-.1-.55-.1-.84 0-2.02 1.65-3.66 3.67-3.66 1.06 0 2.01.44 2.68 1.16.83-.17 1.62-.47 2.33-.89-.28.85-.86 1.57-1.62 2.02.75-.08 1.45-.28 2.11-.57z';
break;
case 'undo':
path = 'M12 5H7V2L1 6l6 4V7h5c2.2 0 4 1.8 4 4s-1.8 4-4 4H7v2h5c3.3 0 6-2.7 6-6s-2.7-6-6-6z';
break;
case 'universal-access-alt':
path = 'M19 10c0-4.97-4.03-9-9-9s-9 4.03-9 9 4.03 9 9 9 9-4.03 9-9zm-9-7.4c.83 0 1.5.67 1.5 1.5s-.67 1.51-1.5 1.51c-.82 0-1.5-.68-1.5-1.51s.68-1.5 1.5-1.5zM3.4 7.36c0-.65 6.6-.76 6.6-.76s6.6.11 6.6.76-4.47 1.4-4.47 1.4 1.69 8.14 1.06 8.38c-.62.24-3.19-5.19-3.19-5.19s-2.56 5.43-3.18 5.19c-.63-.24 1.06-8.38 1.06-8.38S3.4 8.01 3.4 7.36z';
break;
case 'universal-access':
path = 'M10 2.6c.83 0 1.5.67 1.5 1.5s-.67 1.51-1.5 1.51c-.82 0-1.5-.68-1.5-1.51s.68-1.5 1.5-1.5zM3.4 7.36c0-.65 6.6-.76 6.6-.76s6.6.11 6.6.76-4.47 1.4-4.47 1.4 1.69 8.14 1.06 8.38c-.62.24-3.19-5.19-3.19-5.19s-2.56 5.43-3.18 5.19c-.63-.24 1.06-8.38 1.06-8.38S3.4 8.01 3.4 7.36z';
break;
case 'unlock':
path = 'M12 9V6c0-1.1-.9-2-2-2s-2 .9-2 2H6c0-2.21 1.79-4 4-4s4 1.79 4 4v3h1c.55 0 1 .45 1 1v7c0 .55-.45 1-1 1H5c-.55 0-1-.45-1-1v-7c0-.55.45-1 1-1h7zm-1 7l-.36-2.15c.51-.24.86-.75.86-1.35 0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5c0 .6.35 1.11.86 1.35L9 16h2z';
break;
case 'update':
path = 'M10.2 3.28c3.53 0 6.43 2.61 6.92 6h2.08l-3.5 4-3.5-4h2.32c-.45-1.97-2.21-3.45-4.32-3.45-1.45 0-2.73.71-3.54 1.78L4.95 5.66C6.23 4.2 8.11 3.28 10.2 3.28zm-.4 13.44c-3.52 0-6.43-2.61-6.92-6H.8l3.5-4c1.17 1.33 2.33 2.67 3.5 4H5.48c.45 1.97 2.21 3.45 4.32 3.45 1.45 0 2.73-.71 3.54-1.78l1.71 1.95c-1.28 1.46-3.15 2.38-5.25 2.38z';
break;
case 'upload':
path = 'M8 14V8H5l5-6 5 6h-3v6H8zm-2 2v-6H4v8h12.01v-8H14v6H6z';
break;
case 'vault':
path = 'M18 17V3c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v14c0 .55.45 1 1 1h14c.55 0 1-.45 1-1zm-1 0H3V3h14v14zM4.75 4h10.5c.41 0 .75.34.75.75V6h-1v3h1v2h-1v3h1v1.25c0 .41-.34.75-.75.75H4.75c-.41 0-.75-.34-.75-.75V4.75c0-.41.34-.75.75-.75zM13 10c0-2.21-1.79-4-4-4s-4 1.79-4 4 1.79 4 4 4 4-1.79 4-4zM9 7l.77 1.15C10.49 8.46 11 9.17 11 10c0 1.1-.9 2-2 2s-2-.9-2-2c0-.83.51-1.54 1.23-1.85z';
break;
case 'video-alt':
path = 'M8 5c0-.55-.45-1-1-1H2c-.55 0-1 .45-1 1 0 .57.49 1 1 1h5c.55 0 1-.45 1-1zm6 5l4-4v10l-4-4v-2zm-1 4V8c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h8c.55 0 1-.45 1-1z';
break;
case 'video-alt2':
path = 'M12 13V7c0-1.1-.9-2-2-2H3c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2zm1-2.5l6 4.5V5l-6 4.5v1z';
break;
case 'video-alt3':
path = 'M19 15V5c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2zM8 14V6l6 4z';
break;
case 'visibility':
path = 'M19.7 9.4C17.7 6 14 3.9 10 3.9S2.3 6 .3 9.4L0 10l.3.6c2 3.4 5.7 5.5 9.7 5.5s7.7-2.1 9.7-5.5l.3-.6-.3-.6zM10 14.1c-3.1 0-6-1.6-7.7-4.1C3.6 8 5.7 6.6 8 6.1c-.9.6-1.5 1.7-1.5 2.9 0 1.9 1.6 3.5 3.5 3.5s3.5-1.6 3.5-3.5c0-1.2-.6-2.3-1.5-2.9 2.3.5 4.4 1.9 5.7 3.9-1.7 2.5-4.6 4.1-7.7 4.1z';
break;
case 'warning':
path = 'M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm1.13 9.38l.35-6.46H8.52l.35 6.46h2.26zm-.09 3.36c.24-.23.37-.55.37-.96 0-.42-.12-.74-.36-.97s-.59-.35-1.06-.35-.82.12-1.07.35-.37.55-.37.97c0 .41.13.73.38.96.26.23.61.34 1.06.34s.8-.11 1.05-.34z';
break;
case 'welcome-add-page':
path = 'M17 7V4h-2V2h-3v1H3v15h11V9h1V7h2zm-1-2v1h-2v2h-1V6h-2V5h2V3h1v2h2z';
break;
case 'welcome-comments':
path = 'M5 2h10c1.1 0 2 .9 2 2v8c0 1.1-.9 2-2 2h-2l-5 5v-5H5c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2zm8.5 8.5L11 8l2.5-2.5-1-1L10 7 7.5 4.5l-1 1L9 8l-2.5 2.5 1 1L10 9l2.5 2.5z';
break;
case 'welcome-learn-more':
path = 'M10 10L2.54 7.02 3 18H1l.48-11.41L0 6l10-4 10 4zm0-5c-.55 0-1 .22-1 .5s.45.5 1 .5 1-.22 1-.5-.45-.5-1-.5zm0 6l5.57-2.23c.71.94 1.2 2.07 1.36 3.3-.3-.04-.61-.07-.93-.07-2.55 0-4.78 1.37-6 3.41C8.78 13.37 6.55 12 4 12c-.32 0-.63.03-.93.07.16-1.23.65-2.36 1.36-3.3z';
break;
case 'welcome-view-site':
path = 'M18 14V4c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h14c.55 0 1-.45 1-1zm-8-8c2.3 0 4.4 1.14 6 3-1.6 1.86-3.7 3-6 3s-4.4-1.14-6-3c1.6-1.86 3.7-3 6-3zm2 3c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2zm2 8h3v1H3v-1h3v-1h8v1z';
break;
case 'welcome-widgets-menus':
path = 'M19 16V3c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v13c0 .55.45 1 1 1h15c.55 0 1-.45 1-1zM4 4h13v4H4V4zm1 1v2h3V5H5zm4 0v2h3V5H9zm4 0v2h3V5h-3zm-8.5 5c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5.22-.5.5-.5zM6 10h4v1H6v-1zm6 0h5v5h-5v-5zm-7.5 2c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5.22-.5.5-.5zM6 12h4v1H6v-1zm7 0v2h3v-2h-3zm-8.5 2c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5.22-.5.5-.5zM6 14h4v1H6v-1z';
break;
case 'welcome-write-blog':
path = 'M16.89 1.2l1.41 1.41c.39.39.39 1.02 0 1.41L14 8.33V18H3V3h10.67l1.8-1.8c.4-.39 1.03-.4 1.42 0zm-5.66 8.48l5.37-5.36-1.42-1.42-5.36 5.37-.71 2.12z';
break;
case 'wordpress-alt':
path = 'M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z';
break;
case 'wordpress':
path = 'M20 10c0-5.52-4.48-10-10-10S0 4.48 0 10s4.48 10 10 10 10-4.48 10-10zM10 1.01c4.97 0 8.99 4.02 8.99 8.99s-4.02 8.99-8.99 8.99S1.01 14.97 1.01 10 5.03 1.01 10 1.01zM8.01 14.82L4.96 6.61c.49-.03 1.05-.08 1.05-.08.43-.05.38-1.01-.06-.99 0 0-1.29.1-2.13.1-.15 0-.33 0-.52-.01 1.44-2.17 3.9-3.6 6.7-3.6 2.09 0 3.99.79 5.41 2.09-.6-.08-1.45.35-1.45 1.42 0 .66.38 1.22.79 1.88.31.54.5 1.22.5 2.21 0 1.34-1.27 4.48-1.27 4.48l-2.71-7.5c.48-.03.75-.16.75-.16.43-.05.38-1.1-.05-1.08 0 0-1.3.11-2.14.11-.78 0-2.11-.11-2.11-.11-.43-.02-.48 1.06-.05 1.08l.84.08 1.12 3.04zm6.02 2.15L16.64 10s.67-1.69.39-3.81c.63 1.14.94 2.42.94 3.81 0 2.96-1.56 5.58-3.94 6.97zM2.68 6.77L6.5 17.25c-2.67-1.3-4.47-4.08-4.47-7.25 0-1.16.2-2.23.65-3.23zm7.45 4.53l2.29 6.25c-.75.27-1.57.42-2.42.42-.72 0-1.41-.11-2.06-.3z';
break;
case 'yes-alt':
path = 'M10 2c-4.42 0-8 3.58-8 8s3.58 8 8 8 8-3.58 8-8-3.58-8-8-8zm-.615 12.66h-1.34l-3.24-4.54 1.34-1.25 2.57 2.4 5.14-5.93 1.34.94-5.81 8.38z';
break;
case 'yes':
path = 'M14.83 4.89l1.34.94-5.81 8.38H9.02L5.78 9.67l1.34-1.25 2.57 2.4z';
break;
}
if (!path) {
return null;
}
var iconClass = ['dashicon', 'dashicons-' + icon, className].filter(Boolean).join(' ');
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_primitives__WEBPACK_IMPORTED_MODULE_6__["SVG"], {
"aria-hidden": true,
role: "img",
focusable: "false",
className: iconClass,
xmlns: "http://www.w3.org/2000/svg",
width: size,
height: size,
viewBox: "0 0 20 20"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_primitives__WEBPACK_IMPORTED_MODULE_6__["Path"], {
d: path
}));
}
}]);
return Dashicon;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/date-time/date.js":
/*!***************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/date-time/date.js ***!
\***************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_datepicker__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-datepicker */ "./node_modules/react-datepicker/es/index.js");
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! moment */ "moment");
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_4__);
/**
* External dependencies
*/
/**
* Module Constants
*/
var TIMEZONELESS_FORMAT = 'YYYY-MM-DDTHH:mm:ss';
function DatePicker(_ref) {
var currentDate = _ref.currentDate,
onChange = _ref.onChange,
args = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["currentDate", "onChange"]);
var momentDate = currentDate ? moment__WEBPACK_IMPORTED_MODULE_4___default()(currentDate) : moment__WEBPACK_IMPORTED_MODULE_4___default()();
var onChangeMoment = function onChangeMoment(newDate) {
return onChange(newDate.format(TIMEZONELESS_FORMAT));
};
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(react_datepicker__WEBPACK_IMPORTED_MODULE_3__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
inline: true,
selected: momentDate,
onChange: onChangeMoment
}, args));
}
/* harmony default export */ __webpack_exports__["default"] = (DatePicker);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/date-time/index.js":
/*!****************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/date-time/index.js ***!
\****************************************************************************/
/*! exports provided: DatePicker, TimePicker, DateTimePicker */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DateTimePicker", function() { return DateTimePicker; });
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _date__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./date */ "./node_modules/@wordpress/components/build-module/date-time/date.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DatePicker", function() { return _date__WEBPACK_IMPORTED_MODULE_3__["default"]; });
/* harmony import */ var _time__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./time */ "./node_modules/@wordpress/components/build-module/date-time/time.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TimePicker", function() { return _time__WEBPACK_IMPORTED_MODULE_4__["default"]; });
/**
* Internal dependencies
*/
function DateTimePicker(_ref) {
var currentDate = _ref.currentDate,
onChange = _ref.onChange,
is12Hour = _ref.is12Hour,
args = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["currentDate", "onChange", "is12Hour"]);
return [Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_date__WEBPACK_IMPORTED_MODULE_3__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
key: "date-picker",
currentDate: currentDate,
onChange: onChange
}, args)), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_time__WEBPACK_IMPORTED_MODULE_4__["default"], {
key: "time-picker",
currentTime: currentDate,
onChange: onChange,
is12Hour: is12Hour
})];
}
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/date-time/time.js":
/*!***************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/date-time/time.js ***!
\***************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! moment */ "moment");
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../button */ "./node_modules/@wordpress/components/build-module/button/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Module Constants
*/
var TIMEZONELESS_FORMAT = 'YYYY-MM-DDTHH:mm:ss';
var TimePicker =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(TimePicker, _Component);
function TimePicker() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, TimePicker);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(TimePicker).apply(this, arguments));
_this.state = {
hours: '',
minutes: '',
am: true,
date: null
};
_this.updateHours = _this.updateHours.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this)));
_this.updateMinutes = _this.updateMinutes.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this)));
_this.onChangeHours = _this.onChangeHours.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this)));
_this.onChangeMinutes = _this.onChangeMinutes.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this)));
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(TimePicker, [{
key: "componentDidMount",
value: function componentDidMount() {
this.syncState(this.props);
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps) {
var _this$props = this.props,
currentTime = _this$props.currentTime,
is12Hour = _this$props.is12Hour;
if (currentTime !== prevProps.currentTime || is12Hour !== prevProps.is12Hour) {
this.syncState(this.props);
}
}
}, {
key: "syncState",
value: function syncState(_ref) {
var currentTime = _ref.currentTime,
is12Hour = _ref.is12Hour;
var selected = currentTime ? moment__WEBPACK_IMPORTED_MODULE_8___default()(currentTime) : moment__WEBPACK_IMPORTED_MODULE_8___default()();
var minutes = selected.format('mm');
var am = selected.format('A');
var hours = selected.format(is12Hour ? 'hh' : 'HH');
var date = currentTime ? moment__WEBPACK_IMPORTED_MODULE_8___default()(currentTime) : moment__WEBPACK_IMPORTED_MODULE_8___default()();
this.setState({
minutes: minutes,
hours: hours,
am: am,
date: date
});
}
}, {
key: "updateHours",
value: function updateHours() {
var _this$props2 = this.props,
is12Hour = _this$props2.is12Hour,
onChange = _this$props2.onChange;
var _this$state = this.state,
am = _this$state.am,
hours = _this$state.hours,
date = _this$state.date;
var value = parseInt(hours, 10);
if (!Object(lodash__WEBPACK_IMPORTED_MODULE_7__["isInteger"])(value) || is12Hour && (value < 1 || value > 12) || !is12Hour && (value < 0 || value > 23)) {
this.syncState(this.props);
return;
}
var newDate = is12Hour ? date.clone().hours(am === 'AM' ? value % 12 : (value % 12 + 12) % 24) : date.clone().hours(value);
this.setState({
date: newDate
});
var formattedDate = newDate.format(TIMEZONELESS_FORMAT);
onChange(formattedDate);
}
}, {
key: "updateMinutes",
value: function updateMinutes() {
var onChange = this.props.onChange;
var _this$state2 = this.state,
minutes = _this$state2.minutes,
date = _this$state2.date;
var value = parseInt(minutes, 10);
if (!Object(lodash__WEBPACK_IMPORTED_MODULE_7__["isInteger"])(value) || value < 0 || value > 59) {
this.syncState(this.props);
return;
}
var newDate = date.clone().minutes(value);
this.setState({
date: newDate
});
var formattedDate = newDate.format(TIMEZONELESS_FORMAT);
onChange(formattedDate);
}
}, {
key: "updateAmPm",
value: function updateAmPm(value) {
var _this2 = this;
return function () {
var onChange = _this2.props.onChange;
var _this2$state = _this2.state,
am = _this2$state.am,
date = _this2$state.date,
hours = _this2$state.hours;
if (am === value) {
return;
}
var newDate;
if (value === 'PM') {
newDate = date.clone().hours((parseInt(hours, 10) % 12 + 12) % 24);
} else {
newDate = date.clone().hours(parseInt(hours, 10) % 12);
}
_this2.setState({
date: newDate
});
var formattedDate = newDate.format(TIMEZONELESS_FORMAT);
onChange(formattedDate);
};
}
}, {
key: "onChangeHours",
value: function onChangeHours(event) {
this.setState({
hours: event.target.value
});
}
}, {
key: "onChangeMinutes",
value: function onChangeMinutes(event) {
this.setState({
minutes: event.target.value
});
}
}, {
key: "render",
value: function render() {
var is12Hour = this.props.is12Hour;
var _this$state3 = this.state,
minutes = _this$state3.minutes,
hours = _this$state3.hours,
am = _this$state3.am;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
className: "components-time-picker"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("input", {
className: "components-time-picker__input",
type: "text",
value: hours,
onChange: this.onChangeHours,
onBlur: this.updateHours
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("span", {
className: "components-time-picker__separator"
}, ":"), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("input", {
className: "components-time-picker__input",
type: "text",
value: minutes,
onChange: this.onChangeMinutes,
onBlur: this.updateMinutes
}), is12Hour && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_button__WEBPACK_IMPORTED_MODULE_10__["default"], {
isDefault: true,
className: "components-time-picker__am-button",
isToggled: am === 'AM',
onClick: this.updateAmPm('AM')
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('AM')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_button__WEBPACK_IMPORTED_MODULE_10__["default"], {
isDefault: true,
className: "components-time-picker__pm-button",
isToggled: am === 'PM',
onClick: this.updateAmPm('PM')
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_9__["__"])('PM'))));
}
}]);
return TimePicker;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]);
/* harmony default export */ __webpack_exports__["default"] = (TimePicker);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/disabled/index.js":
/*!***************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/disabled/index.js ***!
\***************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/dom */ "@wordpress/dom");
/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_11__);
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
var _createContext = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createContext"])(false),
Consumer = _createContext.Consumer,
Provider = _createContext.Provider;
/**
* Names of control nodes which qualify for disabled behavior.
*
* See WHATWG HTML Standard: 4.10.18.5: "Enabling and disabling form controls: the disabled attribute".
*
* @link https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#enabling-and-disabling-form-controls:-the-disabled-attribute
*
* @type {string[]}
*/
var DISABLED_ELIGIBLE_NODE_NAMES = ['BUTTON', 'FIELDSET', 'INPUT', 'OPTGROUP', 'OPTION', 'SELECT', 'TEXTAREA'];
var Disabled =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(Disabled, _Component);
function Disabled() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Disabled);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(Disabled).apply(this, arguments));
_this.bindNode = _this.bindNode.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.disable = _this.disable.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this))); // Debounce re-disable since disabling process itself will incur
// additional mutations which should be ignored.
_this.debouncedDisable = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["debounce"])(_this.disable, {
leading: true
});
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(Disabled, [{
key: "componentDidMount",
value: function componentDidMount() {
this.disable();
this.observer = new window.MutationObserver(this.debouncedDisable);
this.observer.observe(this.node, {
childList: true,
attributes: true,
subtree: true
});
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.observer.disconnect();
this.debouncedDisable.cancel();
}
}, {
key: "bindNode",
value: function bindNode(node) {
this.node = node;
}
}, {
key: "disable",
value: function disable() {
_wordpress_dom__WEBPACK_IMPORTED_MODULE_11__["focus"].focusable.find(this.node).forEach(function (focusable) {
if (Object(lodash__WEBPACK_IMPORTED_MODULE_9__["includes"])(DISABLED_ELIGIBLE_NODE_NAMES, focusable.nodeName)) {
focusable.setAttribute('disabled', '');
}
if (focusable.hasAttribute('tabindex')) {
focusable.removeAttribute('tabindex');
}
if (focusable.hasAttribute('contenteditable')) {
focusable.setAttribute('contenteditable', 'false');
}
});
}
}, {
key: "render",
value: function render() {
var _this$props = this.props,
className = _this$props.className,
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props, ["className"]);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(Provider, {
value: true
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
ref: this.bindNode,
className: classnames__WEBPACK_IMPORTED_MODULE_10___default()(className, 'components-disabled')
}, props), this.props.children));
}
}]);
return Disabled;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]);
Disabled.Consumer = Consumer;
/* harmony default export */ __webpack_exports__["default"] = (Disabled);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/draggable/index.js":
/*!****************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/draggable/index.js ***!
\****************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__);
/**
* External dependencies
*/
/**
* WordPress Dependencies
*/
var dragImageClass = 'components-draggable__invisible-drag-image';
var cloneWrapperClass = 'components-draggable__clone';
var cloneHeightTransformationBreakpoint = 700;
var clonePadding = 20;
var isChromeUA = function isChromeUA() {
return /Chrome/i.test(window.navigator.userAgent);
};
var documentHasIframes = function documentHasIframes() {
return Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_6__["default"])(document.getElementById('editor').querySelectorAll('iframe')).length > 0;
};
var Draggable =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(Draggable, _Component);
function Draggable() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, Draggable);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(Draggable).apply(this, arguments));
_this.onDragStart = _this.onDragStart.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this)));
_this.onDragOver = _this.onDragOver.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this)));
_this.onDrop = _this.onDrop.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this)));
_this.onDragEnd = _this.onDragEnd.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this)));
_this.resetDragState = _this.resetDragState.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this)));
_this.isChromeAndHasIframes = false;
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(Draggable, [{
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.resetDragState();
}
/**
* Removes the element clone, resets cursor, and removes drag listener.
* @param {Object} event The non-custom DragEvent.
*/
}, {
key: "onDragEnd",
value: function onDragEnd(event) {
var _this$props$onDragEnd = this.props.onDragEnd,
onDragEnd = _this$props$onDragEnd === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_7__["noop"] : _this$props$onDragEnd;
if (event) {
event.preventDefault();
}
this.resetDragState();
this.props.setTimeout(onDragEnd);
}
/*
* Updates positioning of element clone based on mouse movement during dragging.
* @param {Object} event The non-custom DragEvent.
*/
}, {
key: "onDragOver",
value: function onDragOver(event) {
this.cloneWrapper.style.top = "".concat(parseInt(this.cloneWrapper.style.top, 10) + event.clientY - this.cursorTop, "px");
this.cloneWrapper.style.left = "".concat(parseInt(this.cloneWrapper.style.left, 10) + event.clientX - this.cursorLeft, "px"); // Update cursor coordinates.
this.cursorLeft = event.clientX;
this.cursorTop = event.clientY;
}
}, {
key: "onDrop",
value: function onDrop() {
// As per https://html.spec.whatwg.org/multipage/dnd.html#dndevents
// the target node for the dragend is the source node that started the drag operation,
// while drop event's target is the current target element.
this.onDragEnd(null);
}
/**
* - Clones the current element and spawns clone over original element.
* - Adds a fake temporary drag image to avoid browser defaults.
* - Sets transfer data.
* - Adds dragover listener.
* @param {Object} event The non-custom DragEvent.
* @param {string} elementId The HTML id of the element to be dragged.
* @param {Object} transferData The data to be set to the event's dataTransfer - to be accessible in any later drop logic.
*/
}, {
key: "onDragStart",
value: function onDragStart(event) {
var _this$props = this.props,
elementId = _this$props.elementId,
transferData = _this$props.transferData,
_this$props$onDragSta = _this$props.onDragStart,
onDragStart = _this$props$onDragSta === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_7__["noop"] : _this$props$onDragSta;
var element = document.getElementById(elementId);
if (!element) {
event.preventDefault();
return;
} // Set a fake drag image to avoid browser defaults. Remove from DOM
// right after. event.dataTransfer.setDragImage is not supported yet in
// IE, we need to check for its existence first.
if ('function' === typeof event.dataTransfer.setDragImage) {
var dragImage = document.createElement('div');
dragImage.id = "drag-image-".concat(elementId);
dragImage.classList.add(dragImageClass);
document.body.appendChild(dragImage);
event.dataTransfer.setDragImage(dragImage, 0, 0);
this.props.setTimeout(function () {
document.body.removeChild(dragImage);
});
}
event.dataTransfer.setData('text', JSON.stringify(transferData)); // Prepare element clone and append to element wrapper.
var elementRect = element.getBoundingClientRect();
var elementWrapper = element.parentNode;
var elementTopOffset = parseInt(elementRect.top, 10);
var elementLeftOffset = parseInt(elementRect.left, 10);
var clone = element.cloneNode(true);
clone.id = "clone-".concat(elementId);
this.cloneWrapper = document.createElement('div');
this.cloneWrapper.classList.add(cloneWrapperClass);
this.cloneWrapper.style.width = "".concat(elementRect.width + clonePadding * 2, "px");
if (elementRect.height > cloneHeightTransformationBreakpoint) {
// Scale down clone if original element is larger than 700px.
this.cloneWrapper.style.transform = 'scale(0.5)';
this.cloneWrapper.style.transformOrigin = 'top left'; // Position clone near the cursor.
this.cloneWrapper.style.top = "".concat(event.clientY - 100, "px");
this.cloneWrapper.style.left = "".concat(event.clientX, "px");
} else {
// Position clone right over the original element (20px padding).
this.cloneWrapper.style.top = "".concat(elementTopOffset - clonePadding, "px");
this.cloneWrapper.style.left = "".concat(elementLeftOffset - clonePadding, "px");
} // Hack: Remove iFrames as it's causing the embeds drag clone to freeze
Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_6__["default"])(clone.querySelectorAll('iframe')).forEach(function (child) {
return child.parentNode.removeChild(child);
});
this.cloneWrapper.appendChild(clone);
elementWrapper.appendChild(this.cloneWrapper); // Mark the current cursor coordinates.
this.cursorLeft = event.clientX;
this.cursorTop = event.clientY; // Update cursor to 'grabbing', document wide.
document.body.classList.add('is-dragging-components-draggable');
document.addEventListener('dragover', this.onDragOver); // Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=737691#c8
// dragend event won't be dispatched in the chrome browser
// when iframes are affected by the drag operation. So, in that case,
// we use the drop event to wrap up the dragging operation.
// This way the hack is contained to a specific use case and the external API
// still relies mostly on the dragend event.
if (isChromeUA() && documentHasIframes()) {
this.isChromeAndHasIframes = true;
document.addEventListener('drop', this.onDrop);
}
this.props.setTimeout(onDragStart);
}
/**
* Cleans up drag state when drag has completed, or component unmounts
* while dragging.
*/
}, {
key: "resetDragState",
value: function resetDragState() {
// Remove drag clone
document.removeEventListener('dragover', this.onDragOver);
if (this.cloneWrapper && this.cloneWrapper.parentNode) {
this.cloneWrapper.parentNode.removeChild(this.cloneWrapper);
this.cloneWrapper = null;
}
if (this.isChromeAndHasIframes) {
this.isChromeAndHasIframes = false;
document.removeEventListener('drop', this.onDrop);
} // Reset cursor.
document.body.classList.remove('is-dragging-components-draggable');
}
}, {
key: "render",
value: function render() {
var children = this.props.children;
return children({
onDraggableStart: this.onDragStart,
onDraggableEnd: this.onDragEnd
});
}
}]);
return Draggable;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]);
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__["withSafeTimeout"])(Draggable));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/drop-zone/index.js":
/*!****************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/drop-zone/index.js ***!
\****************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var _dashicon__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../dashicon */ "./node_modules/@wordpress/components/build-module/dashicon/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var DropZone =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(DropZone, _Component);
function DropZone() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, DropZone);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(DropZone).apply(this, arguments));
_this.setZoneNode = _this.setZoneNode.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this)));
_this.state = {
isDraggingOverDocument: false,
isDraggingOverElement: false,
position: null,
type: null
};
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(DropZone, [{
key: "componentDidMount",
value: function componentDidMount() {
this.context.dropzones.add({
element: this.zone,
updateState: this.setState.bind(this),
onDrop: this.props.onDrop,
onFilesDrop: this.props.onFilesDrop,
onHTMLDrop: this.props.onHTMLDrop
});
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.context.dropzones.remove(this.zone);
}
}, {
key: "setZoneNode",
value: function setZoneNode(node) {
this.zone = node;
}
}, {
key: "render",
value: function render() {
var _this$props = this.props,
className = _this$props.className,
label = _this$props.label;
var _this$state = this.state,
isDraggingOverDocument = _this$state.isDraggingOverDocument,
isDraggingOverElement = _this$state.isDraggingOverElement,
position = _this$state.position,
type = _this$state.type;
var classes = classnames__WEBPACK_IMPORTED_MODULE_8___default()('components-drop-zone', className, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])({
'is-active': isDraggingOverDocument || isDraggingOverElement,
'is-dragging-over-document': isDraggingOverDocument,
'is-dragging-over-element': isDraggingOverElement,
'is-close-to-top': position && position.y === 'top',
'is-close-to-bottom': position && position.y === 'bottom',
'is-close-to-left': position && position.x === 'left',
'is-close-to-right': position && position.x === 'right'
}, "is-dragging-".concat(type), !!type));
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("div", {
ref: this.setZoneNode,
className: classes
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("div", {
className: "components-drop-zone__content"
}, [Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_dashicon__WEBPACK_IMPORTED_MODULE_11__["default"], {
key: "icon",
icon: "upload",
size: "40",
className: "components-drop-zone__content-icon"
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("span", {
key: "text",
className: "components-drop-zone__content-text"
}, label ? label : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__["__"])('Drop files to upload'))]));
}
}]);
return DropZone;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]);
DropZone.contextTypes = {
dropzones: lodash__WEBPACK_IMPORTED_MODULE_9__["noop"]
};
/* harmony default export */ __webpack_exports__["default"] = (DropZone);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/drop-zone/provider.js":
/*!*******************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/drop-zone/provider.js ***!
\*******************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js");
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/is-shallow-equal */ "@wordpress/is-shallow-equal");
/* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_9__);
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
var DropZoneProvider =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(DropZoneProvider, _Component);
function DropZoneProvider() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, DropZoneProvider);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(DropZoneProvider).apply(this, arguments));
_this.resetDragState = _this.resetDragState.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this)));
_this.toggleDraggingOverDocument = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["throttle"])(_this.toggleDraggingOverDocument.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))), 200);
_this.dragOverListener = _this.dragOverListener.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this)));
_this.isWithinZoneBounds = _this.isWithinZoneBounds.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this)));
_this.onDrop = _this.onDrop.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this)));
_this.state = {
isDraggingOverDocument: false,
hoveredDropZone: -1,
position: null
};
_this.dropzones = [];
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(DropZoneProvider, [{
key: "dragOverListener",
value: function dragOverListener(event) {
this.toggleDraggingOverDocument(event, this.getDragEventType(event));
event.preventDefault();
}
}, {
key: "getChildContext",
value: function getChildContext() {
var _this2 = this;
return {
dropzones: {
add: function add(_ref) {
var element = _ref.element,
updateState = _ref.updateState,
onDrop = _ref.onDrop,
onFilesDrop = _ref.onFilesDrop,
onHTMLDrop = _ref.onHTMLDrop;
_this2.dropzones.push({
element: element,
updateState: updateState,
onDrop: onDrop,
onFilesDrop: onFilesDrop,
onHTMLDrop: onHTMLDrop
});
},
remove: function remove(element) {
_this2.dropzones = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["filter"])(_this2.dropzones, function (dropzone) {
return dropzone.element !== element;
});
}
}
};
}
}, {
key: "componentDidMount",
value: function componentDidMount() {
window.addEventListener('dragover', this.dragOverListener);
window.addEventListener('drop', this.onDrop);
window.addEventListener('mouseup', this.resetDragState); // Disable reason: Can't use a ref since this component just renders its children
// eslint-disable-next-line react/no-find-dom-node
this.container = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["findDOMNode"])(this);
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
window.removeEventListener('dragover', this.dragOverListener);
window.removeEventListener('drop', this.onDrop);
window.removeEventListener('mouseup', this.resetDragState);
}
}, {
key: "resetDragState",
value: function resetDragState() {
// Avoid throttled drag over handler calls
this.toggleDraggingOverDocument.cancel();
var _this$state = this.state,
isDraggingOverDocument = _this$state.isDraggingOverDocument,
hoveredDropZone = _this$state.hoveredDropZone;
if (!isDraggingOverDocument && hoveredDropZone === -1) {
return;
}
this.setState({
isDraggingOverDocument: false,
hoveredDropZone: -1,
position: null
});
this.dropzones.forEach(function (_ref2) {
var updateState = _ref2.updateState;
updateState({
isDraggingOverDocument: false,
isDraggingOverElement: false,
position: null,
type: null
});
});
}
}, {
key: "getDragEventType",
value: function getDragEventType(event) {
if (event.dataTransfer) {
// Use lodash `includes` here as in the Edge browser `types` is implemented
// as a DomStringList, whereas in other browsers it's an array. `includes`
// happily works with both types.
if (Object(lodash__WEBPACK_IMPORTED_MODULE_7__["includes"])(event.dataTransfer.types, 'Files')) {
return 'file';
}
if (Object(lodash__WEBPACK_IMPORTED_MODULE_7__["includes"])(event.dataTransfer.types, 'text/html')) {
return 'html';
}
}
return 'default';
}
}, {
key: "doesDropzoneSupportType",
value: function doesDropzoneSupportType(dropzone, type) {
return type === 'file' && dropzone.onFilesDrop || type === 'html' && dropzone.onHTMLDrop || type === 'default' && dropzone.onDrop;
}
}, {
key: "toggleDraggingOverDocument",
value: function toggleDraggingOverDocument(event, dragEventType) {
var _this3 = this;
// In some contexts, it may be necessary to capture and redirect the
// drag event (e.g. atop an `iframe`). To accommodate this, you can
// create an instance of CustomEvent with the original event specified
// as the `detail` property.
//
// See: https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Creating_and_triggering_events
var detail = window.CustomEvent && event instanceof window.CustomEvent ? event.detail : event; // Index of hovered dropzone.
var hoveredDropZones = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["filter"])(this.dropzones, function (dropzone) {
return _this3.doesDropzoneSupportType(dropzone, dragEventType) && _this3.isWithinZoneBounds(dropzone.element, detail.clientX, detail.clientY);
}); // Find the leaf dropzone not containing another dropzone
var hoveredDropZone = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["find"])(hoveredDropZones, function (zone) {
return !Object(lodash__WEBPACK_IMPORTED_MODULE_7__["some"])(hoveredDropZones, function (subZone) {
return subZone !== zone && zone.element.parentElement.contains(subZone.element);
});
});
var hoveredDropZoneIndex = this.dropzones.indexOf(hoveredDropZone);
var position = null;
if (hoveredDropZone) {
var rect = hoveredDropZone.element.getBoundingClientRect();
position = {
x: detail.clientX - rect.left < rect.right - detail.clientX ? 'left' : 'right',
y: detail.clientY - rect.top < rect.bottom - detail.clientY ? 'top' : 'bottom'
};
} // Optimisation: Only update the changed dropzones
var dropzonesToUpdate = [];
if (!this.state.isDraggingOverDocument) {
dropzonesToUpdate = this.dropzones;
} else if (hoveredDropZoneIndex !== this.state.hoveredDropZone) {
if (this.state.hoveredDropZone !== -1) {
dropzonesToUpdate.push(this.dropzones[this.state.hoveredDropZone]);
}
if (hoveredDropZone) {
dropzonesToUpdate.push(hoveredDropZone);
}
} else if (hoveredDropZone && hoveredDropZoneIndex === this.state.hoveredDropZone && !Object(lodash__WEBPACK_IMPORTED_MODULE_7__["isEqual"])(position, this.state.position)) {
dropzonesToUpdate.push(hoveredDropZone);
} // Notifying the dropzones
dropzonesToUpdate.map(function (dropzone) {
var index = _this3.dropzones.indexOf(dropzone);
var isDraggingOverDropZone = index === hoveredDropZoneIndex;
dropzone.updateState({
isDraggingOverElement: isDraggingOverDropZone,
position: isDraggingOverDropZone ? position : null,
isDraggingOverDocument: _this3.doesDropzoneSupportType(dropzone, dragEventType),
type: isDraggingOverDropZone ? dragEventType : null
});
});
var newState = {
isDraggingOverDocument: true,
hoveredDropZone: hoveredDropZoneIndex,
position: position
};
if (!_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_9___default()(newState, this.state)) {
this.setState(newState);
}
}
}, {
key: "isWithinZoneBounds",
value: function isWithinZoneBounds(dropzone, x, y) {
var isWithinElement = function isWithinElement(element) {
var rect = element.getBoundingClientRect(); /// make sure the rect is a valid rect
if (rect.bottom === rect.top || rect.left === rect.right) {
return false;
}
return x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom;
};
return isWithinElement(dropzone);
}
}, {
key: "onDrop",
value: function onDrop(event) {
// This seemingly useless line has been shown to resolve a Safari issue
// where files dragged directly from the dock are not recognized
event.dataTransfer && event.dataTransfer.files.length; // eslint-disable-line no-unused-expressions
var _this$state2 = this.state,
position = _this$state2.position,
hoveredDropZone = _this$state2.hoveredDropZone;
var dragEventType = this.getDragEventType(event);
var dropzone = this.dropzones[hoveredDropZone];
var isValidDropzone = !!dropzone && this.container.contains(event.target);
this.resetDragState();
if (isValidDropzone) {
switch (dragEventType) {
case 'file':
dropzone.onFilesDrop(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(event.dataTransfer.files), position);
break;
case 'html':
dropzone.onHTMLDrop(event.dataTransfer.getData('text/html'), position);
break;
case 'default':
dropzone.onDrop(event, position);
}
}
event.stopPropagation();
event.preventDefault();
}
}, {
key: "render",
value: function render() {
var children = this.props.children;
return children;
}
}]);
return DropZoneProvider;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]);
DropZoneProvider.childContextTypes = {
dropzones: lodash__WEBPACK_IMPORTED_MODULE_7__["noop"]
};
/* harmony default export */ __webpack_exports__["default"] = (DropZoneProvider);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/dropdown-menu/index.js":
/*!********************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/dropdown-menu/index.js ***!
\********************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes");
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _icon_button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../icon-button */ "./node_modules/@wordpress/components/build-module/icon-button/index.js");
/* harmony import */ var _dropdown__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../dropdown */ "./node_modules/@wordpress/components/build-module/dropdown/index.js");
/* harmony import */ var _navigable_container__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../navigable-container */ "./node_modules/@wordpress/components/build-module/navigable-container/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function DropdownMenu(_ref) {
var _ref$icon = _ref.icon,
icon = _ref$icon === void 0 ? 'menu' : _ref$icon,
label = _ref.label,
menuLabel = _ref.menuLabel,
controls = _ref.controls,
className = _ref.className;
if (!controls || !controls.length) {
return null;
} // Normalize controls to nested array of objects (sets of controls)
var controlSets = controls;
if (!Array.isArray(controlSets[0])) {
controlSets = [controlSets];
}
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_dropdown__WEBPACK_IMPORTED_MODULE_5__["default"], {
className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('components-dropdown-menu', className),
contentClassName: "components-dropdown-menu__popover",
renderToggle: function renderToggle(_ref2) {
var isOpen = _ref2.isOpen,
onToggle = _ref2.onToggle;
var openOnArrowDown = function openOnArrowDown(event) {
if (!isOpen && event.keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_3__["DOWN"]) {
event.preventDefault();
event.stopPropagation();
onToggle();
}
};
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_icon_button__WEBPACK_IMPORTED_MODULE_4__["default"], {
className: "components-dropdown-menu__toggle",
icon: icon,
onClick: onToggle,
onKeyDown: openOnArrowDown,
"aria-haspopup": "true",
"aria-expanded": isOpen,
label: label,
tooltip: label
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", {
className: "components-dropdown-menu__indicator"
}));
},
renderContent: function renderContent(_ref3) {
var onClose = _ref3.onClose;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_navigable_container__WEBPACK_IMPORTED_MODULE_6__["NavigableMenu"], {
className: "components-dropdown-menu__menu",
role: "menu",
"aria-label": menuLabel
}, Object(lodash__WEBPACK_IMPORTED_MODULE_2__["flatMap"])(controlSets, function (controlSet, indexOfSet) {
return controlSet.map(function (control, indexOfControl) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_icon_button__WEBPACK_IMPORTED_MODULE_4__["default"], {
key: [indexOfSet, indexOfControl].join(),
onClick: function onClick(event) {
event.stopPropagation();
onClose();
if (control.onClick) {
control.onClick();
}
},
className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('components-dropdown-menu__menu-item', {
'has-separator': indexOfSet > 0 && indexOfControl === 0,
'is-active': control.isActive
}),
icon: control.icon,
role: "menuitem",
disabled: control.isDisabled
}, control.title);
});
}));
}
});
}
/* harmony default export */ __webpack_exports__["default"] = (DropdownMenu);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/dropdown/index.js":
/*!***************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/dropdown/index.js ***!
\***************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _popover__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../popover */ "./node_modules/@wordpress/components/build-module/popover/index.js");
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var Dropdown =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(Dropdown, _Component);
function Dropdown() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, Dropdown);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(Dropdown).apply(this, arguments));
_this.toggle = _this.toggle.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this)));
_this.close = _this.close.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this)));
_this.clickOutside = _this.clickOutside.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this)));
_this.bindContainer = _this.bindContainer.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this)));
_this.refresh = _this.refresh.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this)));
_this.popoverRef = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createRef"])();
_this.state = {
isOpen: false
};
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(Dropdown, [{
key: "componentWillUnmount",
value: function componentWillUnmount() {
var isOpen = this.state.isOpen;
var onToggle = this.props.onToggle;
if (isOpen && onToggle) {
onToggle(false);
}
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps, prevState) {
var isOpen = this.state.isOpen;
var onToggle = this.props.onToggle;
if (prevState.isOpen !== isOpen && onToggle) {
onToggle(isOpen);
}
}
}, {
key: "bindContainer",
value: function bindContainer(ref) {
this.container = ref;
}
/**
* When contents change height due to user interaction,
* `refresh` can be called to re-render Popover with correct
* attributes which allow scroll, if need be.
*/
}, {
key: "refresh",
value: function refresh() {
if (this.popoverRef.current) {
this.popoverRef.current.refresh();
}
}
}, {
key: "toggle",
value: function toggle() {
this.setState(function (state) {
return {
isOpen: !state.isOpen
};
});
}
}, {
key: "clickOutside",
value: function clickOutside(event) {
if (!this.container.contains(event.target)) {
this.close();
}
}
}, {
key: "close",
value: function close() {
this.setState({
isOpen: false
});
}
}, {
key: "render",
value: function render() {
var isOpen = this.state.isOpen;
var _this$props = this.props,
renderContent = _this$props.renderContent,
renderToggle = _this$props.renderToggle,
_this$props$position = _this$props.position,
position = _this$props$position === void 0 ? 'bottom' : _this$props$position,
className = _this$props.className,
contentClassName = _this$props.contentClassName,
expandOnMobile = _this$props.expandOnMobile,
headerTitle = _this$props.headerTitle;
var args = {
isOpen: isOpen,
onToggle: this.toggle,
onClose: this.close
};
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
className: className,
ref: this.bindContainer
}, renderToggle(args), isOpen && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_popover__WEBPACK_IMPORTED_MODULE_7__["default"], {
className: contentClassName,
ref: this.popoverRef,
position: position,
onClose: this.close,
onClickOutside: this.clickOutside,
expandOnMobile: expandOnMobile,
headerTitle: headerTitle
}, renderContent(args)));
}
}]);
return Dropdown;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]);
/* harmony default export */ __webpack_exports__["default"] = (Dropdown);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/external-link/index.js":
/*!********************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/external-link/index.js ***!
\********************************************************************************/
/*! exports provided: ExternalLink, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExternalLink", function() { return ExternalLink; });
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _dashicon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../dashicon */ "./node_modules/@wordpress/components/build-module/dashicon/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function ExternalLink(_ref, ref) {
var href = _ref.href,
children = _ref.children,
className = _ref.className,
_ref$rel = _ref.rel,
rel = _ref$rel === void 0 ? '' : _ref$rel,
additionalProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__["default"])(_ref, ["href", "children", "className", "rel"]);
rel = Object(lodash__WEBPACK_IMPORTED_MODULE_5__["uniq"])(Object(lodash__WEBPACK_IMPORTED_MODULE_5__["compact"])(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(rel.split(' ')).concat(['external', 'noreferrer', 'noopener']))).join(' ');
var classes = classnames__WEBPACK_IMPORTED_MODULE_4___default()('components-external-link', className);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])("a", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, additionalProps, {
className: classes,
href: href,
target: "_blank",
rel: rel,
ref: ref
}), children, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])("span", {
className: "screen-reader-text"
},
/* translators: accessibility text */
Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('(opens in a new window)')), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_dashicon__WEBPACK_IMPORTED_MODULE_7__["default"], {
icon: "external",
className: "components-external-link__icon"
}));
}
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["forwardRef"])(ExternalLink));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/focusable-iframe/index.js":
/*!***********************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/focusable-iframe/index.js ***!
\***********************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__);
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Browser dependencies
*/
var _window = window,
FocusEvent = _window.FocusEvent;
var FocusableIframe =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(FocusableIframe, _Component);
function FocusableIframe(props) {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, FocusableIframe);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(FocusableIframe).apply(this, arguments));
_this.checkFocus = _this.checkFocus.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this)));
_this.node = props.iframeRef || Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createRef"])();
return _this;
}
/**
* Checks whether the iframe is the activeElement, inferring that it has
* then received focus, and calls the `onFocus` prop callback.
*/
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(FocusableIframe, [{
key: "checkFocus",
value: function checkFocus() {
var iframe = this.node.current;
if (document.activeElement !== iframe) {
return;
}
var focusEvent = new FocusEvent('focus', {
bubbles: true
});
iframe.dispatchEvent(focusEvent);
var onFocus = this.props.onFocus;
if (onFocus) {
onFocus(focusEvent);
}
}
}, {
key: "render",
value: function render() {
// Disable reason: The rendered iframe is a pass-through component,
// assigning props inherited from the rendering parent. It's the
// responsibility of the parent to assign a title.
/* eslint-disable jsx-a11y/iframe-has-title */
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("iframe", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
ref: this.node
}, Object(lodash__WEBPACK_IMPORTED_MODULE_8__["omit"])(this.props, ['iframeRef', 'onFocus'])));
/* eslint-enable jsx-a11y/iframe-has-title */
}
}]);
return FocusableIframe;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]);
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__["withGlobalEvents"])({
blur: 'checkFocus'
})(FocusableIframe));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/font-size-picker/index.js":
/*!***********************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/font-size-picker/index.js ***!
\***********************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _dashicon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../dashicon */ "./node_modules/@wordpress/components/build-module/dashicon/index.js");
/* harmony import */ var _base_control__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../base-control */ "./node_modules/@wordpress/components/build-module/base-control/index.js");
/* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../button */ "./node_modules/@wordpress/components/build-module/button/index.js");
/* harmony import */ var _dropdown__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../dropdown */ "./node_modules/@wordpress/components/build-module/dropdown/index.js");
/* harmony import */ var _range_control__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../range-control */ "./node_modules/@wordpress/components/build-module/range-control/index.js");
/* harmony import */ var _navigable_container__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../navigable-container */ "./node_modules/@wordpress/components/build-module/navigable-container/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function FontSizePicker(_ref) {
var fallbackFontSize = _ref.fallbackFontSize,
_ref$fontSizes = _ref.fontSizes,
fontSizes = _ref$fontSizes === void 0 ? [] : _ref$fontSizes,
onChange = _ref.onChange,
value = _ref.value,
withSlider = _ref.withSlider;
var onChangeValue = function onChangeValue(event) {
var newValue = event.target.value;
if (newValue === '') {
onChange(undefined);
return;
}
onChange(Number(newValue));
};
var currentFont = fontSizes.find(function (font) {
return font.size === value;
});
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_base_control__WEBPACK_IMPORTED_MODULE_5__["default"], {
label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Font Size')
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
className: "components-font-size-picker__buttons"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_dropdown__WEBPACK_IMPORTED_MODULE_7__["default"], {
className: "components-font-size-picker__dropdown",
contentClassName: "components-font-size-picker__dropdown-content",
position: "bottom",
renderToggle: function renderToggle(_ref2) {
var isOpen = _ref2.isOpen,
onToggle = _ref2.onToggle;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_button__WEBPACK_IMPORTED_MODULE_6__["default"], {
className: "components-font-size-picker__selector",
isLarge: true,
onClick: onToggle,
"aria-expanded": isOpen,
"aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Custom font size')
}, currentFont && currentFont.name || !value && 'Normal' || 'Custom');
},
renderContent: function renderContent() {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_navigable_container__WEBPACK_IMPORTED_MODULE_9__["NavigableMenu"], null, Object(lodash__WEBPACK_IMPORTED_MODULE_1__["map"])(fontSizes, function (_ref3) {
var name = _ref3.name,
size = _ref3.size,
slug = _ref3.slug;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_button__WEBPACK_IMPORTED_MODULE_6__["default"], {
key: slug,
onClick: function onClick() {
return onChange(slug === 'normal' ? undefined : size);
},
className: 'is-font-' + slug,
role: "menuitem"
}, (value === size || !value && slug === 'normal') && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_dashicon__WEBPACK_IMPORTED_MODULE_4__["default"], {
icon: "saved"
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", {
className: "components-font-size-picker__dropdown-text-size",
style: {
fontSize: size
}
}, name));
}));
}
}), !withSlider && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("input", {
className: "components-range-control__number",
type: "number",
onChange: onChangeValue,
"aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Custom font size'),
value: value || ''
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_button__WEBPACK_IMPORTED_MODULE_6__["default"], {
className: "components-color-palette__clear",
type: "button",
disabled: value === undefined,
onClick: function onClick() {
return onChange(undefined);
},
isSmall: true,
isDefault: true,
"aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Reset font size')
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Reset'))), withSlider && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_range_control__WEBPACK_IMPORTED_MODULE_8__["default"], {
className: "components-font-size-picker__custom-input",
label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Custom Size'),
value: value || '',
initialPosition: fallbackFontSize,
onChange: onChange,
min: 12,
max: 100,
beforeIcon: "editor-textcolor",
afterIcon: "editor-textcolor"
}));
}
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__["withInstanceId"])(FontSizePicker));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/form-file-upload/index.js":
/*!***********************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/form-file-upload/index.js ***!
\***********************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _icon_button__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../icon-button */ "./node_modules/@wordpress/components/build-module/icon-button/index.js");
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var FormFileUpload =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(FormFileUpload, _Component);
function FormFileUpload() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, FormFileUpload);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(FormFileUpload).apply(this, arguments));
_this.openFileDialog = _this.openFileDialog.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.bindInput = _this.bindInput.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(FormFileUpload, [{
key: "openFileDialog",
value: function openFileDialog() {
this.input.click();
}
}, {
key: "bindInput",
value: function bindInput(ref) {
this.input = ref;
}
}, {
key: "render",
value: function render() {
var _this$props = this.props,
children = _this$props.children,
_this$props$multiple = _this$props.multiple,
multiple = _this$props$multiple === void 0 ? false : _this$props$multiple,
accept = _this$props.accept,
onChange = _this$props.onChange,
_this$props$icon = _this$props.icon,
icon = _this$props$icon === void 0 ? 'upload' : _this$props$icon,
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props, ["children", "multiple", "accept", "onChange", "icon"]);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", {
className: "components-form-file-upload"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_icon_button__WEBPACK_IMPORTED_MODULE_9__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
icon: icon,
onClick: this.openFileDialog
}, props), children), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("input", {
type: "file",
ref: this.bindInput,
multiple: multiple,
style: {
display: 'none'
},
accept: accept,
onChange: onChange
}));
}
}]);
return FormFileUpload;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]);
/* harmony default export */ __webpack_exports__["default"] = (FormFileUpload);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/form-toggle/index.js":
/*!******************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/form-toggle/index.js ***!
\******************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _primitives__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../primitives */ "./node_modules/@wordpress/components/build-module/primitives/index.js");
/**
* External dependencies
*/
/**
* Internal dependencies
*/
function FormToggle(_ref) {
var className = _ref.className,
checked = _ref.checked,
id = _ref.id,
_ref$onChange = _ref.onChange,
onChange = _ref$onChange === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_4__["noop"] : _ref$onChange,
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["className", "checked", "id", "onChange"]);
var wrapperClasses = classnames__WEBPACK_IMPORTED_MODULE_3___default()('components-form-toggle', className, {
'is-checked': checked
});
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("span", {
className: wrapperClasses
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("input", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
className: "components-form-toggle__input",
id: id,
type: "checkbox",
checked: checked,
onChange: onChange
}, props)), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("span", {
className: "components-form-toggle__track"
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("span", {
className: "components-form-toggle__thumb"
}), checked ? Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_primitives__WEBPACK_IMPORTED_MODULE_5__["SVG"], {
className: "components-form-toggle__on",
width: "2",
height: "6",
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 2 6"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_primitives__WEBPACK_IMPORTED_MODULE_5__["Path"], {
d: "M0 0h2v6H0z"
})) : Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_primitives__WEBPACK_IMPORTED_MODULE_5__["SVG"], {
className: "components-form-toggle__off",
width: "6",
height: "6",
"aria-hidden": "true",
role: "img",
focusable: "false",
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 6 6"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_primitives__WEBPACK_IMPORTED_MODULE_5__["Path"], {
d: "M3 1.5c.8 0 1.5.7 1.5 1.5S3.8 4.5 3 4.5 1.5 3.8 1.5 3 2.2 1.5 3 1.5M3 0C1.3 0 0 1.3 0 3s1.3 3 3 3 3-1.3 3-3-1.3-3-3-3z"
})));
}
/* harmony default export */ __webpack_exports__["default"] = (FormToggle);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/form-token-field/index.js":
/*!***********************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/form-token-field/index.js ***!
\***********************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js");
/* harmony import */ var _babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/typeof */ "./node_modules/@babel/runtime/helpers/esm/typeof.js");
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__);
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes");
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_13__);
/* harmony import */ var _token__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./token */ "./node_modules/@wordpress/components/build-module/form-token-field/token.js");
/* harmony import */ var _token_input__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./token-input */ "./node_modules/@wordpress/components/build-module/form-token-field/token-input.js");
/* harmony import */ var _suggestions_list__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./suggestions-list */ "./node_modules/@wordpress/components/build-module/form-token-field/suggestions-list.js");
/* harmony import */ var _higher_order_with_spoken_messages__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../higher-order/with-spoken-messages */ "./node_modules/@wordpress/components/build-module/higher-order/with-spoken-messages/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var initialState = {
incompleteTokenValue: '',
inputOffsetFromEnd: 0,
isActive: false,
isExpanded: false,
selectedSuggestionIndex: -1,
selectedSuggestionScroll: false
};
var FormTokenField =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(FormTokenField, _Component);
function FormTokenField() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, FormTokenField);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(FormTokenField).apply(this, arguments));
_this.state = initialState;
_this.onKeyDown = _this.onKeyDown.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.onKeyPress = _this.onKeyPress.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.onFocus = _this.onFocus.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.onBlur = _this.onBlur.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.deleteTokenBeforeInput = _this.deleteTokenBeforeInput.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.deleteTokenAfterInput = _this.deleteTokenAfterInput.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.addCurrentToken = _this.addCurrentToken.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.onContainerTouched = _this.onContainerTouched.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.renderToken = _this.renderToken.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.onTokenClickRemove = _this.onTokenClickRemove.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.onSuggestionHovered = _this.onSuggestionHovered.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.onSuggestionSelected = _this.onSuggestionSelected.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.onInputChange = _this.onInputChange.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.bindInput = _this.bindInput.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.bindTokensAndInput = _this.bindTokensAndInput.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(FormTokenField, [{
key: "componentDidUpdate",
value: function componentDidUpdate() {
// Make sure to focus the input when the isActive state is true.
if (this.state.isActive && !this.input.hasFocus()) {
this.input.focus();
}
}
}, {
key: "bindInput",
value: function bindInput(ref) {
this.input = ref;
}
}, {
key: "bindTokensAndInput",
value: function bindTokensAndInput(ref) {
this.tokensAndInput = ref;
}
}, {
key: "onFocus",
value: function onFocus(event) {
// If focus is on the input or on the container, set the isActive state to true.
if (this.input.hasFocus() || event.target === this.tokensAndInput) {
this.setState({
isActive: true
});
} else {
/*
* Otherwise, focus is on one of the token "remove" buttons and we
* set the isActive state to false to prevent the input to be
* re-focused, see componentDidUpdate().
*/
this.setState({
isActive: false
});
}
if ('function' === typeof this.props.onFocus) {
this.props.onFocus(event);
}
}
}, {
key: "onBlur",
value: function onBlur() {
if (this.inputHasValidValue()) {
this.setState({
isActive: false
});
} else {
this.setState(initialState);
}
}
}, {
key: "onKeyDown",
value: function onKeyDown(event) {
var preventDefault = false;
switch (event.keyCode) {
case _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_13__["BACKSPACE"]:
preventDefault = this.handleDeleteKey(this.deleteTokenBeforeInput);
break;
case _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_13__["ENTER"]:
preventDefault = this.addCurrentToken();
break;
case _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_13__["LEFT"]:
preventDefault = this.handleLeftArrowKey();
break;
case _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_13__["UP"]:
preventDefault = this.handleUpArrowKey();
break;
case _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_13__["RIGHT"]:
preventDefault = this.handleRightArrowKey();
break;
case _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_13__["DOWN"]:
preventDefault = this.handleDownArrowKey();
break;
case _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_13__["DELETE"]:
preventDefault = this.handleDeleteKey(this.deleteTokenAfterInput);
break;
case _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_13__["SPACE"]:
if (this.props.tokenizeOnSpace) {
preventDefault = this.addCurrentToken();
}
break;
case _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_13__["ESCAPE"]:
preventDefault = this.handleEscapeKey(event);
event.stopPropagation();
break;
default:
break;
}
if (preventDefault) {
event.preventDefault();
}
}
}, {
key: "onKeyPress",
value: function onKeyPress(event) {
var preventDefault = false;
switch (event.charCode) {
case 44:
// comma
preventDefault = this.handleCommaKey();
break;
default:
break;
}
if (preventDefault) {
event.preventDefault();
}
}
}, {
key: "onContainerTouched",
value: function onContainerTouched(event) {
// Prevent clicking/touching the tokensAndInput container from blurring
// the input and adding the current token.
if (event.target === this.tokensAndInput && this.state.isActive) {
event.preventDefault();
}
}
}, {
key: "onTokenClickRemove",
value: function onTokenClickRemove(event) {
this.deleteToken(event.value);
this.input.focus();
}
}, {
key: "onSuggestionHovered",
value: function onSuggestionHovered(suggestion) {
var index = this.getMatchingSuggestions().indexOf(suggestion);
if (index >= 0) {
this.setState({
selectedSuggestionIndex: index,
selectedSuggestionScroll: false
});
}
}
}, {
key: "onSuggestionSelected",
value: function onSuggestionSelected(suggestion) {
this.addNewToken(suggestion);
}
}, {
key: "onInputChange",
value: function onInputChange(event) {
var text = event.value;
var separator = this.props.tokenizeOnSpace ? /[ ,\t]+/ : /[,\t]+/;
var items = text.split(separator);
var tokenValue = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["last"])(items) || '';
var inputHasMinimumChars = tokenValue.trim().length > 1;
var matchingSuggestions = this.getMatchingSuggestions(tokenValue);
var hasVisibleSuggestions = inputHasMinimumChars && !!matchingSuggestions.length;
if (items.length > 1) {
this.addNewTokens(items.slice(0, -1));
}
this.setState({
incompleteTokenValue: tokenValue,
selectedSuggestionIndex: -1,
selectedSuggestionScroll: false,
isExpanded: false
});
this.props.onInputChange(tokenValue);
if (inputHasMinimumChars) {
this.setState({
isExpanded: hasVisibleSuggestions
});
if (!!matchingSuggestions.length) {
this.props.debouncedSpeak(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["_n"])('%d result found, use up and down arrow keys to navigate.', '%d results found, use up and down arrow keys to navigate.', matchingSuggestions.length), matchingSuggestions.length), 'assertive');
} else {
this.props.debouncedSpeak(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('No results.'), 'assertive');
}
}
}
}, {
key: "handleDeleteKey",
value: function handleDeleteKey(deleteToken) {
var preventDefault = false;
if (this.input.hasFocus() && this.isInputEmpty()) {
deleteToken();
preventDefault = true;
}
return preventDefault;
}
}, {
key: "handleLeftArrowKey",
value: function handleLeftArrowKey() {
var preventDefault = false;
if (this.isInputEmpty()) {
this.moveInputBeforePreviousToken();
preventDefault = true;
}
return preventDefault;
}
}, {
key: "handleRightArrowKey",
value: function handleRightArrowKey() {
var preventDefault = false;
if (this.isInputEmpty()) {
this.moveInputAfterNextToken();
preventDefault = true;
}
return preventDefault;
}
}, {
key: "handleUpArrowKey",
value: function handleUpArrowKey() {
var _this2 = this;
this.setState(function (state, props) {
return {
selectedSuggestionIndex: (state.selectedSuggestionIndex === 0 ? _this2.getMatchingSuggestions(state.incompleteTokenValue, props.suggestions, props.value, props.maxSuggestions, props.saveTransform).length : state.selectedSuggestionIndex) - 1,
selectedSuggestionScroll: true
};
});
return true; // preventDefault
}
}, {
key: "handleDownArrowKey",
value: function handleDownArrowKey() {
var _this3 = this;
this.setState(function (state, props) {
return {
selectedSuggestionIndex: (state.selectedSuggestionIndex + 1) % _this3.getMatchingSuggestions(state.incompleteTokenValue, props.suggestions, props.value, props.maxSuggestions, props.saveTransform).length,
selectedSuggestionScroll: true
};
});
return true; // preventDefault
}
}, {
key: "handleEscapeKey",
value: function handleEscapeKey(event) {
this.setState({
incompleteTokenValue: event.target.value,
isExpanded: false,
selectedSuggestionIndex: -1,
selectedSuggestionScroll: false
});
return true; // preventDefault
}
}, {
key: "handleCommaKey",
value: function handleCommaKey() {
if (this.inputHasValidValue()) {
this.addNewToken(this.state.incompleteTokenValue);
}
return true; // preventDefault
}
}, {
key: "moveInputToIndex",
value: function moveInputToIndex(index) {
this.setState(function (state, props) {
return {
inputOffsetFromEnd: props.value.length - Math.max(index, -1) - 1
};
});
}
}, {
key: "moveInputBeforePreviousToken",
value: function moveInputBeforePreviousToken() {
this.setState(function (state, props) {
return {
inputOffsetFromEnd: Math.min(state.inputOffsetFromEnd + 1, props.value.length)
};
});
}
}, {
key: "moveInputAfterNextToken",
value: function moveInputAfterNextToken() {
this.setState(function (state) {
return {
inputOffsetFromEnd: Math.max(state.inputOffsetFromEnd - 1, 0)
};
});
}
}, {
key: "deleteTokenBeforeInput",
value: function deleteTokenBeforeInput() {
var index = this.getIndexOfInput() - 1;
if (index > -1) {
this.deleteToken(this.props.value[index]);
}
}
}, {
key: "deleteTokenAfterInput",
value: function deleteTokenAfterInput() {
var index = this.getIndexOfInput();
if (index < this.props.value.length) {
this.deleteToken(this.props.value[index]); // update input offset since it's the offset from the last token
this.moveInputToIndex(index);
}
}
}, {
key: "addCurrentToken",
value: function addCurrentToken() {
var preventDefault = false;
var selectedSuggestion = this.getSelectedSuggestion();
if (selectedSuggestion) {
this.addNewToken(selectedSuggestion);
preventDefault = true;
} else if (this.inputHasValidValue()) {
this.addNewToken(this.state.incompleteTokenValue);
preventDefault = true;
}
return preventDefault;
}
}, {
key: "addNewTokens",
value: function addNewTokens(tokens) {
var _this4 = this;
var tokensToAdd = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["uniq"])(tokens.map(this.props.saveTransform).filter(Boolean).filter(function (token) {
return !_this4.valueContainsToken(token);
}));
if (tokensToAdd.length > 0) {
var newValue = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["clone"])(this.props.value);
newValue.splice.apply(newValue, [this.getIndexOfInput(), 0].concat(tokensToAdd));
this.props.onChange(newValue);
}
}
}, {
key: "addNewToken",
value: function addNewToken(token) {
this.addNewTokens([token]);
this.props.speak(this.props.messages.added, 'assertive');
this.setState({
incompleteTokenValue: '',
selectedSuggestionIndex: -1,
selectedSuggestionScroll: false,
isExpanded: false
});
if (this.state.isActive) {
this.input.focus();
}
}
}, {
key: "deleteToken",
value: function deleteToken(token) {
var _this5 = this;
var newTokens = this.props.value.filter(function (item) {
return _this5.getTokenValue(item) !== _this5.getTokenValue(token);
});
this.props.onChange(newTokens);
this.props.speak(this.props.messages.removed, 'assertive');
}
}, {
key: "getTokenValue",
value: function getTokenValue(token) {
if ('object' === Object(_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_1__["default"])(token)) {
return token.value;
}
return token;
}
}, {
key: "getMatchingSuggestions",
value: function getMatchingSuggestions() {
var searchValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.state.incompleteTokenValue;
var suggestions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.props.suggestions;
var value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.props.value;
var maxSuggestions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : this.props.maxSuggestions;
var saveTransform = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : this.props.saveTransform;
var match = saveTransform(searchValue);
var startsWithMatch = [];
var containsMatch = [];
if (match.length === 0) {
suggestions = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["difference"])(suggestions, value);
} else {
match = match.toLocaleLowerCase();
Object(lodash__WEBPACK_IMPORTED_MODULE_9__["each"])(suggestions, function (suggestion) {
var index = suggestion.toLocaleLowerCase().indexOf(match);
if (value.indexOf(suggestion) === -1) {
if (index === 0) {
startsWithMatch.push(suggestion);
} else if (index > 0) {
containsMatch.push(suggestion);
}
}
});
suggestions = startsWithMatch.concat(containsMatch);
}
return Object(lodash__WEBPACK_IMPORTED_MODULE_9__["take"])(suggestions, maxSuggestions);
}
}, {
key: "getSelectedSuggestion",
value: function getSelectedSuggestion() {
if (this.state.selectedSuggestionIndex !== -1) {
return this.getMatchingSuggestions()[this.state.selectedSuggestionIndex];
}
}
}, {
key: "valueContainsToken",
value: function valueContainsToken(token) {
var _this6 = this;
return Object(lodash__WEBPACK_IMPORTED_MODULE_9__["some"])(this.props.value, function (item) {
return _this6.getTokenValue(token) === _this6.getTokenValue(item);
});
}
}, {
key: "getIndexOfInput",
value: function getIndexOfInput() {
return this.props.value.length - this.state.inputOffsetFromEnd;
}
}, {
key: "isInputEmpty",
value: function isInputEmpty() {
return this.state.incompleteTokenValue.length === 0;
}
}, {
key: "inputHasValidValue",
value: function inputHasValidValue() {
return this.props.saveTransform(this.state.incompleteTokenValue).length > 0;
}
}, {
key: "renderTokensAndInput",
value: function renderTokensAndInput() {
var components = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["map"])(this.props.value, this.renderToken);
components.splice(this.getIndexOfInput(), 0, this.renderInput());
return components;
}
}, {
key: "renderToken",
value: function renderToken(token, index, tokens) {
var value = this.getTokenValue(token);
var status = token.status ? token.status : undefined;
var termPosition = index + 1;
var termsCount = tokens.length;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_token__WEBPACK_IMPORTED_MODULE_14__["default"], {
key: 'token-' + value,
value: value,
status: status,
title: token.title,
displayTransform: this.props.displayTransform,
onClickRemove: this.onTokenClickRemove,
isBorderless: token.isBorderless || this.props.isBorderless,
onMouseEnter: token.onMouseEnter,
onMouseLeave: token.onMouseLeave,
disabled: 'error' !== status && this.props.disabled,
messages: this.props.messages,
termsCount: termsCount,
termPosition: termPosition
});
}
}, {
key: "renderInput",
value: function renderInput() {
var _this$props = this.props,
autoCapitalize = _this$props.autoCapitalize,
autoComplete = _this$props.autoComplete,
maxLength = _this$props.maxLength,
value = _this$props.value,
placeholder = _this$props.placeholder,
instanceId = _this$props.instanceId;
var props = {
instanceId: instanceId,
autoCapitalize: autoCapitalize,
autoComplete: autoComplete,
ref: this.bindInput,
key: 'input',
disabled: this.props.disabled,
value: this.state.incompleteTokenValue,
onBlur: this.onBlur,
isExpanded: this.state.isExpanded,
selectedSuggestionIndex: this.state.selectedSuggestionIndex
};
if (value.length === 0 && placeholder) {
props.placeholder = placeholder;
}
if (!(maxLength && value.length >= maxLength)) {
props = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
onChange: this.onInputChange
});
}
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_token_input__WEBPACK_IMPORTED_MODULE_15__["default"], props);
}
}, {
key: "render",
value: function render() {
var _this$props2 = this.props,
disabled = _this$props2.disabled,
_this$props2$placehol = _this$props2.placeholder,
placeholder = _this$props2$placehol === void 0 ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Add item.') : _this$props2$placehol,
instanceId = _this$props2.instanceId,
className = _this$props2.className;
var isExpanded = this.state.isExpanded;
var classes = classnames__WEBPACK_IMPORTED_MODULE_10___default()(className, 'components-form-token-field', {
'is-active': this.state.isActive,
'is-disabled': disabled
});
var tokenFieldProps = {
className: classes,
tabIndex: '-1'
};
var matchingSuggestions = this.getMatchingSuggestions();
if (!disabled) {
tokenFieldProps = Object.assign({}, tokenFieldProps, {
onKeyDown: this.onKeyDown,
onKeyPress: this.onKeyPress,
onFocus: this.onFocus
});
} // Disable reason: There is no appropriate role which describes the
// input container intended accessible usability.
// TODO: Refactor click detection to use blur to stop propagation.
/* eslint-disable jsx-a11y/no-static-element-interactions */
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", tokenFieldProps, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("label", {
htmlFor: "components-form-token-input-".concat(instanceId),
className: "screen-reader-text"
}, placeholder), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", {
ref: this.bindTokensAndInput,
className: "components-form-token-field__input-container",
tabIndex: "-1",
onMouseDown: this.onContainerTouched,
onTouchStart: this.onContainerTouched
}, this.renderTokensAndInput()), isExpanded && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_suggestions_list__WEBPACK_IMPORTED_MODULE_16__["default"], {
instanceId: instanceId,
match: this.props.saveTransform(this.state.incompleteTokenValue),
displayTransform: this.props.displayTransform,
suggestions: matchingSuggestions,
selectedIndex: this.state.selectedSuggestionIndex,
scrollIntoView: this.state.selectedSuggestionScroll,
onHover: this.onSuggestionHovered,
onSelect: this.onSuggestionSelected
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", {
id: "components-form-token-suggestions-howto-".concat(instanceId),
className: "screen-reader-text"
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Separate with commas')));
/* eslint-enable jsx-a11y/no-static-element-interactions */
}
}], [{
key: "getDerivedStateFromProps",
value: function getDerivedStateFromProps(props, state) {
if (!props.disabled || !state.isActive) {
return null;
}
return {
isActive: false,
incompleteTokenValue: ''
};
}
}]);
return FormTokenField;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]);
FormTokenField.defaultProps = {
suggestions: Object.freeze([]),
maxSuggestions: 100,
value: Object.freeze([]),
placeholder: '',
displayTransform: lodash__WEBPACK_IMPORTED_MODULE_9__["identity"],
saveTransform: function saveTransform(token) {
return token.trim();
},
onChange: function onChange() {},
onInputChange: function onInputChange() {},
isBorderless: false,
disabled: false,
tokenizeOnSpace: false,
messages: {
added: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Item added.'),
removed: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Item removed.'),
remove: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_11__["__"])('Remove item')
}
};
/* harmony default export */ __webpack_exports__["default"] = (Object(_higher_order_with_spoken_messages__WEBPACK_IMPORTED_MODULE_17__["default"])(Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_12__["withInstanceId"])(FormTokenField)));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/form-token-field/suggestions-list.js":
/*!**********************************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/form-token-field/suggestions-list.js ***!
\**********************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var dom_scroll_into_view__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! dom-scroll-into-view */ "./node_modules/dom-scroll-into-view/lib/index.js");
/* harmony import */ var dom_scroll_into_view__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(dom_scroll_into_view__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_9__);
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
var SuggestionsList =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(SuggestionsList, _Component);
function SuggestionsList() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, SuggestionsList);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(SuggestionsList).apply(this, arguments));
_this.handleMouseDown = _this.handleMouseDown.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this)));
_this.bindList = _this.bindList.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this)));
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(SuggestionsList, [{
key: "componentDidUpdate",
value: function componentDidUpdate() {
var _this2 = this;
// only have to worry about scrolling selected suggestion into view
// when already expanded
if (this.props.selectedIndex > -1 && this.props.scrollIntoView) {
this.scrollingIntoView = true;
dom_scroll_into_view__WEBPACK_IMPORTED_MODULE_8___default()(this.list.children[this.props.selectedIndex], this.list, {
onlyScrollIfNeeded: true
});
setTimeout(function () {
_this2.scrollingIntoView = false;
}, 100);
}
}
}, {
key: "bindList",
value: function bindList(ref) {
this.list = ref;
}
}, {
key: "handleHover",
value: function handleHover(suggestion) {
var _this3 = this;
return function () {
if (!_this3.scrollingIntoView) {
_this3.props.onHover(suggestion);
}
};
}
}, {
key: "handleClick",
value: function handleClick(suggestion) {
var _this4 = this;
return function () {
_this4.props.onSelect(suggestion);
};
}
}, {
key: "handleMouseDown",
value: function handleMouseDown(e) {
// By preventing default here, we will not lose focus of <input> when clicking a suggestion
e.preventDefault();
}
}, {
key: "computeSuggestionMatch",
value: function computeSuggestionMatch(suggestion) {
var match = this.props.displayTransform(this.props.match || '').toLocaleLowerCase();
if (match.length === 0) {
return null;
}
suggestion = this.props.displayTransform(suggestion);
var indexOfMatch = suggestion.toLocaleLowerCase().indexOf(match);
return {
suggestionBeforeMatch: suggestion.substring(0, indexOfMatch),
suggestionMatch: suggestion.substring(indexOfMatch, indexOfMatch + match.length),
suggestionAfterMatch: suggestion.substring(indexOfMatch + match.length)
};
}
}, {
key: "render",
value: function render() {
var _this5 = this;
// We set `tabIndex` here because otherwise Firefox sets focus on this
// div when tabbing off of the input in `TokenField` -- not really sure
// why, since usually a div isn't focusable by default
// TODO does this still apply now that it's a <ul> and not a <div>?
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("ul", {
ref: this.bindList,
className: "components-form-token-field__suggestions-list",
id: "components-form-token-suggestions-".concat(this.props.instanceId),
role: "listbox"
}, Object(lodash__WEBPACK_IMPORTED_MODULE_7__["map"])(this.props.suggestions, function (suggestion, index) {
var match = _this5.computeSuggestionMatch(suggestion);
var classeName = classnames__WEBPACK_IMPORTED_MODULE_9___default()('components-form-token-field__suggestion', {
'is-selected': index === _this5.props.selectedIndex
});
/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("li", {
id: "components-form-token-suggestions-".concat(_this5.props.instanceId, "-").concat(index),
role: "option",
className: classeName,
key: suggestion,
onMouseDown: _this5.handleMouseDown,
onClick: _this5.handleClick(suggestion),
onMouseEnter: _this5.handleHover(suggestion),
"aria-selected": index === _this5.props.selectedIndex
}, match ? Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("span", {
"aria-label": _this5.props.displayTransform(suggestion)
}, match.suggestionBeforeMatch, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("strong", {
className: "components-form-token-field__suggestion-match"
}, match.suggestionMatch), match.suggestionAfterMatch) : _this5.props.displayTransform(suggestion));
/* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
}));
}
}]);
return SuggestionsList;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]);
SuggestionsList.defaultProps = {
match: '',
onHover: function onHover() {},
onSelect: function onSelect() {},
suggestions: Object.freeze([])
};
/* harmony default export */ __webpack_exports__["default"] = (SuggestionsList);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/form-token-field/token-input.js":
/*!*****************************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/form-token-field/token-input.js ***!
\*****************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__);
/**
* WordPress dependencies
*/
var TokenInput =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(TokenInput, _Component);
function TokenInput() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, TokenInput);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(TokenInput).apply(this, arguments));
_this.onChange = _this.onChange.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.bindInput = _this.bindInput.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(TokenInput, [{
key: "focus",
value: function focus() {
this.input.focus();
}
}, {
key: "hasFocus",
value: function hasFocus() {
return this.input === document.activeElement;
}
}, {
key: "bindInput",
value: function bindInput(ref) {
this.input = ref;
}
}, {
key: "onChange",
value: function onChange(event) {
this.props.onChange({
value: event.target.value
});
}
}, {
key: "render",
value: function render() {
var _this$props = this.props,
value = _this$props.value,
placeholder = _this$props.placeholder,
isExpanded = _this$props.isExpanded,
instanceId = _this$props.instanceId,
selectedSuggestionIndex = _this$props.selectedSuggestionIndex,
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props, ["value", "placeholder", "isExpanded", "instanceId", "selectedSuggestionIndex"]);
var size = (value.length === 0 && placeholder && placeholder.length || value.length) + 1;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("input", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
ref: this.bindInput,
id: "components-form-token-input-".concat(instanceId),
type: "text"
}, props, {
value: value,
placeholder: placeholder,
onChange: this.onChange,
size: size,
className: "components-form-token-field__input",
role: "combobox",
"aria-expanded": isExpanded,
"aria-autocomplete": "list",
"aria-owns": isExpanded ? "components-form-token-suggestions-".concat(instanceId) : undefined,
"aria-activedescendant": selectedSuggestionIndex !== -1 ? "components-form-token-suggestions-".concat(instanceId, "-").concat(selectedSuggestionIndex) : undefined,
"aria-describedby": "components-form-token-suggestions-howto-".concat(instanceId)
}));
}
}]);
return TokenInput;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]);
/* harmony default export */ __webpack_exports__["default"] = (TokenInput);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/form-token-field/token.js":
/*!***********************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/form-token-field/token.js ***!
\***********************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _icon_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../icon-button */ "./node_modules/@wordpress/components/build-module/icon-button/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function Token(_ref) {
var value = _ref.value,
status = _ref.status,
title = _ref.title,
displayTransform = _ref.displayTransform,
_ref$isBorderless = _ref.isBorderless,
isBorderless = _ref$isBorderless === void 0 ? false : _ref$isBorderless,
_ref$disabled = _ref.disabled,
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
_ref$onClickRemove = _ref.onClickRemove,
onClickRemove = _ref$onClickRemove === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_2__["noop"] : _ref$onClickRemove,
onMouseEnter = _ref.onMouseEnter,
onMouseLeave = _ref.onMouseLeave,
messages = _ref.messages,
termPosition = _ref.termPosition,
termsCount = _ref.termsCount,
instanceId = _ref.instanceId;
var tokenClasses = classnames__WEBPACK_IMPORTED_MODULE_1___default()('components-form-token-field__token', {
'is-error': 'error' === status,
'is-success': 'success' === status,
'is-validating': 'validating' === status,
'is-borderless': isBorderless,
'is-disabled': disabled
});
var onClick = function onClick() {
return onClickRemove({
value: value
});
};
var transformedValue = displayTransform(value);
var termPositionAndCount = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["sprintf"])(
/* translators: 1: term name, 2: term position in a set of terms, 3: total term set count. */
Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('%1$s (%2$s of %3$s)'), transformedValue, termPosition, termsCount);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", {
className: tokenClasses,
onMouseEnter: onMouseEnter,
onMouseLeave: onMouseLeave,
title: title
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", {
className: "components-form-token-field__token-text",
id: "components-form-token-field__token-text-".concat(instanceId)
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", {
className: "screen-reader-text"
}, termPositionAndCount), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", {
"aria-hidden": "true"
}, transformedValue)), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_icon_button__WEBPACK_IMPORTED_MODULE_5__["default"], {
className: "components-form-token-field__remove-token",
icon: "dismiss",
onClick: !disabled && onClick,
label: messages.remove,
"aria-describedby": "components-form-token-field__token-text-".concat(instanceId)
}));
}
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__["withInstanceId"])(Token));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/higher-order/navigate-regions/index.js":
/*!************************************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/higher-order/navigate-regions/index.js ***!
\************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js");
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var _keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../keyboard-shortcuts */ "./node_modules/@wordpress/components/build-module/keyboard-shortcuts/index.js");
/**
* External Dependencies
*/
/**
* WordPress Dependencies
*/
/**
* Internal Dependencies
*/
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__["createHigherOrderComponent"])(function (WrappedComponent) {
return (
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(_class, _Component);
function _class() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, _class);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(_class).apply(this, arguments));
_this.bindContainer = _this.bindContainer.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this)));
_this.focusNextRegion = _this.focusRegion.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this)), 1);
_this.focusPreviousRegion = _this.focusRegion.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this)), -1);
_this.onClick = _this.onClick.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this)));
_this.state = {
isFocusingRegions: false
};
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(_class, [{
key: "bindContainer",
value: function bindContainer(ref) {
this.container = ref;
}
}, {
key: "focusRegion",
value: function focusRegion(offset) {
var regions = Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(this.container.querySelectorAll('[role="region"]'));
if (!regions.length) {
return;
}
var nextRegion = regions[0];
var selectedIndex = regions.indexOf(document.activeElement);
if (selectedIndex !== -1) {
var nextIndex = selectedIndex + offset;
nextIndex = nextIndex === -1 ? regions.length - 1 : nextIndex;
nextIndex = nextIndex === regions.length ? 0 : nextIndex;
nextRegion = regions[nextIndex];
}
nextRegion.focus();
this.setState({
isFocusingRegions: true
});
}
}, {
key: "onClick",
value: function onClick() {
this.setState({
isFocusingRegions: false
});
}
}, {
key: "render",
value: function render() {
var className = classnames__WEBPACK_IMPORTED_MODULE_8___default()('components-navigate-regions', {
'is-focusing-regions': this.state.isFocusingRegions
}); // Disable reason: Clicking the editor should dismiss the regions focus style
/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/onclick-has-role, jsx-a11y/click-events-have-key-events */
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("div", {
ref: this.bindContainer,
className: className,
onClick: this.onClick
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_10__["default"], {
bindGlobal: true,
shortcuts: {
'ctrl+`': this.focusNextRegion,
'shift+alt+n': this.focusNextRegion,
'ctrl+shift+`': this.focusPreviousRegion,
'shift+alt+p': this.focusPreviousRegion
}
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(WrappedComponent, this.props));
/* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/onclick-has-role, jsx-a11y/click-events-have-key-events */
}
}]);
return _class;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"])
);
}, 'navigateRegions'));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/higher-order/with-constrained-tabbing/index.js":
/*!********************************************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/higher-order/with-constrained-tabbing/index.js ***!
\********************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes");
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/dom */ "@wordpress/dom");
/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_9__);
/**
* WordPress dependencies
*/
var withConstrainedTabbing = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_7__["createHigherOrderComponent"])(function (WrappedComponent) {
return (
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(_class, _Component);
function _class() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, _class);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(_class).apply(this, arguments));
_this.focusContainRef = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createRef"])();
_this.handleTabBehaviour = _this.handleTabBehaviour.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this)));
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(_class, [{
key: "handleTabBehaviour",
value: function handleTabBehaviour(event) {
if (event.keyCode !== _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_8__["TAB"]) {
return;
}
var tabbables = _wordpress_dom__WEBPACK_IMPORTED_MODULE_9__["focus"].tabbable.find(this.focusContainRef.current);
if (!tabbables.length) {
return;
}
var firstTabbable = tabbables[0];
var lastTabbable = tabbables[tabbables.length - 1];
if (event.shiftKey && event.target === firstTabbable) {
event.preventDefault();
lastTabbable.focus();
} else if (!event.shiftKey && event.target === lastTabbable) {
event.preventDefault();
firstTabbable.focus();
/*
* When pressing Tab and none of the tabbables has focus, the keydown
* event happens on the wrapper div: move focus on the first tabbable.
*/
} else if (!tabbables.includes(event.target)) {
event.preventDefault();
firstTabbable.focus();
}
}
}, {
key: "render",
value: function render() {
// Disable reason: this component is non-interactive, but must capture
// events from the wrapped component to determine when the Tab key is used.
/* eslint-disable jsx-a11y/no-static-element-interactions */
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
onKeyDown: this.handleTabBehaviour,
ref: this.focusContainRef,
tabIndex: "-1"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(WrappedComponent, this.props));
/* eslint-enable jsx-a11y/no-static-element-interactions */
}
}]);
return _class;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"])
);
}, 'withConstrainedTabbing');
/* harmony default export */ __webpack_exports__["default"] = (withConstrainedTabbing);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/higher-order/with-fallback-styles/index.js":
/*!****************************************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/higher-order/with-fallback-styles/index.js ***!
\****************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__);
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/* harmony default export */ __webpack_exports__["default"] = (function (mapNodeToProps) {
return Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__["createHigherOrderComponent"])(function (WrappedComponent) {
return (
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(_class, _Component);
function _class() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, _class);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(_class).apply(this, arguments));
_this.nodeRef = _this.props.node;
_this.state = {
fallbackStyles: undefined,
grabStylesCompleted: false
};
_this.bindRef = _this.bindRef.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this)));
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(_class, [{
key: "bindRef",
value: function bindRef(node) {
if (!node) {
return;
}
this.nodeRef = node;
}
}, {
key: "componentDidMount",
value: function componentDidMount() {
this.grabFallbackStyles();
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate() {
this.grabFallbackStyles();
}
}, {
key: "grabFallbackStyles",
value: function grabFallbackStyles() {
var _this$state = this.state,
grabStylesCompleted = _this$state.grabStylesCompleted,
fallbackStyles = _this$state.fallbackStyles;
if (this.nodeRef && !grabStylesCompleted) {
var newFallbackStyles = mapNodeToProps(this.nodeRef, this.props);
if (!Object(lodash__WEBPACK_IMPORTED_MODULE_8__["isEqual"])(newFallbackStyles, fallbackStyles)) {
this.setState({
fallbackStyles: newFallbackStyles,
grabStylesCompleted: !!Object(lodash__WEBPACK_IMPORTED_MODULE_8__["every"])(newFallbackStyles)
});
}
}
}
}, {
key: "render",
value: function render() {
var wrappedComponent = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(WrappedComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, this.props, this.state.fallbackStyles));
return this.props.node ? wrappedComponent : Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("div", {
ref: this.bindRef
}, " ", wrappedComponent, " ");
}
}]);
return _class;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"])
);
}, 'withFallbackStyles');
});
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/higher-order/with-filters/index.js":
/*!********************************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/higher-order/with-filters/index.js ***!
\********************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return withFilters; });
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/hooks */ "@wordpress/hooks");
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__);
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
var ANIMATION_FRAME_PERIOD = 16;
/**
* Creates a higher-order component which adds filtering capability to the
* wrapped component. Filters get applied when the original component is about
* to be mounted. When a filter is added or removed that matches the hook name,
* the wrapped component re-renders.
*
* @param {string} hookName Hook name exposed to be used by filters.
*
* @return {Function} Higher-order component factory.
*/
function withFilters(hookName) {
return Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__["createHigherOrderComponent"])(function (OriginalComponent) {
return (
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(FilteredComponent, _Component);
/** @inheritdoc */
function FilteredComponent(props) {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, FilteredComponent);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(FilteredComponent).call(this, props));
_this.onHooksUpdated = _this.onHooksUpdated.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this)));
_this.Component = Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_8__["applyFilters"])(hookName, OriginalComponent);
_this.namespace = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["uniqueId"])('core/with-filters/component-');
_this.throttledForceUpdate = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["debounce"])(function () {
_this.Component = Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_8__["applyFilters"])(hookName, OriginalComponent);
_this.forceUpdate();
}, ANIMATION_FRAME_PERIOD);
Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_8__["addAction"])('hookRemoved', _this.namespace, _this.onHooksUpdated);
Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_8__["addAction"])('hookAdded', _this.namespace, _this.onHooksUpdated);
return _this;
}
/** @inheritdoc */
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(FilteredComponent, [{
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.throttledForceUpdate.cancel();
Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_8__["removeAction"])('hookRemoved', this.namespace);
Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_8__["removeAction"])('hookAdded', this.namespace);
}
/**
* When a filter is added or removed for the matching hook name, the wrapped component should re-render.
*
* @param {string} updatedHookName Name of the hook that was updated.
*/
}, {
key: "onHooksUpdated",
value: function onHooksUpdated(updatedHookName) {
if (updatedHookName === hookName) {
this.throttledForceUpdate();
}
}
/** @inheritdoc */
}, {
key: "render",
value: function render() {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(this.Component, this.props);
}
}]);
return FilteredComponent;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"])
);
}, 'withFilters');
}
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/higher-order/with-focus-outside/index.js":
/*!**************************************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/higher-order/with-focus-outside/index.js ***!
\**************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__);
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Input types which are classified as button types, for use in considering
* whether element is a (focus-normalized) button.
*
* @type {string[]}
*/
var INPUT_BUTTON_TYPES = ['button', 'submit'];
/**
* Returns true if the given element is a button element subject to focus
* normalization, or false otherwise.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
*
* @param {Element} element Element to test.
*
* @return {boolean} Whether element is a button.
*/
function isFocusNormalizedButton(element) {
switch (element.nodeName) {
case 'A':
case 'BUTTON':
return true;
case 'INPUT':
return Object(lodash__WEBPACK_IMPORTED_MODULE_8__["includes"])(INPUT_BUTTON_TYPES, element.type);
}
return false;
}
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__["createHigherOrderComponent"])(function (WrappedComponent) {
return (
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(_class, _Component);
function _class() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, _class);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(_class).apply(this, arguments));
_this.bindNode = _this.bindNode.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this)));
_this.cancelBlurCheck = _this.cancelBlurCheck.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this)));
_this.queueBlurCheck = _this.queueBlurCheck.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this)));
_this.normalizeButtonFocus = _this.normalizeButtonFocus.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this)));
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(_class, [{
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.cancelBlurCheck();
}
}, {
key: "bindNode",
value: function bindNode(node) {
if (node) {
this.node = node;
} else {
delete this.node;
this.cancelBlurCheck();
}
}
}, {
key: "queueBlurCheck",
value: function queueBlurCheck(event) {
var _this2 = this;
// React does not allow using an event reference asynchronously
// due to recycling behavior, except when explicitly persisted.
event.persist(); // Skip blur check if clicking button. See `normalizeButtonFocus`.
if (this.preventBlurCheck) {
return;
}
this.blurCheckTimeout = setTimeout(function () {
if ('function' === typeof _this2.node.handleFocusOutside) {
_this2.node.handleFocusOutside(event);
}
}, 0);
}
}, {
key: "cancelBlurCheck",
value: function cancelBlurCheck() {
clearTimeout(this.blurCheckTimeout);
}
/**
* Handles a mousedown or mouseup event to respectively assign and
* unassign a flag for preventing blur check on button elements. Some
* browsers, namely Firefox and Safari, do not emit a focus event on
* button elements when clicked, while others do. The logic here
* intends to normalize this as treating click on buttons as focus.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
*
* @param {MouseEvent} event Event for mousedown or mouseup.
*/
}, {
key: "normalizeButtonFocus",
value: function normalizeButtonFocus(event) {
var type = event.type,
target = event.target;
var isInteractionEnd = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["includes"])(['mouseup', 'touchend'], type);
if (isInteractionEnd) {
this.preventBlurCheck = false;
} else if (isFocusNormalizedButton(target)) {
this.preventBlurCheck = true;
}
}
}, {
key: "render",
value: function render() {
// Disable reason: See `normalizeButtonFocus` for browser-specific
// focus event normalization.
/* eslint-disable jsx-a11y/no-static-element-interactions */
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("div", {
onFocus: this.cancelBlurCheck,
onMouseDown: this.normalizeButtonFocus,
onMouseUp: this.normalizeButtonFocus,
onTouchStart: this.normalizeButtonFocus,
onTouchEnd: this.normalizeButtonFocus,
onBlur: this.queueBlurCheck
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(WrappedComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
ref: this.bindNode
}, this.props)));
/* eslint-enable jsx-a11y/no-static-element-interactions */
}
}]);
return _class;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"])
);
}, 'withFocusOutside'));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/higher-order/with-focus-return/index.js":
/*!*************************************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/higher-order/with-focus-return/index.js ***!
\*************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_6__);
/**
* WordPress dependencies
*/
/**
* Higher Order Component used to be used to wrap disposable elements like
* sidebars, modals, dropdowns. When mounting the wrapped component, we track a
* reference to the current active element so we know where to restore focus
* when the component is unmounted.
*
* @param {WPElement} WrappedComponent The disposable component.
*
* @return {Component} Component with the focus restauration behaviour.
*/
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_6__["createHigherOrderComponent"])(function (WrappedComponent) {
return (
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(_class, _Component);
function _class() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, _class);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(_class).apply(this, arguments));
_this.setIsFocusedTrue = function () {
return _this.isFocused = true;
};
_this.setIsFocusedFalse = function () {
return _this.isFocused = false;
};
_this.activeElementOnMount = document.activeElement;
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(_class, [{
key: "componentWillUnmount",
value: function componentWillUnmount() {
var activeElementOnMount = this.activeElementOnMount,
isFocused = this.isFocused;
if (!activeElementOnMount) {
return;
}
var _document = document,
body = _document.body,
activeElement = _document.activeElement;
if (isFocused || null === activeElement || body === activeElement) {
activeElementOnMount.focus();
}
}
}, {
key: "render",
value: function render() {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("div", {
onFocus: this.setIsFocusedTrue,
onBlur: this.setIsFocusedFalse
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(WrappedComponent, this.props));
}
}]);
return _class;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"])
);
}, 'withFocusReturn'));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/higher-order/with-notices/index.js":
/*!********************************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/higher-order/with-notices/index.js ***!
\********************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js");
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var uuid_v4__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! uuid/v4 */ "./node_modules/uuid/v4.js");
/* harmony import */ var uuid_v4__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(uuid_v4__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_11__);
/* harmony import */ var _notice_list__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../notice/list */ "./node_modules/@wordpress/components/build-module/notice/list.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Override the default edit UI to include notices if supported.
*
* @param {function|Component} OriginalComponent Original component.
* @return {Component} Wrapped component.
*/
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_11__["createHigherOrderComponent"])(function (OriginalComponent) {
return (
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_7__["default"])(WrappedBlockEdit, _Component);
function WrappedBlockEdit() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_3__["default"])(this, WrappedBlockEdit);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__["default"])(WrappedBlockEdit).apply(this, arguments));
_this.createNotice = _this.createNotice.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(_this)));
_this.createErrorNotice = _this.createErrorNotice.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(_this)));
_this.removeNotice = _this.removeNotice.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(_this)));
_this.removeAllNotices = _this.removeAllNotices.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_8__["default"])(_this)));
_this.state = {
noticeList: []
};
_this.noticeOperations = {
createNotice: _this.createNotice,
createErrorNotice: _this.createErrorNotice,
removeAllNotices: _this.removeAllNotices,
removeNotice: _this.removeNotice
};
return _this;
}
/**
* Function passed down as a prop that adds a new notice.
*
* @param {Object} notice Notice to add.
*/
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_4__["default"])(WrappedBlockEdit, [{
key: "createNotice",
value: function createNotice(notice) {
var noticeToAdd = notice.id ? notice : Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_2__["default"])({}, notice, {
id: uuid_v4__WEBPACK_IMPORTED_MODULE_10___default()()
});
this.setState(function (state) {
return {
noticeList: Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(state.noticeList).concat([noticeToAdd])
};
});
}
/**
* Function passed as a prop that adds a new error notice.
*
* @param {string} msg Error message of the notice.
*/
}, {
key: "createErrorNotice",
value: function createErrorNotice(msg) {
this.createNotice({
status: 'error',
content: msg
});
}
/**
* Removes a notice by id.
*
* @param {string} id Id of the notice to remove.
*/
}, {
key: "removeNotice",
value: function removeNotice(id) {
this.setState(function (state) {
return {
noticeList: state.noticeList.filter(function (notice) {
return notice.id !== id;
})
};
});
}
/**
* Removes all notices
*/
}, {
key: "removeAllNotices",
value: function removeAllNotices() {
this.setState({
noticeList: []
});
}
}, {
key: "render",
value: function render() {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])(OriginalComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
noticeList: this.state.noticeList,
noticeOperations: this.noticeOperations,
noticeUI: this.state.noticeList.length > 0 && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["createElement"])(_notice_list__WEBPACK_IMPORTED_MODULE_12__["default"], {
className: "components-with-notices-ui",
notices: this.state.noticeList,
onRemove: this.removeNotice
})
}, this.props));
}
}]);
return WrappedBlockEdit;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["Component"])
);
}));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/higher-order/with-spoken-messages/index.js":
/*!****************************************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/higher-order/with-spoken-messages/index.js ***!
\****************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/a11y */ "@wordpress/a11y");
/* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__);
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* A Higher Order Component used to be provide a unique instance ID by
* component.
*
* @param {WPElement} WrappedComponent The wrapped component.
*
* @return {Component} Component with an instanceId prop.
*/
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__["createHigherOrderComponent"])(function (WrappedComponent) {
return (
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(_class, _Component);
function _class() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, _class);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(_class).apply(this, arguments));
_this.debouncedSpeak = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["debounce"])(_this.speak.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this))), 500);
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(_class, [{
key: "speak",
value: function speak(message) {
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'polite';
Object(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_9__["speak"])(message, type);
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.debouncedSpeak.cancel();
}
}, {
key: "render",
value: function render() {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(WrappedComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, this.props, {
speak: this.speak,
debouncedSpeak: this.debouncedSpeak
}));
}
}]);
return _class;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"])
);
}, 'withSpokenMessages'));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/icon-button/index.js":
/*!******************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/icon-button/index.js ***!
\******************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var _tooltip__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../tooltip */ "./node_modules/@wordpress/components/build-module/tooltip/index.js");
/* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../button */ "./node_modules/@wordpress/components/build-module/button/index.js");
/* harmony import */ var _dashicon__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../dashicon */ "./node_modules/@wordpress/components/build-module/dashicon/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
// This is intentionally a Component class, not a function component because it
// is common to apply a ref to the button element (only supported in class)
var IconButton =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(IconButton, _Component);
function IconButton() {
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, IconButton);
return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(IconButton).apply(this, arguments));
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(IconButton, [{
key: "render",
value: function render() {
var _this$props = this.props,
icon = _this$props.icon,
children = _this$props.children,
label = _this$props.label,
className = _this$props.className,
tooltip = _this$props.tooltip,
shortcut = _this$props.shortcut,
additionalProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props, ["icon", "children", "label", "className", "tooltip", "shortcut"]);
var classes = classnames__WEBPACK_IMPORTED_MODULE_8___default()('components-icon-button', className);
var tooltipText = tooltip || label; // Should show the tooltip if...
var showTooltip = // an explicit tooltip is passed or...
tooltip || // there's a shortcut or...
shortcut || // there's a label and...
!!label && ( // the children are empty and...
!children || Object(lodash__WEBPACK_IMPORTED_MODULE_9__["isArray"])(children) && !children.length) && // the tooltip is not explicitly disabled.
false !== tooltip;
var element = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_button__WEBPACK_IMPORTED_MODULE_11__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, additionalProps, {
"aria-label": label,
className: classes
}), Object(lodash__WEBPACK_IMPORTED_MODULE_9__["isString"])(icon) ? Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_dashicon__WEBPACK_IMPORTED_MODULE_12__["default"], {
icon: icon
}) : icon, children);
if (showTooltip) {
element = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_tooltip__WEBPACK_IMPORTED_MODULE_10__["default"], {
text: tooltipText,
shortcut: shortcut
}, element);
}
return element;
}
}]);
return IconButton;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]);
/* harmony default export */ __webpack_exports__["default"] = (IconButton);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/index.js":
/*!******************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/index.js ***!
\******************************************************************/
/*! exports provided: Autocomplete, BaseControl, Button, ButtonGroup, CheckboxControl, ClipboardButton, ColorIndicator, ColorPalette, Dashicon, DateTimePicker, DatePicker, TimePicker, Disabled, Draggable, DropZone, DropZoneProvider, Dropdown, DropdownMenu, ExternalLink, FocusableIframe, FontSizePicker, FormFileUpload, FormToggle, FormTokenField, IconButton, KeyboardShortcuts, MenuGroup, MenuItem, MenuItemsChoice, Modal, ScrollLock, NavigableMenu, TabbableContainer, Notice, NoticeList, Panel, PanelBody, PanelColor, PanelHeader, PanelRow, Placeholder, Popover, QueryControls, RadioControl, RangeControl, ResizableBox, ResponsiveWrapper, SandBox, SelectControl, Spinner, ServerSideRender, TabPanel, TextControl, TextareaControl, ToggleControl, Toolbar, Tooltip, TreeSelect, createSlotFill, Slot, Fill, SlotFillProvider, navigateRegions, withConstrainedTabbing, withFallbackStyles, withFilters, withFocusOutside, withFocusReturn, withNotices, withSpokenMessages, G, Path, Polygon, SVG, AccessibleSVG */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _primitives__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./primitives */ "./node_modules/@wordpress/components/build-module/primitives/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "G", function() { return _primitives__WEBPACK_IMPORTED_MODULE_0__["G"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Path", function() { return _primitives__WEBPACK_IMPORTED_MODULE_0__["Path"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Polygon", function() { return _primitives__WEBPACK_IMPORTED_MODULE_0__["Polygon"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SVG", function() { return _primitives__WEBPACK_IMPORTED_MODULE_0__["SVG"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AccessibleSVG", function() { return _primitives__WEBPACK_IMPORTED_MODULE_0__["AccessibleSVG"]; });
/* harmony import */ var _autocomplete__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./autocomplete */ "./node_modules/@wordpress/components/build-module/autocomplete/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Autocomplete", function() { return _autocomplete__WEBPACK_IMPORTED_MODULE_1__["default"]; });
/* harmony import */ var _base_control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./base-control */ "./node_modules/@wordpress/components/build-module/base-control/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BaseControl", function() { return _base_control__WEBPACK_IMPORTED_MODULE_2__["default"]; });
/* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./button */ "./node_modules/@wordpress/components/build-module/button/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Button", function() { return _button__WEBPACK_IMPORTED_MODULE_3__["default"]; });
/* harmony import */ var _button_group__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./button-group */ "./node_modules/@wordpress/components/build-module/button-group/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ButtonGroup", function() { return _button_group__WEBPACK_IMPORTED_MODULE_4__["default"]; });
/* harmony import */ var _checkbox_control__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./checkbox-control */ "./node_modules/@wordpress/components/build-module/checkbox-control/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CheckboxControl", function() { return _checkbox_control__WEBPACK_IMPORTED_MODULE_5__["default"]; });
/* harmony import */ var _clipboard_button__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./clipboard-button */ "./node_modules/@wordpress/components/build-module/clipboard-button/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ClipboardButton", function() { return _clipboard_button__WEBPACK_IMPORTED_MODULE_6__["default"]; });
/* harmony import */ var _color_indicator__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./color-indicator */ "./node_modules/@wordpress/components/build-module/color-indicator/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorIndicator", function() { return _color_indicator__WEBPACK_IMPORTED_MODULE_7__["default"]; });
/* harmony import */ var _color_palette__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./color-palette */ "./node_modules/@wordpress/components/build-module/color-palette/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorPalette", function() { return _color_palette__WEBPACK_IMPORTED_MODULE_8__["default"]; });
/* harmony import */ var _dashicon__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./dashicon */ "./node_modules/@wordpress/components/build-module/dashicon/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Dashicon", function() { return _dashicon__WEBPACK_IMPORTED_MODULE_9__["default"]; });
/* harmony import */ var _date_time__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./date-time */ "./node_modules/@wordpress/components/build-module/date-time/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DateTimePicker", function() { return _date_time__WEBPACK_IMPORTED_MODULE_10__["DateTimePicker"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DatePicker", function() { return _date_time__WEBPACK_IMPORTED_MODULE_10__["DatePicker"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TimePicker", function() { return _date_time__WEBPACK_IMPORTED_MODULE_10__["TimePicker"]; });
/* harmony import */ var _disabled__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./disabled */ "./node_modules/@wordpress/components/build-module/disabled/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Disabled", function() { return _disabled__WEBPACK_IMPORTED_MODULE_11__["default"]; });
/* harmony import */ var _draggable__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./draggable */ "./node_modules/@wordpress/components/build-module/draggable/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Draggable", function() { return _draggable__WEBPACK_IMPORTED_MODULE_12__["default"]; });
/* harmony import */ var _drop_zone__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./drop-zone */ "./node_modules/@wordpress/components/build-module/drop-zone/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DropZone", function() { return _drop_zone__WEBPACK_IMPORTED_MODULE_13__["default"]; });
/* harmony import */ var _drop_zone_provider__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./drop-zone/provider */ "./node_modules/@wordpress/components/build-module/drop-zone/provider.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DropZoneProvider", function() { return _drop_zone_provider__WEBPACK_IMPORTED_MODULE_14__["default"]; });
/* harmony import */ var _dropdown__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./dropdown */ "./node_modules/@wordpress/components/build-module/dropdown/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Dropdown", function() { return _dropdown__WEBPACK_IMPORTED_MODULE_15__["default"]; });
/* harmony import */ var _dropdown_menu__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./dropdown-menu */ "./node_modules/@wordpress/components/build-module/dropdown-menu/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DropdownMenu", function() { return _dropdown_menu__WEBPACK_IMPORTED_MODULE_16__["default"]; });
/* harmony import */ var _external_link__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./external-link */ "./node_modules/@wordpress/components/build-module/external-link/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ExternalLink", function() { return _external_link__WEBPACK_IMPORTED_MODULE_17__["default"]; });
/* harmony import */ var _focusable_iframe__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./focusable-iframe */ "./node_modules/@wordpress/components/build-module/focusable-iframe/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FocusableIframe", function() { return _focusable_iframe__WEBPACK_IMPORTED_MODULE_18__["default"]; });
/* harmony import */ var _font_size_picker__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./font-size-picker */ "./node_modules/@wordpress/components/build-module/font-size-picker/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FontSizePicker", function() { return _font_size_picker__WEBPACK_IMPORTED_MODULE_19__["default"]; });
/* harmony import */ var _form_file_upload__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./form-file-upload */ "./node_modules/@wordpress/components/build-module/form-file-upload/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormFileUpload", function() { return _form_file_upload__WEBPACK_IMPORTED_MODULE_20__["default"]; });
/* harmony import */ var _form_toggle__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./form-toggle */ "./node_modules/@wordpress/components/build-module/form-toggle/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormToggle", function() { return _form_toggle__WEBPACK_IMPORTED_MODULE_21__["default"]; });
/* harmony import */ var _form_token_field__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./form-token-field */ "./node_modules/@wordpress/components/build-module/form-token-field/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormTokenField", function() { return _form_token_field__WEBPACK_IMPORTED_MODULE_22__["default"]; });
/* harmony import */ var _icon_button__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./icon-button */ "./node_modules/@wordpress/components/build-module/icon-button/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "IconButton", function() { return _icon_button__WEBPACK_IMPORTED_MODULE_23__["default"]; });
/* harmony import */ var _keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./keyboard-shortcuts */ "./node_modules/@wordpress/components/build-module/keyboard-shortcuts/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "KeyboardShortcuts", function() { return _keyboard_shortcuts__WEBPACK_IMPORTED_MODULE_24__["default"]; });
/* harmony import */ var _menu_group__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./menu-group */ "./node_modules/@wordpress/components/build-module/menu-group/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MenuGroup", function() { return _menu_group__WEBPACK_IMPORTED_MODULE_25__["default"]; });
/* harmony import */ var _menu_item__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./menu-item */ "./node_modules/@wordpress/components/build-module/menu-item/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MenuItem", function() { return _menu_item__WEBPACK_IMPORTED_MODULE_26__["default"]; });
/* harmony import */ var _menu_items_choice__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./menu-items-choice */ "./node_modules/@wordpress/components/build-module/menu-items-choice/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MenuItemsChoice", function() { return _menu_items_choice__WEBPACK_IMPORTED_MODULE_27__["default"]; });
/* harmony import */ var _modal__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./modal */ "./node_modules/@wordpress/components/build-module/modal/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Modal", function() { return _modal__WEBPACK_IMPORTED_MODULE_28__["default"]; });
/* harmony import */ var _scroll_lock__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./scroll-lock */ "./node_modules/@wordpress/components/build-module/scroll-lock/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ScrollLock", function() { return _scroll_lock__WEBPACK_IMPORTED_MODULE_29__["default"]; });
/* harmony import */ var _navigable_container__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./navigable-container */ "./node_modules/@wordpress/components/build-module/navigable-container/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NavigableMenu", function() { return _navigable_container__WEBPACK_IMPORTED_MODULE_30__["NavigableMenu"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TabbableContainer", function() { return _navigable_container__WEBPACK_IMPORTED_MODULE_30__["TabbableContainer"]; });
/* harmony import */ var _notice__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./notice */ "./node_modules/@wordpress/components/build-module/notice/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Notice", function() { return _notice__WEBPACK_IMPORTED_MODULE_31__["default"]; });
/* harmony import */ var _notice_list__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./notice/list */ "./node_modules/@wordpress/components/build-module/notice/list.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NoticeList", function() { return _notice_list__WEBPACK_IMPORTED_MODULE_32__["default"]; });
/* harmony import */ var _panel__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./panel */ "./node_modules/@wordpress/components/build-module/panel/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Panel", function() { return _panel__WEBPACK_IMPORTED_MODULE_33__["default"]; });
/* harmony import */ var _panel_body__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./panel/body */ "./node_modules/@wordpress/components/build-module/panel/body.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PanelBody", function() { return _panel_body__WEBPACK_IMPORTED_MODULE_34__["default"]; });
/* harmony import */ var _panel_color__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./panel/color */ "./node_modules/@wordpress/components/build-module/panel/color.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PanelColor", function() { return _panel_color__WEBPACK_IMPORTED_MODULE_35__["default"]; });
/* harmony import */ var _panel_header__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./panel/header */ "./node_modules/@wordpress/components/build-module/panel/header.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PanelHeader", function() { return _panel_header__WEBPACK_IMPORTED_MODULE_36__["default"]; });
/* harmony import */ var _panel_row__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./panel/row */ "./node_modules/@wordpress/components/build-module/panel/row.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PanelRow", function() { return _panel_row__WEBPACK_IMPORTED_MODULE_37__["default"]; });
/* harmony import */ var _placeholder__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./placeholder */ "./node_modules/@wordpress/components/build-module/placeholder/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Placeholder", function() { return _placeholder__WEBPACK_IMPORTED_MODULE_38__["default"]; });
/* harmony import */ var _popover__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./popover */ "./node_modules/@wordpress/components/build-module/popover/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Popover", function() { return _popover__WEBPACK_IMPORTED_MODULE_39__["default"]; });
/* harmony import */ var _query_controls__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./query-controls */ "./node_modules/@wordpress/components/build-module/query-controls/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "QueryControls", function() { return _query_controls__WEBPACK_IMPORTED_MODULE_40__["default"]; });
/* harmony import */ var _radio_control__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./radio-control */ "./node_modules/@wordpress/components/build-module/radio-control/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RadioControl", function() { return _radio_control__WEBPACK_IMPORTED_MODULE_41__["default"]; });
/* harmony import */ var _range_control__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./range-control */ "./node_modules/@wordpress/components/build-module/range-control/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RangeControl", function() { return _range_control__WEBPACK_IMPORTED_MODULE_42__["default"]; });
/* harmony import */ var _resizable_box__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./resizable-box */ "./node_modules/@wordpress/components/build-module/resizable-box/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ResizableBox", function() { return _resizable_box__WEBPACK_IMPORTED_MODULE_43__["default"]; });
/* harmony import */ var _responsive_wrapper__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./responsive-wrapper */ "./node_modules/@wordpress/components/build-module/responsive-wrapper/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ResponsiveWrapper", function() { return _responsive_wrapper__WEBPACK_IMPORTED_MODULE_44__["default"]; });
/* harmony import */ var _sandbox__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./sandbox */ "./node_modules/@wordpress/components/build-module/sandbox/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SandBox", function() { return _sandbox__WEBPACK_IMPORTED_MODULE_45__["default"]; });
/* harmony import */ var _select_control__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./select-control */ "./node_modules/@wordpress/components/build-module/select-control/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectControl", function() { return _select_control__WEBPACK_IMPORTED_MODULE_46__["default"]; });
/* harmony import */ var _spinner__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./spinner */ "./node_modules/@wordpress/components/build-module/spinner/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Spinner", function() { return _spinner__WEBPACK_IMPORTED_MODULE_47__["default"]; });
/* harmony import */ var _server_side_render__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./server-side-render */ "./node_modules/@wordpress/components/build-module/server-side-render/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ServerSideRender", function() { return _server_side_render__WEBPACK_IMPORTED_MODULE_48__["default"]; });
/* harmony import */ var _tab_panel__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./tab-panel */ "./node_modules/@wordpress/components/build-module/tab-panel/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TabPanel", function() { return _tab_panel__WEBPACK_IMPORTED_MODULE_49__["default"]; });
/* harmony import */ var _text_control__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./text-control */ "./node_modules/@wordpress/components/build-module/text-control/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextControl", function() { return _text_control__WEBPACK_IMPORTED_MODULE_50__["default"]; });
/* harmony import */ var _textarea_control__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./textarea-control */ "./node_modules/@wordpress/components/build-module/textarea-control/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextareaControl", function() { return _textarea_control__WEBPACK_IMPORTED_MODULE_51__["default"]; });
/* harmony import */ var _toggle_control__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./toggle-control */ "./node_modules/@wordpress/components/build-module/toggle-control/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ToggleControl", function() { return _toggle_control__WEBPACK_IMPORTED_MODULE_52__["default"]; });
/* harmony import */ var _toolbar__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./toolbar */ "./node_modules/@wordpress/components/build-module/toolbar/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Toolbar", function() { return _toolbar__WEBPACK_IMPORTED_MODULE_53__["default"]; });
/* harmony import */ var _tooltip__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./tooltip */ "./node_modules/@wordpress/components/build-module/tooltip/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Tooltip", function() { return _tooltip__WEBPACK_IMPORTED_MODULE_54__["default"]; });
/* harmony import */ var _tree_select__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./tree-select */ "./node_modules/@wordpress/components/build-module/tree-select/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TreeSelect", function() { return _tree_select__WEBPACK_IMPORTED_MODULE_55__["default"]; });
/* harmony import */ var _slot_fill__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./slot-fill */ "./node_modules/@wordpress/components/build-module/slot-fill/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createSlotFill", function() { return _slot_fill__WEBPACK_IMPORTED_MODULE_56__["createSlotFill"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Slot", function() { return _slot_fill__WEBPACK_IMPORTED_MODULE_56__["Slot"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Fill", function() { return _slot_fill__WEBPACK_IMPORTED_MODULE_56__["Fill"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SlotFillProvider", function() { return _slot_fill__WEBPACK_IMPORTED_MODULE_56__["Provider"]; });
/* harmony import */ var _higher_order_navigate_regions__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./higher-order/navigate-regions */ "./node_modules/@wordpress/components/build-module/higher-order/navigate-regions/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "navigateRegions", function() { return _higher_order_navigate_regions__WEBPACK_IMPORTED_MODULE_57__["default"]; });
/* harmony import */ var _higher_order_with_constrained_tabbing__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./higher-order/with-constrained-tabbing */ "./node_modules/@wordpress/components/build-module/higher-order/with-constrained-tabbing/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withConstrainedTabbing", function() { return _higher_order_with_constrained_tabbing__WEBPACK_IMPORTED_MODULE_58__["default"]; });
/* harmony import */ var _higher_order_with_fallback_styles__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./higher-order/with-fallback-styles */ "./node_modules/@wordpress/components/build-module/higher-order/with-fallback-styles/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withFallbackStyles", function() { return _higher_order_with_fallback_styles__WEBPACK_IMPORTED_MODULE_59__["default"]; });
/* harmony import */ var _higher_order_with_filters__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./higher-order/with-filters */ "./node_modules/@wordpress/components/build-module/higher-order/with-filters/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withFilters", function() { return _higher_order_with_filters__WEBPACK_IMPORTED_MODULE_60__["default"]; });
/* harmony import */ var _higher_order_with_focus_outside__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./higher-order/with-focus-outside */ "./node_modules/@wordpress/components/build-module/higher-order/with-focus-outside/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withFocusOutside", function() { return _higher_order_with_focus_outside__WEBPACK_IMPORTED_MODULE_61__["default"]; });
/* harmony import */ var _higher_order_with_focus_return__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./higher-order/with-focus-return */ "./node_modules/@wordpress/components/build-module/higher-order/with-focus-return/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withFocusReturn", function() { return _higher_order_with_focus_return__WEBPACK_IMPORTED_MODULE_62__["default"]; });
/* harmony import */ var _higher_order_with_notices__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./higher-order/with-notices */ "./node_modules/@wordpress/components/build-module/higher-order/with-notices/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withNotices", function() { return _higher_order_with_notices__WEBPACK_IMPORTED_MODULE_63__["default"]; });
/* harmony import */ var _higher_order_with_spoken_messages__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./higher-order/with-spoken-messages */ "./node_modules/@wordpress/components/build-module/higher-order/with-spoken-messages/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withSpokenMessages", function() { return _higher_order_with_spoken_messages__WEBPACK_IMPORTED_MODULE_64__["default"]; });
// Components
// eslint-disable-next-line camelcase
// Higher-Order Components
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/keyboard-shortcuts/index.js":
/*!*************************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/keyboard-shortcuts/index.js ***!
\*************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var mousetrap__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! mousetrap */ "./node_modules/mousetrap/mousetrap.js");
/* harmony import */ var mousetrap__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(mousetrap__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var mousetrap_plugins_global_bind_mousetrap_global_bind__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! mousetrap/plugins/global-bind/mousetrap-global-bind */ "./node_modules/mousetrap/plugins/global-bind/mousetrap-global-bind.js");
/* harmony import */ var mousetrap_plugins_global_bind_mousetrap_global_bind__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(mousetrap_plugins_global_bind_mousetrap_global_bind__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__);
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
var KeyboardShortcuts =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(KeyboardShortcuts, _Component);
function KeyboardShortcuts() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, KeyboardShortcuts);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(KeyboardShortcuts).apply(this, arguments));
_this.bindKeyTarget = _this.bindKeyTarget.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this)));
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(KeyboardShortcuts, [{
key: "componentDidMount",
value: function componentDidMount() {
var _this2 = this;
var _this$keyTarget = this.keyTarget,
keyTarget = _this$keyTarget === void 0 ? document : _this$keyTarget;
this.mousetrap = new mousetrap__WEBPACK_IMPORTED_MODULE_7___default.a(keyTarget);
Object(lodash__WEBPACK_IMPORTED_MODULE_9__["forEach"])(this.props.shortcuts, function (callback, key) {
var _this2$props = _this2.props,
bindGlobal = _this2$props.bindGlobal,
eventName = _this2$props.eventName;
var bindFn = bindGlobal ? 'bindGlobal' : 'bind';
_this2.mousetrap[bindFn](key, callback, eventName);
});
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.mousetrap.reset();
}
/**
* When rendering with children, binds the wrapper node on which events
* will be bound.
*
* @param {Element} node Key event target.
*/
}, {
key: "bindKeyTarget",
value: function bindKeyTarget(node) {
this.keyTarget = node;
}
}, {
key: "render",
value: function render() {
// Render as non-visual if there are no children pressed. Keyboard
// events will be bound to the document instead.
var children = this.props.children;
if (!_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Children"].count(children)) {
return null;
}
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
ref: this.bindKeyTarget
}, children);
}
}]);
return KeyboardShortcuts;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]);
/* harmony default export */ __webpack_exports__["default"] = (KeyboardShortcuts);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/menu-group/index.js":
/*!*****************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/menu-group/index.js ***!
\*****************************************************************************/
/*! exports provided: MenuGroup, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MenuGroup", function() { return MenuGroup; });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _navigable_container__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../navigable-container */ "./node_modules/@wordpress/components/build-module/navigable-container/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function MenuGroup(_ref) {
var children = _ref.children,
_ref$className = _ref.className,
className = _ref$className === void 0 ? '' : _ref$className,
instanceId = _ref.instanceId,
label = _ref.label;
if (!_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Children"].count(children)) {
return null;
}
var labelId = "components-menu-group-label-".concat(instanceId);
var classNames = classnames__WEBPACK_IMPORTED_MODULE_1___default()(className, 'components-menu-group');
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
className: classNames
}, label && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
className: "components-menu-group__label",
id: labelId
}, label), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_navigable_container__WEBPACK_IMPORTED_MODULE_3__["NavigableMenu"], {
orientation: "vertical",
"aria-labelledby": labelId
}, children));
}
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__["withInstanceId"])(MenuGroup));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/menu-item/index.js":
/*!****************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/menu-item/index.js ***!
\****************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../button */ "./node_modules/@wordpress/components/build-module/button/index.js");
/* harmony import */ var _shortcut__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../shortcut */ "./node_modules/@wordpress/components/build-module/shortcut/index.js");
/* harmony import */ var _icon_button__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../icon-button */ "./node_modules/@wordpress/components/build-module/icon-button/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Renders a generic menu item for use inside the more menu.
*
* @return {WPElement} More menu item.
*/
function MenuItem(_ref) {
var children = _ref.children,
className = _ref.className,
icon = _ref.icon,
shortcut = _ref.shortcut,
isSelected = _ref.isSelected,
_ref$role = _ref.role,
role = _ref$role === void 0 ? 'menuitem' : _ref$role,
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["children", "className", "icon", "shortcut", "isSelected", "role"]);
className = classnames__WEBPACK_IMPORTED_MODULE_3___default()('components-menu-item__button', className, {
'has-icon': icon
});
if (icon) {
if (!Object(lodash__WEBPACK_IMPORTED_MODULE_4__["isString"])(icon)) {
icon = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["cloneElement"])(icon, {
className: 'components-menu-items__item-icon',
height: 20,
width: 20
});
}
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_icon_button__WEBPACK_IMPORTED_MODULE_7__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
className: className,
icon: icon,
"aria-checked": isSelected,
role: role
}, props), children, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_shortcut__WEBPACK_IMPORTED_MODULE_6__["default"], {
className: "components-menu-item__shortcut",
shortcut: shortcut
}));
}
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_button__WEBPACK_IMPORTED_MODULE_5__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
className: className,
"aria-checked": isSelected,
role: role
}, props), children, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_shortcut__WEBPACK_IMPORTED_MODULE_6__["default"], {
className: "components-menu-item__shortcut",
shortcut: shortcut
}));
}
/* harmony default export */ __webpack_exports__["default"] = (MenuItem);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/menu-items-choice/index.js":
/*!************************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/menu-items-choice/index.js ***!
\************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MenuItemsChoice; });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _menu_item__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../menu-item */ "./node_modules/@wordpress/components/build-module/menu-item/index.js");
/**
* Internal dependencies
*/
function MenuItemsChoice(_ref) {
var _ref$choices = _ref.choices,
choices = _ref$choices === void 0 ? [] : _ref$choices,
onSelect = _ref.onSelect,
value = _ref.value;
return choices.map(function (item) {
var isSelected = value === item.value;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_menu_item__WEBPACK_IMPORTED_MODULE_1__["default"], {
key: item.value,
role: "menuitemradio",
icon: isSelected && 'yes',
isSelected: isSelected,
shortcut: item.shortcut,
onClick: function onClick() {
if (!isSelected) {
onSelect(item.value);
}
}
}, item.label);
});
}
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/modal/aria-helper.js":
/*!******************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/modal/aria-helper.js ***!
\******************************************************************************/
/*! exports provided: hideApp, elementShouldBeHidden, showApp */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hideApp", function() { return hideApp; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "elementShouldBeHidden", function() { return elementShouldBeHidden; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "showApp", function() { return showApp; });
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
/**
* External dependencies
*/
var LIVE_REGION_ARIA_ROLES = new Set(['alert', 'status', 'log', 'marquee', 'timer']);
var hiddenElements = [],
isHidden = false;
/**
* Hides all elements in the body element from screen-readers except
* the provided element and elements that should not be hidden from
* screen-readers.
*
* The reason we do this is because `aria-modal="true"` currently is bugged
* in Safari, and support is spotty in other browsers overall. In the future
* we should consider removing these helper functions in favor of
* `aria-modal="true"`.
*
* @param {Element} unhiddenElement The element that should not be hidden.
*/
function hideApp(unhiddenElement) {
if (isHidden) {
return;
}
var elements = document.body.children;
Object(lodash__WEBPACK_IMPORTED_MODULE_0__["forEach"])(elements, function (element) {
if (element === unhiddenElement) {
return;
}
if (elementShouldBeHidden(element)) {
element.setAttribute('aria-hidden', 'true');
hiddenElements.push(element);
}
});
isHidden = true;
}
/**
* Determines if the passed element should not be hidden from screen readers.
*
* @param {HTMLElement} element The element that should be checked.
*
* @return {boolean} Whether the element should not be hidden from screen-readers.
*/
function elementShouldBeHidden(element) {
var role = element.getAttribute('role');
return !(element.tagName === 'SCRIPT' || element.hasAttribute('aria-hidden') || element.hasAttribute('aria-live') || LIVE_REGION_ARIA_ROLES.has(role));
}
/**
* Makes all elements in the body that have been hidden by `hideApp`
* visible again to screen-readers.
*/
function showApp() {
if (!isHidden) {
return;
}
Object(lodash__WEBPACK_IMPORTED_MODULE_0__["forEach"])(hiddenElements, function (element) {
element.removeAttribute('aria-hidden');
});
hiddenElements = [];
isHidden = false;
}
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/modal/frame.js":
/*!************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/modal/frame.js ***!
\************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes");
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/dom */ "@wordpress/dom");
/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var react_click_outside__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react-click-outside */ "./node_modules/react-click-outside/dist/index.js");
/* harmony import */ var react_click_outside__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(react_click_outside__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var _higher_order_with_focus_return__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../higher-order/with-focus-return */ "./node_modules/@wordpress/components/build-module/higher-order/with-focus-return/index.js");
/* harmony import */ var _higher_order_with_constrained_tabbing__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../higher-order/with-constrained-tabbing */ "./node_modules/@wordpress/components/build-module/higher-order/with-constrained-tabbing/index.js");
/**
* WordPress dependencies
*/
/**
* External dependencies
*/
/**
* Internal dependencies
*/
var ModalFrame =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(ModalFrame, _Component);
function ModalFrame() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, ModalFrame);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(ModalFrame).apply(this, arguments));
_this.containerRef = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createRef"])();
_this.handleKeyDown = _this.handleKeyDown.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this)));
_this.handleClickOutside = _this.handleClickOutside.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this)));
_this.focusFirstTabbable = _this.focusFirstTabbable.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this)));
return _this;
}
/**
* Focuses the first tabbable element when props.focusOnMount is true.
*/
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(ModalFrame, [{
key: "componentDidMount",
value: function componentDidMount() {
// Focus on mount
if (this.props.focusOnMount) {
this.focusFirstTabbable();
}
}
/**
* Focuses the first tabbable element.
*/
}, {
key: "focusFirstTabbable",
value: function focusFirstTabbable() {
var tabbables = _wordpress_dom__WEBPACK_IMPORTED_MODULE_8__["focus"].tabbable.find(this.containerRef.current);
if (tabbables.length) {
tabbables[0].focus();
}
}
/**
* Callback function called when clicked outside the modal.
*
* @param {Object} event Mouse click event.
*/
}, {
key: "handleClickOutside",
value: function handleClickOutside(event) {
if (this.props.shouldCloseOnClickOutside) {
this.onRequestClose(event);
}
}
/**
* Callback function called when a key is pressed.
*
* @param {KeyboardEvent} event Key down event.
*/
}, {
key: "handleKeyDown",
value: function handleKeyDown(event) {
if (event.keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_7__["ESCAPE"]) {
this.handleEscapeKeyDown(event);
}
}
/**
* Handles a escape key down event.
*
* Calls onRequestClose and prevents default key press behaviour.
*
* @param {Object} event Key down event.
*/
}, {
key: "handleEscapeKeyDown",
value: function handleEscapeKeyDown(event) {
if (this.props.shouldCloseOnEsc) {
event.preventDefault();
this.onRequestClose(event);
}
}
/**
* Calls the onRequestClose callback props when it is available.
*
* @param {Object} event Event object.
*/
}, {
key: "onRequestClose",
value: function onRequestClose(event) {
var onRequestClose = this.props.onRequestClose;
if (onRequestClose) {
onRequestClose(event);
}
}
/**
* Renders the modal frame element.
*
* @return {WPElement} The modal frame element.
*/
}, {
key: "render",
value: function render() {
var _this$props = this.props,
contentLabel = _this$props.contentLabel,
_this$props$aria = _this$props.aria,
describedby = _this$props$aria.describedby,
labelledby = _this$props$aria.labelledby,
children = _this$props.children,
className = _this$props.className,
role = _this$props.role,
style = _this$props.style;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
className: className,
style: style,
ref: this.containerRef,
role: role,
"aria-label": contentLabel,
"aria-labelledby": contentLabel ? null : labelledby,
"aria-describedby": describedby,
tabIndex: "-1"
}, children);
}
}]);
return ModalFrame;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]);
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__["compose"])([_higher_order_with_focus_return__WEBPACK_IMPORTED_MODULE_11__["default"], _higher_order_with_constrained_tabbing__WEBPACK_IMPORTED_MODULE_12__["default"], react_click_outside__WEBPACK_IMPORTED_MODULE_10___default.a, Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__["withGlobalEvents"])({
keydown: 'handleKeyDown'
})])(ModalFrame));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/modal/header.js":
/*!*************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/modal/header.js ***!
\*************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _icon_button__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../icon-button */ "./node_modules/@wordpress/components/build-module/icon-button/index.js");
/**
* WordPress dependencies
*/
/**
* Internal dependencies.
*/
var ModalHeader = function ModalHeader(_ref) {
var icon = _ref.icon,
title = _ref.title,
onClose = _ref.onClose,
closeLabel = _ref.closeLabel,
headingId = _ref.headingId,
isDismissable = _ref.isDismissable;
var label = closeLabel ? closeLabel : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Close dialog');
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
className: "components-modal__header"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
className: "components-modal__header-heading-container"
}, icon && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", {
className: "components-modal__icon-container",
"aria-hidden": true
}, icon), title && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("h1", {
id: headingId,
className: "components-modal__header-heading"
}, title)), isDismissable && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_icon_button__WEBPACK_IMPORTED_MODULE_2__["default"], {
onClick: onClose,
icon: "no-alt",
label: label
}));
};
/* harmony default export */ __webpack_exports__["default"] = (ModalHeader);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/modal/index.js":
/*!************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/modal/index.js ***!
\************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_11__);
/* harmony import */ var _frame__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./frame */ "./node_modules/@wordpress/components/build-module/modal/frame.js");
/* harmony import */ var _header__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./header */ "./node_modules/@wordpress/components/build-module/modal/header.js");
/* harmony import */ var _aria_helper__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./aria-helper */ "./node_modules/@wordpress/components/build-module/modal/aria-helper.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
// Used to count the number of open modals.
var parentElement,
openModalCount = 0;
var Modal =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(Modal, _Component);
function Modal(props) {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Modal);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(Modal).call(this, props));
_this.prepareDOM();
_this.stopEventPropagationOutsideModal = _this.stopEventPropagationOutsideModal.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
return _this;
}
/**
* Appends the modal's node to the DOM, so the portal can render the
* modal in it. Also calls the openFirstModal when this is the first modal to be
* opened.
*/
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(Modal, [{
key: "componentDidMount",
value: function componentDidMount() {
openModalCount++;
if (openModalCount === 1) {
this.openFirstModal();
}
}
/**
* Removes the modal's node from the DOM. Also calls closeLastModal when this is
* the last modal to be closed.
*/
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
openModalCount--;
if (openModalCount === 0) {
this.closeLastModal();
}
this.cleanDOM();
}
/**
* Prepares the DOM for the modals to be rendered.
*
* Every modal is mounted in a separate div appended to a parent div
* that is appended to the document body.
*
* The parent div will be created if it does not yet exist, and the
* separate div for this specific modal will be appended to that.
*/
}, {
key: "prepareDOM",
value: function prepareDOM() {
if (!parentElement) {
parentElement = document.createElement('div');
document.body.appendChild(parentElement);
}
this.node = document.createElement('div');
parentElement.appendChild(this.node);
}
/**
* Removes the specific mounting point for this modal from the DOM.
*/
}, {
key: "cleanDOM",
value: function cleanDOM() {
parentElement.removeChild(this.node);
}
/**
* Prepares the DOM for this modal and any additional modal to be mounted.
*
* It appends an additional div to the body for the modals to be rendered in,
* it hides any other elements from screen-readers and adds an additional class
* to the body to prevent scrolling while the modal is open.
*/
}, {
key: "openFirstModal",
value: function openFirstModal() {
_aria_helper__WEBPACK_IMPORTED_MODULE_14__["hideApp"](parentElement);
document.body.classList.add(this.props.bodyOpenClassName);
}
/**
* Cleans up the DOM after the last modal is closed and makes the app available
* for screen-readers again.
*/
}, {
key: "closeLastModal",
value: function closeLastModal() {
document.body.classList.remove(this.props.bodyOpenClassName);
_aria_helper__WEBPACK_IMPORTED_MODULE_14__["showApp"]();
}
/**
* Stop all onMouseDown events propagating further - they should only go to the modal
* @param {string} event Event object
*/
}, {
key: "stopEventPropagationOutsideModal",
value: function stopEventPropagationOutsideModal(event) {
event.stopPropagation();
}
/**
* Renders the modal.
*
* @return {WPElement} The modal element.
*/
}, {
key: "render",
value: function render() {
var _this$props = this.props,
overlayClassName = _this$props.overlayClassName,
className = _this$props.className,
onRequestClose = _this$props.onRequestClose,
title = _this$props.title,
icon = _this$props.icon,
closeButtonLabel = _this$props.closeButtonLabel,
children = _this$props.children,
aria = _this$props.aria,
instanceId = _this$props.instanceId,
isDismissable = _this$props.isDismissable,
otherProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props, ["overlayClassName", "className", "onRequestClose", "title", "icon", "closeButtonLabel", "children", "aria", "instanceId", "isDismissable"]);
var headingId = aria.labelledby || "components-modal-header-".concat(instanceId); // Disable reason: this stops mouse events from triggering tooltips and
// other elements underneath the modal overlay.
/* eslint-disable jsx-a11y/no-static-element-interactions */
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createPortal"])(Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", {
className: classnames__WEBPACK_IMPORTED_MODULE_9___default()('components-modal__screen-overlay', overlayClassName),
onMouseDown: this.stopEventPropagationOutsideModal
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_frame__WEBPACK_IMPORTED_MODULE_12__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
className: classnames__WEBPACK_IMPORTED_MODULE_9___default()('components-modal__frame', className),
onRequestClose: onRequestClose,
aria: {
labelledby: title ? headingId : null,
describedby: aria.describedby
}
}, otherProps), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", {
className: 'components-modal__content',
tabIndex: "0"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_header__WEBPACK_IMPORTED_MODULE_13__["default"], {
closeLabel: closeButtonLabel,
headingId: headingId,
icon: icon,
isDismissable: isDismissable,
onClose: onRequestClose,
title: title
}), children))), this.node);
/* eslint-enable jsx-a11y/no-static-element-interactions */
}
}]);
return Modal;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]);
Modal.defaultProps = {
bodyOpenClassName: 'modal-open',
role: 'dialog',
title: null,
onRequestClose: lodash__WEBPACK_IMPORTED_MODULE_10__["noop"],
focusOnMount: true,
shouldCloseOnEsc: true,
shouldCloseOnClickOutside: true,
isDismissable: true,
/* accessibility */
aria: {
labelledby: null,
describedby: null
}
};
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_11__["withInstanceId"])(Modal));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/navigable-container/index.js":
/*!**************************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/navigable-container/index.js ***!
\**************************************************************************************/
/*! exports provided: NavigableMenu, TabbableContainer */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NavigableMenu", function() { return NavigableMenu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TabbableContainer", function() { return TabbableContainer; });
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/dom */ "@wordpress/dom");
/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes");
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__);
/**
* External Dependencies
*/
/**
* WordPress Dependencies
*/
function cycleValue(value, total, offset) {
var nextValue = value + offset;
if (nextValue < 0) {
return total + nextValue;
} else if (nextValue >= total) {
return nextValue - total;
}
return nextValue;
}
var NavigableContainer =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(NavigableContainer, _Component);
function NavigableContainer() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, NavigableContainer);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(NavigableContainer).apply(this, arguments));
_this.bindContainer = _this.bindContainer.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.onKeyDown = _this.onKeyDown.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.getFocusableContext = _this.getFocusableContext.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.getFocusableIndex = _this.getFocusableIndex.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(NavigableContainer, [{
key: "bindContainer",
value: function bindContainer(ref) {
this.container = ref;
}
}, {
key: "getFocusableContext",
value: function getFocusableContext(target) {
var onlyBrowserTabstops = this.props.onlyBrowserTabstops;
var finder = onlyBrowserTabstops ? _wordpress_dom__WEBPACK_IMPORTED_MODULE_10__["focus"].tabbable : _wordpress_dom__WEBPACK_IMPORTED_MODULE_10__["focus"].focusable;
var focusables = finder.find(this.container);
var index = this.getFocusableIndex(focusables, target);
if (index > -1 && target) {
return {
index: index,
target: target,
focusables: focusables
};
}
return null;
}
}, {
key: "getFocusableIndex",
value: function getFocusableIndex(focusables, target) {
var directIndex = focusables.indexOf(target);
if (directIndex !== -1) {
return directIndex;
}
}
}, {
key: "onKeyDown",
value: function onKeyDown(event) {
if (this.props.onKeyDown) {
this.props.onKeyDown(event);
}
var getFocusableContext = this.getFocusableContext;
var _this$props = this.props,
_this$props$cycle = _this$props.cycle,
cycle = _this$props$cycle === void 0 ? true : _this$props$cycle,
eventToOffset = _this$props.eventToOffset,
_this$props$onNavigat = _this$props.onNavigate,
onNavigate = _this$props$onNavigat === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_9__["noop"] : _this$props$onNavigat,
stopNavigationEvents = _this$props.stopNavigationEvents;
var offset = eventToOffset(event); // eventToOffset returns undefined if the event is not handled by the component
if (offset !== undefined && stopNavigationEvents) {
// Prevents arrow key handlers bound to the document directly interfering
event.nativeEvent.stopImmediatePropagation(); // When navigating a collection of items, prevent scroll containers
// from scrolling.
if (event.target.getAttribute('role') === 'menuitem') {
event.preventDefault();
}
event.stopPropagation();
}
if (!offset) {
return;
}
var context = getFocusableContext(document.activeElement);
if (!context) {
return;
}
var index = context.index,
focusables = context.focusables;
var nextIndex = cycle ? cycleValue(index, focusables.length, offset) : index + offset;
if (nextIndex >= 0 && nextIndex < focusables.length) {
focusables[nextIndex].focus();
onNavigate(nextIndex, focusables[nextIndex]);
}
}
}, {
key: "render",
value: function render() {
var _this$props2 = this.props,
children = _this$props2.children,
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props2, ["children"]); // Disable reason: Assumed role is applied by parent via props spread.
/* eslint-disable jsx-a11y/no-static-element-interactions */
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
ref: this.bindContainer
}, Object(lodash__WEBPACK_IMPORTED_MODULE_9__["omit"])(props, ['stopNavigationEvents', 'eventToOffset', 'onNavigate', 'cycle', 'onlyBrowserTabstops']), {
onKeyDown: this.onKeyDown,
onFocus: this.onFocus
}), children);
}
}]);
return NavigableContainer;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]);
var NavigableMenu =
/*#__PURE__*/
function (_Component2) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(NavigableMenu, _Component2);
function NavigableMenu() {
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, NavigableMenu);
return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(NavigableMenu).apply(this, arguments));
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(NavigableMenu, [{
key: "render",
value: function render() {
var _this$props3 = this.props,
_this$props3$role = _this$props3.role,
role = _this$props3$role === void 0 ? 'menu' : _this$props3$role,
_this$props3$orientat = _this$props3.orientation,
orientation = _this$props3$orientat === void 0 ? 'vertical' : _this$props3$orientat,
rest = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props3, ["role", "orientation"]);
var eventToOffset = function eventToOffset(evt) {
var keyCode = evt.keyCode;
var next = [_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["DOWN"]];
var previous = [_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["UP"]];
if (orientation === 'horizontal') {
next = [_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["RIGHT"]];
previous = [_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["LEFT"]];
}
if (orientation === 'both') {
next = [_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["RIGHT"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["DOWN"]];
previous = [_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["LEFT"], _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["UP"]];
}
if (Object(lodash__WEBPACK_IMPORTED_MODULE_9__["includes"])(next, keyCode)) {
return 1;
} else if (Object(lodash__WEBPACK_IMPORTED_MODULE_9__["includes"])(previous, keyCode)) {
return -1;
}
};
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(NavigableContainer, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
stopNavigationEvents: true,
onlyBrowserTabstops: false,
role: role,
"aria-orientation": orientation,
eventToOffset: eventToOffset
}, rest));
}
}]);
return NavigableMenu;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]);
var TabbableContainer =
/*#__PURE__*/
function (_Component3) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(TabbableContainer, _Component3);
function TabbableContainer() {
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, TabbableContainer);
return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(TabbableContainer).apply(this, arguments));
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(TabbableContainer, [{
key: "render",
value: function render() {
var _this2 = this;
var eventToOffset = function eventToOffset(evt) {
var keyCode = evt.keyCode,
shiftKey = evt.shiftKey;
if (_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_11__["TAB"] === keyCode) {
return shiftKey ? -1 : 1;
} // Allow custom handling of keys besides Tab.
//
// By default, TabbableContainer will move focus forward on Tab and
// backward on Shift+Tab. The handler below will be used for all other
// events. The semantics for `this.props.eventToOffset`'s return
// values are the following:
//
// - +1: move focus forward
// - -1: move focus backward
// - 0: don't move focus, but acknowledge event and thus stop it
// - undefined: do nothing, let the event propagate
if (_this2.props.eventToOffset) {
return _this2.props.eventToOffset(evt);
}
};
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(NavigableContainer, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
stopNavigationEvents: true,
onlyBrowserTabstops: true,
eventToOffset: eventToOffset
}, this.props));
}
}]);
return TabbableContainer;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/notice/index.js":
/*!*************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/notice/index.js ***!
\*************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _icon_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../icon-button */ "./node_modules/@wordpress/components/build-module/icon-button/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function Notice(_ref) {
var className = _ref.className,
status = _ref.status,
children = _ref.children,
_ref$onRemove = _ref.onRemove,
onRemove = _ref$onRemove === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_2__["noop"] : _ref$onRemove,
_ref$isDismissible = _ref.isDismissible,
isDismissible = _ref$isDismissible === void 0 ? true : _ref$isDismissible;
var classNames = classnames__WEBPACK_IMPORTED_MODULE_3___default()(className, 'components-notice', Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])({}, "is-".concat(status), !!status), {
'is-dismissible': isDismissible
});
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("div", {
className: classNames
}, Object(lodash__WEBPACK_IMPORTED_MODULE_2__["isString"])(children) ? Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("div", {
className: "components-notice__content"
}, children) : children, isDismissible && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_icon_button__WEBPACK_IMPORTED_MODULE_5__["default"], {
className: "components-notice__dismiss",
icon: "no",
label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Dismiss this notice'),
onClick: onRemove,
tooltip: false
}));
}
/* harmony default export */ __webpack_exports__["default"] = (Notice);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/notice/list.js":
/*!************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/notice/list.js ***!
\************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ */ "./node_modules/@wordpress/components/build-module/notice/index.js");
/**
* External dependencies
*/
/**
* Internal dependencies
*/
/**
* Renders a list of notices.
*
* @param {Object} $0 Props passed to the component.
* @param {Array} $0.notices Array of notices to render.
* @param {Function} $0.onRemove Function called when a notice should be removed / dismissed.
* @param {Object} $0.className Name of the class used by the component.
* @param {Object} $0.children Array of children to be rendered inside the notice list.
* @return {Object} The rendered notices list.
*/
function NoticeList(_ref) {
var notices = _ref.notices,
_ref$onRemove = _ref.onRemove,
onRemove = _ref$onRemove === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_3__["noop"] : _ref$onRemove,
_ref$className = _ref.className,
className = _ref$className === void 0 ? 'components-notice-list' : _ref$className,
children = _ref.children;
var removeNotice = function removeNotice(id) {
return function () {
return onRemove(id);
};
};
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("div", {
className: className
}, children, Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(notices).reverse().map(function (notice) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(___WEBPACK_IMPORTED_MODULE_4__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, Object(lodash__WEBPACK_IMPORTED_MODULE_3__["omit"])(notice, 'content'), {
key: notice.id,
onRemove: removeNotice(notice.id)
}), notice.content);
}));
}
/* harmony default export */ __webpack_exports__["default"] = (NoticeList);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/panel/body.js":
/*!***********************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/panel/body.js ***!
\***********************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../button */ "./node_modules/@wordpress/components/build-module/button/index.js");
/* harmony import */ var _dashicon__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../dashicon */ "./node_modules/@wordpress/components/build-module/dashicon/index.js");
/* harmony import */ var _primitives__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../primitives */ "./node_modules/@wordpress/components/build-module/primitives/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var PanelBody =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(PanelBody, _Component);
function PanelBody(props) {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, PanelBody);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(PanelBody).apply(this, arguments));
_this.state = {
opened: props.initialOpen === undefined ? true : props.initialOpen
};
_this.toggle = _this.toggle.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this)));
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(PanelBody, [{
key: "toggle",
value: function toggle(event) {
event.preventDefault();
if (this.props.opened === undefined) {
this.setState(function (state) {
return {
opened: !state.opened
};
});
}
if (this.props.onToggle) {
this.props.onToggle();
}
}
}, {
key: "render",
value: function render() {
var _this$props = this.props,
title = _this$props.title,
children = _this$props.children,
opened = _this$props.opened,
className = _this$props.className,
icon = _this$props.icon;
var isOpened = opened === undefined ? this.state.opened : opened;
var classes = classnames__WEBPACK_IMPORTED_MODULE_7___default()('components-panel__body', className, {
'is-opened': isOpened
});
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
className: classes
}, !!title && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("h2", {
className: "components-panel__body-title"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_button__WEBPACK_IMPORTED_MODULE_8__["default"], {
className: "components-panel__body-toggle",
onClick: this.toggle,
"aria-expanded": isOpened
}, isOpened ? Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_primitives__WEBPACK_IMPORTED_MODULE_10__["SVG"], {
className: "components-panel__arrow",
width: "24px",
height: "24px",
viewBox: "0 0 24 24",
xmlns: "http://www.w3.org/2000/svg"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_primitives__WEBPACK_IMPORTED_MODULE_10__["G"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_primitives__WEBPACK_IMPORTED_MODULE_10__["Path"], {
fill: "none",
d: "M0,0h24v24H0V0z"
})), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_primitives__WEBPACK_IMPORTED_MODULE_10__["G"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_primitives__WEBPACK_IMPORTED_MODULE_10__["Path"], {
d: "M12,8l-6,6l1.41,1.41L12,10.83l4.59,4.58L18,14L12,8z"
}))) : Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_primitives__WEBPACK_IMPORTED_MODULE_10__["SVG"], {
className: "components-panel__arrow",
width: "24px",
height: "24px",
viewBox: "0 0 24 24",
xmlns: "http://www.w3.org/2000/svg"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_primitives__WEBPACK_IMPORTED_MODULE_10__["G"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_primitives__WEBPACK_IMPORTED_MODULE_10__["Path"], {
fill: "none",
d: "M0,0h24v24H0V0z"
})), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_primitives__WEBPACK_IMPORTED_MODULE_10__["G"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_primitives__WEBPACK_IMPORTED_MODULE_10__["Path"], {
d: "M7.41,8.59L12,13.17l4.59-4.58L18,10l-6,6l-6-6L7.41,8.59z"
}))), icon && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_dashicon__WEBPACK_IMPORTED_MODULE_9__["default"], {
icon: icon,
className: "components-panel__icon"
}), title)), isOpened && children);
}
}]);
return PanelBody;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]);
/* harmony default export */ __webpack_exports__["default"] = (PanelBody);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/panel/color.js":
/*!************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/panel/color.js ***!
\************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _body__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./body */ "./node_modules/@wordpress/components/build-module/panel/body.js");
/* harmony import */ var _color_indicator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../color-indicator */ "./node_modules/@wordpress/components/build-module/color-indicator/index.js");
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function PanelColor(_ref) {
var colorValue = _ref.colorValue,
colorName = _ref.colorName,
title = _ref.title,
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["colorValue", "colorName", "title"]);
// translators: %s: The name of the color e.g: "vivid red" or color hex code if name is not available e.g: "#f00".
var currentColorLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__["__"])('(current color: %s)'), colorName || colorValue);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_body__WEBPACK_IMPORTED_MODULE_4__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
title: [Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("span", {
className: "components-panel__color-title",
key: "title"
}, title), colorValue && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_color_indicator__WEBPACK_IMPORTED_MODULE_5__["default"], {
key: "color",
className: "components-panel__color-indicator",
"aria-label": currentColorLabel,
colorValue: colorValue
})]
}));
}
/* harmony default export */ __webpack_exports__["default"] = (PanelColor);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/panel/header.js":
/*!*************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/panel/header.js ***!
\*************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
function PanelHeader(_ref) {
var label = _ref.label,
children = _ref.children;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
className: "components-panel__header"
}, label && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("h2", null, label), children);
}
/* harmony default export */ __webpack_exports__["default"] = (PanelHeader);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/panel/index.js":
/*!************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/panel/index.js ***!
\************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _header__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./header */ "./node_modules/@wordpress/components/build-module/panel/header.js");
/**
* External dependencies
*/
/**
* Internal dependencies
*/
function Panel(_ref) {
var header = _ref.header,
className = _ref.className,
children = _ref.children;
var classNames = classnames__WEBPACK_IMPORTED_MODULE_1___default()(className, 'components-panel');
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
className: classNames
}, header && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_header__WEBPACK_IMPORTED_MODULE_2__["default"], {
label: header
}), children);
}
/* harmony default export */ __webpack_exports__["default"] = (Panel);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/panel/row.js":
/*!**********************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/panel/row.js ***!
\**********************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
/**
* External dependencies
*/
function PanelRow(_ref) {
var className = _ref.className,
children = _ref.children;
var classes = classnames__WEBPACK_IMPORTED_MODULE_1___default()('components-panel__row', className);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
className: classes
}, children);
}
/* harmony default export */ __webpack_exports__["default"] = (PanelRow);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/placeholder/index.js":
/*!******************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/placeholder/index.js ***!
\******************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _dashicon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../dashicon */ "./node_modules/@wordpress/components/build-module/dashicon/index.js");
/**
* External dependencies
*/
/**
* Internal dependencies
*/
/**
* Renders a placeholder. Normally used by blocks to render their empty state.
*
* @param {Object} props The component props.
* @return {Object} The rendered placeholder.
*/
function Placeholder(_ref) {
var icon = _ref.icon,
children = _ref.children,
label = _ref.label,
instructions = _ref.instructions,
className = _ref.className,
notices = _ref.notices,
additionalProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["icon", "children", "label", "instructions", "className", "notices"]);
var classes = classnames__WEBPACK_IMPORTED_MODULE_3___default()('components-placeholder', className);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, additionalProps, {
className: classes
}), notices, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("div", {
className: "components-placeholder__label"
}, Object(lodash__WEBPACK_IMPORTED_MODULE_4__["isString"])(icon) ? Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_dashicon__WEBPACK_IMPORTED_MODULE_5__["default"], {
icon: icon
}) : icon, label), !!instructions && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("div", {
className: "components-placeholder__instructions"
}, instructions), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("div", {
className: "components-placeholder__fieldset"
}, children));
}
/* harmony default export */ __webpack_exports__["default"] = (Placeholder);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/popover/detect-outside.js":
/*!***********************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/popover/detect-outside.js ***!
\***********************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var react_click_outside__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-click-outside */ "./node_modules/react-click-outside/dist/index.js");
/* harmony import */ var react_click_outside__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_click_outside__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__);
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
var PopoverDetectOutside =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(PopoverDetectOutside, _Component);
function PopoverDetectOutside() {
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, PopoverDetectOutside);
return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(PopoverDetectOutside).apply(this, arguments));
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(PopoverDetectOutside, [{
key: "handleClickOutside",
value: function handleClickOutside(event) {
var onClickOutside = this.props.onClickOutside;
if (onClickOutside) {
onClickOutside(event);
}
}
}, {
key: "render",
value: function render() {
return this.props.children;
}
}]);
return PopoverDetectOutside;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]);
/* harmony default export */ __webpack_exports__["default"] = (react_click_outside__WEBPACK_IMPORTED_MODULE_5___default()(PopoverDetectOutside));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/popover/index.js":
/*!**************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/popover/index.js ***!
\**************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/dom */ "@wordpress/dom");
/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_11__);
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/keycodes */ "@wordpress/keycodes");
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__);
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./utils */ "./node_modules/@wordpress/components/build-module/popover/utils.js");
/* harmony import */ var _higher_order_with_focus_return__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../higher-order/with-focus-return */ "./node_modules/@wordpress/components/build-module/higher-order/with-focus-return/index.js");
/* harmony import */ var _higher_order_with_constrained_tabbing__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../higher-order/with-constrained-tabbing */ "./node_modules/@wordpress/components/build-module/higher-order/with-constrained-tabbing/index.js");
/* harmony import */ var _detect_outside__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./detect-outside */ "./node_modules/@wordpress/components/build-module/popover/detect-outside.js");
/* harmony import */ var _icon_button__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../icon-button */ "./node_modules/@wordpress/components/build-module/icon-button/index.js");
/* harmony import */ var _scroll_lock__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../scroll-lock */ "./node_modules/@wordpress/components/build-module/scroll-lock/index.js");
/* harmony import */ var _slot_fill__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../slot-fill */ "./node_modules/@wordpress/components/build-module/slot-fill/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var FocusManaged = Object(_higher_order_with_constrained_tabbing__WEBPACK_IMPORTED_MODULE_15__["default"])(Object(_higher_order_with_focus_return__WEBPACK_IMPORTED_MODULE_14__["default"])(function (_ref) {
var children = _ref.children;
return children;
}));
/**
* Name of slot in which popover should fill.
*
* @type {String}
*/
var SLOT_NAME = 'Popover';
var Popover =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_6__["default"])(Popover, _Component);
function Popover() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Popover);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__["default"])(Popover).apply(this, arguments));
_this.focus = _this.focus.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.refresh = _this.refresh.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.getAnchorRect = _this.getAnchorRect.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.updatePopoverSize = _this.updatePopoverSize.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.computePopoverPosition = _this.computePopoverPosition.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.throttledComputePopoverPosition = _this.throttledComputePopoverPosition.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.maybeClose = _this.maybeClose.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_7__["default"])(_this)));
_this.contentNode = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createRef"])();
_this.anchorNode = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createRef"])();
_this.state = {
popoverLeft: null,
popoverTop: null,
yAxis: 'top',
xAxis: 'center',
contentHeight: null,
contentWidth: null,
isMobile: false,
popoverSize: null
};
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(Popover, [{
key: "componentDidMount",
value: function componentDidMount() {
var _this2 = this;
this.toggleWindowEvents(true);
this.refresh();
/*
* Without the setTimeout, the dom node is not being focused. Related:
* https://stackoverflow.com/questions/35522220/react-ref-with-focus-doesnt-work-without-settimeout-my-example
*
* TODO: Treat the cause, not the symptom.
*/
this.focusTimeout = setTimeout(function () {
_this2.focus();
}, 0);
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps) {
if (prevProps.position !== this.props.position) {
this.computePopoverPosition();
}
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.toggleWindowEvents(false);
clearTimeout(this.focusTimeout);
}
}, {
key: "toggleWindowEvents",
value: function toggleWindowEvents(isListening) {
var handler = isListening ? 'addEventListener' : 'removeEventListener';
window.cancelAnimationFrame(this.rafHandle);
window[handler]('resize', this.throttledComputePopoverPosition);
window[handler]('scroll', this.throttledComputePopoverPosition, true);
}
}, {
key: "throttledComputePopoverPosition",
value: function throttledComputePopoverPosition(event) {
var _this3 = this;
if (event.type === 'scroll' && this.contentNode.current.contains(event.target)) {
return;
}
this.rafHandle = window.requestAnimationFrame(function () {
return _this3.computePopoverPosition();
});
}
/**
* Calling `refresh()` will force the Popover to recalculate its size and
* position. This is useful when a DOM change causes the anchor node to change
* position.
*
* @return {void}
*/
}, {
key: "refresh",
value: function refresh() {
var popoverSize = this.updatePopoverSize();
this.computePopoverPosition(popoverSize);
}
}, {
key: "focus",
value: function focus() {
var focusOnMount = this.props.focusOnMount;
if (!focusOnMount || !this.contentNode.current) {
return;
}
if (focusOnMount === 'firstElement') {
// Find first tabbable node within content and shift focus, falling
// back to the popover panel itself.
var firstTabbable = _wordpress_dom__WEBPACK_IMPORTED_MODULE_11__["focus"].tabbable.find(this.contentNode.current)[0];
if (firstTabbable) {
firstTabbable.focus();
} else {
this.contentNode.current.focus();
}
return;
}
if (focusOnMount === 'container') {
// Focus the popover panel itself so items in the popover are easily
// accessed via keyboard navigation.
this.contentNode.current.focus();
}
}
}, {
key: "getAnchorRect",
value: function getAnchorRect(anchor) {
if (!anchor || !anchor.parentNode) {
return;
}
var rect = anchor.parentNode.getBoundingClientRect(); // subtract padding
var _window$getComputedSt = window.getComputedStyle(anchor.parentNode),
paddingTop = _window$getComputedSt.paddingTop,
paddingBottom = _window$getComputedSt.paddingBottom;
var topPad = parseInt(paddingTop, 10);
var bottomPad = parseInt(paddingBottom, 10);
return {
x: rect.left,
y: rect.top + topPad,
width: rect.width,
height: rect.height - topPad - bottomPad,
left: rect.left,
right: rect.right,
top: rect.top + topPad,
bottom: rect.bottom - bottomPad
};
}
}, {
key: "updatePopoverSize",
value: function updatePopoverSize() {
var rect = this.contentNode.current.getBoundingClientRect();
if (!this.state.popoverSize || rect.width !== this.state.popoverSize.width || rect.height !== this.state.popoverSize.height) {
var popoverSize = {
height: rect.height,
width: rect.width
};
this.setState({
popoverSize: popoverSize
});
return popoverSize;
}
return this.state.popoverSize;
}
}, {
key: "computePopoverPosition",
value: function computePopoverPosition(popoverSize) {
var _this$props = this.props,
_this$props$getAnchor = _this$props.getAnchorRect,
getAnchorRect = _this$props$getAnchor === void 0 ? this.getAnchorRect : _this$props$getAnchor,
_this$props$position = _this$props.position,
position = _this$props$position === void 0 ? 'top' : _this$props$position,
expandOnMobile = _this$props.expandOnMobile;
var newPopoverPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_13__["computePopoverPosition"])(getAnchorRect(this.anchorNode.current), popoverSize || this.state.popoverSize, position, expandOnMobile);
if (this.state.yAxis !== newPopoverPosition.yAxis || this.state.xAxis !== newPopoverPosition.xAxis || this.state.popoverLeft !== newPopoverPosition.popoverLeft || this.state.popoverTop !== newPopoverPosition.popoverTop || this.state.contentHeight !== newPopoverPosition.contentHeight || this.state.contentWidth !== newPopoverPosition.contentWidth || this.state.isMobile !== newPopoverPosition.isMobile) {
this.setState(newPopoverPosition);
}
}
}, {
key: "maybeClose",
value: function maybeClose(event) {
var _this$props2 = this.props,
onKeyDown = _this$props2.onKeyDown,
onClose = _this$props2.onClose; // Close on escape
if (event.keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_12__["ESCAPE"] && onClose) {
event.stopPropagation();
onClose();
} // Preserve original content prop behavior
if (onKeyDown) {
onKeyDown(event);
}
}
}, {
key: "render",
value: function render() {
var _this$props3 = this.props,
headerTitle = _this$props3.headerTitle,
onClose = _this$props3.onClose,
children = _this$props3.children,
className = _this$props3.className,
_this$props3$onClickO = _this$props3.onClickOutside,
onClickOutside = _this$props3$onClickO === void 0 ? onClose : _this$props3$onClickO,
noArrow = _this$props3.noArrow,
position = _this$props3.position,
range = _this$props3.range,
focusOnMount = _this$props3.focusOnMount,
getAnchorRect = _this$props3.getAnchorRect,
expandOnMobile = _this$props3.expandOnMobile,
contentProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props3, ["headerTitle", "onClose", "children", "className", "onClickOutside", "noArrow", "position", "range", "focusOnMount", "getAnchorRect", "expandOnMobile"]);
var _this$state = this.state,
popoverLeft = _this$state.popoverLeft,
popoverTop = _this$state.popoverTop,
yAxis = _this$state.yAxis,
xAxis = _this$state.xAxis,
contentHeight = _this$state.contentHeight,
contentWidth = _this$state.contentWidth,
popoverSize = _this$state.popoverSize,
isMobile = _this$state.isMobile;
var classes = classnames__WEBPACK_IMPORTED_MODULE_9___default()('components-popover', className, 'is-' + yAxis, 'is-' + xAxis, {
'is-mobile': isMobile,
'is-without-arrow': noArrow || xAxis === 'center' && yAxis === 'middle'
}); // Disable reason: We care to capture the _bubbled_ events from inputs
// within popover as inferring close intent.
/* eslint-disable jsx-a11y/no-static-element-interactions */
var content = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_detect_outside__WEBPACK_IMPORTED_MODULE_16__["default"], {
onClickOutside: onClickOutside
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
className: classes,
style: {
top: !isMobile && popoverTop ? popoverTop + 'px' : undefined,
left: !isMobile && popoverLeft ? popoverLeft + 'px' : undefined,
visibility: popoverSize ? undefined : 'hidden'
}
}, contentProps, {
onKeyDown: this.maybeClose
}), isMobile && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", {
className: "components-popover__header"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("span", {
className: "components-popover__header-title"
}, headerTitle), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_icon_button__WEBPACK_IMPORTED_MODULE_17__["default"], {
className: "components-popover__close",
icon: "no-alt",
onClick: onClose
})), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", {
ref: this.contentNode,
className: "components-popover__content",
style: {
maxHeight: !isMobile && contentHeight ? contentHeight + 'px' : undefined,
maxWidth: !isMobile && contentWidth ? contentWidth + 'px' : undefined
},
tabIndex: "-1"
}, children)));
/* eslint-enable jsx-a11y/no-static-element-interactions */
// Apply focus to element as long as focusOnMount is truthy; false is
// the only "disabled" value.
if (focusOnMount) {
content = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(FocusManaged, null, content);
} // In case there is no slot context in which to render, default to an
// in-place rendering.
var getSlot = this.context.getSlot;
if (getSlot && getSlot(SLOT_NAME)) {
content = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_slot_fill__WEBPACK_IMPORTED_MODULE_19__["Fill"], {
name: SLOT_NAME
}, content);
}
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("span", {
ref: this.anchorNode
}, content, isMobile && expandOnMobile && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_scroll_lock__WEBPACK_IMPORTED_MODULE_18__["default"], null));
}
}]);
return Popover;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]);
Popover.defaultProps = {
focusOnMount: 'firstElement',
noArrow: false
};
var PopoverContainer = Popover;
PopoverContainer.contextTypes = {
getSlot: lodash__WEBPACK_IMPORTED_MODULE_10__["noop"]
};
PopoverContainer.Slot = function () {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_slot_fill__WEBPACK_IMPORTED_MODULE_19__["Slot"], {
bubblesVirtually: true,
name: SLOT_NAME
});
};
/* harmony default export */ __webpack_exports__["default"] = (PopoverContainer);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/popover/utils.js":
/*!**************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/popover/utils.js ***!
\**************************************************************************/
/*! exports provided: computePopoverXAxisPosition, computePopoverYAxisPosition, computePopoverPosition */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "computePopoverXAxisPosition", function() { return computePopoverXAxisPosition; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "computePopoverYAxisPosition", function() { return computePopoverYAxisPosition; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "computePopoverPosition", function() { return computePopoverPosition; });
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js");
/* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
/**
* Module constants
*/
var HEIGHT_OFFSET = 10; // used by the arrow and a bit of empty space
var isMobileViewport = function isMobileViewport() {
return window.innerWidth < 782;
};
/**
* Utility used to compute the popover position over the xAxis
*
* @param {Object} anchorRect Anchor Rect.
* @param {Object} contentSize Content Size.
* @param {string} xAxis Desired xAxis.
* @param {string} chosenYAxis yAxis to be used.
* @param {boolean} expandOnMobile Whether to expand the popover on mobile or not.
*
* @return {Object} Popover xAxis position and constraints.
*/
function computePopoverXAxisPosition(anchorRect, contentSize, xAxis, chosenYAxis) {
var width = contentSize.width; // x axis alignment choices
var anchorMidPoint = Math.round(anchorRect.left + anchorRect.width / 2);
var centerAlignment = {
popoverLeft: anchorMidPoint,
contentWidth: (anchorMidPoint - width / 2 > 0 ? width / 2 : anchorMidPoint) + (anchorMidPoint + width / 2 > window.innerWidth ? window.innerWidth - anchorMidPoint : width / 2)
};
var leftAlignmentX = chosenYAxis === 'middle' ? anchorRect.left : anchorMidPoint;
var leftAlignment = {
popoverLeft: leftAlignmentX,
contentWidth: leftAlignmentX - width > 0 ? width : leftAlignmentX
};
var rightAlignmentX = chosenYAxis === 'middle' ? anchorRect.right : anchorMidPoint;
var rightAlignment = {
popoverLeft: rightAlignmentX,
contentWidth: rightAlignmentX + width > window.innerWidth ? window.innerWidth - rightAlignmentX : width
}; // Choosing the x axis
var chosenXAxis;
var contentWidth = null;
if (xAxis === 'center' && centerAlignment.contentWidth === width) {
chosenXAxis = 'center';
} else if (xAxis === 'left' && leftAlignment.contentWidth === width) {
chosenXAxis = 'left';
} else if (xAxis === 'right' && rightAlignment.contentWidth === width) {
chosenXAxis = 'right';
} else {
chosenXAxis = leftAlignment.contentWidth > rightAlignment.contentWidth ? 'left' : 'right';
var chosenWidth = chosenXAxis === 'left' ? leftAlignment.contentWidth : rightAlignment.contentWidth;
contentWidth = chosenWidth !== width ? chosenWidth : null;
}
var popoverLeft;
if (chosenXAxis === 'center') {
popoverLeft = centerAlignment.popoverLeft;
} else if (chosenXAxis === 'left') {
popoverLeft = leftAlignment.popoverLeft;
} else {
popoverLeft = rightAlignment.popoverLeft;
}
return {
xAxis: chosenXAxis,
popoverLeft: popoverLeft,
contentWidth: contentWidth
};
}
/**
* Utility used to compute the popover position over the yAxis
*
* @param {Object} anchorRect Anchor Rect.
* @param {Object} contentSize Content Size.
* @param {string} yAxis Desired yAxis.
* @param {boolean} expandOnMobile Whether to expand the popover on mobile or not.
*
* @return {Object} Popover xAxis position and constraints.
*/
function computePopoverYAxisPosition(anchorRect, contentSize, yAxis) {
var height = contentSize.height; // y axis alignment choices
var anchorMidPoint = anchorRect.top + anchorRect.height / 2;
var middleAlignment = {
popoverTop: anchorMidPoint,
contentHeight: (anchorMidPoint - height / 2 > 0 ? height / 2 : anchorMidPoint) + (anchorMidPoint + height / 2 > window.innerHeight ? window.innerHeight - anchorMidPoint : height / 2)
};
var topAlignment = {
popoverTop: anchorRect.top,
contentHeight: anchorRect.top - HEIGHT_OFFSET - height > 0 ? height : anchorRect.top - HEIGHT_OFFSET
};
var bottomAlignment = {
popoverTop: anchorRect.bottom,
contentHeight: anchorRect.bottom + HEIGHT_OFFSET + height > window.innerHeight ? window.innerHeight - HEIGHT_OFFSET - anchorRect.bottom : height
}; // Choosing the y axis
var chosenYAxis;
var contentHeight = null;
if (yAxis === 'middle' && middleAlignment.contentHeight === height) {
chosenYAxis = 'middle';
} else if (yAxis === 'top' && topAlignment.contentHeight === height) {
chosenYAxis = 'top';
} else if (yAxis === 'bottom' && bottomAlignment.contentHeight === height) {
chosenYAxis = 'bottom';
} else {
chosenYAxis = topAlignment.contentHeight > bottomAlignment.contentHeight ? 'top' : 'bottom';
var chosenHeight = chosenYAxis === 'top' ? topAlignment.contentHeight : bottomAlignment.contentHeight;
contentHeight = chosenHeight !== height ? chosenHeight : null;
}
var popoverTop;
if (chosenYAxis === 'middle') {
popoverTop = middleAlignment.popoverTop;
} else if (chosenYAxis === 'top') {
popoverTop = topAlignment.popoverTop;
} else {
popoverTop = bottomAlignment.popoverTop;
}
return {
yAxis: chosenYAxis,
popoverTop: popoverTop,
contentHeight: contentHeight
};
}
/**
* Utility used to compute the popover position and the content max width/height for a popover
* given its anchor rect and its content size.
*
* @param {Object} anchorRect Anchor Rect.
* @param {Object} contentSize Content Size.
* @param {string} position Position.
* @param {boolean} expandOnMobile Whether to expand the popover on mobile or not.
*
* @return {Object} Popover position and constraints.
*/
function computePopoverPosition(anchorRect, contentSize) {
var position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'top';
var expandOnMobile = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
var _position$split = position.split(' '),
_position$split2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_1__["default"])(_position$split, 2),
yAxis = _position$split2[0],
_position$split2$ = _position$split2[1],
xAxis = _position$split2$ === void 0 ? 'center' : _position$split2$;
var yAxisPosition = computePopoverYAxisPosition(anchorRect, contentSize, yAxis);
var xAxisPosition = computePopoverXAxisPosition(anchorRect, contentSize, xAxis, yAxisPosition.yAxis);
return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({
isMobile: isMobileViewport() && expandOnMobile
}, xAxisPosition, yAxisPosition);
}
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/primitives/index.js":
/*!*****************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/primitives/index.js ***!
\*****************************************************************************/
/*! exports provided: G, Path, Polygon, SVG, AccessibleSVG */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _svg__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./svg */ "./node_modules/@wordpress/components/build-module/primitives/svg/index.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "G", function() { return _svg__WEBPACK_IMPORTED_MODULE_0__["G"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Path", function() { return _svg__WEBPACK_IMPORTED_MODULE_0__["Path"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Polygon", function() { return _svg__WEBPACK_IMPORTED_MODULE_0__["Polygon"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SVG", function() { return _svg__WEBPACK_IMPORTED_MODULE_0__["SVG"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AccessibleSVG", function() { return _svg__WEBPACK_IMPORTED_MODULE_0__["AccessibleSVG"]; });
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/primitives/svg/index.js":
/*!*********************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/primitives/svg/index.js ***!
\*********************************************************************************/
/*! exports provided: G, Path, Polygon, SVG, AccessibleSVG */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "G", function() { return G; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Path", function() { return Path; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Polygon", function() { return Polygon; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SVG", function() { return SVG; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AccessibleSVG", function() { return AccessibleSVG; });
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/deprecated */ "@wordpress/deprecated");
/* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_2__);
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
var G = function G(props) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])('g', props);
};
var Path = function Path(props) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])('path', props);
};
var Polygon = function Polygon(props) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])('polygon', props);
};
var SVG = function SVG(props) {
var appliedProps = Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
role: 'img',
'aria-hidden': 'true',
focusable: 'false'
});
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("svg", appliedProps);
}; // deprecations
var AccessibleSVG = function AccessibleSVG(props) {
_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_2___default()('wp.components.AccessibleSVG', {
version: '4.2',
alternative: 'wp.components.SVG',
plugin: 'Gutenberg'
});
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(SVG, props);
};
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/query-controls/category-select.js":
/*!*******************************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/query-controls/category-select.js ***!
\*******************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CategorySelect; });
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _terms__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./terms */ "./node_modules/@wordpress/components/build-module/query-controls/terms.js");
/* harmony import */ var _tree_select__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../tree-select */ "./node_modules/@wordpress/components/build-module/tree-select/index.js");
/**
* Internal dependencies
*/
function CategorySelect(_ref) {
var label = _ref.label,
noOptionLabel = _ref.noOptionLabel,
categoriesList = _ref.categoriesList,
selectedCategoryId = _ref.selectedCategoryId,
onChange = _ref.onChange;
var termsTree = Object(_terms__WEBPACK_IMPORTED_MODULE_2__["buildTermsTree"])(categoriesList);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_tree_select__WEBPACK_IMPORTED_MODULE_3__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
label: label,
noOptionLabel: noOptionLabel,
onChange: onChange
}, {
tree: termsTree,
selectedId: selectedCategoryId
}));
}
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/query-controls/index.js":
/*!*********************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/query-controls/index.js ***!
\*********************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return QueryControls; });
/* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ */ "./node_modules/@wordpress/components/build-module/index.js");
/* harmony import */ var _category_select__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./category-select */ "./node_modules/@wordpress/components/build-module/query-controls/category-select.js");
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var DEFAULT_MIN_ITEMS = 1;
var DEFAULT_MAX_ITEMS = 100;
function QueryControls(_ref) {
var categoriesList = _ref.categoriesList,
selectedCategoryId = _ref.selectedCategoryId,
numberOfItems = _ref.numberOfItems,
order = _ref.order,
orderBy = _ref.orderBy,
_ref$maxItems = _ref.maxItems,
maxItems = _ref$maxItems === void 0 ? DEFAULT_MAX_ITEMS : _ref$maxItems,
_ref$minItems = _ref.minItems,
minItems = _ref$minItems === void 0 ? DEFAULT_MIN_ITEMS : _ref$minItems,
onCategoryChange = _ref.onCategoryChange,
onNumberOfItemsChange = _ref.onNumberOfItemsChange,
onOrderChange = _ref.onOrderChange,
onOrderByChange = _ref.onOrderByChange;
return [onOrderChange && onOrderByChange && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(___WEBPACK_IMPORTED_MODULE_3__["SelectControl"], {
key: "query-controls-order-select",
label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Order by'),
value: "".concat(orderBy, "/").concat(order),
options: [{
label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Newest to Oldest'),
value: 'date/desc'
}, {
label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Oldest to Newest'),
value: 'date/asc'
}, {
/* translators: label for ordering posts by title in ascending order */
label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('A → Z'),
value: 'title/asc'
}, {
/* translators: label for ordering posts by title in descending order */
label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Z → A'),
value: 'title/desc'
}],
onChange: function onChange(value) {
var _value$split = value.split('/'),
_value$split2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["default"])(_value$split, 2),
newOrderBy = _value$split2[0],
newOrder = _value$split2[1];
if (newOrder !== order) {
onOrderChange(newOrder);
}
if (newOrderBy !== orderBy) {
onOrderByChange(newOrderBy);
}
}
}), onCategoryChange && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_category_select__WEBPACK_IMPORTED_MODULE_4__["default"], {
key: "query-controls-category-select",
categoriesList: categoriesList,
label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Category'),
noOptionLabel: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('All'),
selectedCategoryId: selectedCategoryId,
onChange: onCategoryChange
}), onNumberOfItemsChange && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(___WEBPACK_IMPORTED_MODULE_3__["RangeControl"], {
key: "query-controls-range-control",
label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Number of items'),
value: numberOfItems,
onChange: onNumberOfItemsChange,
min: minItems,
max: maxItems
})];
}
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/query-controls/terms.js":
/*!*********************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/query-controls/terms.js ***!
\*********************************************************************************/
/*! exports provided: buildTermsTree */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "buildTermsTree", function() { return buildTermsTree; });
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
/**
* External dependencies
*/
/**
* Returns terms in a tree form.
*
* @param {Array} flatTerms Array of terms in flat format.
*
* @return {Array} Array of terms in tree format.
*/
function buildTermsTree(flatTerms) {
var termsByParent = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["groupBy"])(flatTerms, 'parent');
var fillWithChildren = function fillWithChildren(terms) {
return terms.map(function (term) {
var children = termsByParent[term.id];
return Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__["default"])({}, term, {
children: children && children.length ? fillWithChildren(children) : []
});
});
};
return fillWithChildren(termsByParent['0'] || []);
}
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/radio-control/index.js":
/*!********************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/radio-control/index.js ***!
\********************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _base_control__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../base-control */ "./node_modules/@wordpress/components/build-module/base-control/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function RadioControl(_ref) {
var label = _ref.label,
className = _ref.className,
selected = _ref.selected,
help = _ref.help,
instanceId = _ref.instanceId,
onChange = _ref.onChange,
_ref$options = _ref.options,
options = _ref$options === void 0 ? [] : _ref$options;
var id = "inspector-radio-control-".concat(instanceId);
var onChangeValue = function onChangeValue(event) {
return onChange(event.target.value);
};
return !Object(lodash__WEBPACK_IMPORTED_MODULE_1__["isEmpty"])(options) && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_base_control__WEBPACK_IMPORTED_MODULE_4__["default"], {
label: label,
id: id,
help: help,
className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, 'components-radio-control')
}, options.map(function (option, index) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
key: "".concat(id, "-").concat(index),
className: "components-radio-control__option"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("input", {
id: "".concat(id, "-").concat(index),
className: "components-radio-control__input",
type: "radio",
name: id,
value: option.value,
onChange: onChangeValue,
checked: option.value === selected,
"aria-describedby": !!help ? "".concat(id, "__help") : undefined
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("label", {
htmlFor: "".concat(id, "-").concat(index)
}, option.label));
}));
}
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__["withInstanceId"])(RadioControl));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/range-control/index.js":
/*!********************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/range-control/index.js ***!
\********************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../ */ "./node_modules/@wordpress/components/build-module/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function RangeControl(_ref) {
var className = _ref.className,
label = _ref.label,
value = _ref.value,
instanceId = _ref.instanceId,
onChange = _ref.onChange,
beforeIcon = _ref.beforeIcon,
afterIcon = _ref.afterIcon,
help = _ref.help,
allowReset = _ref.allowReset,
initialPosition = _ref.initialPosition,
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["className", "label", "value", "instanceId", "onChange", "beforeIcon", "afterIcon", "help", "allowReset", "initialPosition"]);
var id = "inspector-range-control-".concat(instanceId);
var resetValue = function resetValue() {
return onChange();
};
var onChangeValue = function onChangeValue(event) {
var newValue = event.target.value;
if (newValue === '') {
resetValue();
return;
}
onChange(Number(newValue));
};
var initialSliderValue = Object(lodash__WEBPACK_IMPORTED_MODULE_3__["isFinite"])(value) ? value : initialPosition || '';
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(___WEBPACK_IMPORTED_MODULE_7__["BaseControl"], {
label: label,
id: id,
help: help,
className: classnames__WEBPACK_IMPORTED_MODULE_4___default()('components-range-control', className)
}, beforeIcon && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(___WEBPACK_IMPORTED_MODULE_7__["Dashicon"], {
icon: beforeIcon
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("input", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
className: "components-range-control__slider",
id: id,
type: "range",
value: initialSliderValue,
onChange: onChangeValue,
"aria-describedby": !!help ? id + '__help' : undefined
}, props)), afterIcon && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(___WEBPACK_IMPORTED_MODULE_7__["Dashicon"], {
icon: afterIcon
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("input", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
className: "components-range-control__number",
type: "number",
onChange: onChangeValue,
"aria-label": label,
value: value
}, props)), allowReset && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(___WEBPACK_IMPORTED_MODULE_7__["Button"], {
onClick: resetValue,
disabled: value === undefined
}, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["__"])('Reset')));
}
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_6__["withInstanceId"])(RangeControl));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/resizable-box/index.js":
/*!********************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/resizable-box/index.js ***!
\********************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var re_resizable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! re-resizable */ "./node_modules/re-resizable/lib/index.js");
/**
* External dependencies
*/
function ResizableBox(_ref) {
var className = _ref.className,
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["className"]);
// Removes the inline styles in the drag handles.
var handleStylesOverrides = {
width: null,
height: null,
top: null,
right: null,
bottom: null,
left: null
};
var handleClassName = 'components-resizable-box__handle';
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(re_resizable__WEBPACK_IMPORTED_MODULE_4__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
className: classnames__WEBPACK_IMPORTED_MODULE_3___default()('components-resizable-box__container', className),
handleClasses: {
top: classnames__WEBPACK_IMPORTED_MODULE_3___default()(handleClassName, 'components-resizable-box__handle-top'),
right: classnames__WEBPACK_IMPORTED_MODULE_3___default()(handleClassName, 'components-resizable-box__handle-right'),
bottom: classnames__WEBPACK_IMPORTED_MODULE_3___default()(handleClassName, 'components-resizable-box__handle-bottom'),
left: classnames__WEBPACK_IMPORTED_MODULE_3___default()(handleClassName, 'components-resizable-box__handle-left')
},
handleStyles: {
top: handleStylesOverrides,
right: handleStylesOverrides,
bottom: handleStylesOverrides,
left: handleStylesOverrides
}
}, props));
}
/* harmony default export */ __webpack_exports__["default"] = (ResizableBox);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/responsive-wrapper/index.js":
/*!*************************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/responsive-wrapper/index.js ***!
\*************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
/**
* External dependencies
*/
/**
* WordPress Dependencies
*/
function ResponsiveWrapper(_ref) {
var naturalWidth = _ref.naturalWidth,
naturalHeight = _ref.naturalHeight,
children = _ref.children;
if (_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Children"].count(children) !== 1) {
return null;
}
var imageStyle = {
paddingBottom: naturalHeight / naturalWidth * 100 + '%'
};
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
className: "components-responsive-wrapper"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
style: imageStyle
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["cloneElement"])(children, {
className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('components-responsive-wrapper__content', children.props.className)
}));
}
/* harmony default export */ __webpack_exports__["default"] = (ResponsiveWrapper);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/sandbox/index.js":
/*!**************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/sandbox/index.js ***!
\**************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _focusable_iframe__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../focusable-iframe */ "./node_modules/@wordpress/components/build-module/focusable-iframe/index.js");
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var Sandbox =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(Sandbox, _Component);
function Sandbox() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, Sandbox);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(Sandbox).apply(this, arguments));
_this.trySandbox = _this.trySandbox.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this)));
_this.checkMessageForResize = _this.checkMessageForResize.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this)));
_this.iframe = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createRef"])();
_this.state = {
width: 0,
height: 0
};
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(Sandbox, [{
key: "componentDidMount",
value: function componentDidMount() {
this.trySandbox();
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate() {
this.trySandbox();
}
}, {
key: "isFrameAccessible",
value: function isFrameAccessible() {
try {
return !!this.iframe.current.contentDocument.body;
} catch (e) {
return false;
}
}
}, {
key: "checkMessageForResize",
value: function checkMessageForResize(event) {
var iframe = this.iframe.current; // Attempt to parse the message data as JSON if passed as string
var data = event.data || {};
if ('string' === typeof data) {
try {
data = JSON.parse(data);
} catch (e) {} // eslint-disable-line no-empty
} // Verify that the mounted element is the source of the message
if (!iframe || iframe.contentWindow !== event.source) {
return;
} // Update the state only if the message is formatted as we expect, i.e.
// as an object with a 'resize' action, width, and height
var _data = data,
action = _data.action,
width = _data.width,
height = _data.height;
var _this$state = this.state,
oldWidth = _this$state.width,
oldHeight = _this$state.height;
if ('resize' === action && (oldWidth !== width || oldHeight !== height)) {
this.setState({
width: width,
height: height
});
}
}
}, {
key: "trySandbox",
value: function trySandbox() {
if (!this.isFrameAccessible()) {
return;
}
var body = this.iframe.current.contentDocument.body;
if (null !== body.getAttribute('data-resizable-iframe-connected')) {
return;
}
var observeAndResizeJS = "\n\t\t\t( function() {\n\t\t\t\tvar observer;\n\n\t\t\t\tif ( ! window.MutationObserver || ! document.body || ! window.parent ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfunction sendResize() {\n\t\t\t\t\tvar clientBoundingRect = document.body.getBoundingClientRect();\n\n\t\t\t\t\twindow.parent.postMessage( {\n\t\t\t\t\t\taction: 'resize',\n\t\t\t\t\t\twidth: clientBoundingRect.width,\n\t\t\t\t\t\theight: clientBoundingRect.height,\n\t\t\t\t\t}, '*' );\n\t\t\t\t}\n\n\t\t\t\tobserver = new MutationObserver( sendResize );\n\t\t\t\tobserver.observe( document.body, {\n\t\t\t\t\tattributes: true,\n\t\t\t\t\tattributeOldValue: false,\n\t\t\t\t\tcharacterData: true,\n\t\t\t\t\tcharacterDataOldValue: false,\n\t\t\t\t\tchildList: true,\n\t\t\t\t\tsubtree: true\n\t\t\t\t} );\n\n\t\t\t\twindow.addEventListener( 'load', sendResize, true );\n\n\t\t\t\t// Hack: Remove viewport unit styles, as these are relative\n\t\t\t\t// the iframe root and interfere with our mechanism for\n\t\t\t\t// determining the unconstrained page bounds.\n\t\t\t\tfunction removeViewportStyles( ruleOrNode ) {\n\t\t\t\t\t[ 'width', 'height', 'minHeight', 'maxHeight' ].forEach( function( style ) {\n\t\t\t\t\t\tif ( /^\\d+(vmin|vmax|vh|vw)$/.test( ruleOrNode.style[ style ] ) ) {\n\t\t\t\t\t\t\truleOrNode.style[ style ] = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\tArray.prototype.forEach.call( document.querySelectorAll( '[style]' ), removeViewportStyles );\n\t\t\t\tArray.prototype.forEach.call( document.styleSheets, function( stylesheet ) {\n\t\t\t\t\tArray.prototype.forEach.call( stylesheet.cssRules || stylesheet.rules, removeViewportStyles );\n\t\t\t\t} );\n\n\t\t\t\tdocument.body.style.position = 'absolute';\n\t\t\t\tdocument.body.style.width = '100%';\n\t\t\t\tdocument.body.setAttribute( 'data-resizable-iframe-connected', '' );\n\n\t\t\t\tsendResize();\n\n\t\t\t\t// Resize events can change the width of elements with 100% width, but we don't\n\t\t\t\t// get an DOM mutations for that, so do the resize when the window is resized, too.\n\t\t\t\twindow.addEventListener( 'resize', sendResize, true );\n\t\t} )();";
var style = "\n\t\t\tbody {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\thtml,\n\t\t\tbody,\n\t\t\tbody > div,\n\t\t\tbody > div > iframe {\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t\thtml.wp-has-aspect-ratio,\n\t\t\tbody.wp-has-aspect-ratio,\n\t\t\tbody.wp-has-aspect-ratio > div,\n\t\t\tbody.wp-has-aspect-ratio > div > iframe {\n\t\t\t\theight: 100%;\n\t\t\t\toverflow: hidden; /* If it has an aspect ratio, it shouldn't scroll. */\n\t\t\t}\n\t\t\tbody > div > * {\n\t\t\t\tmargin-top: 0 !important; /* Has to have !important to override inline styles. */\n\t\t\t\tmargin-bottom: 0 !important;\n\t\t\t}\n\t\t"; // put the html snippet into a html document, and then write it to the iframe's document
// we can use this in the future to inject custom styles or scripts.
// Scripts go into the body rather than the head, to support embedded content such as Instagram
// that expect the scripts to be part of the body.
var htmlDoc = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("html", {
lang: document.documentElement.lang,
className: this.props.type
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("head", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("title", null, this.props.title), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("style", {
dangerouslySetInnerHTML: {
__html: style
}
})), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("body", {
"data-resizable-iframe-connected": "data-resizable-iframe-connected",
className: this.props.type
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
dangerouslySetInnerHTML: {
__html: this.props.html
}
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("script", {
type: "text/javascript",
dangerouslySetInnerHTML: {
__html: observeAndResizeJS
}
}), this.props.scripts && this.props.scripts.map(function (src) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("script", {
key: src,
src: src
});
}))); // writing the document like this makes it act in the same way as if it was
// loaded over the network, so DOM creation and mutation, script execution, etc.
// all work as expected
var iframeDocument = this.iframe.current.contentWindow.document;
iframeDocument.open();
iframeDocument.write('<!DOCTYPE html>' + Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["renderToString"])(htmlDoc));
iframeDocument.close();
}
}, {
key: "render",
value: function render() {
var title = this.props.title;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_focusable_iframe__WEBPACK_IMPORTED_MODULE_8__["default"], {
iframeRef: this.iframe,
title: title,
className: "components-sandbox",
sandbox: "allow-scripts allow-same-origin allow-presentation",
onLoad: this.trySandbox,
width: Math.ceil(this.state.width),
height: Math.ceil(this.state.height)
});
}
}], [{
key: "defaultProps",
get: function get() {
return {
html: '',
title: ''
};
}
}]);
return Sandbox;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]);
Sandbox = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_7__["withGlobalEvents"])({
message: 'checkMessageForResize'
})(Sandbox);
/* harmony default export */ __webpack_exports__["default"] = (Sandbox);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/scroll-lock/index.js":
/*!******************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/scroll-lock/index.js ***!
\******************************************************************************/
/*! exports provided: createScrollLockComponent, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createScrollLockComponent", function() { return createScrollLockComponent; });
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__);
/**
* WordPress dependencies
*/
/**
* Creates a ScrollLock component bound to the specified document.
*
* This function creates a ScrollLock component for the specified document
* and is exposed so we can create an isolated component for unit testing.
*
* @param {Object} args Keyword args.
* @param {HTMLDocument} args.htmlDocument The document to lock the scroll for.
* @param {string} args.className The name of the class used to lock scrolling.
* @return {Component} The bound ScrollLock component.
*/
function createScrollLockComponent() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
_ref$htmlDocument = _ref.htmlDocument,
htmlDocument = _ref$htmlDocument === void 0 ? document : _ref$htmlDocument,
_ref$className = _ref.className,
className = _ref$className === void 0 ? 'lockscroll' : _ref$className;
var lockCounter = 0;
/*
* Setting `overflow: hidden` on html and body elements resets body scroll in iOS.
* Save scroll top so we can restore it after locking scroll.
*
* NOTE: It would be cleaner and possibly safer to find a localized solution such
* as preventing default on certain touchmove events.
*/
var previousScrollTop = 0;
/**
* Locks and unlocks scroll depending on the boolean argument.
*
* @param {boolean} locked Whether or not scroll should be locked.
*/
function setLocked(locked) {
var scrollingElement = htmlDocument.scrollingElement || htmlDocument.body;
if (locked) {
previousScrollTop = scrollingElement.scrollTop;
}
var methodName = locked ? 'add' : 'remove';
scrollingElement.classList[methodName](className); // Adding the class to the document element seems to be necessary in iOS.
htmlDocument.documentElement.classList[methodName](className);
if (!locked) {
scrollingElement.scrollTop = previousScrollTop;
}
}
/**
* Requests scroll lock.
*
* This function tracks requests for scroll lock. It locks scroll on the first
* request and counts each request so `releaseLock` can unlock scroll when
* all requests have been released.
*/
function requestLock() {
if (lockCounter === 0) {
setLocked(true);
}
++lockCounter;
}
/**
* Releases a request for scroll lock.
*
* This function tracks released requests for scroll lock. When all requests
* have been released, it unlocks scroll.
*/
function releaseLock() {
if (lockCounter === 1) {
setLocked(false);
}
--lockCounter;
}
return (
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(ScrollLock, _Component);
function ScrollLock() {
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, ScrollLock);
return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(ScrollLock).apply(this, arguments));
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(ScrollLock, [{
key: "componentDidMount",
/**
* Requests scroll lock on mount.
*/
value: function componentDidMount() {
requestLock();
}
/**
* Releases scroll lock before unmount.
*/
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
releaseLock();
}
/**
* Render nothing as this component is merely a way to declare scroll lock.
*
* @return {null} Render nothing by returning `null`.
*/
}, {
key: "render",
value: function render() {
return null;
}
}]);
return ScrollLock;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"])
);
}
/* harmony default export */ __webpack_exports__["default"] = (createScrollLockComponent());
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/select-control/index.js":
/*!*********************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/select-control/index.js ***!
\*********************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _base_control__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../base-control */ "./node_modules/@wordpress/components/build-module/base-control/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function SelectControl(_ref) {
var help = _ref.help,
instanceId = _ref.instanceId,
label = _ref.label,
_ref$multiple = _ref.multiple,
multiple = _ref$multiple === void 0 ? false : _ref$multiple,
onChange = _ref.onChange,
_ref$options = _ref.options,
options = _ref$options === void 0 ? [] : _ref$options,
className = _ref.className,
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__["default"])(_ref, ["help", "instanceId", "label", "multiple", "onChange", "options", "className"]);
var id = "inspector-select-control-".concat(instanceId);
var onChangeValue = function onChangeValue(event) {
if (multiple) {
var selectedOptions = Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["default"])(event.target.options).filter(function (_ref2) {
var selected = _ref2.selected;
return selected;
});
var newValues = selectedOptions.map(function (_ref3) {
var value = _ref3.value;
return value;
});
onChange(newValues);
return;
}
onChange(event.target.value);
}; // Disable reason: A select with an onchange throws a warning
/* eslint-disable jsx-a11y/no-onchange */
return !Object(lodash__WEBPACK_IMPORTED_MODULE_4__["isEmpty"])(options) && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_base_control__WEBPACK_IMPORTED_MODULE_6__["default"], {
label: label,
id: id,
help: help,
className: className
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])("select", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
id: id,
className: "components-select-control__input",
onChange: onChangeValue,
"aria-describedby": !!help ? "".concat(id, "__help") : undefined,
multiple: multiple
}, props), options.map(function (option, index) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])("option", {
key: "".concat(option.label, "-").concat(option.value, "-").concat(index),
value: option.value
}, option.label);
})));
/* eslint-enable jsx-a11y/no-onchange */
}
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__["withInstanceId"])(SelectControl));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/server-side-render/index.js":
/*!*************************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/server-side-render/index.js ***!
\*************************************************************************************/
/*! exports provided: rendererPath, ServerSideRender, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rendererPath", function() { return rendererPath; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ServerSideRender", function() { return ServerSideRender; });
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread */ "./node_modules/@babel/runtime/helpers/esm/objectSpread.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch");
/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url");
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var _placeholder__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../placeholder */ "./node_modules/@wordpress/components/build-module/placeholder/index.js");
/* harmony import */ var _spinner__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../spinner */ "./node_modules/@wordpress/components/build-module/spinner/index.js");
/**
* External dependencies.
*/
/**
* WordPress dependencies.
*/
/**
* Internal dependencies.
*/
function rendererPath(block) {
var attributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
var urlQueryArgs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
return Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_10__["addQueryArgs"])("/gutenberg/v1/block-renderer/".concat(block), Object(_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_5__["default"])({
context: 'edit'
}, null !== attributes ? {
attributes: attributes
} : {}, urlQueryArgs));
}
var ServerSideRender =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(ServerSideRender, _Component);
function ServerSideRender(props) {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, ServerSideRender);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(ServerSideRender).call(this, props));
_this.state = {
response: null
};
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(ServerSideRender, [{
key: "componentDidMount",
value: function componentDidMount() {
this.isStillMounted = true;
this.fetch(this.props);
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.isStillMounted = false;
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps) {
if (!Object(lodash__WEBPACK_IMPORTED_MODULE_7__["isEqual"])(prevProps, this.props)) {
this.fetch(this.props);
}
}
}, {
key: "fetch",
value: function fetch(props) {
var _this2 = this;
if (null !== this.state.response) {
this.setState({
response: null
});
}
var block = props.block,
_props$attributes = props.attributes,
attributes = _props$attributes === void 0 ? null : _props$attributes,
_props$urlQueryArgs = props.urlQueryArgs,
urlQueryArgs = _props$urlQueryArgs === void 0 ? {} : _props$urlQueryArgs;
var path = rendererPath(block, attributes, urlQueryArgs);
return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_9___default()({
path: path
}).then(function (response) {
if (_this2.isStillMounted && response && response.rendered) {
_this2.setState({
response: response.rendered
});
}
}).catch(function (error) {
if (_this2.isStillMounted) {
_this2.setState({
response: {
error: true,
errorMsg: error.message
}
});
}
});
}
}, {
key: "render",
value: function render() {
var response = this.state.response;
if (!response) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_placeholder__WEBPACK_IMPORTED_MODULE_11__["default"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_spinner__WEBPACK_IMPORTED_MODULE_12__["default"], null));
} else if (response.error) {
// translators: %s: error message describing the problem
var errorMessage = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["sprintf"])(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Error loading block: %s'), response.errorMsg);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_placeholder__WEBPACK_IMPORTED_MODULE_11__["default"], null, errorMessage);
} else if (!response.length) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_placeholder__WEBPACK_IMPORTED_MODULE_11__["default"], null, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('No results found.'));
}
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["RawHTML"], {
key: "html"
}, response);
}
}]);
return ServerSideRender;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]);
/* harmony default export */ __webpack_exports__["default"] = (ServerSideRender);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/shortcut/index.js":
/*!***************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/shortcut/index.js ***!
\***************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
/**
* External dependencies
*/
function Shortcut(_ref) {
var shortcut = _ref.shortcut,
className = _ref.className;
if (!shortcut) {
return null;
}
var displayText;
var ariaLabel;
if (Object(lodash__WEBPACK_IMPORTED_MODULE_1__["isString"])(shortcut)) {
displayText = shortcut;
}
if (Object(lodash__WEBPACK_IMPORTED_MODULE_1__["isObject"])(shortcut)) {
displayText = shortcut.display;
ariaLabel = shortcut.ariaLabel;
}
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", {
className: className,
"aria-label": ariaLabel
}, displayText);
}
/* harmony default export */ __webpack_exports__["default"] = (Shortcut);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/slot-fill/fill.js":
/*!***************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/slot-fill/fill.js ***!
\***************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__);
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
var occurrences = 0;
var Fill =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(Fill, _Component);
function Fill() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, Fill);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(Fill).apply(this, arguments));
_this.occurrence = ++occurrences;
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(Fill, [{
key: "componentDidMount",
value: function componentDidMount() {
var _this$context$registe = this.context.registerFill,
registerFill = _this$context$registe === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_5__["noop"] : _this$context$registe;
registerFill(this.props.name, this);
}
}, {
key: "componentWillUpdate",
value: function componentWillUpdate() {
if (!this.occurrence) {
this.occurrence = ++occurrences;
}
var _this$context$getSlot = this.context.getSlot,
getSlot = _this$context$getSlot === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_5__["noop"] : _this$context$getSlot;
var slot = getSlot(this.props.name);
if (slot && !slot.props.bubblesVirtually) {
slot.forceUpdate();
}
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
var _this$context$unregis = this.context.unregisterFill,
unregisterFill = _this$context$unregis === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_5__["noop"] : _this$context$unregis;
unregisterFill(this.props.name, this);
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps) {
var name = this.props.name;
var _this$context = this.context,
_this$context$unregis2 = _this$context.unregisterFill,
unregisterFill = _this$context$unregis2 === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_5__["noop"] : _this$context$unregis2,
_this$context$registe2 = _this$context.registerFill,
registerFill = _this$context$registe2 === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_5__["noop"] : _this$context$registe2;
if (prevProps.name !== name) {
unregisterFill(prevProps.name, this);
registerFill(name, this);
}
}
}, {
key: "resetOccurrence",
value: function resetOccurrence() {
this.occurrence = null;
}
}, {
key: "render",
value: function render() {
var _this$context$getSlot2 = this.context.getSlot,
getSlot = _this$context$getSlot2 === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_5__["noop"] : _this$context$getSlot2;
var name = this.props.name;
var children = this.props.children;
var slot = getSlot(name);
if (!slot || !slot.props.bubblesVirtually) {
return null;
} // If a function is passed as a child, provide it with the fillProps.
if (Object(lodash__WEBPACK_IMPORTED_MODULE_5__["isFunction"])(children)) {
children = children(slot.props.fillProps);
}
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createPortal"])(children, slot.node);
}
}]);
return Fill;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]);
Fill.contextTypes = {
getSlot: lodash__WEBPACK_IMPORTED_MODULE_5__["noop"],
registerFill: lodash__WEBPACK_IMPORTED_MODULE_5__["noop"],
unregisterFill: lodash__WEBPACK_IMPORTED_MODULE_5__["noop"]
};
/* harmony default export */ __webpack_exports__["default"] = (Fill);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/slot-fill/index.js":
/*!****************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/slot-fill/index.js ***!
\****************************************************************************/
/*! exports provided: Slot, Fill, Provider, createSlotFill */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSlotFill", function() { return createSlotFill; });
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _slot__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./slot */ "./node_modules/@wordpress/components/build-module/slot-fill/slot.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Slot", function() { return _slot__WEBPACK_IMPORTED_MODULE_3__["default"]; });
/* harmony import */ var _fill__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./fill */ "./node_modules/@wordpress/components/build-module/slot-fill/fill.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Fill", function() { return _fill__WEBPACK_IMPORTED_MODULE_4__["default"]; });
/* harmony import */ var _provider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./provider */ "./node_modules/@wordpress/components/build-module/slot-fill/provider.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Provider", function() { return _provider__WEBPACK_IMPORTED_MODULE_5__["default"]; });
/**
* Internal dependencies
*/
function createSlotFill(name) {
var FillComponent = function FillComponent(_ref) {
var children = _ref.children,
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["children"]);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_fill__WEBPACK_IMPORTED_MODULE_4__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
name: name
}, props), children);
};
FillComponent.displayName = name + 'Fill';
var SlotComponent = function SlotComponent(_ref2) {
var children = _ref2.children,
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref2, ["children"]);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_slot__WEBPACK_IMPORTED_MODULE_3__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
name: name
}, props), children);
};
SlotComponent.displayName = name + 'Slot';
return {
Fill: FillComponent,
Slot: SlotComponent
};
}
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/slot-fill/provider.js":
/*!*******************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/slot-fill/provider.js ***!
\*******************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js");
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__);
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
var SlotFillProvider =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(SlotFillProvider, _Component);
function SlotFillProvider() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, SlotFillProvider);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(SlotFillProvider).apply(this, arguments));
_this.registerSlot = _this.registerSlot.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this)));
_this.registerFill = _this.registerFill.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this)));
_this.unregisterSlot = _this.unregisterSlot.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this)));
_this.unregisterFill = _this.unregisterFill.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this)));
_this.getSlot = _this.getSlot.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this)));
_this.getFills = _this.getFills.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this)));
_this.slots = {};
_this.fills = {};
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(SlotFillProvider, [{
key: "getChildContext",
value: function getChildContext() {
return Object(lodash__WEBPACK_IMPORTED_MODULE_7__["pick"])(this, ['registerSlot', 'registerFill', 'unregisterSlot', 'unregisterFill', 'getSlot', 'getFills']);
}
}, {
key: "registerSlot",
value: function registerSlot(name, slot) {
this.slots[name] = slot;
this.forceUpdateFills(name); // Sometimes the fills are registered after the initial render of slot
// But before the registerSlot call, we need to rerender the slot
this.forceUpdateSlot(name);
}
}, {
key: "registerFill",
value: function registerFill(name, instance) {
this.fills[name] = Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(this.fills[name] || []).concat([instance]);
this.forceUpdateSlot(name);
}
}, {
key: "unregisterSlot",
value: function unregisterSlot(name) {
delete this.slots[name];
this.forceUpdateFills(name);
}
}, {
key: "unregisterFill",
value: function unregisterFill(name, instance) {
this.fills[name] = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["without"])(this.fills[name], instance);
this.resetFillOccurrence(name);
this.forceUpdateSlot(name);
}
}, {
key: "getSlot",
value: function getSlot(name) {
return this.slots[name];
}
}, {
key: "getFills",
value: function getFills(name) {
return Object(lodash__WEBPACK_IMPORTED_MODULE_7__["sortBy"])(this.fills[name], 'occurrence');
}
}, {
key: "resetFillOccurrence",
value: function resetFillOccurrence(name) {
Object(lodash__WEBPACK_IMPORTED_MODULE_7__["forEach"])(this.fills[name], function (instance) {
instance.resetOccurrence();
});
}
}, {
key: "forceUpdateFills",
value: function forceUpdateFills(name) {
Object(lodash__WEBPACK_IMPORTED_MODULE_7__["forEach"])(this.fills[name], function (instance) {
instance.forceUpdate();
});
}
}, {
key: "forceUpdateSlot",
value: function forceUpdateSlot(name) {
var slot = this.getSlot(name);
if (slot) {
slot.forceUpdate();
}
}
}, {
key: "render",
value: function render() {
return this.props.children;
}
}]);
return SlotFillProvider;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]);
SlotFillProvider.childContextTypes = {
registerSlot: lodash__WEBPACK_IMPORTED_MODULE_7__["noop"],
unregisterSlot: lodash__WEBPACK_IMPORTED_MODULE_7__["noop"],
registerFill: lodash__WEBPACK_IMPORTED_MODULE_7__["noop"],
unregisterFill: lodash__WEBPACK_IMPORTED_MODULE_7__["noop"],
getSlot: lodash__WEBPACK_IMPORTED_MODULE_7__["noop"],
getFills: lodash__WEBPACK_IMPORTED_MODULE_7__["noop"]
};
/* harmony default export */ __webpack_exports__["default"] = (SlotFillProvider);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/slot-fill/slot.js":
/*!***************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/slot-fill/slot.js ***!
\***************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__);
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
var Slot =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(Slot, _Component);
function Slot() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, Slot);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(Slot).apply(this, arguments));
_this.bindNode = _this.bindNode.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this)));
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(Slot, [{
key: "componentDidMount",
value: function componentDidMount() {
var _this$context$registe = this.context.registerSlot,
registerSlot = _this$context$registe === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_7__["noop"] : _this$context$registe;
registerSlot(this.props.name, this);
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
var _this$context$unregis = this.context.unregisterSlot,
unregisterSlot = _this$context$unregis === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_7__["noop"] : _this$context$unregis;
unregisterSlot(this.props.name, this);
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps) {
var name = this.props.name;
var _this$context = this.context,
_this$context$unregis2 = _this$context.unregisterSlot,
unregisterSlot = _this$context$unregis2 === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_7__["noop"] : _this$context$unregis2,
_this$context$registe2 = _this$context.registerSlot,
registerSlot = _this$context$registe2 === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_7__["noop"] : _this$context$registe2;
if (prevProps.name !== name) {
unregisterSlot(prevProps.name);
registerSlot(name, this);
}
}
}, {
key: "bindNode",
value: function bindNode(node) {
this.node = node;
}
}, {
key: "render",
value: function render() {
var _this$props = this.props,
children = _this$props.children,
name = _this$props.name,
_this$props$bubblesVi = _this$props.bubblesVirtually,
bubblesVirtually = _this$props$bubblesVi === void 0 ? false : _this$props$bubblesVi,
_this$props$fillProps = _this$props.fillProps,
fillProps = _this$props$fillProps === void 0 ? {} : _this$props$fillProps;
var _this$context$getFill = this.context.getFills,
getFills = _this$context$getFill === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_7__["noop"] : _this$context$getFill;
if (bubblesVirtually) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
ref: this.bindNode
});
}
var fills = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["map"])(getFills(name), function (fill) {
var fillKey = fill.occurrence;
var fillChildren = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["isFunction"])(fill.props.children) ? fill.props.children(fillProps) : fill.props.children;
return _wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Children"].map(fillChildren, function (child, childIndex) {
if (!child || Object(lodash__WEBPACK_IMPORTED_MODULE_7__["isString"])(child)) {
return child;
}
var childKey = "".concat(fillKey, "---").concat(child.key || childIndex);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["cloneElement"])(child, {
key: childKey
});
});
}).filter( // In some cases fills are rendered only when some conditions apply.
// This ensures that we only use non-empty fills when rendering, i.e.,
// it allows us to render wrappers only when the fills are actually present.
Object(lodash__WEBPACK_IMPORTED_MODULE_7__["negate"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["isEmptyElement"]));
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Fragment"], null, Object(lodash__WEBPACK_IMPORTED_MODULE_7__["isFunction"])(children) ? children(fills) : fills);
}
}]);
return Slot;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]);
Slot.contextTypes = {
registerSlot: lodash__WEBPACK_IMPORTED_MODULE_7__["noop"],
unregisterSlot: lodash__WEBPACK_IMPORTED_MODULE_7__["noop"],
getFills: lodash__WEBPACK_IMPORTED_MODULE_7__["noop"]
};
/* harmony default export */ __webpack_exports__["default"] = (Slot);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/spinner/index.js":
/*!**************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/spinner/index.js ***!
\**************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony default export */ __webpack_exports__["default"] = (function () {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", {
className: "components-spinner"
});
});
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/tab-panel/index.js":
/*!****************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/tab-panel/index.js ***!
\****************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/deprecated */ "@wordpress/deprecated");
/* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_11__);
/* harmony import */ var _navigable_container__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../navigable-container */ "./node_modules/@wordpress/components/build-module/navigable-container/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var TabButton = function TabButton(_ref) {
var tabId = _ref.tabId,
onClick = _ref.onClick,
children = _ref.children,
selected = _ref.selected,
rest = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_7__["default"])(_ref, ["tabId", "onClick", "children", "selected"]);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("button", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_6__["default"])({
role: "tab",
tabIndex: selected ? null : -1,
"aria-selected": selected,
id: tabId,
onClick: onClick
}, rest), children);
};
var TabPanel =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(TabPanel, _Component);
function TabPanel() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, TabPanel);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(TabPanel).apply(this, arguments));
var _this$props = _this.props,
tabs = _this$props.tabs,
initialTabName = _this$props.initialTabName;
_this.handleClick = _this.handleClick.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this)));
_this.onNavigate = _this.onNavigate.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this)));
_this.state = {
selected: initialTabName || (tabs.length > 0 ? tabs[0].name : null)
};
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(TabPanel, [{
key: "handleClick",
value: function handleClick(tabKey) {
var _this$props$onSelect = this.props.onSelect,
onSelect = _this$props$onSelect === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_9__["noop"] : _this$props$onSelect;
this.setState({
selected: tabKey
});
onSelect(tabKey);
}
}, {
key: "onNavigate",
value: function onNavigate(childIndex, child) {
child.click();
}
}, {
key: "render",
value: function render() {
var _this2 = this;
var selected = this.state.selected;
var _this$props2 = this.props,
_this$props2$activeCl = _this$props2.activeClass,
activeClass = _this$props2$activeCl === void 0 ? 'is-active' : _this$props2$activeCl,
className = _this$props2.className,
instanceId = _this$props2.instanceId,
_this$props2$orientat = _this$props2.orientation,
orientation = _this$props2$orientat === void 0 ? 'horizontal' : _this$props2$orientat,
tabs = _this$props2.tabs;
var selectedTab = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["find"])(tabs, {
name: selected
});
var selectedId = instanceId + '-' + selectedTab.name;
_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_11___default()('Tab Panel child function argument used as string', {
alternative: 'Argument is now an object, access the name property directly.',
version: '4.2.0',
plugin: 'Gutenberg',
hint: 'This is a global warning, shown regardless of whether the component is used.'
});
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", {
className: className
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(_navigable_container__WEBPACK_IMPORTED_MODULE_12__["NavigableMenu"], {
role: "tablist",
orientation: orientation,
onNavigate: this.onNavigate,
className: "components-tab-panel__tabs"
}, tabs.map(function (tab) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])(TabButton, {
className: "".concat(tab.className, " ").concat(tab.name === selected ? activeClass : ''),
tabId: instanceId + '-' + tab.name,
"aria-controls": instanceId + '-' + tab.name + '-view',
selected: tab.name === selected,
key: tab.name,
onClick: Object(lodash__WEBPACK_IMPORTED_MODULE_9__["partial"])(_this2.handleClick, tab.name)
}, tab.title);
})), selectedTab && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["createElement"])("div", {
"aria-labelledby": selectedId,
role: "tabpanel",
id: selectedId + '-view',
className: "components-tab-panel__tab-content",
tabIndex: "0"
}, this.props.children(Object.assign(new String(selectedTab.name), selectedTab))));
}
}]);
return TabPanel;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["Component"]);
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__["withInstanceId"])(TabPanel));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/text-control/index.js":
/*!*******************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/text-control/index.js ***!
\*******************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _base_control__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../base-control */ "./node_modules/@wordpress/components/build-module/base-control/index.js");
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function TextControl(_ref) {
var label = _ref.label,
value = _ref.value,
help = _ref.help,
className = _ref.className,
instanceId = _ref.instanceId,
onChange = _ref.onChange,
_ref$type = _ref.type,
type = _ref$type === void 0 ? 'text' : _ref$type,
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["label", "value", "help", "className", "instanceId", "onChange", "type"]);
var id = "inspector-text-control-".concat(instanceId);
var onChangeValue = function onChangeValue(event) {
return onChange(event.target.value);
};
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_base_control__WEBPACK_IMPORTED_MODULE_4__["default"], {
label: label,
id: id,
help: help,
className: className
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("input", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
className: "components-text-control__input",
type: type,
id: id,
value: value,
onChange: onChangeValue,
"aria-describedby": !!help ? id + '__help' : undefined
}, props)));
}
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__["withInstanceId"])(TextControl));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/textarea-control/index.js":
/*!***********************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/textarea-control/index.js ***!
\***********************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _base_control__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../base-control */ "./node_modules/@wordpress/components/build-module/base-control/index.js");
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function TextareaControl(_ref) {
var label = _ref.label,
value = _ref.value,
help = _ref.help,
instanceId = _ref.instanceId,
onChange = _ref.onChange,
_ref$rows = _ref.rows,
rows = _ref$rows === void 0 ? 4 : _ref$rows,
className = _ref.className,
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["label", "value", "help", "instanceId", "onChange", "rows", "className"]);
var id = "inspector-textarea-control-".concat(instanceId);
var onChangeValue = function onChangeValue(event) {
return onChange(event.target.value);
};
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_base_control__WEBPACK_IMPORTED_MODULE_4__["default"], {
label: label,
id: id,
help: help,
className: className
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("textarea", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
className: "components-textarea-control__input",
id: id,
rows: rows,
onChange: onChangeValue,
"aria-describedby": !!help ? id + '__help' : undefined,
value: value
}, props)));
}
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__["withInstanceId"])(TextareaControl));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/toggle-control/index.js":
/*!*********************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/toggle-control/index.js ***!
\*********************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _form_toggle__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../form-toggle */ "./node_modules/@wordpress/components/build-module/form-toggle/index.js");
/* harmony import */ var _base_control__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./../base-control */ "./node_modules/@wordpress/components/build-module/base-control/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
var ToggleControl =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__["default"])(ToggleControl, _Component);
function ToggleControl() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, ToggleControl);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(ToggleControl).apply(this, arguments));
_this.onChange = _this.onChange.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__["default"])(_this)));
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(ToggleControl, [{
key: "onChange",
value: function onChange(event) {
if (this.props.onChange) {
this.props.onChange(event.target.checked);
}
}
}, {
key: "render",
value: function render() {
var _this$props = this.props,
label = _this$props.label,
checked = _this$props.checked,
help = _this$props.help,
instanceId = _this$props.instanceId;
var id = "inspector-toggle-control-".concat(instanceId);
var describedBy, helpLabel;
if (help) {
describedBy = id + '__help';
helpLabel = Object(lodash__WEBPACK_IMPORTED_MODULE_7__["isFunction"])(help) ? help(checked) : help;
}
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_base_control__WEBPACK_IMPORTED_MODULE_10__["default"], {
label: label,
id: id,
help: helpLabel,
className: "components-toggle-control"
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_form_toggle__WEBPACK_IMPORTED_MODULE_9__["default"], {
id: id,
checked: checked,
onChange: this.onChange,
"aria-describedby": describedBy
}));
}
}]);
return ToggleControl;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]);
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_8__["withInstanceId"])(ToggleControl));
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/toolbar/index.js":
/*!**************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/toolbar/index.js ***!
\**************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _icon_button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../icon-button */ "./node_modules/@wordpress/components/build-module/icon-button/index.js");
/* harmony import */ var _dropdown_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../dropdown-menu */ "./node_modules/@wordpress/components/build-module/dropdown-menu/index.js");
/* harmony import */ var _toolbar_container__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./toolbar-container */ "./node_modules/@wordpress/components/build-module/toolbar/toolbar-container.js");
/* harmony import */ var _toolbar_button_container__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./toolbar-button-container */ "./node_modules/@wordpress/components/build-module/toolbar/toolbar-button-container.js");
/**
* External dependencies
*/
/**
* Internal dependencies
*/
/**
* Renders a toolbar with controls.
*
* The `controls` prop accepts an array of sets. A set is an array of controls.
* Controls have the following shape:
*
* ```
* {
* icon: string,
* title: string,
* subscript: string,
* onClick: Function,
* isActive: boolean,
* isDisabled: boolean
* }
* ```
*
* For convenience it is also possible to pass only an array of controls. It is
* then assumed this is the only set.
*
* Either `controls` or `children` is required, otherwise this components
* renders nothing.
*
* @param {?Array} controls The controls to render in this toolbar.
* @param {?ReactElement} children Any other things to render inside the
* toolbar besides the controls.
* @param {?string} className Class to set on the container div.
*
* @return {ReactElement} The rendered toolbar.
*/
function Toolbar(_ref) {
var _ref$controls = _ref.controls,
controls = _ref$controls === void 0 ? [] : _ref$controls,
children = _ref.children,
className = _ref.className,
isCollapsed = _ref.isCollapsed,
icon = _ref.icon,
label = _ref.label;
if ((!controls || !controls.length) && !children) {
return null;
} // Normalize controls to nested array of objects (sets of controls)
var controlSets = controls;
if (!Array.isArray(controlSets[0])) {
controlSets = [controlSets];
}
if (isCollapsed) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_dropdown_menu__WEBPACK_IMPORTED_MODULE_5__["default"], {
icon: icon,
label: label,
controls: controlSets,
className: classnames__WEBPACK_IMPORTED_MODULE_2___default()('components-toolbar', className)
});
}
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_toolbar_container__WEBPACK_IMPORTED_MODULE_6__["default"], {
className: classnames__WEBPACK_IMPORTED_MODULE_2___default()('components-toolbar', className)
}, Object(lodash__WEBPACK_IMPORTED_MODULE_3__["flatMap"])(controlSets, function (controlSet, indexOfSet) {
return controlSet.map(function (control, indexOfControl) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_toolbar_button_container__WEBPACK_IMPORTED_MODULE_7__["default"], {
key: [indexOfSet, indexOfControl].join(),
className: indexOfSet > 0 && indexOfControl === 0 ? 'has-left-divider' : null
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_icon_button__WEBPACK_IMPORTED_MODULE_4__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
icon: control.icon,
label: control.title,
shortcut: control.shortcut,
"data-subscript": control.subscript,
onClick: function onClick(event) {
event.stopPropagation();
control.onClick();
},
className: classnames__WEBPACK_IMPORTED_MODULE_2___default()('components-toolbar__control', control.className, {
'is-active': control.isActive
}),
"aria-pressed": control.isActive,
disabled: control.isDisabled
}, control.extraProps)), control.children);
});
}), children);
}
/* harmony default export */ __webpack_exports__["default"] = (Toolbar);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/toolbar/toolbar-button-container.js":
/*!*********************************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/toolbar/toolbar-button-container.js ***!
\*********************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
var ToolbarButtonContainer = function ToolbarButtonContainer(props) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
className: props.className
}, props.children);
};
/* harmony default export */ __webpack_exports__["default"] = (ToolbarButtonContainer);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/toolbar/toolbar-container.js":
/*!**************************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/toolbar/toolbar-container.js ***!
\**************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
/**
* External dependencies
*/
var ToolbarContainer = function ToolbarContainer(props) {
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('components-toolbar', props.className)
}, props.children);
};
/* harmony default export */ __webpack_exports__["default"] = (ToolbarContainer);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/tooltip/index.js":
/*!**************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/tooltip/index.js ***!
\**************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "./node_modules/@babel/runtime/helpers/esm/inherits.js");
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _popover__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../popover */ "./node_modules/@wordpress/components/build-module/popover/index.js");
/* harmony import */ var _shortcut__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../shortcut */ "./node_modules/@wordpress/components/build-module/shortcut/index.js");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Time over children to wait before showing tooltip
*
* @type {Number}
*/
var TOOLTIP_DELAY = 700;
var Tooltip =
/*#__PURE__*/
function (_Component) {
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(Tooltip, _Component);
function Tooltip() {
var _this;
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, Tooltip);
_this = Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__["default"])(this, Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__["default"])(Tooltip).apply(this, arguments));
_this.bindNode = _this.bindNode.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_6__["default"])(_this)));
_this.delayedSetIsOver = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["debounce"])(function (isOver) {
return _this.setState({
isOver: isOver
});
}, TOOLTIP_DELAY);
_this.state = {
isOver: false
};
return _this;
}
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(Tooltip, [{
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.delayedSetIsOver.cancel();
this.disconnectDisabledAttributeObserver();
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps, prevState) {
var isOver = this.state.isOver;
if (isOver !== prevState.isOver) {
if (isOver) {
this.observeDisabledAttribute();
} else {
this.disconnectDisabledAttributeObserver();
}
}
}
/**
* Assigns DOM node of the rendered component as an instance property.
*
* @param {Element} ref Rendered component reference.
*/
}, {
key: "bindNode",
value: function bindNode(ref) {
// Disable reason: Because render clones the child, we don't know what
// type of element we have, but if it's a DOM node, we want to observe
// the disabled attribute.
// eslint-disable-next-line react/no-find-dom-node
this.node = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["findDOMNode"])(ref);
}
/**
* Disconnects any DOM observer attached to the rendered node.
*/
}, {
key: "disconnectDisabledAttributeObserver",
value: function disconnectDisabledAttributeObserver() {
if (this.observer) {
this.observer.disconnect();
}
}
/**
* Adds a DOM observer to the rendered node, if supported and if the DOM
* node exists, to monitor for application of a disabled attribute.
*/
}, {
key: "observeDisabledAttribute",
value: function observeDisabledAttribute() {
var _this2 = this;
if (!window.MutationObserver || !this.node) {
return;
}
this.observer = new window.MutationObserver(function (_ref) {
var _ref2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["default"])(_ref, 1),
mutation = _ref2[0];
if (mutation.target.disabled) {
// We can assume here that isOver is true, because mutation
// observer is only attached for duration of isOver active
_this2.setState({
isOver: false
});
}
}); // Monitor changes to the disable attribute on the DOM node
this.observer.observe(this.node, {
subtree: true,
attributes: true,
attributeFilter: ['disabled']
});
}
}, {
key: "emitToChild",
value: function emitToChild(eventName, event) {
var children = this.props.children;
if (_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Children"].count(children) !== 1) {
return;
}
var child = _wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Children"].only(children);
if (typeof child.props[eventName] === 'function') {
child.props[eventName](event);
}
}
}, {
key: "createToggleIsOver",
value: function createToggleIsOver(eventName, isDelayed) {
var _this3 = this;
return function (event) {
// Preserve original child callback behavior
_this3.emitToChild(eventName, event); // Mouse events behave unreliably in React for disabled elements,
// firing on mouseenter but not mouseleave. Further, the default
// behavior for disabled elements in some browsers is to ignore
// mouse events. Don't bother trying to to handle them.
//
// See: https://github.com/facebook/react/issues/4251
if (event.currentTarget.disabled) {
return;
} // Needed in case unsetting is over while delayed set pending, i.e.
// quickly blur/mouseleave before delayedSetIsOver is called
_this3.delayedSetIsOver.cancel();
var isOver = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["includes"])(['focus', 'mouseenter'], event.type);
if (isOver === _this3.state.isOver) {
return;
}
if (isDelayed) {
_this3.delayedSetIsOver(isOver);
} else {
_this3.setState({
isOver: isOver
});
}
};
}
}, {
key: "render",
value: function render() {
var _this$props = this.props,
children = _this$props.children,
position = _this$props.position,
text = _this$props.text,
shortcut = _this$props.shortcut;
if (_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Children"].count(children) !== 1) {
if (true) {
// eslint-disable-next-line no-console
console.error('Tooltip should be called with only a single child element.');
}
return children;
}
var child = _wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Children"].only(children);
var isOver = this.state.isOver;
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["cloneElement"])(child, {
ref: this.bindNode,
onMouseEnter: this.createToggleIsOver('onMouseEnter', true),
onMouseLeave: this.createToggleIsOver('onMouseLeave'),
onClick: this.createToggleIsOver('onClick'),
onFocus: this.createToggleIsOver('onFocus'),
onBlur: this.createToggleIsOver('onBlur'),
children: Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["concatChildren"])(child.props.children, isOver && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_popover__WEBPACK_IMPORTED_MODULE_9__["default"], {
focusOnMount: false,
position: position,
className: "components-tooltip",
"aria-hidden": "true"
}, text, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_shortcut__WEBPACK_IMPORTED_MODULE_10__["default"], {
className: "components-tooltip__shortcut",
shortcut: shortcut
})))
});
}
}]);
return Tooltip;
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]);
/* harmony default export */ __webpack_exports__["default"] = (Tooltip);
/***/ }),
/***/ "./node_modules/@wordpress/components/build-module/tree-select/index.js":
/*!******************************************************************************!*\
!*** ./node_modules/@wordpress/components/build-module/tree-select/index.js ***!
\******************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TreeSelect; });
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
/* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash */ "lodash");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../ */ "./node_modules/@wordpress/components/build-module/index.js");
/**
* External dependencies
*/
/**
* Internal dependencies
*/
function getSelectOptions(tree) {
var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
return Object(lodash__WEBPACK_IMPORTED_MODULE_4__["flatMap"])(tree, function (treeNode) {
return [{
value: treeNode.id,
label: Object(lodash__WEBPACK_IMPORTED_MODULE_4__["repeat"])("\xA0", level * 3) + Object(lodash__WEBPACK_IMPORTED_MODULE_4__["unescape"])(treeNode.name)
}].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__["default"])(getSelectOptions(treeNode.children || [], level + 1)));
});
}
function TreeSelect(_ref) {
var label = _ref.label,
noOptionLabel = _ref.noOptionLabel,
onChange = _ref.onChange,
selectedId = _ref.selectedId,
tree = _ref.tree,
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["label", "noOptionLabel", "onChange", "selectedId", "tree"]);
var options = Object(lodash__WEBPACK_IMPORTED_MODULE_4__["compact"])([noOptionLabel && {
value: '',
label: noOptionLabel
}].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__["default"])(getSelectOptions(tree))));
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(___WEBPACK_IMPORTED_MODULE_5__["SelectControl"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
label: label,
options: options,
onChange: onChange
}, {
value: selectedId
}, props));
}
/***/ }),
/***/ "./node_modules/classnames/index.js":
/*!******************************************!*\
!*** ./node_modules/classnames/index.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
Copyright (c) 2017 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
/* global define */
(function () {
'use strict';
var hasOwn = {}.hasOwnProperty;
function classNames () {
var classes = [];
for (var i = 0; i < arguments.length; i++) {
var arg = arguments[i];
if (!arg) continue;
var argType = typeof arg;
if (argType === 'string' || argType === 'number') {
classes.push(arg);
} else if (Array.isArray(arg) && arg.length) {
var inner = classNames.apply(null, arg);
if (inner) {
classes.push(inner);
}
} else if (argType === 'object') {
for (var key in arg) {
if (hasOwn.call(arg, key) && arg[key]) {
classes.push(key);
}
}
}
}
return classes.join(' ');
}
if ( true && module.exports) {
classNames.default = classNames;
module.exports = classNames;
} else if (true) {
// register as 'classnames', consistent with npm package name
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
return classNames;
}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else {}
}());
/***/ }),
/***/ "./node_modules/clipboard/lib/clipboard-action.js":
/*!********************************************************!*\
!*** ./node_modules/clipboard/lib/clipboard-action.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
if (true) {
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, __webpack_require__(/*! select */ "./node_modules/select/src/select.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else { var mod; }
})(this, function (module, _select) {
'use strict';
var _select2 = _interopRequireDefault(_select);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
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;
};
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
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;
};
}();
var ClipboardAction = function () {
/**
* @param {Object} options
*/
function ClipboardAction(options) {
_classCallCheck(this, ClipboardAction);
this.resolveOptions(options);
this.initSelection();
}
/**
* Defines base properties passed from constructor.
* @param {Object} options
*/
_createClass(ClipboardAction, [{
key: 'resolveOptions',
value: function resolveOptions() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
this.action = options.action;
this.container = options.container;
this.emitter = options.emitter;
this.target = options.target;
this.text = options.text;
this.trigger = options.trigger;
this.selectedText = '';
}
}, {
key: 'initSelection',
value: function initSelection() {
if (this.text) {
this.selectFake();
} else if (this.target) {
this.selectTarget();
}
}
}, {
key: 'selectFake',
value: function selectFake() {
var _this = this;
var isRTL = document.documentElement.getAttribute('dir') == 'rtl';
this.removeFake();
this.fakeHandlerCallback = function () {
return _this.removeFake();
};
this.fakeHandler = this.container.addEventListener('click', this.fakeHandlerCallback) || true;
this.fakeElem = document.createElement('textarea');
// Prevent zooming on iOS
this.fakeElem.style.fontSize = '12pt';
// Reset box model
this.fakeElem.style.border = '0';
this.fakeElem.style.padding = '0';
this.fakeElem.style.margin = '0';
// Move element out of screen horizontally
this.fakeElem.style.position = 'absolute';
this.fakeElem.style[isRTL ? 'right' : 'left'] = '-9999px';
// Move element to the same position vertically
var yPosition = window.pageYOffset || document.documentElement.scrollTop;
this.fakeElem.style.top = yPosition + 'px';
this.fakeElem.setAttribute('readonly', '');
this.fakeElem.value = this.text;
this.container.appendChild(this.fakeElem);
this.selectedText = (0, _select2.default)(this.fakeElem);
this.copyText();
}
}, {
key: 'removeFake',
value: function removeFake() {
if (this.fakeHandler) {
this.container.removeEventListener('click', this.fakeHandlerCallback);
this.fakeHandler = null;
this.fakeHandlerCallback = null;
}
if (this.fakeElem) {
this.container.removeChild(this.fakeElem);
this.fakeElem = null;
}
}
}, {
key: 'selectTarget',
value: function selectTarget() {
this.selectedText = (0, _select2.default)(this.target);
this.copyText();
}
}, {
key: 'copyText',
value: function copyText() {
var succeeded = void 0;
try {
succeeded = document.execCommand(this.action);
} catch (err) {
succeeded = false;
}
this.handleResult(succeeded);
}
}, {
key: 'handleResult',
value: function handleResult(succeeded) {
this.emitter.emit(succeeded ? 'success' : 'error', {
action: this.action,
text: this.selectedText,
trigger: this.trigger,
clearSelection: this.clearSelection.bind(this)
});
}
}, {
key: 'clearSelection',
value: function clearSelection() {
if (this.trigger) {
this.trigger.focus();
}
window.getSelection().removeAllRanges();
}
}, {
key: 'destroy',
value: function destroy() {
this.removeFake();
}
}, {
key: 'action',
set: function set() {
var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'copy';
this._action = action;
if (this._action !== 'copy' && this._action !== 'cut') {
throw new Error('Invalid "action" value, use either "copy" or "cut"');
}
},
get: function get() {
return this._action;
}
}, {
key: 'target',
set: function set(target) {
if (target !== undefined) {
if (target && (typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' && target.nodeType === 1) {
if (this.action === 'copy' && target.hasAttribute('disabled')) {
throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
}
if (this.action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) {
throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');
}
this._target = target;
} else {
throw new Error('Invalid "target" value, use a valid Element');
}
}
},
get: function get() {
return this._target;
}
}]);
return ClipboardAction;
}();
module.exports = ClipboardAction;
});
/***/ }),
/***/ "./node_modules/clipboard/lib/clipboard.js":
/*!*************************************************!*\
!*** ./node_modules/clipboard/lib/clipboard.js ***!
\*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
if (true) {
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, __webpack_require__(/*! ./clipboard-action */ "./node_modules/clipboard/lib/clipboard-action.js"), __webpack_require__(/*! tiny-emitter */ "./node_modules/tiny-emitter/index.js"), __webpack_require__(/*! good-listener */ "./node_modules/good-listener/src/listen.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else { var mod; }
})(this, function (module, _clipboardAction, _tinyEmitter, _goodListener) {
'use strict';
var _clipboardAction2 = _interopRequireDefault(_clipboardAction);
var _tinyEmitter2 = _interopRequireDefault(_tinyEmitter);
var _goodListener2 = _interopRequireDefault(_goodListener);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
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;
};
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
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;
};
}();
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;
}
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;
}
var Clipboard = function (_Emitter) {
_inherits(Clipboard, _Emitter);
/**
* @param {String|HTMLElement|HTMLCollection|NodeList} trigger
* @param {Object} options
*/
function Clipboard(trigger, options) {
_classCallCheck(this, Clipboard);
var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this));
_this.resolveOptions(options);
_this.listenClick(trigger);
return _this;
}
/**
* Defines if attributes would be resolved using internal setter functions
* or custom functions that were passed in the constructor.
* @param {Object} options
*/
_createClass(Clipboard, [{
key: 'resolveOptions',
value: function resolveOptions() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
this.action = typeof options.action === 'function' ? options.action : this.defaultAction;
this.target = typeof options.target === 'function' ? options.target : this.defaultTarget;
this.text = typeof options.text === 'function' ? options.text : this.defaultText;
this.container = _typeof(options.container) === 'object' ? options.container : document.body;
}
}, {
key: 'listenClick',
value: function listenClick(trigger) {
var _this2 = this;
this.listener = (0, _goodListener2.default)(trigger, 'click', function (e) {
return _this2.onClick(e);
});
}
}, {
key: 'onClick',
value: function onClick(e) {
var trigger = e.delegateTarget || e.currentTarget;
if (this.clipboardAction) {
this.clipboardAction = null;
}
this.clipboardAction = new _clipboardAction2.default({
action: this.action(trigger),
target: this.target(trigger),
text: this.text(trigger),
container: this.container,
trigger: trigger,
emitter: this
});
}
}, {
key: 'defaultAction',
value: function defaultAction(trigger) {
return getAttributeValue('action', trigger);
}
}, {
key: 'defaultTarget',
value: function defaultTarget(trigger) {
var selector = getAttributeValue('target', trigger);
if (selector) {
return document.querySelector(selector);
}
}
}, {
key: 'defaultText',
value: function defaultText(trigger) {
return getAttributeValue('text', trigger);
}
}, {
key: 'destroy',
value: function destroy() {
this.listener.destroy();
if (this.clipboardAction) {
this.clipboardAction.destroy();
this.clipboardAction = null;
}
}
}], [{
key: 'isSupported',
value: function isSupported() {
var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut'];
var actions = typeof action === 'string' ? [action] : action;
var support = !!document.queryCommandSupported;
actions.forEach(function (action) {
support = support && !!document.queryCommandSupported(action);
});
return support;
}
}]);
return Clipboard;
}(_tinyEmitter2.default);
/**
* Helper function to retrieve attribute value.
* @param {String} suffix
* @param {Element} element
*/
function getAttributeValue(suffix, element) {
var attribute = 'data-clipboard-' + suffix;
if (!element.hasAttribute(attribute)) {
return;
}
return element.getAttribute(attribute);
}
module.exports = Clipboard;
});
/***/ }),
/***/ "./node_modules/create-react-context/lib/implementation.js":
/*!*****************************************************************!*\
!*** ./node_modules/create-react-context/lib/implementation.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _propTypes2 = _interopRequireDefault(_propTypes);
var _gud = __webpack_require__(/*! gud */ "./node_modules/gud/index.js");
var _gud2 = _interopRequireDefault(_gud);
var _warning = __webpack_require__(/*! fbjs/lib/warning */ "./node_modules/fbjs/lib/warning.js");
var _warning2 = _interopRequireDefault(_warning);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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; }
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; }
var MAX_SIGNED_31_BIT_INT = 1073741823;
// Inlined Object.is polyfill.
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
function objectIs(x, y) {
if (x === y) {
return x !== 0 || 1 / x === 1 / y;
} else {
return x !== x && y !== y;
}
}
function createEventEmitter(value) {
var handlers = [];
return {
on: function on(handler) {
handlers.push(handler);
},
off: function off(handler) {
handlers = handlers.filter(function (h) {
return h !== handler;
});
},
get: function get() {
return value;
},
set: function set(newValue, changedBits) {
value = newValue;
handlers.forEach(function (handler) {
return handler(value, changedBits);
});
}
};
}
function onlyChild(children) {
return Array.isArray(children) ? children[0] : children;
}
function createReactContext(defaultValue, calculateChangedBits) {
var _Provider$childContex, _Consumer$contextType;
var contextProp = '__create-react-context-' + (0, _gud2.default)() + '__';
var Provider = function (_Component) {
_inherits(Provider, _Component);
function Provider() {
var _temp, _this, _ret;
_classCallCheck(this, Provider);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.emitter = createEventEmitter(_this.props.value), _temp), _possibleConstructorReturn(_this, _ret);
}
Provider.prototype.getChildContext = function getChildContext() {
var _ref;
return _ref = {}, _ref[contextProp] = this.emitter, _ref;
};
Provider.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
if (this.props.value !== nextProps.value) {
var oldValue = this.props.value;
var newValue = nextProps.value;
var changedBits = void 0;
if (objectIs(oldValue, newValue)) {
changedBits = 0; // No change
} else {
changedBits = typeof calculateChangedBits === 'function' ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;
if (true) {
(0, _warning2.default)((changedBits & MAX_SIGNED_31_BIT_INT) === changedBits, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: %s', changedBits);
}
changedBits |= 0;
if (changedBits !== 0) {
this.emitter.set(nextProps.value, changedBits);
}
}
}
};
Provider.prototype.render = function render() {
return this.props.children;
};
return Provider;
}(_react.Component);
Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = _propTypes2.default.object.isRequired, _Provider$childContex);
var Consumer = function (_Component2) {
_inherits(Consumer, _Component2);
function Consumer() {
var _temp2, _this2, _ret2;
_classCallCheck(this, Consumer);
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
return _ret2 = (_temp2 = (_this2 = _possibleConstructorReturn(this, _Component2.call.apply(_Component2, [this].concat(args))), _this2), _this2.state = {
value: _this2.getValue()
}, _this2.onUpdate = function (newValue, changedBits) {
var observedBits = _this2.observedBits | 0;
if ((observedBits & changedBits) !== 0) {
_this2.setState({ value: _this2.getValue() });
}
}, _temp2), _possibleConstructorReturn(_this2, _ret2);
}
Consumer.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
var observedBits = nextProps.observedBits;
this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default
: observedBits;
};
Consumer.prototype.componentDidMount = function componentDidMount() {
if (this.context[contextProp]) {
this.context[contextProp].on(this.onUpdate);
}
var observedBits = this.props.observedBits;
this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default
: observedBits;
};
Consumer.prototype.componentWillUnmount = function componentWillUnmount() {
if (this.context[contextProp]) {
this.context[contextProp].off(this.onUpdate);
}
};
Consumer.prototype.getValue = function getValue() {
if (this.context[contextProp]) {
return this.context[contextProp].get();
} else {
return defaultValue;
}
};
Consumer.prototype.render = function render() {
return onlyChild(this.props.children)(this.state.value);
};
return Consumer;
}(_react.Component);
Consumer.contextTypes = (_Consumer$contextType = {}, _Consumer$contextType[contextProp] = _propTypes2.default.object, _Consumer$contextType);
return {
Provider: Provider,
Consumer: Consumer
};
}
exports.default = createReactContext;
module.exports = exports['default'];
/***/ }),
/***/ "./node_modules/create-react-context/lib/index.js":
/*!********************************************************!*\
!*** ./node_modules/create-react-context/lib/index.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _implementation = __webpack_require__(/*! ./implementation */ "./node_modules/create-react-context/lib/implementation.js");
var _implementation2 = _interopRequireDefault(_implementation);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _react2.default.createContext || _implementation2.default;
module.exports = exports['default'];
/***/ }),
/***/ "./node_modules/delegate/src/closest.js":
/*!**********************************************!*\
!*** ./node_modules/delegate/src/closest.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports) {
var DOCUMENT_NODE_TYPE = 9;
/**
* A polyfill for Element.matches()
*/
if (typeof Element !== 'undefined' && !Element.prototype.matches) {
var proto = Element.prototype;
proto.matches = proto.matchesSelector ||
proto.mozMatchesSelector ||
proto.msMatchesSelector ||
proto.oMatchesSelector ||
proto.webkitMatchesSelector;
}
/**
* Finds the closest parent that matches a selector.
*
* @param {Element} element
* @param {String} selector
* @return {Function}
*/
function closest (element, selector) {
while (element && element.nodeType !== DOCUMENT_NODE_TYPE) {
if (typeof element.matches === 'function' &&
element.matches(selector)) {
return element;
}
element = element.parentNode;
}
}
module.exports = closest;
/***/ }),
/***/ "./node_modules/delegate/src/delegate.js":
/*!***********************************************!*\
!*** ./node_modules/delegate/src/delegate.js ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var closest = __webpack_require__(/*! ./closest */ "./node_modules/delegate/src/closest.js");
/**
* Delegates event to a selector.
*
* @param {Element} element
* @param {String} selector
* @param {String} type
* @param {Function} callback
* @param {Boolean} useCapture
* @return {Object}
*/
function _delegate(element, selector, type, callback, useCapture) {
var listenerFn = listener.apply(this, arguments);
element.addEventListener(type, listenerFn, useCapture);
return {
destroy: function() {
element.removeEventListener(type, listenerFn, useCapture);
}
}
}
/**
* Delegates event to a selector.
*
* @param {Element|String|Array} [elements]
* @param {String} selector
* @param {String} type
* @param {Function} callback
* @param {Boolean} useCapture
* @return {Object}
*/
function delegate(elements, selector, type, callback, useCapture) {
// Handle the regular Element usage
if (typeof elements.addEventListener === 'function') {
return _delegate.apply(null, arguments);
}
// Handle Element-less usage, it defaults to global delegation
if (typeof type === 'function') {
// Use `document` as the first parameter, then apply arguments
// This is a short way to .unshift `arguments` without running into deoptimizations
return _delegate.bind(null, document).apply(null, arguments);
}
// Handle Selector-based usage
if (typeof elements === 'string') {
elements = document.querySelectorAll(elements);
}
// Handle Array-like based usage
return Array.prototype.map.call(elements, function (element) {
return _delegate(element, selector, type, callback, useCapture);
});
}
/**
* Finds closest match and invokes callback.
*
* @param {Element} element
* @param {String} selector
* @param {String} type
* @param {Function} callback
* @return {Function}
*/
function listener(element, selector, type, callback) {
return function(e) {
e.delegateTarget = closest(e.target, selector);
if (e.delegateTarget) {
callback.call(element, e);
}
}
}
module.exports = delegate;
/***/ }),
/***/ "./node_modules/dom-scroll-into-view/lib/dom-scroll-into-view.js":
/*!***********************************************************************!*\
!*** ./node_modules/dom-scroll-into-view/lib/dom-scroll-into-view.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var util = __webpack_require__(/*! ./util */ "./node_modules/dom-scroll-into-view/lib/util.js");
function scrollIntoView(elem, container, config) {
config = config || {};
// document 归一化到 window
if (container.nodeType === 9) {
container = util.getWindow(container);
}
var allowHorizontalScroll = config.allowHorizontalScroll;
var onlyScrollIfNeeded = config.onlyScrollIfNeeded;
var alignWithTop = config.alignWithTop;
var alignWithLeft = config.alignWithLeft;
var offsetTop = config.offsetTop || 0;
var offsetLeft = config.offsetLeft || 0;
var offsetBottom = config.offsetBottom || 0;
var offsetRight = config.offsetRight || 0;
allowHorizontalScroll = allowHorizontalScroll === undefined ? true : allowHorizontalScroll;
var isWin = util.isWindow(container);
var elemOffset = util.offset(elem);
var eh = util.outerHeight(elem);
var ew = util.outerWidth(elem);
var containerOffset = undefined;
var ch = undefined;
var cw = undefined;
var containerScroll = undefined;
var diffTop = undefined;
var diffBottom = undefined;
var win = undefined;
var winScroll = undefined;
var ww = undefined;
var wh = undefined;
if (isWin) {
win = container;
wh = util.height(win);
ww = util.width(win);
winScroll = {
left: util.scrollLeft(win),
top: util.scrollTop(win)
};
// elem 相对 container 可视视窗的距离
diffTop = {
left: elemOffset.left - winScroll.left - offsetLeft,
top: elemOffset.top - winScroll.top - offsetTop
};
diffBottom = {
left: elemOffset.left + ew - (winScroll.left + ww) + offsetRight,
top: elemOffset.top + eh - (winScroll.top + wh) + offsetBottom
};
containerScroll = winScroll;
} else {
containerOffset = util.offset(container);
ch = container.clientHeight;
cw = container.clientWidth;
containerScroll = {
left: container.scrollLeft,
top: container.scrollTop
};
// elem 相对 container 可视视窗的距离
// 注意边框, offset 是边框到根节点
diffTop = {
left: elemOffset.left - (containerOffset.left + (parseFloat(util.css(container, 'borderLeftWidth')) || 0)) - offsetLeft,
top: elemOffset.top - (containerOffset.top + (parseFloat(util.css(container, 'borderTopWidth')) || 0)) - offsetTop
};
diffBottom = {
left: elemOffset.left + ew - (containerOffset.left + cw + (parseFloat(util.css(container, 'borderRightWidth')) || 0)) + offsetRight,
top: elemOffset.top + eh - (containerOffset.top + ch + (parseFloat(util.css(container, 'borderBottomWidth')) || 0)) + offsetBottom
};
}
if (diffTop.top < 0 || diffBottom.top > 0) {
// 强制向上
if (alignWithTop === true) {
util.scrollTop(container, containerScroll.top + diffTop.top);
} else if (alignWithTop === false) {
util.scrollTop(container, containerScroll.top + diffBottom.top);
} else {
// 自动调整
if (diffTop.top < 0) {
util.scrollTop(container, containerScroll.top + diffTop.top);
} else {
util.scrollTop(container, containerScroll.top + diffBottom.top);
}
}
} else {
if (!onlyScrollIfNeeded) {
alignWithTop = alignWithTop === undefined ? true : !!alignWithTop;
if (alignWithTop) {
util.scrollTop(container, containerScroll.top + diffTop.top);
} else {
util.scrollTop(container, containerScroll.top + diffBottom.top);
}
}
}
if (allowHorizontalScroll) {
if (diffTop.left < 0 || diffBottom.left > 0) {
// 强制向上
if (alignWithLeft === true) {
util.scrollLeft(container, containerScroll.left + diffTop.left);
} else if (alignWithLeft === false) {
util.scrollLeft(container, containerScroll.left + diffBottom.left);
} else {
// 自动调整
if (diffTop.left < 0) {
util.scrollLeft(container, containerScroll.left + diffTop.left);
} else {
util.scrollLeft(container, containerScroll.left + diffBottom.left);
}
}
} else {
if (!onlyScrollIfNeeded) {
alignWithLeft = alignWithLeft === undefined ? true : !!alignWithLeft;
if (alignWithLeft) {
util.scrollLeft(container, containerScroll.left + diffTop.left);
} else {
util.scrollLeft(container, containerScroll.left + diffBottom.left);
}
}
}
}
}
module.exports = scrollIntoView;
/***/ }),
/***/ "./node_modules/dom-scroll-into-view/lib/index.js":
/*!********************************************************!*\
!*** ./node_modules/dom-scroll-into-view/lib/index.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = __webpack_require__(/*! ./dom-scroll-into-view */ "./node_modules/dom-scroll-into-view/lib/dom-scroll-into-view.js");
/***/ }),
/***/ "./node_modules/dom-scroll-into-view/lib/util.js":
/*!*******************************************************!*\
!*** ./node_modules/dom-scroll-into-view/lib/util.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
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; };
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
var RE_NUM = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source;
function getClientPosition(elem) {
var box = undefined;
var x = undefined;
var y = undefined;
var doc = elem.ownerDocument;
var body = doc.body;
var docElem = doc && doc.documentElement;
// 根据 GBS 最新数据A-Grade Browsers 都已支持 getBoundingClientRect 方法,不用再考虑传统的实现方式
box = elem.getBoundingClientRect();
// 注jQuery 还考虑减去 docElem.clientLeft/clientTop
// 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确
// 此外ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin
x = box.left;
y = box.top;
// In IE, most of the time, 2 extra pixels are added to the top and left
// due to the implicit 2-pixel inset border. In IE6/7 quirks mode and
// IE6 standards mode, this border can be overridden by setting the
// document element's border to zero -- thus, we cannot rely on the
// offset always being 2 pixels.
// In quirks mode, the offset can be determined by querying the body's
// clientLeft/clientTop, but in standards mode, it is found by querying
// the document element's clientLeft/clientTop. Since we already called
// getClientBoundingRect we have already forced a reflow, so it is not
// too expensive just to query them all.
// ie 下应该减去窗口的边框吧,毕竟默认 absolute 都是相对窗口定位的
// 窗口边框标准是设 documentElement ,quirks 时设置 body
// 最好禁止在 body 和 html 上边框 ,但 ie < 9 html 默认有 2px ,减去
// 但是非 ie 不可能设置窗口边框body html 也不是窗口 ,ie 可以通过 html,body 设置
// 标准 ie 下 docElem.clientTop 就是 border-top
// ie7 html 即窗口边框改变不了。永远为 2
// 但标准 firefox/chrome/ie9 下 docElem.clientTop 是窗口边框,即使设了 border-top 也为 0
x -= docElem.clientLeft || body.clientLeft || 0;
y -= docElem.clientTop || body.clientTop || 0;
return {
left: x,
top: y
};
}
function getScroll(w, top) {
var ret = w['page' + (top ? 'Y' : 'X') + 'Offset'];
var method = 'scroll' + (top ? 'Top' : 'Left');
if (typeof ret !== 'number') {
var d = w.document;
// ie6,7,8 standard mode
ret = d.documentElement[method];
if (typeof ret !== 'number') {
// quirks mode
ret = d.body[method];
}
}
return ret;
}
function getScrollLeft(w) {
return getScroll(w);
}
function getScrollTop(w) {
return getScroll(w, true);
}
function getOffset(el) {
var pos = getClientPosition(el);
var doc = el.ownerDocument;
var w = doc.defaultView || doc.parentWindow;
pos.left += getScrollLeft(w);
pos.top += getScrollTop(w);
return pos;
}
function _getComputedStyle(elem, name, computedStyle_) {
var val = '';
var d = elem.ownerDocument;
var computedStyle = computedStyle_ || d.defaultView.getComputedStyle(elem, null);
// https://github.com/kissyteam/kissy/issues/61
if (computedStyle) {
val = computedStyle.getPropertyValue(name) || computedStyle[name];
}
return val;
}
var _RE_NUM_NO_PX = new RegExp('^(' + RE_NUM + ')(?!px)[a-z%]+$', 'i');
var RE_POS = /^(top|right|bottom|left)$/;
var CURRENT_STYLE = 'currentStyle';
var RUNTIME_STYLE = 'runtimeStyle';
var LEFT = 'left';
var PX = 'px';
function _getComputedStyleIE(elem, name) {
// currentStyle maybe null
// http://msdn.microsoft.com/en-us/library/ms535231.aspx
var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name];
// 当 width/height 设置为百分比时,通过 pixelLeft 方式转换的 width/height 值
// 一开始就处理了! CUSTOM_STYLE.height,CUSTOM_STYLE.width ,cssHook 解决@2011-08-19
// 在 ie 下不对,需要直接用 offset 方式
// borderWidth 等值也有问题,但考虑到 borderWidth 设为百分比的概率很小,这里就不考虑了
// From the awesome hack by Dean Edwards
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
// If we're not dealing with a regular pixel number
// but a number that has a weird ending, we need to convert it to pixels
// exclude left right for relativity
if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) {
// Remember the original values
var style = elem.style;
var left = style[LEFT];
var rsLeft = elem[RUNTIME_STYLE][LEFT];
// prevent flashing of content
elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT];
// Put in the new values to get a computed value out
style[LEFT] = name === 'fontSize' ? '1em' : ret || 0;
ret = style.pixelLeft + PX;
// Revert the changed values
style[LEFT] = left;
elem[RUNTIME_STYLE][LEFT] = rsLeft;
}
return ret === '' ? 'auto' : ret;
}
var getComputedStyleX = undefined;
if (typeof window !== 'undefined') {
getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE;
}
function each(arr, fn) {
for (var i = 0; i < arr.length; i++) {
fn(arr[i]);
}
}
function isBorderBoxFn(elem) {
return getComputedStyleX(elem, 'boxSizing') === 'border-box';
}
var BOX_MODELS = ['margin', 'border', 'padding'];
var CONTENT_INDEX = -1;
var PADDING_INDEX = 2;
var BORDER_INDEX = 1;
var MARGIN_INDEX = 0;
function swap(elem, options, callback) {
var old = {};
var style = elem.style;
var name = undefined;
// Remember the old values, and insert the new ones
for (name in options) {
if (options.hasOwnProperty(name)) {
old[name] = style[name];
style[name] = options[name];
}
}
callback.call(elem);
// Revert the old values
for (name in options) {
if (options.hasOwnProperty(name)) {
style[name] = old[name];
}
}
}
function getPBMWidth(elem, props, which) {
var value = 0;
var prop = undefined;
var j = undefined;
var i = undefined;
for (j = 0; j < props.length; j++) {
prop = props[j];
if (prop) {
for (i = 0; i < which.length; i++) {
var cssProp = undefined;
if (prop === 'border') {
cssProp = prop + which[i] + 'Width';
} else {
cssProp = prop + which[i];
}
value += parseFloat(getComputedStyleX(elem, cssProp)) || 0;
}
}
}
return value;
}
/**
* A crude way of determining if an object is a window
* @member util
*/
function isWindow(obj) {
// must use == for ie8
/* eslint eqeqeq:0 */
return obj != null && obj == obj.window;
}
var domUtils = {};
each(['Width', 'Height'], function (name) {
domUtils['doc' + name] = function (refWin) {
var d = refWin.document;
return Math.max(
// firefox chrome documentElement.scrollHeight< body.scrollHeight
// ie standard mode : documentElement.scrollHeight> body.scrollHeight
d.documentElement['scroll' + name],
// quirks : documentElement.scrollHeight 最大等于可视窗口多一点?
d.body['scroll' + name], domUtils['viewport' + name](d));
};
domUtils['viewport' + name] = function (win) {
// pc browser includes scrollbar in window.innerWidth
var prop = 'client' + name;
var doc = win.document;
var body = doc.body;
var documentElement = doc.documentElement;
var documentElementProp = documentElement[prop];
// 标准模式取 documentElement
// backcompat 取 body
return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp;
};
});
/*
得到元素的大小信息
@param elem
@param name
@param {String} [extra] 'padding' : (css width) + padding
'border' : (css width) + padding + border
'margin' : (css width) + padding + border + margin
*/
function getWH(elem, name, extra) {
if (isWindow(elem)) {
return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem);
} else if (elem.nodeType === 9) {
return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem);
}
var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];
var borderBoxValue = name === 'width' ? elem.offsetWidth : elem.offsetHeight;
var computedStyle = getComputedStyleX(elem);
var isBorderBox = isBorderBoxFn(elem, computedStyle);
var cssBoxValue = 0;
if (borderBoxValue == null || borderBoxValue <= 0) {
borderBoxValue = undefined;
// Fall back to computed then un computed css if necessary
cssBoxValue = getComputedStyleX(elem, name);
if (cssBoxValue == null || Number(cssBoxValue) < 0) {
cssBoxValue = elem.style[name] || 0;
}
// Normalize '', auto, and prepare for extra
cssBoxValue = parseFloat(cssBoxValue) || 0;
}
if (extra === undefined) {
extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX;
}
var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox;
var val = borderBoxValue || cssBoxValue;
if (extra === CONTENT_INDEX) {
if (borderBoxValueOrIsBorderBox) {
return val - getPBMWidth(elem, ['border', 'padding'], which, computedStyle);
}
return cssBoxValue;
}
if (borderBoxValueOrIsBorderBox) {
var padding = extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which, computedStyle) : getPBMWidth(elem, ['margin'], which, computedStyle);
return val + (extra === BORDER_INDEX ? 0 : padding);
}
return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which, computedStyle);
}
var cssShow = {
position: 'absolute',
visibility: 'hidden',
display: 'block'
};
// fix #119 : https://github.com/kissyteam/kissy/issues/119
function getWHIgnoreDisplay(elem) {
var val = undefined;
var args = arguments;
// in case elem is window
// elem.offsetWidth === undefined
if (elem.offsetWidth !== 0) {
val = getWH.apply(undefined, args);
} else {
swap(elem, cssShow, function () {
val = getWH.apply(undefined, args);
});
}
return val;
}
function css(el, name, v) {
var value = v;
if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {
for (var i in name) {
if (name.hasOwnProperty(i)) {
css(el, i, name[i]);
}
}
return undefined;
}
if (typeof value !== 'undefined') {
if (typeof value === 'number') {
value += 'px';
}
el.style[name] = value;
return undefined;
}
return getComputedStyleX(el, name);
}
each(['width', 'height'], function (name) {
var first = name.charAt(0).toUpperCase() + name.slice(1);
domUtils['outer' + first] = function (el, includeMargin) {
return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX);
};
var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];
domUtils[name] = function (elem, val) {
if (val !== undefined) {
if (elem) {
var computedStyle = getComputedStyleX(elem);
var isBorderBox = isBorderBoxFn(elem);
if (isBorderBox) {
val += getPBMWidth(elem, ['padding', 'border'], which, computedStyle);
}
return css(elem, name, val);
}
return undefined;
}
return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX);
};
});
// 设置 elem 相对 elem.ownerDocument 的坐标
function setOffset(elem, offset) {
// set position first, in-case top/left are set even on static elem
if (css(elem, 'position') === 'static') {
elem.style.position = 'relative';
}
var old = getOffset(elem);
var ret = {};
var current = undefined;
var key = undefined;
for (key in offset) {
if (offset.hasOwnProperty(key)) {
current = parseFloat(css(elem, key)) || 0;
ret[key] = current + offset[key] - old[key];
}
}
css(elem, ret);
}
module.exports = _extends({
getWindow: function getWindow(node) {
var doc = node.ownerDocument || node;
return doc.defaultView || doc.parentWindow;
},
offset: function offset(el, value) {
if (typeof value !== 'undefined') {
setOffset(el, value);
} else {
return getOffset(el);
}
},
isWindow: isWindow,
each: each,
css: css,
clone: function clone(obj) {
var ret = {};
for (var i in obj) {
if (obj.hasOwnProperty(i)) {
ret[i] = obj[i];
}
}
var overflow = obj.overflow;
if (overflow) {
for (var i in obj) {
if (obj.hasOwnProperty(i)) {
ret.overflow[i] = obj.overflow[i];
}
}
}
return ret;
},
scrollLeft: function scrollLeft(w, v) {
if (isWindow(w)) {
if (v === undefined) {
return getScrollLeft(w);
}
window.scrollTo(v, getScrollTop(w));
} else {
if (v === undefined) {
return w.scrollLeft;
}
w.scrollLeft = v;
}
},
scrollTop: function scrollTop(w, v) {
if (isWindow(w)) {
if (v === undefined) {
return getScrollTop(w);
}
window.scrollTo(getScrollLeft(w), v);
} else {
if (v === undefined) {
return w.scrollTop;
}
w.scrollTop = v;
}
},
viewportWidth: 0,
viewportHeight: 0
}, domUtils);
/***/ }),
/***/ "./node_modules/fbjs/lib/emptyFunction.js":
/*!************************************************!*\
!*** ./node_modules/fbjs/lib/emptyFunction.js ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
function makeEmptyFunction(arg) {
return function () {
return arg;
};
}
/**
* This function accepts and discards inputs; it has no side effects. This is
* primarily useful idiomatically for overridable function endpoints which
* always need to be callable, since JS lacks a null-call idiom ala Cocoa.
*/
var emptyFunction = function emptyFunction() {};
emptyFunction.thatReturns = makeEmptyFunction;
emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
emptyFunction.thatReturnsNull = makeEmptyFunction(null);
emptyFunction.thatReturnsThis = function () {
return this;
};
emptyFunction.thatReturnsArgument = function (arg) {
return arg;
};
module.exports = emptyFunction;
/***/ }),
/***/ "./node_modules/fbjs/lib/warning.js":
/*!******************************************!*\
!*** ./node_modules/fbjs/lib/warning.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Copyright (c) 2014-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
var emptyFunction = __webpack_require__(/*! ./emptyFunction */ "./node_modules/fbjs/lib/emptyFunction.js");
/**
* Similar to invariant but only logs a warning if the condition is not met.
* This can be used to log issues in development environments in critical
* paths. Removing the logging code for production environments will keep the
* same logic and follow the same code paths.
*/
var warning = emptyFunction;
if (true) {
var printWarning = function printWarning(format) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
var argIndex = 0;
var message = 'Warning: ' + format.replace(/%s/g, function () {
return args[argIndex++];
});
if (typeof console !== 'undefined') {
console.error(message);
}
try {
// --- Welcome to debugging React ---
// This error was thrown as a convenience so that you can use this stack
// to find the callsite that caused this warning to fire.
throw new Error(message);
} catch (x) {}
};
warning = function warning(condition, format) {
if (format === undefined) {
throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
}
if (format.indexOf('Failed Composite propType: ') === 0) {
return; // Ignore CompositeComponent proptype check.
}
if (!condition) {
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
args[_key2 - 2] = arguments[_key2];
}
printWarning.apply(undefined, [format].concat(args));
}
};
}
module.exports = warning;
/***/ }),
/***/ "./node_modules/good-listener/src/is.js":
/*!**********************************************!*\
!*** ./node_modules/good-listener/src/is.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* Check if argument is a HTML element.
*
* @param {Object} value
* @return {Boolean}
*/
exports.node = function(value) {
return value !== undefined
&& value instanceof HTMLElement
&& value.nodeType === 1;
};
/**
* Check if argument is a list of HTML elements.
*
* @param {Object} value
* @return {Boolean}
*/
exports.nodeList = function(value) {
var type = Object.prototype.toString.call(value);
return value !== undefined
&& (type === '[object NodeList]' || type === '[object HTMLCollection]')
&& ('length' in value)
&& (value.length === 0 || exports.node(value[0]));
};
/**
* Check if argument is a string.
*
* @param {Object} value
* @return {Boolean}
*/
exports.string = function(value) {
return typeof value === 'string'
|| value instanceof String;
};
/**
* Check if argument is a function.
*
* @param {Object} value
* @return {Boolean}
*/
exports.fn = function(value) {
var type = Object.prototype.toString.call(value);
return type === '[object Function]';
};
/***/ }),
/***/ "./node_modules/good-listener/src/listen.js":
/*!**************************************************!*\
!*** ./node_modules/good-listener/src/listen.js ***!
\**************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var is = __webpack_require__(/*! ./is */ "./node_modules/good-listener/src/is.js");
var delegate = __webpack_require__(/*! delegate */ "./node_modules/delegate/src/delegate.js");
/**
* Validates all params and calls the right
* listener function based on its target type.
*
* @param {String|HTMLElement|HTMLCollection|NodeList} target
* @param {String} type
* @param {Function} callback
* @return {Object}
*/
function listen(target, type, callback) {
if (!target && !type && !callback) {
throw new Error('Missing required arguments');
}
if (!is.string(type)) {
throw new TypeError('Second argument must be a String');
}
if (!is.fn(callback)) {
throw new TypeError('Third argument must be a Function');
}
if (is.node(target)) {
return listenNode(target, type, callback);
}
else if (is.nodeList(target)) {
return listenNodeList(target, type, callback);
}
else if (is.string(target)) {
return listenSelector(target, type, callback);
}
else {
throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList');
}
}
/**
* Adds an event listener to a HTML element
* and returns a remove listener function.
*
* @param {HTMLElement} node
* @param {String} type
* @param {Function} callback
* @return {Object}
*/
function listenNode(node, type, callback) {
node.addEventListener(type, callback);
return {
destroy: function() {
node.removeEventListener(type, callback);
}
}
}
/**
* Add an event listener to a list of HTML elements
* and returns a remove listener function.
*
* @param {NodeList|HTMLCollection} nodeList
* @param {String} type
* @param {Function} callback
* @return {Object}
*/
function listenNodeList(nodeList, type, callback) {
Array.prototype.forEach.call(nodeList, function(node) {
node.addEventListener(type, callback);
});
return {
destroy: function() {
Array.prototype.forEach.call(nodeList, function(node) {
node.removeEventListener(type, callback);
});
}
}
}
/**
* Add an event listener to a selector
* and returns a remove listener function.
*
* @param {String} selector
* @param {String} type
* @param {Function} callback
* @return {Object}
*/
function listenSelector(selector, type, callback) {
return delegate(document.body, selector, type, callback);
}
module.exports = listen;
/***/ }),
/***/ "./node_modules/gud/index.js":
/*!***********************************!*\
!*** ./node_modules/gud/index.js ***!
\***********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(global) {// @flow
var key = '__global_unique_id__';
module.exports = function() {
return global[key] = (global[key] || 0) + 1;
};
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "./node_modules/hoist-non-react-statics/index.js":
/*!*******************************************************!*\
!*** ./node_modules/hoist-non-react-statics/index.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Copyright 2015, Yahoo! Inc.
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
var REACT_STATICS = {
childContextTypes: true,
contextTypes: true,
defaultProps: true,
displayName: true,
getDefaultProps: true,
mixins: true,
propTypes: true,
type: true
};
var KNOWN_STATICS = {
name: true,
length: true,
prototype: true,
caller: true,
arguments: true,
arity: true
};
var isGetOwnPropertySymbolsAvailable = typeof Object.getOwnPropertySymbols === 'function';
module.exports = function hoistNonReactStatics(targetComponent, sourceComponent, customStatics) {
if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components
var keys = Object.getOwnPropertyNames(sourceComponent);
/* istanbul ignore else */
if (isGetOwnPropertySymbolsAvailable) {
keys = keys.concat(Object.getOwnPropertySymbols(sourceComponent));
}
for (var i = 0; i < keys.length; ++i) {
if (!REACT_STATICS[keys[i]] && !KNOWN_STATICS[keys[i]] && (!customStatics || !customStatics[keys[i]])) {
try {
targetComponent[keys[i]] = sourceComponent[keys[i]];
} catch (error) {
}
}
}
}
return targetComponent;
};
/***/ }),
/***/ "./node_modules/lodash/_DataView.js":
/*!******************************************!*\
!*** ./node_modules/lodash/_DataView.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"),
root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");
/* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView');
module.exports = DataView;
/***/ }),
/***/ "./node_modules/lodash/_Hash.js":
/*!**************************************!*\
!*** ./node_modules/lodash/_Hash.js ***!
\**************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var hashClear = __webpack_require__(/*! ./_hashClear */ "./node_modules/lodash/_hashClear.js"),
hashDelete = __webpack_require__(/*! ./_hashDelete */ "./node_modules/lodash/_hashDelete.js"),
hashGet = __webpack_require__(/*! ./_hashGet */ "./node_modules/lodash/_hashGet.js"),
hashHas = __webpack_require__(/*! ./_hashHas */ "./node_modules/lodash/_hashHas.js"),
hashSet = __webpack_require__(/*! ./_hashSet */ "./node_modules/lodash/_hashSet.js");
/**
* Creates a hash object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Hash(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
// Add methods to `Hash`.
Hash.prototype.clear = hashClear;
Hash.prototype['delete'] = hashDelete;
Hash.prototype.get = hashGet;
Hash.prototype.has = hashHas;
Hash.prototype.set = hashSet;
module.exports = Hash;
/***/ }),
/***/ "./node_modules/lodash/_ListCache.js":
/*!*******************************************!*\
!*** ./node_modules/lodash/_ListCache.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var listCacheClear = __webpack_require__(/*! ./_listCacheClear */ "./node_modules/lodash/_listCacheClear.js"),
listCacheDelete = __webpack_require__(/*! ./_listCacheDelete */ "./node_modules/lodash/_listCacheDelete.js"),
listCacheGet = __webpack_require__(/*! ./_listCacheGet */ "./node_modules/lodash/_listCacheGet.js"),
listCacheHas = __webpack_require__(/*! ./_listCacheHas */ "./node_modules/lodash/_listCacheHas.js"),
listCacheSet = __webpack_require__(/*! ./_listCacheSet */ "./node_modules/lodash/_listCacheSet.js");
/**
* Creates an list cache object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function ListCache(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
// Add methods to `ListCache`.
ListCache.prototype.clear = listCacheClear;
ListCache.prototype['delete'] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;
module.exports = ListCache;
/***/ }),
/***/ "./node_modules/lodash/_Map.js":
/*!*************************************!*\
!*** ./node_modules/lodash/_Map.js ***!
\*************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"),
root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");
/* Built-in method references that are verified to be native. */
var Map = getNative(root, 'Map');
module.exports = Map;
/***/ }),
/***/ "./node_modules/lodash/_MapCache.js":
/*!******************************************!*\
!*** ./node_modules/lodash/_MapCache.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var mapCacheClear = __webpack_require__(/*! ./_mapCacheClear */ "./node_modules/lodash/_mapCacheClear.js"),
mapCacheDelete = __webpack_require__(/*! ./_mapCacheDelete */ "./node_modules/lodash/_mapCacheDelete.js"),
mapCacheGet = __webpack_require__(/*! ./_mapCacheGet */ "./node_modules/lodash/_mapCacheGet.js"),
mapCacheHas = __webpack_require__(/*! ./_mapCacheHas */ "./node_modules/lodash/_mapCacheHas.js"),
mapCacheSet = __webpack_require__(/*! ./_mapCacheSet */ "./node_modules/lodash/_mapCacheSet.js");
/**
* Creates a map cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function MapCache(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
// Add methods to `MapCache`.
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype['delete'] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;
module.exports = MapCache;
/***/ }),
/***/ "./node_modules/lodash/_Promise.js":
/*!*****************************************!*\
!*** ./node_modules/lodash/_Promise.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"),
root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");
/* Built-in method references that are verified to be native. */
var Promise = getNative(root, 'Promise');
module.exports = Promise;
/***/ }),
/***/ "./node_modules/lodash/_Set.js":
/*!*************************************!*\
!*** ./node_modules/lodash/_Set.js ***!
\*************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"),
root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");
/* Built-in method references that are verified to be native. */
var Set = getNative(root, 'Set');
module.exports = Set;
/***/ }),
/***/ "./node_modules/lodash/_SetCache.js":
/*!******************************************!*\
!*** ./node_modules/lodash/_SetCache.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var MapCache = __webpack_require__(/*! ./_MapCache */ "./node_modules/lodash/_MapCache.js"),
setCacheAdd = __webpack_require__(/*! ./_setCacheAdd */ "./node_modules/lodash/_setCacheAdd.js"),
setCacheHas = __webpack_require__(/*! ./_setCacheHas */ "./node_modules/lodash/_setCacheHas.js");
/**
*
* Creates an array cache object to store unique values.
*
* @private
* @constructor
* @param {Array} [values] The values to cache.
*/
function SetCache(values) {
var index = -1,
length = values == null ? 0 : values.length;
this.__data__ = new MapCache;
while (++index < length) {
this.add(values[index]);
}
}
// Add methods to `SetCache`.
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
SetCache.prototype.has = setCacheHas;
module.exports = SetCache;
/***/ }),
/***/ "./node_modules/lodash/_Stack.js":
/*!***************************************!*\
!*** ./node_modules/lodash/_Stack.js ***!
\***************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var ListCache = __webpack_require__(/*! ./_ListCache */ "./node_modules/lodash/_ListCache.js"),
stackClear = __webpack_require__(/*! ./_stackClear */ "./node_modules/lodash/_stackClear.js"),
stackDelete = __webpack_require__(/*! ./_stackDelete */ "./node_modules/lodash/_stackDelete.js"),
stackGet = __webpack_require__(/*! ./_stackGet */ "./node_modules/lodash/_stackGet.js"),
stackHas = __webpack_require__(/*! ./_stackHas */ "./node_modules/lodash/_stackHas.js"),
stackSet = __webpack_require__(/*! ./_stackSet */ "./node_modules/lodash/_stackSet.js");
/**
* Creates a stack cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Stack(entries) {
var data = this.__data__ = new ListCache(entries);
this.size = data.size;
}
// Add methods to `Stack`.
Stack.prototype.clear = stackClear;
Stack.prototype['delete'] = stackDelete;
Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet;
module.exports = Stack;
/***/ }),
/***/ "./node_modules/lodash/_Symbol.js":
/*!****************************************!*\
!*** ./node_modules/lodash/_Symbol.js ***!
\****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");
/** Built-in value references. */
var Symbol = root.Symbol;
module.exports = Symbol;
/***/ }),
/***/ "./node_modules/lodash/_Uint8Array.js":
/*!********************************************!*\
!*** ./node_modules/lodash/_Uint8Array.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");
/** Built-in value references. */
var Uint8Array = root.Uint8Array;
module.exports = Uint8Array;
/***/ }),
/***/ "./node_modules/lodash/_WeakMap.js":
/*!*****************************************!*\
!*** ./node_modules/lodash/_WeakMap.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js"),
root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");
/* Built-in method references that are verified to be native. */
var WeakMap = getNative(root, 'WeakMap');
module.exports = WeakMap;
/***/ }),
/***/ "./node_modules/lodash/_arrayEach.js":
/*!*******************************************!*\
!*** ./node_modules/lodash/_arrayEach.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* A specialized version of `_.forEach` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns `array`.
*/
function arrayEach(array, iteratee) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
if (iteratee(array[index], index, array) === false) {
break;
}
}
return array;
}
module.exports = arrayEach;
/***/ }),
/***/ "./node_modules/lodash/_arrayFilter.js":
/*!*********************************************!*\
!*** ./node_modules/lodash/_arrayFilter.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* A specialized version of `_.filter` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {Array} Returns the new filtered array.
*/
function arrayFilter(array, predicate) {
var index = -1,
length = array == null ? 0 : array.length,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index];
if (predicate(value, index, array)) {
result[resIndex++] = value;
}
}
return result;
}
module.exports = arrayFilter;
/***/ }),
/***/ "./node_modules/lodash/_arrayLikeKeys.js":
/*!***********************************************!*\
!*** ./node_modules/lodash/_arrayLikeKeys.js ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseTimes = __webpack_require__(/*! ./_baseTimes */ "./node_modules/lodash/_baseTimes.js"),
isArguments = __webpack_require__(/*! ./isArguments */ "./node_modules/lodash/isArguments.js"),
isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"),
isBuffer = __webpack_require__(/*! ./isBuffer */ "./node_modules/lodash/isBuffer.js"),
isIndex = __webpack_require__(/*! ./_isIndex */ "./node_modules/lodash/_isIndex.js"),
isTypedArray = __webpack_require__(/*! ./isTypedArray */ "./node_modules/lodash/isTypedArray.js");
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
var isArr = isArray(value),
isArg = !isArr && isArguments(value),
isBuff = !isArr && !isArg && isBuffer(value),
isType = !isArr && !isArg && !isBuff && isTypedArray(value),
skipIndexes = isArr || isArg || isBuff || isType,
result = skipIndexes ? baseTimes(value.length, String) : [],
length = result.length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (
// Safari 9 has enumerable `arguments.length` in strict mode.
key == 'length' ||
// Node.js 0.10 has enumerable non-index properties on buffers.
(isBuff && (key == 'offset' || key == 'parent')) ||
// PhantomJS 2 has enumerable non-index properties on typed arrays.
(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
// Skip index properties.
isIndex(key, length)
))) {
result.push(key);
}
}
return result;
}
module.exports = arrayLikeKeys;
/***/ }),
/***/ "./node_modules/lodash/_arrayMap.js":
/*!******************************************!*\
!*** ./node_modules/lodash/_arrayMap.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* A specialized version of `_.map` for arrays without support for iteratee
* shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
*/
function arrayMap(array, iteratee) {
var index = -1,
length = array == null ? 0 : array.length,
result = Array(length);
while (++index < length) {
result[index] = iteratee(array[index], index, array);
}
return result;
}
module.exports = arrayMap;
/***/ }),
/***/ "./node_modules/lodash/_arrayPush.js":
/*!*******************************************!*\
!*** ./node_modules/lodash/_arrayPush.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* Appends the elements of `values` to `array`.
*
* @private
* @param {Array} array The array to modify.
* @param {Array} values The values to append.
* @returns {Array} Returns `array`.
*/
function arrayPush(array, values) {
var index = -1,
length = values.length,
offset = array.length;
while (++index < length) {
array[offset + index] = values[index];
}
return array;
}
module.exports = arrayPush;
/***/ }),
/***/ "./node_modules/lodash/_arraySome.js":
/*!*******************************************!*\
!*** ./node_modules/lodash/_arraySome.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* A specialized version of `_.some` for arrays without support for iteratee
* shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if any element passes the predicate check,
* else `false`.
*/
function arraySome(array, predicate) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
if (predicate(array[index], index, array)) {
return true;
}
}
return false;
}
module.exports = arraySome;
/***/ }),
/***/ "./node_modules/lodash/_assignValue.js":
/*!*********************************************!*\
!*** ./node_modules/lodash/_assignValue.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ "./node_modules/lodash/_baseAssignValue.js"),
eq = __webpack_require__(/*! ./eq */ "./node_modules/lodash/eq.js");
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Assigns `value` to `key` of `object` if the existing value is not equivalent
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* @private
* @param {Object} object The object to modify.
* @param {string} key The key of the property to assign.
* @param {*} value The value to assign.
*/
function assignValue(object, key, value) {
var objValue = object[key];
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
(value === undefined && !(key in object))) {
baseAssignValue(object, key, value);
}
}
module.exports = assignValue;
/***/ }),
/***/ "./node_modules/lodash/_assocIndexOf.js":
/*!**********************************************!*\
!*** ./node_modules/lodash/_assocIndexOf.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var eq = __webpack_require__(/*! ./eq */ "./node_modules/lodash/eq.js");
/**
* Gets the index at which the `key` is found in `array` of key-value pairs.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function assocIndexOf(array, key) {
var length = array.length;
while (length--) {
if (eq(array[length][0], key)) {
return length;
}
}
return -1;
}
module.exports = assocIndexOf;
/***/ }),
/***/ "./node_modules/lodash/_baseAssign.js":
/*!********************************************!*\
!*** ./node_modules/lodash/_baseAssign.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/lodash/_copyObject.js"),
keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js");
/**
* The base implementation of `_.assign` without support for multiple sources
* or `customizer` functions.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @returns {Object} Returns `object`.
*/
function baseAssign(object, source) {
return object && copyObject(source, keys(source), object);
}
module.exports = baseAssign;
/***/ }),
/***/ "./node_modules/lodash/_baseAssignIn.js":
/*!**********************************************!*\
!*** ./node_modules/lodash/_baseAssignIn.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/lodash/_copyObject.js"),
keysIn = __webpack_require__(/*! ./keysIn */ "./node_modules/lodash/keysIn.js");
/**
* The base implementation of `_.assignIn` without support for multiple sources
* or `customizer` functions.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @returns {Object} Returns `object`.
*/
function baseAssignIn(object, source) {
return object && copyObject(source, keysIn(source), object);
}
module.exports = baseAssignIn;
/***/ }),
/***/ "./node_modules/lodash/_baseAssignValue.js":
/*!*************************************************!*\
!*** ./node_modules/lodash/_baseAssignValue.js ***!
\*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var defineProperty = __webpack_require__(/*! ./_defineProperty */ "./node_modules/lodash/_defineProperty.js");
/**
* The base implementation of `assignValue` and `assignMergeValue` without
* value checks.
*
* @private
* @param {Object} object The object to modify.
* @param {string} key The key of the property to assign.
* @param {*} value The value to assign.
*/
function baseAssignValue(object, key, value) {
if (key == '__proto__' && defineProperty) {
defineProperty(object, key, {
'configurable': true,
'enumerable': true,
'value': value,
'writable': true
});
} else {
object[key] = value;
}
}
module.exports = baseAssignValue;
/***/ }),
/***/ "./node_modules/lodash/_baseClone.js":
/*!*******************************************!*\
!*** ./node_modules/lodash/_baseClone.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Stack = __webpack_require__(/*! ./_Stack */ "./node_modules/lodash/_Stack.js"),
arrayEach = __webpack_require__(/*! ./_arrayEach */ "./node_modules/lodash/_arrayEach.js"),
assignValue = __webpack_require__(/*! ./_assignValue */ "./node_modules/lodash/_assignValue.js"),
baseAssign = __webpack_require__(/*! ./_baseAssign */ "./node_modules/lodash/_baseAssign.js"),
baseAssignIn = __webpack_require__(/*! ./_baseAssignIn */ "./node_modules/lodash/_baseAssignIn.js"),
cloneBuffer = __webpack_require__(/*! ./_cloneBuffer */ "./node_modules/lodash/_cloneBuffer.js"),
copyArray = __webpack_require__(/*! ./_copyArray */ "./node_modules/lodash/_copyArray.js"),
copySymbols = __webpack_require__(/*! ./_copySymbols */ "./node_modules/lodash/_copySymbols.js"),
copySymbolsIn = __webpack_require__(/*! ./_copySymbolsIn */ "./node_modules/lodash/_copySymbolsIn.js"),
getAllKeys = __webpack_require__(/*! ./_getAllKeys */ "./node_modules/lodash/_getAllKeys.js"),
getAllKeysIn = __webpack_require__(/*! ./_getAllKeysIn */ "./node_modules/lodash/_getAllKeysIn.js"),
getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/lodash/_getTag.js"),
initCloneArray = __webpack_require__(/*! ./_initCloneArray */ "./node_modules/lodash/_initCloneArray.js"),
initCloneByTag = __webpack_require__(/*! ./_initCloneByTag */ "./node_modules/lodash/_initCloneByTag.js"),
initCloneObject = __webpack_require__(/*! ./_initCloneObject */ "./node_modules/lodash/_initCloneObject.js"),
isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"),
isBuffer = __webpack_require__(/*! ./isBuffer */ "./node_modules/lodash/isBuffer.js"),
isMap = __webpack_require__(/*! ./isMap */ "./node_modules/lodash/isMap.js"),
isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"),
isSet = __webpack_require__(/*! ./isSet */ "./node_modules/lodash/isSet.js"),
keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js");
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1,
CLONE_FLAT_FLAG = 2,
CLONE_SYMBOLS_FLAG = 4;
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
boolTag = '[object Boolean]',
dateTag = '[object Date]',
errorTag = '[object Error]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]',
mapTag = '[object Map]',
numberTag = '[object Number]',
objectTag = '[object Object]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
symbolTag = '[object Symbol]',
weakMapTag = '[object WeakMap]';
var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]',
float32Tag = '[object Float32Array]',
float64Tag = '[object Float64Array]',
int8Tag = '[object Int8Array]',
int16Tag = '[object Int16Array]',
int32Tag = '[object Int32Array]',
uint8Tag = '[object Uint8Array]',
uint8ClampedTag = '[object Uint8ClampedArray]',
uint16Tag = '[object Uint16Array]',
uint32Tag = '[object Uint32Array]';
/** Used to identify `toStringTag` values supported by `_.clone`. */
var cloneableTags = {};
cloneableTags[argsTag] = cloneableTags[arrayTag] =
cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
cloneableTags[boolTag] = cloneableTags[dateTag] =
cloneableTags[float32Tag] = cloneableTags[float64Tag] =
cloneableTags[int8Tag] = cloneableTags[int16Tag] =
cloneableTags[int32Tag] = cloneableTags[mapTag] =
cloneableTags[numberTag] = cloneableTags[objectTag] =
cloneableTags[regexpTag] = cloneableTags[setTag] =
cloneableTags[stringTag] = cloneableTags[symbolTag] =
cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
cloneableTags[errorTag] = cloneableTags[funcTag] =
cloneableTags[weakMapTag] = false;
/**
* The base implementation of `_.clone` and `_.cloneDeep` which tracks
* traversed objects.
*
* @private
* @param {*} value The value to clone.
* @param {boolean} bitmask The bitmask flags.
* 1 - Deep clone
* 2 - Flatten inherited properties
* 4 - Clone symbols
* @param {Function} [customizer] The function to customize cloning.
* @param {string} [key] The key of `value`.
* @param {Object} [object] The parent object of `value`.
* @param {Object} [stack] Tracks traversed objects and their clone counterparts.
* @returns {*} Returns the cloned value.
*/
function baseClone(value, bitmask, customizer, key, object, stack) {
var result,
isDeep = bitmask & CLONE_DEEP_FLAG,
isFlat = bitmask & CLONE_FLAT_FLAG,
isFull = bitmask & CLONE_SYMBOLS_FLAG;
if (customizer) {
result = object ? customizer(value, key, object, stack) : customizer(value);
}
if (result !== undefined) {
return result;
}
if (!isObject(value)) {
return value;
}
var isArr = isArray(value);
if (isArr) {
result = initCloneArray(value);
if (!isDeep) {
return copyArray(value, result);
}
} else {
var tag = getTag(value),
isFunc = tag == funcTag || tag == genTag;
if (isBuffer(value)) {
return cloneBuffer(value, isDeep);
}
if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
result = (isFlat || isFunc) ? {} : initCloneObject(value);
if (!isDeep) {
return isFlat
? copySymbolsIn(value, baseAssignIn(result, value))
: copySymbols(value, baseAssign(result, value));
}
} else {
if (!cloneableTags[tag]) {
return object ? value : {};
}
result = initCloneByTag(value, tag, isDeep);
}
}
// Check for circular references and return its corresponding clone.
stack || (stack = new Stack);
var stacked = stack.get(value);
if (stacked) {
return stacked;
}
stack.set(value, result);
if (isSet(value)) {
value.forEach(function(subValue) {
result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
});
return result;
}
if (isMap(value)) {
value.forEach(function(subValue, key) {
result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
});
return result;
}
var keysFunc = isFull
? (isFlat ? getAllKeysIn : getAllKeys)
: (isFlat ? keysIn : keys);
var props = isArr ? undefined : keysFunc(value);
arrayEach(props || value, function(subValue, key) {
if (props) {
key = subValue;
subValue = value[key];
}
// Recursively populate clone (susceptible to call stack limits).
assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
});
return result;
}
module.exports = baseClone;
/***/ }),
/***/ "./node_modules/lodash/_baseCreate.js":
/*!********************************************!*\
!*** ./node_modules/lodash/_baseCreate.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js");
/** Built-in value references. */
var objectCreate = Object.create;
/**
* The base implementation of `_.create` without support for assigning
* properties to the created object.
*
* @private
* @param {Object} proto The object to inherit from.
* @returns {Object} Returns the new object.
*/
var baseCreate = (function() {
function object() {}
return function(proto) {
if (!isObject(proto)) {
return {};
}
if (objectCreate) {
return objectCreate(proto);
}
object.prototype = proto;
var result = new object;
object.prototype = undefined;
return result;
};
}());
module.exports = baseCreate;
/***/ }),
/***/ "./node_modules/lodash/_baseEach.js":
/*!******************************************!*\
!*** ./node_modules/lodash/_baseEach.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseForOwn = __webpack_require__(/*! ./_baseForOwn */ "./node_modules/lodash/_baseForOwn.js"),
createBaseEach = __webpack_require__(/*! ./_createBaseEach */ "./node_modules/lodash/_createBaseEach.js");
/**
* The base implementation of `_.forEach` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array|Object} Returns `collection`.
*/
var baseEach = createBaseEach(baseForOwn);
module.exports = baseEach;
/***/ }),
/***/ "./node_modules/lodash/_baseFor.js":
/*!*****************************************!*\
!*** ./node_modules/lodash/_baseFor.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var createBaseFor = __webpack_require__(/*! ./_createBaseFor */ "./node_modules/lodash/_createBaseFor.js");
/**
* The base implementation of `baseForOwn` which iterates over `object`
* properties returned by `keysFunc` and invokes `iteratee` for each property.
* Iteratee functions may exit iteration early by explicitly returning `false`.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {Function} keysFunc The function to get the keys of `object`.
* @returns {Object} Returns `object`.
*/
var baseFor = createBaseFor();
module.exports = baseFor;
/***/ }),
/***/ "./node_modules/lodash/_baseForOwn.js":
/*!********************************************!*\
!*** ./node_modules/lodash/_baseForOwn.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseFor = __webpack_require__(/*! ./_baseFor */ "./node_modules/lodash/_baseFor.js"),
keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js");
/**
* The base implementation of `_.forOwn` without support for iteratee shorthands.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Object} Returns `object`.
*/
function baseForOwn(object, iteratee) {
return object && baseFor(object, iteratee, keys);
}
module.exports = baseForOwn;
/***/ }),
/***/ "./node_modules/lodash/_baseGet.js":
/*!*****************************************!*\
!*** ./node_modules/lodash/_baseGet.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var castPath = __webpack_require__(/*! ./_castPath */ "./node_modules/lodash/_castPath.js"),
toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/lodash/_toKey.js");
/**
* The base implementation of `_.get` without support for default values.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to get.
* @returns {*} Returns the resolved value.
*/
function baseGet(object, path) {
path = castPath(path, object);
var index = 0,
length = path.length;
while (object != null && index < length) {
object = object[toKey(path[index++])];
}
return (index && index == length) ? object : undefined;
}
module.exports = baseGet;
/***/ }),
/***/ "./node_modules/lodash/_baseGetAllKeys.js":
/*!************************************************!*\
!*** ./node_modules/lodash/_baseGetAllKeys.js ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var arrayPush = __webpack_require__(/*! ./_arrayPush */ "./node_modules/lodash/_arrayPush.js"),
isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js");
/**
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses
* `keysFunc` and `symbolsFunc` to get the enumerable property names and
* symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Function} keysFunc The function to get the keys of `object`.
* @param {Function} symbolsFunc The function to get the symbols of `object`.
* @returns {Array} Returns the array of property names and symbols.
*/
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
var result = keysFunc(object);
return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
}
module.exports = baseGetAllKeys;
/***/ }),
/***/ "./node_modules/lodash/_baseGetTag.js":
/*!********************************************!*\
!*** ./node_modules/lodash/_baseGetTag.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"),
getRawTag = __webpack_require__(/*! ./_getRawTag */ "./node_modules/lodash/_getRawTag.js"),
objectToString = __webpack_require__(/*! ./_objectToString */ "./node_modules/lodash/_objectToString.js");
/** `Object#toString` result references. */
var nullTag = '[object Null]',
undefinedTag = '[object Undefined]';
/** Built-in value references. */
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
/**
* The base implementation of `getTag` without fallbacks for buggy environments.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
function baseGetTag(value) {
if (value == null) {
return value === undefined ? undefinedTag : nullTag;
}
return (symToStringTag && symToStringTag in Object(value))
? getRawTag(value)
: objectToString(value);
}
module.exports = baseGetTag;
/***/ }),
/***/ "./node_modules/lodash/_baseHasIn.js":
/*!*******************************************!*\
!*** ./node_modules/lodash/_baseHasIn.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* The base implementation of `_.hasIn` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHasIn(object, key) {
return object != null && key in Object(object);
}
module.exports = baseHasIn;
/***/ }),
/***/ "./node_modules/lodash/_baseIsArguments.js":
/*!*************************************************!*\
!*** ./node_modules/lodash/_baseIsArguments.js ***!
\*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js");
/** `Object#toString` result references. */
var argsTag = '[object Arguments]';
/**
* The base implementation of `_.isArguments`.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
*/
function baseIsArguments(value) {
return isObjectLike(value) && baseGetTag(value) == argsTag;
}
module.exports = baseIsArguments;
/***/ }),
/***/ "./node_modules/lodash/_baseIsEqual.js":
/*!*********************************************!*\
!*** ./node_modules/lodash/_baseIsEqual.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseIsEqualDeep = __webpack_require__(/*! ./_baseIsEqualDeep */ "./node_modules/lodash/_baseIsEqualDeep.js"),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js");
/**
* The base implementation of `_.isEqual` which supports partial comparisons
* and tracks traversed objects.
*
* @private
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @param {boolean} bitmask The bitmask flags.
* 1 - Unordered comparison
* 2 - Partial comparison
* @param {Function} [customizer] The function to customize comparisons.
* @param {Object} [stack] Tracks traversed `value` and `other` objects.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
*/
function baseIsEqual(value, other, bitmask, customizer, stack) {
if (value === other) {
return true;
}
if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
return value !== value && other !== other;
}
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
}
module.exports = baseIsEqual;
/***/ }),
/***/ "./node_modules/lodash/_baseIsEqualDeep.js":
/*!*************************************************!*\
!*** ./node_modules/lodash/_baseIsEqualDeep.js ***!
\*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Stack = __webpack_require__(/*! ./_Stack */ "./node_modules/lodash/_Stack.js"),
equalArrays = __webpack_require__(/*! ./_equalArrays */ "./node_modules/lodash/_equalArrays.js"),
equalByTag = __webpack_require__(/*! ./_equalByTag */ "./node_modules/lodash/_equalByTag.js"),
equalObjects = __webpack_require__(/*! ./_equalObjects */ "./node_modules/lodash/_equalObjects.js"),
getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/lodash/_getTag.js"),
isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"),
isBuffer = __webpack_require__(/*! ./isBuffer */ "./node_modules/lodash/isBuffer.js"),
isTypedArray = __webpack_require__(/*! ./isTypedArray */ "./node_modules/lodash/isTypedArray.js");
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1;
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
objectTag = '[object Object]';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* A specialized version of `baseIsEqual` for arrays and objects which performs
* deep comparisons and tracks traversed objects enabling objects with circular
* references to be compared.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} [stack] Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
var objIsArr = isArray(object),
othIsArr = isArray(other),
objTag = objIsArr ? arrayTag : getTag(object),
othTag = othIsArr ? arrayTag : getTag(other);
objTag = objTag == argsTag ? objectTag : objTag;
othTag = othTag == argsTag ? objectTag : othTag;
var objIsObj = objTag == objectTag,
othIsObj = othTag == objectTag,
isSameTag = objTag == othTag;
if (isSameTag && isBuffer(object)) {
if (!isBuffer(other)) {
return false;
}
objIsArr = true;
objIsObj = false;
}
if (isSameTag && !objIsObj) {
stack || (stack = new Stack);
return (objIsArr || isTypedArray(object))
? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
: equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
}
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
if (objIsWrapped || othIsWrapped) {
var objUnwrapped = objIsWrapped ? object.value() : object,
othUnwrapped = othIsWrapped ? other.value() : other;
stack || (stack = new Stack);
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
}
}
if (!isSameTag) {
return false;
}
stack || (stack = new Stack);
return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
}
module.exports = baseIsEqualDeep;
/***/ }),
/***/ "./node_modules/lodash/_baseIsMap.js":
/*!*******************************************!*\
!*** ./node_modules/lodash/_baseIsMap.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/lodash/_getTag.js"),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js");
/** `Object#toString` result references. */
var mapTag = '[object Map]';
/**
* The base implementation of `_.isMap` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a map, else `false`.
*/
function baseIsMap(value) {
return isObjectLike(value) && getTag(value) == mapTag;
}
module.exports = baseIsMap;
/***/ }),
/***/ "./node_modules/lodash/_baseIsMatch.js":
/*!*********************************************!*\
!*** ./node_modules/lodash/_baseIsMatch.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Stack = __webpack_require__(/*! ./_Stack */ "./node_modules/lodash/_Stack.js"),
baseIsEqual = __webpack_require__(/*! ./_baseIsEqual */ "./node_modules/lodash/_baseIsEqual.js");
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/**
* The base implementation of `_.isMatch` without support for iteratee shorthands.
*
* @private
* @param {Object} object The object to inspect.
* @param {Object} source The object of property values to match.
* @param {Array} matchData The property names, values, and compare flags to match.
* @param {Function} [customizer] The function to customize comparisons.
* @returns {boolean} Returns `true` if `object` is a match, else `false`.
*/
function baseIsMatch(object, source, matchData, customizer) {
var index = matchData.length,
length = index,
noCustomizer = !customizer;
if (object == null) {
return !length;
}
object = Object(object);
while (index--) {
var data = matchData[index];
if ((noCustomizer && data[2])
? data[1] !== object[data[0]]
: !(data[0] in object)
) {
return false;
}
}
while (++index < length) {
data = matchData[index];
var key = data[0],
objValue = object[key],
srcValue = data[1];
if (noCustomizer && data[2]) {
if (objValue === undefined && !(key in object)) {
return false;
}
} else {
var stack = new Stack;
if (customizer) {
var result = customizer(objValue, srcValue, key, object, source, stack);
}
if (!(result === undefined
? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
: result
)) {
return false;
}
}
}
return true;
}
module.exports = baseIsMatch;
/***/ }),
/***/ "./node_modules/lodash/_baseIsNative.js":
/*!**********************************************!*\
!*** ./node_modules/lodash/_baseIsNative.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isFunction = __webpack_require__(/*! ./isFunction */ "./node_modules/lodash/isFunction.js"),
isMasked = __webpack_require__(/*! ./_isMasked */ "./node_modules/lodash/_isMasked.js"),
isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"),
toSource = __webpack_require__(/*! ./_toSource */ "./node_modules/lodash/_toSource.js");
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** Used for built-in method references. */
var funcProto = Function.prototype,
objectProto = Object.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);
/**
* The base implementation of `_.isNative` without bad shim checks.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function,
* else `false`.
*/
function baseIsNative(value) {
if (!isObject(value) || isMasked(value)) {
return false;
}
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
return pattern.test(toSource(value));
}
module.exports = baseIsNative;
/***/ }),
/***/ "./node_modules/lodash/_baseIsSet.js":
/*!*******************************************!*\
!*** ./node_modules/lodash/_baseIsSet.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getTag = __webpack_require__(/*! ./_getTag */ "./node_modules/lodash/_getTag.js"),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js");
/** `Object#toString` result references. */
var setTag = '[object Set]';
/**
* The base implementation of `_.isSet` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a set, else `false`.
*/
function baseIsSet(value) {
return isObjectLike(value) && getTag(value) == setTag;
}
module.exports = baseIsSet;
/***/ }),
/***/ "./node_modules/lodash/_baseIsTypedArray.js":
/*!**************************************************!*\
!*** ./node_modules/lodash/_baseIsTypedArray.js ***!
\**************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"),
isLength = __webpack_require__(/*! ./isLength */ "./node_modules/lodash/isLength.js"),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js");
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
boolTag = '[object Boolean]',
dateTag = '[object Date]',
errorTag = '[object Error]',
funcTag = '[object Function]',
mapTag = '[object Map]',
numberTag = '[object Number]',
objectTag = '[object Object]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
weakMapTag = '[object WeakMap]';
var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]',
float32Tag = '[object Float32Array]',
float64Tag = '[object Float64Array]',
int8Tag = '[object Int8Array]',
int16Tag = '[object Int16Array]',
int32Tag = '[object Int32Array]',
uint8Tag = '[object Uint8Array]',
uint8ClampedTag = '[object Uint8ClampedArray]',
uint16Tag = '[object Uint16Array]',
uint32Tag = '[object Uint32Array]';
/** Used to identify `toStringTag` values of typed arrays. */
var typedArrayTags = {};
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
typedArrayTags[uint32Tag] = true;
typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
typedArrayTags[errorTag] = typedArrayTags[funcTag] =
typedArrayTags[mapTag] = typedArrayTags[numberTag] =
typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
typedArrayTags[setTag] = typedArrayTags[stringTag] =
typedArrayTags[weakMapTag] = false;
/**
* The base implementation of `_.isTypedArray` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
*/
function baseIsTypedArray(value) {
return isObjectLike(value) &&
isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
}
module.exports = baseIsTypedArray;
/***/ }),
/***/ "./node_modules/lodash/_baseIteratee.js":
/*!**********************************************!*\
!*** ./node_modules/lodash/_baseIteratee.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseMatches = __webpack_require__(/*! ./_baseMatches */ "./node_modules/lodash/_baseMatches.js"),
baseMatchesProperty = __webpack_require__(/*! ./_baseMatchesProperty */ "./node_modules/lodash/_baseMatchesProperty.js"),
identity = __webpack_require__(/*! ./identity */ "./node_modules/lodash/identity.js"),
isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"),
property = __webpack_require__(/*! ./property */ "./node_modules/lodash/property.js");
/**
* The base implementation of `_.iteratee`.
*
* @private
* @param {*} [value=_.identity] The value to convert to an iteratee.
* @returns {Function} Returns the iteratee.
*/
function baseIteratee(value) {
// Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
// See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
if (typeof value == 'function') {
return value;
}
if (value == null) {
return identity;
}
if (typeof value == 'object') {
return isArray(value)
? baseMatchesProperty(value[0], value[1])
: baseMatches(value);
}
return property(value);
}
module.exports = baseIteratee;
/***/ }),
/***/ "./node_modules/lodash/_baseKeys.js":
/*!******************************************!*\
!*** ./node_modules/lodash/_baseKeys.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isPrototype = __webpack_require__(/*! ./_isPrototype */ "./node_modules/lodash/_isPrototype.js"),
nativeKeys = __webpack_require__(/*! ./_nativeKeys */ "./node_modules/lodash/_nativeKeys.js");
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
module.exports = baseKeys;
/***/ }),
/***/ "./node_modules/lodash/_baseKeysIn.js":
/*!********************************************!*\
!*** ./node_modules/lodash/_baseKeysIn.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"),
isPrototype = __webpack_require__(/*! ./_isPrototype */ "./node_modules/lodash/_isPrototype.js"),
nativeKeysIn = __webpack_require__(/*! ./_nativeKeysIn */ "./node_modules/lodash/_nativeKeysIn.js");
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function baseKeysIn(object) {
if (!isObject(object)) {
return nativeKeysIn(object);
}
var isProto = isPrototype(object),
result = [];
for (var key in object) {
if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
result.push(key);
}
}
return result;
}
module.exports = baseKeysIn;
/***/ }),
/***/ "./node_modules/lodash/_baseMap.js":
/*!*****************************************!*\
!*** ./node_modules/lodash/_baseMap.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseEach = __webpack_require__(/*! ./_baseEach */ "./node_modules/lodash/_baseEach.js"),
isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js");
/**
* The base implementation of `_.map` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
*/
function baseMap(collection, iteratee) {
var index = -1,
result = isArrayLike(collection) ? Array(collection.length) : [];
baseEach(collection, function(value, key, collection) {
result[++index] = iteratee(value, key, collection);
});
return result;
}
module.exports = baseMap;
/***/ }),
/***/ "./node_modules/lodash/_baseMatches.js":
/*!*********************************************!*\
!*** ./node_modules/lodash/_baseMatches.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseIsMatch = __webpack_require__(/*! ./_baseIsMatch */ "./node_modules/lodash/_baseIsMatch.js"),
getMatchData = __webpack_require__(/*! ./_getMatchData */ "./node_modules/lodash/_getMatchData.js"),
matchesStrictComparable = __webpack_require__(/*! ./_matchesStrictComparable */ "./node_modules/lodash/_matchesStrictComparable.js");
/**
* The base implementation of `_.matches` which doesn't clone `source`.
*
* @private
* @param {Object} source The object of property values to match.
* @returns {Function} Returns the new spec function.
*/
function baseMatches(source) {
var matchData = getMatchData(source);
if (matchData.length == 1 && matchData[0][2]) {
return matchesStrictComparable(matchData[0][0], matchData[0][1]);
}
return function(object) {
return object === source || baseIsMatch(object, source, matchData);
};
}
module.exports = baseMatches;
/***/ }),
/***/ "./node_modules/lodash/_baseMatchesProperty.js":
/*!*****************************************************!*\
!*** ./node_modules/lodash/_baseMatchesProperty.js ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseIsEqual = __webpack_require__(/*! ./_baseIsEqual */ "./node_modules/lodash/_baseIsEqual.js"),
get = __webpack_require__(/*! ./get */ "./node_modules/lodash/get.js"),
hasIn = __webpack_require__(/*! ./hasIn */ "./node_modules/lodash/hasIn.js"),
isKey = __webpack_require__(/*! ./_isKey */ "./node_modules/lodash/_isKey.js"),
isStrictComparable = __webpack_require__(/*! ./_isStrictComparable */ "./node_modules/lodash/_isStrictComparable.js"),
matchesStrictComparable = __webpack_require__(/*! ./_matchesStrictComparable */ "./node_modules/lodash/_matchesStrictComparable.js"),
toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/lodash/_toKey.js");
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/**
* The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
*
* @private
* @param {string} path The path of the property to get.
* @param {*} srcValue The value to match.
* @returns {Function} Returns the new spec function.
*/
function baseMatchesProperty(path, srcValue) {
if (isKey(path) && isStrictComparable(srcValue)) {
return matchesStrictComparable(toKey(path), srcValue);
}
return function(object) {
var objValue = get(object, path);
return (objValue === undefined && objValue === srcValue)
? hasIn(object, path)
: baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
};
}
module.exports = baseMatchesProperty;
/***/ }),
/***/ "./node_modules/lodash/_baseProperty.js":
/*!**********************************************!*\
!*** ./node_modules/lodash/_baseProperty.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* The base implementation of `_.property` without support for deep paths.
*
* @private
* @param {string} key The key of the property to get.
* @returns {Function} Returns the new accessor function.
*/
function baseProperty(key) {
return function(object) {
return object == null ? undefined : object[key];
};
}
module.exports = baseProperty;
/***/ }),
/***/ "./node_modules/lodash/_basePropertyDeep.js":
/*!**************************************************!*\
!*** ./node_modules/lodash/_basePropertyDeep.js ***!
\**************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseGet = __webpack_require__(/*! ./_baseGet */ "./node_modules/lodash/_baseGet.js");
/**
* A specialized version of `baseProperty` which supports deep paths.
*
* @private
* @param {Array|string} path The path of the property to get.
* @returns {Function} Returns the new accessor function.
*/
function basePropertyDeep(path) {
return function(object) {
return baseGet(object, path);
};
}
module.exports = basePropertyDeep;
/***/ }),
/***/ "./node_modules/lodash/_baseTimes.js":
/*!*******************************************!*\
!*** ./node_modules/lodash/_baseTimes.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* The base implementation of `_.times` without support for iteratee shorthands
* or max array length checks.
*
* @private
* @param {number} n The number of times to invoke `iteratee`.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the array of results.
*/
function baseTimes(n, iteratee) {
var index = -1,
result = Array(n);
while (++index < n) {
result[index] = iteratee(index);
}
return result;
}
module.exports = baseTimes;
/***/ }),
/***/ "./node_modules/lodash/_baseToString.js":
/*!**********************************************!*\
!*** ./node_modules/lodash/_baseToString.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"),
arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"),
isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"),
isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js");
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolToString = symbolProto ? symbolProto.toString : undefined;
/**
* The base implementation of `_.toString` which doesn't convert nullish
* values to empty strings.
*
* @private
* @param {*} value The value to process.
* @returns {string} Returns the string.
*/
function baseToString(value) {
// Exit early for strings to avoid a performance hit in some environments.
if (typeof value == 'string') {
return value;
}
if (isArray(value)) {
// Recursively convert values (susceptible to call stack limits).
return arrayMap(value, baseToString) + '';
}
if (isSymbol(value)) {
return symbolToString ? symbolToString.call(value) : '';
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
module.exports = baseToString;
/***/ }),
/***/ "./node_modules/lodash/_baseUnary.js":
/*!*******************************************!*\
!*** ./node_modules/lodash/_baseUnary.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* The base implementation of `_.unary` without support for storing metadata.
*
* @private
* @param {Function} func The function to cap arguments for.
* @returns {Function} Returns the new capped function.
*/
function baseUnary(func) {
return function(value) {
return func(value);
};
}
module.exports = baseUnary;
/***/ }),
/***/ "./node_modules/lodash/_cacheHas.js":
/*!******************************************!*\
!*** ./node_modules/lodash/_cacheHas.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* Checks if a `cache` value for `key` exists.
*
* @private
* @param {Object} cache The cache to query.
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function cacheHas(cache, key) {
return cache.has(key);
}
module.exports = cacheHas;
/***/ }),
/***/ "./node_modules/lodash/_castFunction.js":
/*!**********************************************!*\
!*** ./node_modules/lodash/_castFunction.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var identity = __webpack_require__(/*! ./identity */ "./node_modules/lodash/identity.js");
/**
* Casts `value` to `identity` if it's not a function.
*
* @private
* @param {*} value The value to inspect.
* @returns {Function} Returns cast function.
*/
function castFunction(value) {
return typeof value == 'function' ? value : identity;
}
module.exports = castFunction;
/***/ }),
/***/ "./node_modules/lodash/_castPath.js":
/*!******************************************!*\
!*** ./node_modules/lodash/_castPath.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"),
isKey = __webpack_require__(/*! ./_isKey */ "./node_modules/lodash/_isKey.js"),
stringToPath = __webpack_require__(/*! ./_stringToPath */ "./node_modules/lodash/_stringToPath.js"),
toString = __webpack_require__(/*! ./toString */ "./node_modules/lodash/toString.js");
/**
* Casts `value` to a path array if it's not one.
*
* @private
* @param {*} value The value to inspect.
* @param {Object} [object] The object to query keys on.
* @returns {Array} Returns the cast property path array.
*/
function castPath(value, object) {
if (isArray(value)) {
return value;
}
return isKey(value, object) ? [value] : stringToPath(toString(value));
}
module.exports = castPath;
/***/ }),
/***/ "./node_modules/lodash/_cloneArrayBuffer.js":
/*!**************************************************!*\
!*** ./node_modules/lodash/_cloneArrayBuffer.js ***!
\**************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Uint8Array = __webpack_require__(/*! ./_Uint8Array */ "./node_modules/lodash/_Uint8Array.js");
/**
* Creates a clone of `arrayBuffer`.
*
* @private
* @param {ArrayBuffer} arrayBuffer The array buffer to clone.
* @returns {ArrayBuffer} Returns the cloned array buffer.
*/
function cloneArrayBuffer(arrayBuffer) {
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
new Uint8Array(result).set(new Uint8Array(arrayBuffer));
return result;
}
module.exports = cloneArrayBuffer;
/***/ }),
/***/ "./node_modules/lodash/_cloneBuffer.js":
/*!*********************************************!*\
!*** ./node_modules/lodash/_cloneBuffer.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");
/** Detect free variable `exports`. */
var freeExports = true && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;
/** Built-in value references. */
var Buffer = moduleExports ? root.Buffer : undefined,
allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
/**
* Creates a clone of `buffer`.
*
* @private
* @param {Buffer} buffer The buffer to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Buffer} Returns the cloned buffer.
*/
function cloneBuffer(buffer, isDeep) {
if (isDeep) {
return buffer.slice();
}
var length = buffer.length,
result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
buffer.copy(result);
return result;
}
module.exports = cloneBuffer;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
/***/ }),
/***/ "./node_modules/lodash/_cloneDataView.js":
/*!***********************************************!*\
!*** ./node_modules/lodash/_cloneDataView.js ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var cloneArrayBuffer = __webpack_require__(/*! ./_cloneArrayBuffer */ "./node_modules/lodash/_cloneArrayBuffer.js");
/**
* Creates a clone of `dataView`.
*
* @private
* @param {Object} dataView The data view to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned data view.
*/
function cloneDataView(dataView, isDeep) {
var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
}
module.exports = cloneDataView;
/***/ }),
/***/ "./node_modules/lodash/_cloneRegExp.js":
/*!*********************************************!*\
!*** ./node_modules/lodash/_cloneRegExp.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/** Used to match `RegExp` flags from their coerced string values. */
var reFlags = /\w*$/;
/**
* Creates a clone of `regexp`.
*
* @private
* @param {Object} regexp The regexp to clone.
* @returns {Object} Returns the cloned regexp.
*/
function cloneRegExp(regexp) {
var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
result.lastIndex = regexp.lastIndex;
return result;
}
module.exports = cloneRegExp;
/***/ }),
/***/ "./node_modules/lodash/_cloneSymbol.js":
/*!*********************************************!*\
!*** ./node_modules/lodash/_cloneSymbol.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js");
/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
/**
* Creates a clone of the `symbol` object.
*
* @private
* @param {Object} symbol The symbol object to clone.
* @returns {Object} Returns the cloned symbol object.
*/
function cloneSymbol(symbol) {
return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
}
module.exports = cloneSymbol;
/***/ }),
/***/ "./node_modules/lodash/_cloneTypedArray.js":
/*!*************************************************!*\
!*** ./node_modules/lodash/_cloneTypedArray.js ***!
\*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var cloneArrayBuffer = __webpack_require__(/*! ./_cloneArrayBuffer */ "./node_modules/lodash/_cloneArrayBuffer.js");
/**
* Creates a clone of `typedArray`.
*
* @private
* @param {Object} typedArray The typed array to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned typed array.
*/
function cloneTypedArray(typedArray, isDeep) {
var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
}
module.exports = cloneTypedArray;
/***/ }),
/***/ "./node_modules/lodash/_copyArray.js":
/*!*******************************************!*\
!*** ./node_modules/lodash/_copyArray.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* Copies the values of `source` to `array`.
*
* @private
* @param {Array} source The array to copy values from.
* @param {Array} [array=[]] The array to copy values to.
* @returns {Array} Returns `array`.
*/
function copyArray(source, array) {
var index = -1,
length = source.length;
array || (array = Array(length));
while (++index < length) {
array[index] = source[index];
}
return array;
}
module.exports = copyArray;
/***/ }),
/***/ "./node_modules/lodash/_copyObject.js":
/*!********************************************!*\
!*** ./node_modules/lodash/_copyObject.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var assignValue = __webpack_require__(/*! ./_assignValue */ "./node_modules/lodash/_assignValue.js"),
baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ "./node_modules/lodash/_baseAssignValue.js");
/**
* Copies properties of `source` to `object`.
*
* @private
* @param {Object} source The object to copy properties from.
* @param {Array} props The property identifiers to copy.
* @param {Object} [object={}] The object to copy properties to.
* @param {Function} [customizer] The function to customize copied values.
* @returns {Object} Returns `object`.
*/
function copyObject(source, props, object, customizer) {
var isNew = !object;
object || (object = {});
var index = -1,
length = props.length;
while (++index < length) {
var key = props[index];
var newValue = customizer
? customizer(object[key], source[key], key, object, source)
: undefined;
if (newValue === undefined) {
newValue = source[key];
}
if (isNew) {
baseAssignValue(object, key, newValue);
} else {
assignValue(object, key, newValue);
}
}
return object;
}
module.exports = copyObject;
/***/ }),
/***/ "./node_modules/lodash/_copySymbols.js":
/*!*********************************************!*\
!*** ./node_modules/lodash/_copySymbols.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/lodash/_copyObject.js"),
getSymbols = __webpack_require__(/*! ./_getSymbols */ "./node_modules/lodash/_getSymbols.js");
/**
* Copies own symbols of `source` to `object`.
*
* @private
* @param {Object} source The object to copy symbols from.
* @param {Object} [object={}] The object to copy symbols to.
* @returns {Object} Returns `object`.
*/
function copySymbols(source, object) {
return copyObject(source, getSymbols(source), object);
}
module.exports = copySymbols;
/***/ }),
/***/ "./node_modules/lodash/_copySymbolsIn.js":
/*!***********************************************!*\
!*** ./node_modules/lodash/_copySymbolsIn.js ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var copyObject = __webpack_require__(/*! ./_copyObject */ "./node_modules/lodash/_copyObject.js"),
getSymbolsIn = __webpack_require__(/*! ./_getSymbolsIn */ "./node_modules/lodash/_getSymbolsIn.js");
/**
* Copies own and inherited symbols of `source` to `object`.
*
* @private
* @param {Object} source The object to copy symbols from.
* @param {Object} [object={}] The object to copy symbols to.
* @returns {Object} Returns `object`.
*/
function copySymbolsIn(source, object) {
return copyObject(source, getSymbolsIn(source), object);
}
module.exports = copySymbolsIn;
/***/ }),
/***/ "./node_modules/lodash/_coreJsData.js":
/*!********************************************!*\
!*** ./node_modules/lodash/_coreJsData.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");
/** Used to detect overreaching core-js shims. */
var coreJsData = root['__core-js_shared__'];
module.exports = coreJsData;
/***/ }),
/***/ "./node_modules/lodash/_createBaseEach.js":
/*!************************************************!*\
!*** ./node_modules/lodash/_createBaseEach.js ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js");
/**
* Creates a `baseEach` or `baseEachRight` function.
*
* @private
* @param {Function} eachFunc The function to iterate over a collection.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new base function.
*/
function createBaseEach(eachFunc, fromRight) {
return function(collection, iteratee) {
if (collection == null) {
return collection;
}
if (!isArrayLike(collection)) {
return eachFunc(collection, iteratee);
}
var length = collection.length,
index = fromRight ? length : -1,
iterable = Object(collection);
while ((fromRight ? index-- : ++index < length)) {
if (iteratee(iterable[index], index, iterable) === false) {
break;
}
}
return collection;
};
}
module.exports = createBaseEach;
/***/ }),
/***/ "./node_modules/lodash/_createBaseFor.js":
/*!***********************************************!*\
!*** ./node_modules/lodash/_createBaseFor.js ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* Creates a base function for methods like `_.forIn` and `_.forOwn`.
*
* @private
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new base function.
*/
function createBaseFor(fromRight) {
return function(object, iteratee, keysFunc) {
var index = -1,
iterable = Object(object),
props = keysFunc(object),
length = props.length;
while (length--) {
var key = props[fromRight ? length : ++index];
if (iteratee(iterable[key], key, iterable) === false) {
break;
}
}
return object;
};
}
module.exports = createBaseFor;
/***/ }),
/***/ "./node_modules/lodash/_defineProperty.js":
/*!************************************************!*\
!*** ./node_modules/lodash/_defineProperty.js ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js");
var defineProperty = (function() {
try {
var func = getNative(Object, 'defineProperty');
func({}, '', {});
return func;
} catch (e) {}
}());
module.exports = defineProperty;
/***/ }),
/***/ "./node_modules/lodash/_equalArrays.js":
/*!*********************************************!*\
!*** ./node_modules/lodash/_equalArrays.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var SetCache = __webpack_require__(/*! ./_SetCache */ "./node_modules/lodash/_SetCache.js"),
arraySome = __webpack_require__(/*! ./_arraySome */ "./node_modules/lodash/_arraySome.js"),
cacheHas = __webpack_require__(/*! ./_cacheHas */ "./node_modules/lodash/_cacheHas.js");
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/**
* A specialized version of `baseIsEqualDeep` for arrays with support for
* partial deep comparisons.
*
* @private
* @param {Array} array The array to compare.
* @param {Array} other The other array to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} stack Tracks traversed `array` and `other` objects.
* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
*/
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
arrLength = array.length,
othLength = other.length;
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
return false;
}
// Assume cyclic values are equal.
var stacked = stack.get(array);
if (stacked && stack.get(other)) {
return stacked == other;
}
var index = -1,
result = true,
seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
stack.set(array, other);
stack.set(other, array);
// Ignore non-index properties.
while (++index < arrLength) {
var arrValue = array[index],
othValue = other[index];
if (customizer) {
var compared = isPartial
? customizer(othValue, arrValue, index, other, array, stack)
: customizer(arrValue, othValue, index, array, other, stack);
}
if (compared !== undefined) {
if (compared) {
continue;
}
result = false;
break;
}
// Recursively compare arrays (susceptible to call stack limits).
if (seen) {
if (!arraySome(other, function(othValue, othIndex) {
if (!cacheHas(seen, othIndex) &&
(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
return seen.push(othIndex);
}
})) {
result = false;
break;
}
} else if (!(
arrValue === othValue ||
equalFunc(arrValue, othValue, bitmask, customizer, stack)
)) {
result = false;
break;
}
}
stack['delete'](array);
stack['delete'](other);
return result;
}
module.exports = equalArrays;
/***/ }),
/***/ "./node_modules/lodash/_equalByTag.js":
/*!********************************************!*\
!*** ./node_modules/lodash/_equalByTag.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"),
Uint8Array = __webpack_require__(/*! ./_Uint8Array */ "./node_modules/lodash/_Uint8Array.js"),
eq = __webpack_require__(/*! ./eq */ "./node_modules/lodash/eq.js"),
equalArrays = __webpack_require__(/*! ./_equalArrays */ "./node_modules/lodash/_equalArrays.js"),
mapToArray = __webpack_require__(/*! ./_mapToArray */ "./node_modules/lodash/_mapToArray.js"),
setToArray = __webpack_require__(/*! ./_setToArray */ "./node_modules/lodash/_setToArray.js");
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/** `Object#toString` result references. */
var boolTag = '[object Boolean]',
dateTag = '[object Date]',
errorTag = '[object Error]',
mapTag = '[object Map]',
numberTag = '[object Number]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
symbolTag = '[object Symbol]';
var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]';
/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
/**
* A specialized version of `baseIsEqualDeep` for comparing objects of
* the same `toStringTag`.
*
* **Note:** This function only supports comparing values with tags of
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {string} tag The `toStringTag` of the objects to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} stack Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
switch (tag) {
case dataViewTag:
if ((object.byteLength != other.byteLength) ||
(object.byteOffset != other.byteOffset)) {
return false;
}
object = object.buffer;
other = other.buffer;
case arrayBufferTag:
if ((object.byteLength != other.byteLength) ||
!equalFunc(new Uint8Array(object), new Uint8Array(other))) {
return false;
}
return true;
case boolTag:
case dateTag:
case numberTag:
// Coerce booleans to `1` or `0` and dates to milliseconds.
// Invalid dates are coerced to `NaN`.
return eq(+object, +other);
case errorTag:
return object.name == other.name && object.message == other.message;
case regexpTag:
case stringTag:
// Coerce regexes to strings and treat strings, primitives and objects,
// as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
// for more details.
return object == (other + '');
case mapTag:
var convert = mapToArray;
case setTag:
var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
convert || (convert = setToArray);
if (object.size != other.size && !isPartial) {
return false;
}
// Assume cyclic values are equal.
var stacked = stack.get(object);
if (stacked) {
return stacked == other;
}
bitmask |= COMPARE_UNORDERED_FLAG;
// Recursively compare objects (susceptible to call stack limits).
stack.set(object, other);
var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
stack['delete'](object);
return result;
case symbolTag:
if (symbolValueOf) {
return symbolValueOf.call(object) == symbolValueOf.call(other);
}
}
return false;
}
module.exports = equalByTag;
/***/ }),
/***/ "./node_modules/lodash/_equalObjects.js":
/*!**********************************************!*\
!*** ./node_modules/lodash/_equalObjects.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getAllKeys = __webpack_require__(/*! ./_getAllKeys */ "./node_modules/lodash/_getAllKeys.js");
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1;
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* A specialized version of `baseIsEqualDeep` for objects with support for
* partial deep comparisons.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} stack Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
objProps = getAllKeys(object),
objLength = objProps.length,
othProps = getAllKeys(other),
othLength = othProps.length;
if (objLength != othLength && !isPartial) {
return false;
}
var index = objLength;
while (index--) {
var key = objProps[index];
if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
return false;
}
}
// Assume cyclic values are equal.
var stacked = stack.get(object);
if (stacked && stack.get(other)) {
return stacked == other;
}
var result = true;
stack.set(object, other);
stack.set(other, object);
var skipCtor = isPartial;
while (++index < objLength) {
key = objProps[index];
var objValue = object[key],
othValue = other[key];
if (customizer) {
var compared = isPartial
? customizer(othValue, objValue, key, other, object, stack)
: customizer(objValue, othValue, key, object, other, stack);
}
// Recursively compare objects (susceptible to call stack limits).
if (!(compared === undefined
? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
: compared
)) {
result = false;
break;
}
skipCtor || (skipCtor = key == 'constructor');
}
if (result && !skipCtor) {
var objCtor = object.constructor,
othCtor = other.constructor;
// Non `Object` object instances with different constructors are not equal.
if (objCtor != othCtor &&
('constructor' in object && 'constructor' in other) &&
!(typeof objCtor == 'function' && objCtor instanceof objCtor &&
typeof othCtor == 'function' && othCtor instanceof othCtor)) {
result = false;
}
}
stack['delete'](object);
stack['delete'](other);
return result;
}
module.exports = equalObjects;
/***/ }),
/***/ "./node_modules/lodash/_freeGlobal.js":
/*!********************************************!*\
!*** ./node_modules/lodash/_freeGlobal.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
module.exports = freeGlobal;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "./node_modules/lodash/_getAllKeys.js":
/*!********************************************!*\
!*** ./node_modules/lodash/_getAllKeys.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseGetAllKeys = __webpack_require__(/*! ./_baseGetAllKeys */ "./node_modules/lodash/_baseGetAllKeys.js"),
getSymbols = __webpack_require__(/*! ./_getSymbols */ "./node_modules/lodash/_getSymbols.js"),
keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js");
/**
* Creates an array of own enumerable property names and symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names and symbols.
*/
function getAllKeys(object) {
return baseGetAllKeys(object, keys, getSymbols);
}
module.exports = getAllKeys;
/***/ }),
/***/ "./node_modules/lodash/_getAllKeysIn.js":
/*!**********************************************!*\
!*** ./node_modules/lodash/_getAllKeysIn.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseGetAllKeys = __webpack_require__(/*! ./_baseGetAllKeys */ "./node_modules/lodash/_baseGetAllKeys.js"),
getSymbolsIn = __webpack_require__(/*! ./_getSymbolsIn */ "./node_modules/lodash/_getSymbolsIn.js"),
keysIn = __webpack_require__(/*! ./keysIn */ "./node_modules/lodash/keysIn.js");
/**
* Creates an array of own and inherited enumerable property names and
* symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names and symbols.
*/
function getAllKeysIn(object) {
return baseGetAllKeys(object, keysIn, getSymbolsIn);
}
module.exports = getAllKeysIn;
/***/ }),
/***/ "./node_modules/lodash/_getMapData.js":
/*!********************************************!*\
!*** ./node_modules/lodash/_getMapData.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isKeyable = __webpack_require__(/*! ./_isKeyable */ "./node_modules/lodash/_isKeyable.js");
/**
* Gets the data for `map`.
*
* @private
* @param {Object} map The map to query.
* @param {string} key The reference key.
* @returns {*} Returns the map data.
*/
function getMapData(map, key) {
var data = map.__data__;
return isKeyable(key)
? data[typeof key == 'string' ? 'string' : 'hash']
: data.map;
}
module.exports = getMapData;
/***/ }),
/***/ "./node_modules/lodash/_getMatchData.js":
/*!**********************************************!*\
!*** ./node_modules/lodash/_getMatchData.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isStrictComparable = __webpack_require__(/*! ./_isStrictComparable */ "./node_modules/lodash/_isStrictComparable.js"),
keys = __webpack_require__(/*! ./keys */ "./node_modules/lodash/keys.js");
/**
* Gets the property names, values, and compare flags of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the match data of `object`.
*/
function getMatchData(object) {
var result = keys(object),
length = result.length;
while (length--) {
var key = result[length],
value = object[key];
result[length] = [key, value, isStrictComparable(value)];
}
return result;
}
module.exports = getMatchData;
/***/ }),
/***/ "./node_modules/lodash/_getNative.js":
/*!*******************************************!*\
!*** ./node_modules/lodash/_getNative.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseIsNative = __webpack_require__(/*! ./_baseIsNative */ "./node_modules/lodash/_baseIsNative.js"),
getValue = __webpack_require__(/*! ./_getValue */ "./node_modules/lodash/_getValue.js");
/**
* Gets the native function at `key` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the method to get.
* @returns {*} Returns the function if it's native, else `undefined`.
*/
function getNative(object, key) {
var value = getValue(object, key);
return baseIsNative(value) ? value : undefined;
}
module.exports = getNative;
/***/ }),
/***/ "./node_modules/lodash/_getPrototype.js":
/*!**********************************************!*\
!*** ./node_modules/lodash/_getPrototype.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var overArg = __webpack_require__(/*! ./_overArg */ "./node_modules/lodash/_overArg.js");
/** Built-in value references. */
var getPrototype = overArg(Object.getPrototypeOf, Object);
module.exports = getPrototype;
/***/ }),
/***/ "./node_modules/lodash/_getRawTag.js":
/*!*******************************************!*\
!*** ./node_modules/lodash/_getRawTag.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js");
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/** Built-in value references. */
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
/**
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the raw `toStringTag`.
*/
function getRawTag(value) {
var isOwn = hasOwnProperty.call(value, symToStringTag),
tag = value[symToStringTag];
try {
value[symToStringTag] = undefined;
var unmasked = true;
} catch (e) {}
var result = nativeObjectToString.call(value);
if (unmasked) {
if (isOwn) {
value[symToStringTag] = tag;
} else {
delete value[symToStringTag];
}
}
return result;
}
module.exports = getRawTag;
/***/ }),
/***/ "./node_modules/lodash/_getSymbols.js":
/*!********************************************!*\
!*** ./node_modules/lodash/_getSymbols.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var arrayFilter = __webpack_require__(/*! ./_arrayFilter */ "./node_modules/lodash/_arrayFilter.js"),
stubArray = __webpack_require__(/*! ./stubArray */ "./node_modules/lodash/stubArray.js");
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Built-in value references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetSymbols = Object.getOwnPropertySymbols;
/**
* Creates an array of the own enumerable symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
if (object == null) {
return [];
}
object = Object(object);
return arrayFilter(nativeGetSymbols(object), function(symbol) {
return propertyIsEnumerable.call(object, symbol);
});
};
module.exports = getSymbols;
/***/ }),
/***/ "./node_modules/lodash/_getSymbolsIn.js":
/*!**********************************************!*\
!*** ./node_modules/lodash/_getSymbolsIn.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var arrayPush = __webpack_require__(/*! ./_arrayPush */ "./node_modules/lodash/_arrayPush.js"),
getPrototype = __webpack_require__(/*! ./_getPrototype */ "./node_modules/lodash/_getPrototype.js"),
getSymbols = __webpack_require__(/*! ./_getSymbols */ "./node_modules/lodash/_getSymbols.js"),
stubArray = __webpack_require__(/*! ./stubArray */ "./node_modules/lodash/stubArray.js");
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetSymbols = Object.getOwnPropertySymbols;
/**
* Creates an array of the own and inherited enumerable symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
var result = [];
while (object) {
arrayPush(result, getSymbols(object));
object = getPrototype(object);
}
return result;
};
module.exports = getSymbolsIn;
/***/ }),
/***/ "./node_modules/lodash/_getTag.js":
/*!****************************************!*\
!*** ./node_modules/lodash/_getTag.js ***!
\****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var DataView = __webpack_require__(/*! ./_DataView */ "./node_modules/lodash/_DataView.js"),
Map = __webpack_require__(/*! ./_Map */ "./node_modules/lodash/_Map.js"),
Promise = __webpack_require__(/*! ./_Promise */ "./node_modules/lodash/_Promise.js"),
Set = __webpack_require__(/*! ./_Set */ "./node_modules/lodash/_Set.js"),
WeakMap = __webpack_require__(/*! ./_WeakMap */ "./node_modules/lodash/_WeakMap.js"),
baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"),
toSource = __webpack_require__(/*! ./_toSource */ "./node_modules/lodash/_toSource.js");
/** `Object#toString` result references. */
var mapTag = '[object Map]',
objectTag = '[object Object]',
promiseTag = '[object Promise]',
setTag = '[object Set]',
weakMapTag = '[object WeakMap]';
var dataViewTag = '[object DataView]';
/** Used to detect maps, sets, and weakmaps. */
var dataViewCtorString = toSource(DataView),
mapCtorString = toSource(Map),
promiseCtorString = toSource(Promise),
setCtorString = toSource(Set),
weakMapCtorString = toSource(WeakMap);
/**
* Gets the `toStringTag` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
var getTag = baseGetTag;
// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(Map && getTag(new Map) != mapTag) ||
(Promise && getTag(Promise.resolve()) != promiseTag) ||
(Set && getTag(new Set) != setTag) ||
(WeakMap && getTag(new WeakMap) != weakMapTag)) {
getTag = function(value) {
var result = baseGetTag(value),
Ctor = result == objectTag ? value.constructor : undefined,
ctorString = Ctor ? toSource(Ctor) : '';
if (ctorString) {
switch (ctorString) {
case dataViewCtorString: return dataViewTag;
case mapCtorString: return mapTag;
case promiseCtorString: return promiseTag;
case setCtorString: return setTag;
case weakMapCtorString: return weakMapTag;
}
}
return result;
};
}
module.exports = getTag;
/***/ }),
/***/ "./node_modules/lodash/_getValue.js":
/*!******************************************!*\
!*** ./node_modules/lodash/_getValue.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* Gets the value at `key` of `object`.
*
* @private
* @param {Object} [object] The object to query.
* @param {string} key The key of the property to get.
* @returns {*} Returns the property value.
*/
function getValue(object, key) {
return object == null ? undefined : object[key];
}
module.exports = getValue;
/***/ }),
/***/ "./node_modules/lodash/_hasPath.js":
/*!*****************************************!*\
!*** ./node_modules/lodash/_hasPath.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var castPath = __webpack_require__(/*! ./_castPath */ "./node_modules/lodash/_castPath.js"),
isArguments = __webpack_require__(/*! ./isArguments */ "./node_modules/lodash/isArguments.js"),
isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"),
isIndex = __webpack_require__(/*! ./_isIndex */ "./node_modules/lodash/_isIndex.js"),
isLength = __webpack_require__(/*! ./isLength */ "./node_modules/lodash/isLength.js"),
toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/lodash/_toKey.js");
/**
* Checks if `path` exists on `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @param {Function} hasFunc The function to check properties.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
*/
function hasPath(object, path, hasFunc) {
path = castPath(path, object);
var index = -1,
length = path.length,
result = false;
while (++index < length) {
var key = toKey(path[index]);
if (!(result = object != null && hasFunc(object, key))) {
break;
}
object = object[key];
}
if (result || ++index != length) {
return result;
}
length = object == null ? 0 : object.length;
return !!length && isLength(length) && isIndex(key, length) &&
(isArray(object) || isArguments(object));
}
module.exports = hasPath;
/***/ }),
/***/ "./node_modules/lodash/_hashClear.js":
/*!*******************************************!*\
!*** ./node_modules/lodash/_hashClear.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "./node_modules/lodash/_nativeCreate.js");
/**
* Removes all key-value entries from the hash.
*
* @private
* @name clear
* @memberOf Hash
*/
function hashClear() {
this.__data__ = nativeCreate ? nativeCreate(null) : {};
this.size = 0;
}
module.exports = hashClear;
/***/ }),
/***/ "./node_modules/lodash/_hashDelete.js":
/*!********************************************!*\
!*** ./node_modules/lodash/_hashDelete.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* Removes `key` and its value from the hash.
*
* @private
* @name delete
* @memberOf Hash
* @param {Object} hash The hash to modify.
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function hashDelete(key) {
var result = this.has(key) && delete this.__data__[key];
this.size -= result ? 1 : 0;
return result;
}
module.exports = hashDelete;
/***/ }),
/***/ "./node_modules/lodash/_hashGet.js":
/*!*****************************************!*\
!*** ./node_modules/lodash/_hashGet.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "./node_modules/lodash/_nativeCreate.js");
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Gets the hash value for `key`.
*
* @private
* @name get
* @memberOf Hash
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function hashGet(key) {
var data = this.__data__;
if (nativeCreate) {
var result = data[key];
return result === HASH_UNDEFINED ? undefined : result;
}
return hasOwnProperty.call(data, key) ? data[key] : undefined;
}
module.exports = hashGet;
/***/ }),
/***/ "./node_modules/lodash/_hashHas.js":
/*!*****************************************!*\
!*** ./node_modules/lodash/_hashHas.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "./node_modules/lodash/_nativeCreate.js");
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Checks if a hash value for `key` exists.
*
* @private
* @name has
* @memberOf Hash
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function hashHas(key) {
var data = this.__data__;
return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
}
module.exports = hashHas;
/***/ }),
/***/ "./node_modules/lodash/_hashSet.js":
/*!*****************************************!*\
!*** ./node_modules/lodash/_hashSet.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "./node_modules/lodash/_nativeCreate.js");
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/**
* Sets the hash `key` to `value`.
*
* @private
* @name set
* @memberOf Hash
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the hash instance.
*/
function hashSet(key, value) {
var data = this.__data__;
this.size += this.has(key) ? 0 : 1;
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
return this;
}
module.exports = hashSet;
/***/ }),
/***/ "./node_modules/lodash/_initCloneArray.js":
/*!************************************************!*\
!*** ./node_modules/lodash/_initCloneArray.js ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Initializes an array clone.
*
* @private
* @param {Array} array The array to clone.
* @returns {Array} Returns the initialized clone.
*/
function initCloneArray(array) {
var length = array.length,
result = new array.constructor(length);
// Add properties assigned by `RegExp#exec`.
if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
result.index = array.index;
result.input = array.input;
}
return result;
}
module.exports = initCloneArray;
/***/ }),
/***/ "./node_modules/lodash/_initCloneByTag.js":
/*!************************************************!*\
!*** ./node_modules/lodash/_initCloneByTag.js ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var cloneArrayBuffer = __webpack_require__(/*! ./_cloneArrayBuffer */ "./node_modules/lodash/_cloneArrayBuffer.js"),
cloneDataView = __webpack_require__(/*! ./_cloneDataView */ "./node_modules/lodash/_cloneDataView.js"),
cloneRegExp = __webpack_require__(/*! ./_cloneRegExp */ "./node_modules/lodash/_cloneRegExp.js"),
cloneSymbol = __webpack_require__(/*! ./_cloneSymbol */ "./node_modules/lodash/_cloneSymbol.js"),
cloneTypedArray = __webpack_require__(/*! ./_cloneTypedArray */ "./node_modules/lodash/_cloneTypedArray.js");
/** `Object#toString` result references. */
var boolTag = '[object Boolean]',
dateTag = '[object Date]',
mapTag = '[object Map]',
numberTag = '[object Number]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
symbolTag = '[object Symbol]';
var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]',
float32Tag = '[object Float32Array]',
float64Tag = '[object Float64Array]',
int8Tag = '[object Int8Array]',
int16Tag = '[object Int16Array]',
int32Tag = '[object Int32Array]',
uint8Tag = '[object Uint8Array]',
uint8ClampedTag = '[object Uint8ClampedArray]',
uint16Tag = '[object Uint16Array]',
uint32Tag = '[object Uint32Array]';
/**
* Initializes an object clone based on its `toStringTag`.
*
* **Note:** This function only supports cloning values with tags of
* `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
*
* @private
* @param {Object} object The object to clone.
* @param {string} tag The `toStringTag` of the object to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the initialized clone.
*/
function initCloneByTag(object, tag, isDeep) {
var Ctor = object.constructor;
switch (tag) {
case arrayBufferTag:
return cloneArrayBuffer(object);
case boolTag:
case dateTag:
return new Ctor(+object);
case dataViewTag:
return cloneDataView(object, isDeep);
case float32Tag: case float64Tag:
case int8Tag: case int16Tag: case int32Tag:
case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
return cloneTypedArray(object, isDeep);
case mapTag:
return new Ctor;
case numberTag:
case stringTag:
return new Ctor(object);
case regexpTag:
return cloneRegExp(object);
case setTag:
return new Ctor;
case symbolTag:
return cloneSymbol(object);
}
}
module.exports = initCloneByTag;
/***/ }),
/***/ "./node_modules/lodash/_initCloneObject.js":
/*!*************************************************!*\
!*** ./node_modules/lodash/_initCloneObject.js ***!
\*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseCreate = __webpack_require__(/*! ./_baseCreate */ "./node_modules/lodash/_baseCreate.js"),
getPrototype = __webpack_require__(/*! ./_getPrototype */ "./node_modules/lodash/_getPrototype.js"),
isPrototype = __webpack_require__(/*! ./_isPrototype */ "./node_modules/lodash/_isPrototype.js");
/**
* Initializes an object clone.
*
* @private
* @param {Object} object The object to clone.
* @returns {Object} Returns the initialized clone.
*/
function initCloneObject(object) {
return (typeof object.constructor == 'function' && !isPrototype(object))
? baseCreate(getPrototype(object))
: {};
}
module.exports = initCloneObject;
/***/ }),
/***/ "./node_modules/lodash/_isIndex.js":
/*!*****************************************!*\
!*** ./node_modules/lodash/_isIndex.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/** Used to detect unsigned integer values. */
var reIsUint = /^(?:0|[1-9]\d*)$/;
/**
* Checks if `value` is a valid array-like index.
*
* @private
* @param {*} value The value to check.
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex(value, length) {
var type = typeof value;
length = length == null ? MAX_SAFE_INTEGER : length;
return !!length &&
(type == 'number' ||
(type != 'symbol' && reIsUint.test(value))) &&
(value > -1 && value % 1 == 0 && value < length);
}
module.exports = isIndex;
/***/ }),
/***/ "./node_modules/lodash/_isKey.js":
/*!***************************************!*\
!*** ./node_modules/lodash/_isKey.js ***!
\***************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"),
isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js");
/** Used to match property names within property paths. */
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
reIsPlainProp = /^\w*$/;
/**
* Checks if `value` is a property name and not a property path.
*
* @private
* @param {*} value The value to check.
* @param {Object} [object] The object to query keys on.
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
*/
function isKey(value, object) {
if (isArray(value)) {
return false;
}
var type = typeof value;
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
value == null || isSymbol(value)) {
return true;
}
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
(object != null && value in Object(object));
}
module.exports = isKey;
/***/ }),
/***/ "./node_modules/lodash/_isKeyable.js":
/*!*******************************************!*\
!*** ./node_modules/lodash/_isKeyable.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* Checks if `value` is suitable for use as unique object key.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
*/
function isKeyable(value) {
var type = typeof value;
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
? (value !== '__proto__')
: (value === null);
}
module.exports = isKeyable;
/***/ }),
/***/ "./node_modules/lodash/_isMasked.js":
/*!******************************************!*\
!*** ./node_modules/lodash/_isMasked.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var coreJsData = __webpack_require__(/*! ./_coreJsData */ "./node_modules/lodash/_coreJsData.js");
/** Used to detect methods masquerading as native. */
var maskSrcKey = (function() {
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
return uid ? ('Symbol(src)_1.' + uid) : '';
}());
/**
* Checks if `func` has its source masked.
*
* @private
* @param {Function} func The function to check.
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
*/
function isMasked(func) {
return !!maskSrcKey && (maskSrcKey in func);
}
module.exports = isMasked;
/***/ }),
/***/ "./node_modules/lodash/_isPrototype.js":
/*!*********************************************!*\
!*** ./node_modules/lodash/_isPrototype.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Checks if `value` is likely a prototype object.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
*/
function isPrototype(value) {
var Ctor = value && value.constructor,
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
return value === proto;
}
module.exports = isPrototype;
/***/ }),
/***/ "./node_modules/lodash/_isStrictComparable.js":
/*!****************************************************!*\
!*** ./node_modules/lodash/_isStrictComparable.js ***!
\****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js");
/**
* Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` if suitable for strict
* equality comparisons, else `false`.
*/
function isStrictComparable(value) {
return value === value && !isObject(value);
}
module.exports = isStrictComparable;
/***/ }),
/***/ "./node_modules/lodash/_listCacheClear.js":
/*!************************************************!*\
!*** ./node_modules/lodash/_listCacheClear.js ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* Removes all key-value entries from the list cache.
*
* @private
* @name clear
* @memberOf ListCache
*/
function listCacheClear() {
this.__data__ = [];
this.size = 0;
}
module.exports = listCacheClear;
/***/ }),
/***/ "./node_modules/lodash/_listCacheDelete.js":
/*!*************************************************!*\
!*** ./node_modules/lodash/_listCacheDelete.js ***!
\*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "./node_modules/lodash/_assocIndexOf.js");
/** Used for built-in method references. */
var arrayProto = Array.prototype;
/** Built-in value references. */
var splice = arrayProto.splice;
/**
* Removes `key` and its value from the list cache.
*
* @private
* @name delete
* @memberOf ListCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function listCacheDelete(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
return false;
}
var lastIndex = data.length - 1;
if (index == lastIndex) {
data.pop();
} else {
splice.call(data, index, 1);
}
--this.size;
return true;
}
module.exports = listCacheDelete;
/***/ }),
/***/ "./node_modules/lodash/_listCacheGet.js":
/*!**********************************************!*\
!*** ./node_modules/lodash/_listCacheGet.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "./node_modules/lodash/_assocIndexOf.js");
/**
* Gets the list cache value for `key`.
*
* @private
* @name get
* @memberOf ListCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function listCacheGet(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
return index < 0 ? undefined : data[index][1];
}
module.exports = listCacheGet;
/***/ }),
/***/ "./node_modules/lodash/_listCacheHas.js":
/*!**********************************************!*\
!*** ./node_modules/lodash/_listCacheHas.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "./node_modules/lodash/_assocIndexOf.js");
/**
* Checks if a list cache value for `key` exists.
*
* @private
* @name has
* @memberOf ListCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function listCacheHas(key) {
return assocIndexOf(this.__data__, key) > -1;
}
module.exports = listCacheHas;
/***/ }),
/***/ "./node_modules/lodash/_listCacheSet.js":
/*!**********************************************!*\
!*** ./node_modules/lodash/_listCacheSet.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "./node_modules/lodash/_assocIndexOf.js");
/**
* Sets the list cache `key` to `value`.
*
* @private
* @name set
* @memberOf ListCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the list cache instance.
*/
function listCacheSet(key, value) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
++this.size;
data.push([key, value]);
} else {
data[index][1] = value;
}
return this;
}
module.exports = listCacheSet;
/***/ }),
/***/ "./node_modules/lodash/_mapCacheClear.js":
/*!***********************************************!*\
!*** ./node_modules/lodash/_mapCacheClear.js ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var Hash = __webpack_require__(/*! ./_Hash */ "./node_modules/lodash/_Hash.js"),
ListCache = __webpack_require__(/*! ./_ListCache */ "./node_modules/lodash/_ListCache.js"),
Map = __webpack_require__(/*! ./_Map */ "./node_modules/lodash/_Map.js");
/**
* Removes all key-value entries from the map.
*
* @private
* @name clear
* @memberOf MapCache
*/
function mapCacheClear() {
this.size = 0;
this.__data__ = {
'hash': new Hash,
'map': new (Map || ListCache),
'string': new Hash
};
}
module.exports = mapCacheClear;
/***/ }),
/***/ "./node_modules/lodash/_mapCacheDelete.js":
/*!************************************************!*\
!*** ./node_modules/lodash/_mapCacheDelete.js ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(/*! ./_getMapData */ "./node_modules/lodash/_getMapData.js");
/**
* Removes `key` and its value from the map.
*
* @private
* @name delete
* @memberOf MapCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function mapCacheDelete(key) {
var result = getMapData(this, key)['delete'](key);
this.size -= result ? 1 : 0;
return result;
}
module.exports = mapCacheDelete;
/***/ }),
/***/ "./node_modules/lodash/_mapCacheGet.js":
/*!*********************************************!*\
!*** ./node_modules/lodash/_mapCacheGet.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(/*! ./_getMapData */ "./node_modules/lodash/_getMapData.js");
/**
* Gets the map value for `key`.
*
* @private
* @name get
* @memberOf MapCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function mapCacheGet(key) {
return getMapData(this, key).get(key);
}
module.exports = mapCacheGet;
/***/ }),
/***/ "./node_modules/lodash/_mapCacheHas.js":
/*!*********************************************!*\
!*** ./node_modules/lodash/_mapCacheHas.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(/*! ./_getMapData */ "./node_modules/lodash/_getMapData.js");
/**
* Checks if a map value for `key` exists.
*
* @private
* @name has
* @memberOf MapCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function mapCacheHas(key) {
return getMapData(this, key).has(key);
}
module.exports = mapCacheHas;
/***/ }),
/***/ "./node_modules/lodash/_mapCacheSet.js":
/*!*********************************************!*\
!*** ./node_modules/lodash/_mapCacheSet.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(/*! ./_getMapData */ "./node_modules/lodash/_getMapData.js");
/**
* Sets the map `key` to `value`.
*
* @private
* @name set
* @memberOf MapCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the map cache instance.
*/
function mapCacheSet(key, value) {
var data = getMapData(this, key),
size = data.size;
data.set(key, value);
this.size += data.size == size ? 0 : 1;
return this;
}
module.exports = mapCacheSet;
/***/ }),
/***/ "./node_modules/lodash/_mapToArray.js":
/*!********************************************!*\
!*** ./node_modules/lodash/_mapToArray.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* Converts `map` to its key-value pairs.
*
* @private
* @param {Object} map The map to convert.
* @returns {Array} Returns the key-value pairs.
*/
function mapToArray(map) {
var index = -1,
result = Array(map.size);
map.forEach(function(value, key) {
result[++index] = [key, value];
});
return result;
}
module.exports = mapToArray;
/***/ }),
/***/ "./node_modules/lodash/_matchesStrictComparable.js":
/*!*********************************************************!*\
!*** ./node_modules/lodash/_matchesStrictComparable.js ***!
\*********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* A specialized version of `matchesProperty` for source values suitable
* for strict equality comparisons, i.e. `===`.
*
* @private
* @param {string} key The key of the property to get.
* @param {*} srcValue The value to match.
* @returns {Function} Returns the new spec function.
*/
function matchesStrictComparable(key, srcValue) {
return function(object) {
if (object == null) {
return false;
}
return object[key] === srcValue &&
(srcValue !== undefined || (key in Object(object)));
};
}
module.exports = matchesStrictComparable;
/***/ }),
/***/ "./node_modules/lodash/_memoizeCapped.js":
/*!***********************************************!*\
!*** ./node_modules/lodash/_memoizeCapped.js ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var memoize = __webpack_require__(/*! ./memoize */ "./node_modules/lodash/memoize.js");
/** Used as the maximum memoize cache size. */
var MAX_MEMOIZE_SIZE = 500;
/**
* A specialized version of `_.memoize` which clears the memoized function's
* cache when it exceeds `MAX_MEMOIZE_SIZE`.
*
* @private
* @param {Function} func The function to have its output memoized.
* @returns {Function} Returns the new memoized function.
*/
function memoizeCapped(func) {
var result = memoize(func, function(key) {
if (cache.size === MAX_MEMOIZE_SIZE) {
cache.clear();
}
return key;
});
var cache = result.cache;
return result;
}
module.exports = memoizeCapped;
/***/ }),
/***/ "./node_modules/lodash/_nativeCreate.js":
/*!**********************************************!*\
!*** ./node_modules/lodash/_nativeCreate.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(/*! ./_getNative */ "./node_modules/lodash/_getNative.js");
/* Built-in method references that are verified to be native. */
var nativeCreate = getNative(Object, 'create');
module.exports = nativeCreate;
/***/ }),
/***/ "./node_modules/lodash/_nativeKeys.js":
/*!********************************************!*\
!*** ./node_modules/lodash/_nativeKeys.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var overArg = __webpack_require__(/*! ./_overArg */ "./node_modules/lodash/_overArg.js");
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeKeys = overArg(Object.keys, Object);
module.exports = nativeKeys;
/***/ }),
/***/ "./node_modules/lodash/_nativeKeysIn.js":
/*!**********************************************!*\
!*** ./node_modules/lodash/_nativeKeysIn.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* This function is like
* [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* except that it includes inherited enumerable properties.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function nativeKeysIn(object) {
var result = [];
if (object != null) {
for (var key in Object(object)) {
result.push(key);
}
}
return result;
}
module.exports = nativeKeysIn;
/***/ }),
/***/ "./node_modules/lodash/_nodeUtil.js":
/*!******************************************!*\
!*** ./node_modules/lodash/_nodeUtil.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ "./node_modules/lodash/_freeGlobal.js");
/** Detect free variable `exports`. */
var freeExports = true && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;
/** Detect free variable `process` from Node.js. */
var freeProcess = moduleExports && freeGlobal.process;
/** Used to access faster Node.js helpers. */
var nodeUtil = (function() {
try {
// Use `util.types` for Node.js 10+.
var types = freeModule && freeModule.require && freeModule.require('util').types;
if (types) {
return types;
}
// Legacy `process.binding('util')` for Node.js < 10.
return freeProcess && freeProcess.binding && freeProcess.binding('util');
} catch (e) {}
}());
module.exports = nodeUtil;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
/***/ }),
/***/ "./node_modules/lodash/_objectToString.js":
/*!************************************************!*\
!*** ./node_modules/lodash/_objectToString.js ***!
\************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/**
* Converts `value` to a string using `Object.prototype.toString`.
*
* @private
* @param {*} value The value to convert.
* @returns {string} Returns the converted string.
*/
function objectToString(value) {
return nativeObjectToString.call(value);
}
module.exports = objectToString;
/***/ }),
/***/ "./node_modules/lodash/_overArg.js":
/*!*****************************************!*\
!*** ./node_modules/lodash/_overArg.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* Creates a unary function that invokes `func` with its argument transformed.
*
* @private
* @param {Function} func The function to wrap.
* @param {Function} transform The argument transform.
* @returns {Function} Returns the new function.
*/
function overArg(func, transform) {
return function(arg) {
return func(transform(arg));
};
}
module.exports = overArg;
/***/ }),
/***/ "./node_modules/lodash/_root.js":
/*!**************************************!*\
!*** ./node_modules/lodash/_root.js ***!
\**************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ "./node_modules/lodash/_freeGlobal.js");
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
module.exports = root;
/***/ }),
/***/ "./node_modules/lodash/_setCacheAdd.js":
/*!*********************************************!*\
!*** ./node_modules/lodash/_setCacheAdd.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/**
* Adds `value` to the array cache.
*
* @private
* @name add
* @memberOf SetCache
* @alias push
* @param {*} value The value to cache.
* @returns {Object} Returns the cache instance.
*/
function setCacheAdd(value) {
this.__data__.set(value, HASH_UNDEFINED);
return this;
}
module.exports = setCacheAdd;
/***/ }),
/***/ "./node_modules/lodash/_setCacheHas.js":
/*!*********************************************!*\
!*** ./node_modules/lodash/_setCacheHas.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* Checks if `value` is in the array cache.
*
* @private
* @name has
* @memberOf SetCache
* @param {*} value The value to search for.
* @returns {number} Returns `true` if `value` is found, else `false`.
*/
function setCacheHas(value) {
return this.__data__.has(value);
}
module.exports = setCacheHas;
/***/ }),
/***/ "./node_modules/lodash/_setToArray.js":
/*!********************************************!*\
!*** ./node_modules/lodash/_setToArray.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* Converts `set` to an array of its values.
*
* @private
* @param {Object} set The set to convert.
* @returns {Array} Returns the values.
*/
function setToArray(set) {
var index = -1,
result = Array(set.size);
set.forEach(function(value) {
result[++index] = value;
});
return result;
}
module.exports = setToArray;
/***/ }),
/***/ "./node_modules/lodash/_stackClear.js":
/*!********************************************!*\
!*** ./node_modules/lodash/_stackClear.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var ListCache = __webpack_require__(/*! ./_ListCache */ "./node_modules/lodash/_ListCache.js");
/**
* Removes all key-value entries from the stack.
*
* @private
* @name clear
* @memberOf Stack
*/
function stackClear() {
this.__data__ = new ListCache;
this.size = 0;
}
module.exports = stackClear;
/***/ }),
/***/ "./node_modules/lodash/_stackDelete.js":
/*!*********************************************!*\
!*** ./node_modules/lodash/_stackDelete.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* Removes `key` and its value from the stack.
*
* @private
* @name delete
* @memberOf Stack
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function stackDelete(key) {
var data = this.__data__,
result = data['delete'](key);
this.size = data.size;
return result;
}
module.exports = stackDelete;
/***/ }),
/***/ "./node_modules/lodash/_stackGet.js":
/*!******************************************!*\
!*** ./node_modules/lodash/_stackGet.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* Gets the stack value for `key`.
*
* @private
* @name get
* @memberOf Stack
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function stackGet(key) {
return this.__data__.get(key);
}
module.exports = stackGet;
/***/ }),
/***/ "./node_modules/lodash/_stackHas.js":
/*!******************************************!*\
!*** ./node_modules/lodash/_stackHas.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* Checks if a stack value for `key` exists.
*
* @private
* @name has
* @memberOf Stack
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function stackHas(key) {
return this.__data__.has(key);
}
module.exports = stackHas;
/***/ }),
/***/ "./node_modules/lodash/_stackSet.js":
/*!******************************************!*\
!*** ./node_modules/lodash/_stackSet.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var ListCache = __webpack_require__(/*! ./_ListCache */ "./node_modules/lodash/_ListCache.js"),
Map = __webpack_require__(/*! ./_Map */ "./node_modules/lodash/_Map.js"),
MapCache = __webpack_require__(/*! ./_MapCache */ "./node_modules/lodash/_MapCache.js");
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/**
* Sets the stack `key` to `value`.
*
* @private
* @name set
* @memberOf Stack
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the stack cache instance.
*/
function stackSet(key, value) {
var data = this.__data__;
if (data instanceof ListCache) {
var pairs = data.__data__;
if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
pairs.push([key, value]);
this.size = ++data.size;
return this;
}
data = this.__data__ = new MapCache(pairs);
}
data.set(key, value);
this.size = data.size;
return this;
}
module.exports = stackSet;
/***/ }),
/***/ "./node_modules/lodash/_stringToPath.js":
/*!**********************************************!*\
!*** ./node_modules/lodash/_stringToPath.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var memoizeCapped = __webpack_require__(/*! ./_memoizeCapped */ "./node_modules/lodash/_memoizeCapped.js");
/** Used to match property names within property paths. */
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
/** Used to match backslashes in property paths. */
var reEscapeChar = /\\(\\)?/g;
/**
* Converts `string` to a property path array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the property path array.
*/
var stringToPath = memoizeCapped(function(string) {
var result = [];
if (string.charCodeAt(0) === 46 /* . */) {
result.push('');
}
string.replace(rePropName, function(match, number, quote, subString) {
result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
});
return result;
});
module.exports = stringToPath;
/***/ }),
/***/ "./node_modules/lodash/_toKey.js":
/*!***************************************!*\
!*** ./node_modules/lodash/_toKey.js ***!
\***************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js");
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/**
* Converts `value` to a string key if it's not a string or symbol.
*
* @private
* @param {*} value The value to inspect.
* @returns {string|symbol} Returns the key.
*/
function toKey(value) {
if (typeof value == 'string' || isSymbol(value)) {
return value;
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
module.exports = toKey;
/***/ }),
/***/ "./node_modules/lodash/_toSource.js":
/*!******************************************!*\
!*** ./node_modules/lodash/_toSource.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/** Used for built-in method references. */
var funcProto = Function.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/**
* Converts `func` to its source code.
*
* @private
* @param {Function} func The function to convert.
* @returns {string} Returns the source code.
*/
function toSource(func) {
if (func != null) {
try {
return funcToString.call(func);
} catch (e) {}
try {
return (func + '');
} catch (e) {}
}
return '';
}
module.exports = toSource;
/***/ }),
/***/ "./node_modules/lodash/cloneDeep.js":
/*!******************************************!*\
!*** ./node_modules/lodash/cloneDeep.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseClone = __webpack_require__(/*! ./_baseClone */ "./node_modules/lodash/_baseClone.js");
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1,
CLONE_SYMBOLS_FLAG = 4;
/**
* This method is like `_.clone` except that it recursively clones `value`.
*
* @static
* @memberOf _
* @since 1.0.0
* @category Lang
* @param {*} value The value to recursively clone.
* @returns {*} Returns the deep cloned value.
* @see _.clone
* @example
*
* var objects = [{ 'a': 1 }, { 'b': 2 }];
*
* var deep = _.cloneDeep(objects);
* console.log(deep[0] === objects[0]);
* // => false
*/
function cloneDeep(value) {
return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
}
module.exports = cloneDeep;
/***/ }),
/***/ "./node_modules/lodash/debounce.js":
/*!*****************************************!*\
!*** ./node_modules/lodash/debounce.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"),
now = __webpack_require__(/*! ./now */ "./node_modules/lodash/now.js"),
toNumber = __webpack_require__(/*! ./toNumber */ "./node_modules/lodash/toNumber.js");
/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max,
nativeMin = Math.min;
/**
* Creates a debounced function that delays invoking `func` until after `wait`
* milliseconds have elapsed since the last time the debounced function was
* invoked. The debounced function comes with a `cancel` method to cancel
* delayed `func` invocations and a `flush` method to immediately invoke them.
* Provide `options` to indicate whether `func` should be invoked on the
* leading and/or trailing edge of the `wait` timeout. The `func` is invoked
* with the last arguments provided to the debounced function. Subsequent
* calls to the debounced function return the result of the last `func`
* invocation.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is
* invoked on the trailing edge of the timeout only if the debounced function
* is invoked more than once during the `wait` timeout.
*
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
*
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
* for details over the differences between `_.debounce` and `_.throttle`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to debounce.
* @param {number} [wait=0] The number of milliseconds to delay.
* @param {Object} [options={}] The options object.
* @param {boolean} [options.leading=false]
* Specify invoking on the leading edge of the timeout.
* @param {number} [options.maxWait]
* The maximum time `func` is allowed to be delayed before it's invoked.
* @param {boolean} [options.trailing=true]
* Specify invoking on the trailing edge of the timeout.
* @returns {Function} Returns the new debounced function.
* @example
*
* // Avoid costly calculations while the window size is in flux.
* jQuery(window).on('resize', _.debounce(calculateLayout, 150));
*
* // Invoke `sendMail` when clicked, debouncing subsequent calls.
* jQuery(element).on('click', _.debounce(sendMail, 300, {
* 'leading': true,
* 'trailing': false
* }));
*
* // Ensure `batchLog` is invoked once after 1 second of debounced calls.
* var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
* var source = new EventSource('/stream');
* jQuery(source).on('message', debounced);
*
* // Cancel the trailing debounced invocation.
* jQuery(window).on('popstate', debounced.cancel);
*/
function debounce(func, wait, options) {
var lastArgs,
lastThis,
maxWait,
result,
timerId,
lastCallTime,
lastInvokeTime = 0,
leading = false,
maxing = false,
trailing = true;
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
wait = toNumber(wait) || 0;
if (isObject(options)) {
leading = !!options.leading;
maxing = 'maxWait' in options;
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
trailing = 'trailing' in options ? !!options.trailing : trailing;
}
function invokeFunc(time) {
var args = lastArgs,
thisArg = lastThis;
lastArgs = lastThis = undefined;
lastInvokeTime = time;
result = func.apply(thisArg, args);
return result;
}
function leadingEdge(time) {
// Reset any `maxWait` timer.
lastInvokeTime = time;
// Start the timer for the trailing edge.
timerId = setTimeout(timerExpired, wait);
// Invoke the leading edge.
return leading ? invokeFunc(time) : result;
}
function remainingWait(time) {
var timeSinceLastCall = time - lastCallTime,
timeSinceLastInvoke = time - lastInvokeTime,
timeWaiting = wait - timeSinceLastCall;
return maxing
? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
: timeWaiting;
}
function shouldInvoke(time) {
var timeSinceLastCall = time - lastCallTime,
timeSinceLastInvoke = time - lastInvokeTime;
// Either this is the first call, activity has stopped and we're at the
// trailing edge, the system time has gone backwards and we're treating
// it as the trailing edge, or we've hit the `maxWait` limit.
return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
}
function timerExpired() {
var time = now();
if (shouldInvoke(time)) {
return trailingEdge(time);
}
// Restart the timer.
timerId = setTimeout(timerExpired, remainingWait(time));
}
function trailingEdge(time) {
timerId = undefined;
// Only invoke if we have `lastArgs` which means `func` has been
// debounced at least once.
if (trailing && lastArgs) {
return invokeFunc(time);
}
lastArgs = lastThis = undefined;
return result;
}
function cancel() {
if (timerId !== undefined) {
clearTimeout(timerId);
}
lastInvokeTime = 0;
lastArgs = lastCallTime = lastThis = timerId = undefined;
}
function flush() {
return timerId === undefined ? result : trailingEdge(now());
}
function debounced() {
var time = now(),
isInvoking = shouldInvoke(time);
lastArgs = arguments;
lastThis = this;
lastCallTime = time;
if (isInvoking) {
if (timerId === undefined) {
return leadingEdge(lastCallTime);
}
if (maxing) {
// Handle invocations in a tight loop.
timerId = setTimeout(timerExpired, wait);
return invokeFunc(lastCallTime);
}
}
if (timerId === undefined) {
timerId = setTimeout(timerExpired, wait);
}
return result;
}
debounced.cancel = cancel;
debounced.flush = flush;
return debounced;
}
module.exports = debounce;
/***/ }),
/***/ "./node_modules/lodash/each.js":
/*!*************************************!*\
!*** ./node_modules/lodash/each.js ***!
\*************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(/*! ./forEach */ "./node_modules/lodash/forEach.js");
/***/ }),
/***/ "./node_modules/lodash/eq.js":
/*!***********************************!*\
!*** ./node_modules/lodash/eq.js ***!
\***********************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'a': 1 };
* var other = { 'a': 1 };
*
* _.eq(object, object);
* // => true
*
* _.eq(object, other);
* // => false
*
* _.eq('a', 'a');
* // => true
*
* _.eq('a', Object('a'));
* // => false
*
* _.eq(NaN, NaN);
* // => true
*/
function eq(value, other) {
return value === other || (value !== value && other !== other);
}
module.exports = eq;
/***/ }),
/***/ "./node_modules/lodash/forEach.js":
/*!****************************************!*\
!*** ./node_modules/lodash/forEach.js ***!
\****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var arrayEach = __webpack_require__(/*! ./_arrayEach */ "./node_modules/lodash/_arrayEach.js"),
baseEach = __webpack_require__(/*! ./_baseEach */ "./node_modules/lodash/_baseEach.js"),
castFunction = __webpack_require__(/*! ./_castFunction */ "./node_modules/lodash/_castFunction.js"),
isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js");
/**
* Iterates over elements of `collection` and invokes `iteratee` for each element.
* The iteratee is invoked with three arguments: (value, index|key, collection).
* Iteratee functions may exit iteration early by explicitly returning `false`.
*
* **Note:** As with other "Collections" methods, objects with a "length"
* property are iterated like arrays. To avoid this behavior use `_.forIn`
* or `_.forOwn` for object iteration.
*
* @static
* @memberOf _
* @since 0.1.0
* @alias each
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array|Object} Returns `collection`.
* @see _.forEachRight
* @example
*
* _.forEach([1, 2], function(value) {
* console.log(value);
* });
* // => Logs `1` then `2`.
*
* _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
* console.log(key);
* });
* // => Logs 'a' then 'b' (iteration order is not guaranteed).
*/
function forEach(collection, iteratee) {
var func = isArray(collection) ? arrayEach : baseEach;
return func(collection, castFunction(iteratee));
}
module.exports = forEach;
/***/ }),
/***/ "./node_modules/lodash/forOwn.js":
/*!***************************************!*\
!*** ./node_modules/lodash/forOwn.js ***!
\***************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseForOwn = __webpack_require__(/*! ./_baseForOwn */ "./node_modules/lodash/_baseForOwn.js"),
castFunction = __webpack_require__(/*! ./_castFunction */ "./node_modules/lodash/_castFunction.js");
/**
* Iterates over own enumerable string keyed properties of an object and
* invokes `iteratee` for each property. The iteratee is invoked with three
* arguments: (value, key, object). Iteratee functions may exit iteration
* early by explicitly returning `false`.
*
* @static
* @memberOf _
* @since 0.3.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns `object`.
* @see _.forOwnRight
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.forOwn(new Foo, function(value, key) {
* console.log(key);
* });
* // => Logs 'a' then 'b' (iteration order is not guaranteed).
*/
function forOwn(object, iteratee) {
return object && baseForOwn(object, castFunction(iteratee));
}
module.exports = forOwn;
/***/ }),
/***/ "./node_modules/lodash/get.js":
/*!************************************!*\
!*** ./node_modules/lodash/get.js ***!
\************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseGet = __webpack_require__(/*! ./_baseGet */ "./node_modules/lodash/_baseGet.js");
/**
* Gets the value at `path` of `object`. If the resolved value is
* `undefined`, the `defaultValue` is returned in its place.
*
* @static
* @memberOf _
* @since 3.7.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to get.
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
* @returns {*} Returns the resolved value.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
*
* _.get(object, 'a[0].b.c');
* // => 3
*
* _.get(object, ['a', '0', 'b', 'c']);
* // => 3
*
* _.get(object, 'a.b.c', 'default');
* // => 'default'
*/
function get(object, path, defaultValue) {
var result = object == null ? undefined : baseGet(object, path);
return result === undefined ? defaultValue : result;
}
module.exports = get;
/***/ }),
/***/ "./node_modules/lodash/hasIn.js":
/*!**************************************!*\
!*** ./node_modules/lodash/hasIn.js ***!
\**************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseHasIn = __webpack_require__(/*! ./_baseHasIn */ "./node_modules/lodash/_baseHasIn.js"),
hasPath = __webpack_require__(/*! ./_hasPath */ "./node_modules/lodash/_hasPath.js");
/**
* Checks if `path` is a direct or inherited property of `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
* @example
*
* var object = _.create({ 'a': _.create({ 'b': 2 }) });
*
* _.hasIn(object, 'a');
* // => true
*
* _.hasIn(object, 'a.b');
* // => true
*
* _.hasIn(object, ['a', 'b']);
* // => true
*
* _.hasIn(object, 'b');
* // => false
*/
function hasIn(object, path) {
return object != null && hasPath(object, path, baseHasIn);
}
module.exports = hasIn;
/***/ }),
/***/ "./node_modules/lodash/identity.js":
/*!*****************************************!*\
!*** ./node_modules/lodash/identity.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* This method returns the first argument it receives.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {*} value Any value.
* @returns {*} Returns `value`.
* @example
*
* var object = { 'a': 1 };
*
* console.log(_.identity(object) === object);
* // => true
*/
function identity(value) {
return value;
}
module.exports = identity;
/***/ }),
/***/ "./node_modules/lodash/isArguments.js":
/*!********************************************!*\
!*** ./node_modules/lodash/isArguments.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseIsArguments = __webpack_require__(/*! ./_baseIsArguments */ "./node_modules/lodash/_baseIsArguments.js"),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js");
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Built-in value references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
/**
* Checks if `value` is likely an `arguments` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
* else `false`.
* @example
*
* _.isArguments(function() { return arguments; }());
* // => true
*
* _.isArguments([1, 2, 3]);
* // => false
*/
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
!propertyIsEnumerable.call(value, 'callee');
};
module.exports = isArguments;
/***/ }),
/***/ "./node_modules/lodash/isArray.js":
/*!****************************************!*\
!*** ./node_modules/lodash/isArray.js ***!
\****************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* Checks if `value` is classified as an `Array` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
* @example
*
* _.isArray([1, 2, 3]);
* // => true
*
* _.isArray(document.body.children);
* // => false
*
* _.isArray('abc');
* // => false
*
* _.isArray(_.noop);
* // => false
*/
var isArray = Array.isArray;
module.exports = isArray;
/***/ }),
/***/ "./node_modules/lodash/isArrayLike.js":
/*!********************************************!*\
!*** ./node_modules/lodash/isArrayLike.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isFunction = __webpack_require__(/*! ./isFunction */ "./node_modules/lodash/isFunction.js"),
isLength = __webpack_require__(/*! ./isLength */ "./node_modules/lodash/isLength.js");
/**
* Checks if `value` is array-like. A value is considered array-like if it's
* not a function and has a `value.length` that's an integer greater than or
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
* @example
*
* _.isArrayLike([1, 2, 3]);
* // => true
*
* _.isArrayLike(document.body.children);
* // => true
*
* _.isArrayLike('abc');
* // => true
*
* _.isArrayLike(_.noop);
* // => false
*/
function isArrayLike(value) {
return value != null && isLength(value.length) && !isFunction(value);
}
module.exports = isArrayLike;
/***/ }),
/***/ "./node_modules/lodash/isBuffer.js":
/*!*****************************************!*\
!*** ./node_modules/lodash/isBuffer.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js"),
stubFalse = __webpack_require__(/*! ./stubFalse */ "./node_modules/lodash/stubFalse.js");
/** Detect free variable `exports`. */
var freeExports = true && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;
/** Built-in value references. */
var Buffer = moduleExports ? root.Buffer : undefined;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
/**
* Checks if `value` is a buffer.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
* @example
*
* _.isBuffer(new Buffer(2));
* // => true
*
* _.isBuffer(new Uint8Array(2));
* // => false
*/
var isBuffer = nativeIsBuffer || stubFalse;
module.exports = isBuffer;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
/***/ }),
/***/ "./node_modules/lodash/isFunction.js":
/*!*******************************************!*\
!*** ./node_modules/lodash/isFunction.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"),
isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js");
/** `Object#toString` result references. */
var asyncTag = '[object AsyncFunction]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]',
proxyTag = '[object Proxy]';
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
if (!isObject(value)) {
return false;
}
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 9 which returns 'object' for typed arrays and other constructors.
var tag = baseGetTag(value);
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
}
module.exports = isFunction;
/***/ }),
/***/ "./node_modules/lodash/isLength.js":
/*!*****************************************!*\
!*** ./node_modules/lodash/isLength.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/**
* Checks if `value` is a valid array-like length.
*
* **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* @example
*
* _.isLength(3);
* // => true
*
* _.isLength(Number.MIN_VALUE);
* // => false
*
* _.isLength(Infinity);
* // => false
*
* _.isLength('3');
* // => false
*/
function isLength(value) {
return typeof value == 'number' &&
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
module.exports = isLength;
/***/ }),
/***/ "./node_modules/lodash/isMap.js":
/*!**************************************!*\
!*** ./node_modules/lodash/isMap.js ***!
\**************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseIsMap = __webpack_require__(/*! ./_baseIsMap */ "./node_modules/lodash/_baseIsMap.js"),
baseUnary = __webpack_require__(/*! ./_baseUnary */ "./node_modules/lodash/_baseUnary.js"),
nodeUtil = __webpack_require__(/*! ./_nodeUtil */ "./node_modules/lodash/_nodeUtil.js");
/* Node.js helper references. */
var nodeIsMap = nodeUtil && nodeUtil.isMap;
/**
* Checks if `value` is classified as a `Map` object.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a map, else `false`.
* @example
*
* _.isMap(new Map);
* // => true
*
* _.isMap(new WeakMap);
* // => false
*/
var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
module.exports = isMap;
/***/ }),
/***/ "./node_modules/lodash/isObject.js":
/*!*****************************************!*\
!*** ./node_modules/lodash/isObject.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject(value) {
var type = typeof value;
return value != null && (type == 'object' || type == 'function');
}
module.exports = isObject;
/***/ }),
/***/ "./node_modules/lodash/isObjectLike.js":
/*!*********************************************!*\
!*** ./node_modules/lodash/isObjectLike.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return value != null && typeof value == 'object';
}
module.exports = isObjectLike;
/***/ }),
/***/ "./node_modules/lodash/isPlainObject.js":
/*!**********************************************!*\
!*** ./node_modules/lodash/isPlainObject.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"),
getPrototype = __webpack_require__(/*! ./_getPrototype */ "./node_modules/lodash/_getPrototype.js"),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js");
/** `Object#toString` result references. */
var objectTag = '[object Object]';
/** Used for built-in method references. */
var funcProto = Function.prototype,
objectProto = Object.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Used to infer the `Object` constructor. */
var objectCtorString = funcToString.call(Object);
/**
* Checks if `value` is a plain object, that is, an object created by the
* `Object` constructor or one with a `[[Prototype]]` of `null`.
*
* @static
* @memberOf _
* @since 0.8.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
* @example
*
* function Foo() {
* this.a = 1;
* }
*
* _.isPlainObject(new Foo);
* // => false
*
* _.isPlainObject([1, 2, 3]);
* // => false
*
* _.isPlainObject({ 'x': 0, 'y': 0 });
* // => true
*
* _.isPlainObject(Object.create(null));
* // => true
*/
function isPlainObject(value) {
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
return false;
}
var proto = getPrototype(value);
if (proto === null) {
return true;
}
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
return typeof Ctor == 'function' && Ctor instanceof Ctor &&
funcToString.call(Ctor) == objectCtorString;
}
module.exports = isPlainObject;
/***/ }),
/***/ "./node_modules/lodash/isSet.js":
/*!**************************************!*\
!*** ./node_modules/lodash/isSet.js ***!
\**************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseIsSet = __webpack_require__(/*! ./_baseIsSet */ "./node_modules/lodash/_baseIsSet.js"),
baseUnary = __webpack_require__(/*! ./_baseUnary */ "./node_modules/lodash/_baseUnary.js"),
nodeUtil = __webpack_require__(/*! ./_nodeUtil */ "./node_modules/lodash/_nodeUtil.js");
/* Node.js helper references. */
var nodeIsSet = nodeUtil && nodeUtil.isSet;
/**
* Checks if `value` is classified as a `Set` object.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a set, else `false`.
* @example
*
* _.isSet(new Set);
* // => true
*
* _.isSet(new WeakSet);
* // => false
*/
var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
module.exports = isSet;
/***/ }),
/***/ "./node_modules/lodash/isString.js":
/*!*****************************************!*\
!*** ./node_modules/lodash/isString.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"),
isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js");
/** `Object#toString` result references. */
var stringTag = '[object String]';
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
}
module.exports = isString;
/***/ }),
/***/ "./node_modules/lodash/isSymbol.js":
/*!*****************************************!*\
!*** ./node_modules/lodash/isSymbol.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js");
/** `Object#toString` result references. */
var symbolTag = '[object Symbol]';
/**
* Checks if `value` is classified as a `Symbol` primitive or object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
* @example
*
* _.isSymbol(Symbol.iterator);
* // => true
*
* _.isSymbol('abc');
* // => false
*/
function isSymbol(value) {
return typeof value == 'symbol' ||
(isObjectLike(value) && baseGetTag(value) == symbolTag);
}
module.exports = isSymbol;
/***/ }),
/***/ "./node_modules/lodash/isTypedArray.js":
/*!*********************************************!*\
!*** ./node_modules/lodash/isTypedArray.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseIsTypedArray = __webpack_require__(/*! ./_baseIsTypedArray */ "./node_modules/lodash/_baseIsTypedArray.js"),
baseUnary = __webpack_require__(/*! ./_baseUnary */ "./node_modules/lodash/_baseUnary.js"),
nodeUtil = __webpack_require__(/*! ./_nodeUtil */ "./node_modules/lodash/_nodeUtil.js");
/* Node.js helper references. */
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
/**
* Checks if `value` is classified as a typed array.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
* @example
*
* _.isTypedArray(new Uint8Array);
* // => true
*
* _.isTypedArray([]);
* // => false
*/
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
module.exports = isTypedArray;
/***/ }),
/***/ "./node_modules/lodash/keys.js":
/*!*************************************!*\
!*** ./node_modules/lodash/keys.js ***!
\*************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var arrayLikeKeys = __webpack_require__(/*! ./_arrayLikeKeys */ "./node_modules/lodash/_arrayLikeKeys.js"),
baseKeys = __webpack_require__(/*! ./_baseKeys */ "./node_modules/lodash/_baseKeys.js"),
isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js");
/**
* Creates an array of the own enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.keys(new Foo);
* // => ['a', 'b'] (iteration order is not guaranteed)
*
* _.keys('hi');
* // => ['0', '1']
*/
function keys(object) {
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
}
module.exports = keys;
/***/ }),
/***/ "./node_modules/lodash/keysIn.js":
/*!***************************************!*\
!*** ./node_modules/lodash/keysIn.js ***!
\***************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var arrayLikeKeys = __webpack_require__(/*! ./_arrayLikeKeys */ "./node_modules/lodash/_arrayLikeKeys.js"),
baseKeysIn = __webpack_require__(/*! ./_baseKeysIn */ "./node_modules/lodash/_baseKeysIn.js"),
isArrayLike = __webpack_require__(/*! ./isArrayLike */ "./node_modules/lodash/isArrayLike.js");
/**
* Creates an array of the own and inherited enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.keysIn(new Foo);
* // => ['a', 'b', 'c'] (iteration order is not guaranteed)
*/
function keysIn(object) {
return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
}
module.exports = keysIn;
/***/ }),
/***/ "./node_modules/lodash/map.js":
/*!************************************!*\
!*** ./node_modules/lodash/map.js ***!
\************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"),
baseIteratee = __webpack_require__(/*! ./_baseIteratee */ "./node_modules/lodash/_baseIteratee.js"),
baseMap = __webpack_require__(/*! ./_baseMap */ "./node_modules/lodash/_baseMap.js"),
isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js");
/**
* Creates an array of values by running each element in `collection` thru
* `iteratee`. The iteratee is invoked with three arguments:
* (value, index|key, collection).
*
* Many lodash methods are guarded to work as iteratees for methods like
* `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
*
* The guarded methods are:
* `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
* `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
* `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
* `template`, `trim`, `trimEnd`, `trimStart`, and `words`
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
* @example
*
* function square(n) {
* return n * n;
* }
*
* _.map([4, 8], square);
* // => [16, 64]
*
* _.map({ 'a': 4, 'b': 8 }, square);
* // => [16, 64] (iteration order is not guaranteed)
*
* var users = [
* { 'user': 'barney' },
* { 'user': 'fred' }
* ];
*
* // The `_.property` iteratee shorthand.
* _.map(users, 'user');
* // => ['barney', 'fred']
*/
function map(collection, iteratee) {
var func = isArray(collection) ? arrayMap : baseMap;
return func(collection, baseIteratee(iteratee, 3));
}
module.exports = map;
/***/ }),
/***/ "./node_modules/lodash/memoize.js":
/*!****************************************!*\
!*** ./node_modules/lodash/memoize.js ***!
\****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var MapCache = __webpack_require__(/*! ./_MapCache */ "./node_modules/lodash/_MapCache.js");
/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';
/**
* Creates a function that memoizes the result of `func`. If `resolver` is
* provided, it determines the cache key for storing the result based on the
* arguments provided to the memoized function. By default, the first argument
* provided to the memoized function is used as the map cache key. The `func`
* is invoked with the `this` binding of the memoized function.
*
* **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `clear`, `delete`, `get`, `has`, and `set`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to have its output memoized.
* @param {Function} [resolver] The function to resolve the cache key.
* @returns {Function} Returns the new memoized function.
* @example
*
* var object = { 'a': 1, 'b': 2 };
* var other = { 'c': 3, 'd': 4 };
*
* var values = _.memoize(_.values);
* values(object);
* // => [1, 2]
*
* values(other);
* // => [3, 4]
*
* object.a = 2;
* values(object);
* // => [1, 2]
*
* // Modify the result cache.
* values.cache.set(object, ['a', 'b']);
* values(object);
* // => ['a', 'b']
*
* // Replace `_.memoize.Cache`.
* _.memoize.Cache = WeakMap;
*/
function memoize(func, resolver) {
if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
throw new TypeError(FUNC_ERROR_TEXT);
}
var memoized = function() {
var args = arguments,
key = resolver ? resolver.apply(this, args) : args[0],
cache = memoized.cache;
if (cache.has(key)) {
return cache.get(key);
}
var result = func.apply(this, args);
memoized.cache = cache.set(key, result) || cache;
return result;
};
memoized.cache = new (memoize.Cache || MapCache);
return memoized;
}
// Expose `MapCache`.
memoize.Cache = MapCache;
module.exports = memoize;
/***/ }),
/***/ "./node_modules/lodash/now.js":
/*!************************************!*\
!*** ./node_modules/lodash/now.js ***!
\************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");
/**
* Gets the timestamp of the number of milliseconds that have elapsed since
* the Unix epoch (1 January 1970 00:00:00 UTC).
*
* @static
* @memberOf _
* @since 2.4.0
* @category Date
* @returns {number} Returns the timestamp.
* @example
*
* _.defer(function(stamp) {
* console.log(_.now() - stamp);
* }, _.now());
* // => Logs the number of milliseconds it took for the deferred invocation.
*/
var now = function() {
return root.Date.now();
};
module.exports = now;
/***/ }),
/***/ "./node_modules/lodash/property.js":
/*!*****************************************!*\
!*** ./node_modules/lodash/property.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseProperty = __webpack_require__(/*! ./_baseProperty */ "./node_modules/lodash/_baseProperty.js"),
basePropertyDeep = __webpack_require__(/*! ./_basePropertyDeep */ "./node_modules/lodash/_basePropertyDeep.js"),
isKey = __webpack_require__(/*! ./_isKey */ "./node_modules/lodash/_isKey.js"),
toKey = __webpack_require__(/*! ./_toKey */ "./node_modules/lodash/_toKey.js");
/**
* Creates a function that returns the value at `path` of a given object.
*
* @static
* @memberOf _
* @since 2.4.0
* @category Util
* @param {Array|string} path The path of the property to get.
* @returns {Function} Returns the new accessor function.
* @example
*
* var objects = [
* { 'a': { 'b': 2 } },
* { 'a': { 'b': 1 } }
* ];
*
* _.map(objects, _.property('a.b'));
* // => [2, 1]
*
* _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
* // => [1, 2]
*/
function property(path) {
return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
}
module.exports = property;
/***/ }),
/***/ "./node_modules/lodash/stubArray.js":
/*!******************************************!*\
!*** ./node_modules/lodash/stubArray.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* This method returns a new empty array.
*
* @static
* @memberOf _
* @since 4.13.0
* @category Util
* @returns {Array} Returns the new empty array.
* @example
*
* var arrays = _.times(2, _.stubArray);
*
* console.log(arrays);
* // => [[], []]
*
* console.log(arrays[0] === arrays[1]);
* // => false
*/
function stubArray() {
return [];
}
module.exports = stubArray;
/***/ }),
/***/ "./node_modules/lodash/stubFalse.js":
/*!******************************************!*\
!*** ./node_modules/lodash/stubFalse.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* This method returns `false`.
*
* @static
* @memberOf _
* @since 4.13.0
* @category Util
* @returns {boolean} Returns `false`.
* @example
*
* _.times(2, _.stubFalse);
* // => [false, false]
*/
function stubFalse() {
return false;
}
module.exports = stubFalse;
/***/ }),
/***/ "./node_modules/lodash/throttle.js":
/*!*****************************************!*\
!*** ./node_modules/lodash/throttle.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var debounce = __webpack_require__(/*! ./debounce */ "./node_modules/lodash/debounce.js"),
isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js");
/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';
/**
* Creates a throttled function that only invokes `func` at most once per
* every `wait` milliseconds. The throttled function comes with a `cancel`
* method to cancel delayed `func` invocations and a `flush` method to
* immediately invoke them. Provide `options` to indicate whether `func`
* should be invoked on the leading and/or trailing edge of the `wait`
* timeout. The `func` is invoked with the last arguments provided to the
* throttled function. Subsequent calls to the throttled function return the
* result of the last `func` invocation.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is
* invoked on the trailing edge of the timeout only if the throttled function
* is invoked more than once during the `wait` timeout.
*
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
*
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
* for details over the differences between `_.throttle` and `_.debounce`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to throttle.
* @param {number} [wait=0] The number of milliseconds to throttle invocations to.
* @param {Object} [options={}] The options object.
* @param {boolean} [options.leading=true]
* Specify invoking on the leading edge of the timeout.
* @param {boolean} [options.trailing=true]
* Specify invoking on the trailing edge of the timeout.
* @returns {Function} Returns the new throttled function.
* @example
*
* // Avoid excessively updating the position while scrolling.
* jQuery(window).on('scroll', _.throttle(updatePosition, 100));
*
* // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
* var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
* jQuery(element).on('click', throttled);
*
* // Cancel the trailing throttled invocation.
* jQuery(window).on('popstate', throttled.cancel);
*/
function throttle(func, wait, options) {
var leading = true,
trailing = true;
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
if (isObject(options)) {
leading = 'leading' in options ? !!options.leading : leading;
trailing = 'trailing' in options ? !!options.trailing : trailing;
}
return debounce(func, wait, {
'leading': leading,
'maxWait': wait,
'trailing': trailing
});
}
module.exports = throttle;
/***/ }),
/***/ "./node_modules/lodash/toNumber.js":
/*!*****************************************!*\
!*** ./node_modules/lodash/toNumber.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(/*! ./isObject */ "./node_modules/lodash/isObject.js"),
isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js");
/** Used as references for various `Number` constants. */
var NAN = 0 / 0;
/** Used to match leading and trailing whitespace. */
var reTrim = /^\s+|\s+$/g;
/** Used to detect bad signed hexadecimal string values. */
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
/** Used to detect binary string values. */
var reIsBinary = /^0b[01]+$/i;
/** Used to detect octal string values. */
var reIsOctal = /^0o[0-7]+$/i;
/** Built-in method references without a dependency on `root`. */
var freeParseInt = parseInt;
/**
* Converts `value` to a number.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to process.
* @returns {number} Returns the number.
* @example
*
* _.toNumber(3.2);
* // => 3.2
*
* _.toNumber(Number.MIN_VALUE);
* // => 5e-324
*
* _.toNumber(Infinity);
* // => Infinity
*
* _.toNumber('3.2');
* // => 3.2
*/
function toNumber(value) {
if (typeof value == 'number') {
return value;
}
if (isSymbol(value)) {
return NAN;
}
if (isObject(value)) {
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
value = isObject(other) ? (other + '') : other;
}
if (typeof value != 'string') {
return value === 0 ? value : +value;
}
value = value.replace(reTrim, '');
var isBinary = reIsBinary.test(value);
return (isBinary || reIsOctal.test(value))
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
: (reIsBadHex.test(value) ? NAN : +value);
}
module.exports = toNumber;
/***/ }),
/***/ "./node_modules/lodash/toString.js":
/*!*****************************************!*\
!*** ./node_modules/lodash/toString.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var baseToString = __webpack_require__(/*! ./_baseToString */ "./node_modules/lodash/_baseToString.js");
/**
* Converts `value` to a string. An empty string is returned for `null`
* and `undefined` values. The sign of `-0` is preserved.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {string} Returns the converted string.
* @example
*
* _.toString(null);
* // => ''
*
* _.toString(-0);
* // => '-0'
*
* _.toString([1, 2, 3]);
* // => '1,2,3'
*/
function toString(value) {
return value == null ? '' : baseToString(value);
}
module.exports = toString;
/***/ }),
/***/ "./node_modules/material-colors/dist/colors.es2015.js":
/*!************************************************************!*\
!*** ./node_modules/material-colors/dist/colors.es2015.js ***!
\************************************************************/
/*! exports provided: red, pink, purple, deepPurple, indigo, blue, lightBlue, cyan, teal, green, lightGreen, lime, yellow, amber, orange, deepOrange, brown, grey, blueGrey, darkText, lightText, darkIcons, lightIcons, white, black, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "red", function() { return red; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pink", function() { return pink; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "purple", function() { return purple; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "deepPurple", function() { return deepPurple; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "indigo", function() { return indigo; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "blue", function() { return blue; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lightBlue", function() { return lightBlue; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cyan", function() { return cyan; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "teal", function() { return teal; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "green", function() { return green; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lightGreen", function() { return lightGreen; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lime", function() { return lime; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "yellow", function() { return yellow; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "amber", function() { return amber; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "orange", function() { return orange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "deepOrange", function() { return deepOrange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "brown", function() { return brown; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "grey", function() { return grey; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "blueGrey", function() { return blueGrey; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "darkText", function() { return darkText; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lightText", function() { return lightText; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "darkIcons", function() { return darkIcons; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lightIcons", function() { return lightIcons; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "white", function() { return white; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "black", function() { return black; });
var red = {"50":"#ffebee","100":"#ffcdd2","200":"#ef9a9a","300":"#e57373","400":"#ef5350","500":"#f44336","600":"#e53935","700":"#d32f2f","800":"#c62828","900":"#b71c1c","a100":"#ff8a80","a200":"#ff5252","a400":"#ff1744","a700":"#d50000"};
var pink = {"50":"#fce4ec","100":"#f8bbd0","200":"#f48fb1","300":"#f06292","400":"#ec407a","500":"#e91e63","600":"#d81b60","700":"#c2185b","800":"#ad1457","900":"#880e4f","a100":"#ff80ab","a200":"#ff4081","a400":"#f50057","a700":"#c51162"};
var purple = {"50":"#f3e5f5","100":"#e1bee7","200":"#ce93d8","300":"#ba68c8","400":"#ab47bc","500":"#9c27b0","600":"#8e24aa","700":"#7b1fa2","800":"#6a1b9a","900":"#4a148c","a100":"#ea80fc","a200":"#e040fb","a400":"#d500f9","a700":"#aa00ff"};
var deepPurple = {"50":"#ede7f6","100":"#d1c4e9","200":"#b39ddb","300":"#9575cd","400":"#7e57c2","500":"#673ab7","600":"#5e35b1","700":"#512da8","800":"#4527a0","900":"#311b92","a100":"#b388ff","a200":"#7c4dff","a400":"#651fff","a700":"#6200ea"};
var indigo = {"50":"#e8eaf6","100":"#c5cae9","200":"#9fa8da","300":"#7986cb","400":"#5c6bc0","500":"#3f51b5","600":"#3949ab","700":"#303f9f","800":"#283593","900":"#1a237e","a100":"#8c9eff","a200":"#536dfe","a400":"#3d5afe","a700":"#304ffe"};
var blue = {"50":"#e3f2fd","100":"#bbdefb","200":"#90caf9","300":"#64b5f6","400":"#42a5f5","500":"#2196f3","600":"#1e88e5","700":"#1976d2","800":"#1565c0","900":"#0d47a1","a100":"#82b1ff","a200":"#448aff","a400":"#2979ff","a700":"#2962ff"};
var lightBlue = {"50":"#e1f5fe","100":"#b3e5fc","200":"#81d4fa","300":"#4fc3f7","400":"#29b6f6","500":"#03a9f4","600":"#039be5","700":"#0288d1","800":"#0277bd","900":"#01579b","a100":"#80d8ff","a200":"#40c4ff","a400":"#00b0ff","a700":"#0091ea"};
var cyan = {"50":"#e0f7fa","100":"#b2ebf2","200":"#80deea","300":"#4dd0e1","400":"#26c6da","500":"#00bcd4","600":"#00acc1","700":"#0097a7","800":"#00838f","900":"#006064","a100":"#84ffff","a200":"#18ffff","a400":"#00e5ff","a700":"#00b8d4"};
var teal = {"50":"#e0f2f1","100":"#b2dfdb","200":"#80cbc4","300":"#4db6ac","400":"#26a69a","500":"#009688","600":"#00897b","700":"#00796b","800":"#00695c","900":"#004d40","a100":"#a7ffeb","a200":"#64ffda","a400":"#1de9b6","a700":"#00bfa5"};
var green = {"50":"#e8f5e9","100":"#c8e6c9","200":"#a5d6a7","300":"#81c784","400":"#66bb6a","500":"#4caf50","600":"#43a047","700":"#388e3c","800":"#2e7d32","900":"#1b5e20","a100":"#b9f6ca","a200":"#69f0ae","a400":"#00e676","a700":"#00c853"};
var lightGreen = {"50":"#f1f8e9","100":"#dcedc8","200":"#c5e1a5","300":"#aed581","400":"#9ccc65","500":"#8bc34a","600":"#7cb342","700":"#689f38","800":"#558b2f","900":"#33691e","a100":"#ccff90","a200":"#b2ff59","a400":"#76ff03","a700":"#64dd17"};
var lime = {"50":"#f9fbe7","100":"#f0f4c3","200":"#e6ee9c","300":"#dce775","400":"#d4e157","500":"#cddc39","600":"#c0ca33","700":"#afb42b","800":"#9e9d24","900":"#827717","a100":"#f4ff81","a200":"#eeff41","a400":"#c6ff00","a700":"#aeea00"};
var yellow = {"50":"#fffde7","100":"#fff9c4","200":"#fff59d","300":"#fff176","400":"#ffee58","500":"#ffeb3b","600":"#fdd835","700":"#fbc02d","800":"#f9a825","900":"#f57f17","a100":"#ffff8d","a200":"#ffff00","a400":"#ffea00","a700":"#ffd600"};
var amber = {"50":"#fff8e1","100":"#ffecb3","200":"#ffe082","300":"#ffd54f","400":"#ffca28","500":"#ffc107","600":"#ffb300","700":"#ffa000","800":"#ff8f00","900":"#ff6f00","a100":"#ffe57f","a200":"#ffd740","a400":"#ffc400","a700":"#ffab00"};
var orange = {"50":"#fff3e0","100":"#ffe0b2","200":"#ffcc80","300":"#ffb74d","400":"#ffa726","500":"#ff9800","600":"#fb8c00","700":"#f57c00","800":"#ef6c00","900":"#e65100","a100":"#ffd180","a200":"#ffab40","a400":"#ff9100","a700":"#ff6d00"};
var deepOrange = {"50":"#fbe9e7","100":"#ffccbc","200":"#ffab91","300":"#ff8a65","400":"#ff7043","500":"#ff5722","600":"#f4511e","700":"#e64a19","800":"#d84315","900":"#bf360c","a100":"#ff9e80","a200":"#ff6e40","a400":"#ff3d00","a700":"#dd2c00"};
var brown = {"50":"#efebe9","100":"#d7ccc8","200":"#bcaaa4","300":"#a1887f","400":"#8d6e63","500":"#795548","600":"#6d4c41","700":"#5d4037","800":"#4e342e","900":"#3e2723"};
var grey = {"50":"#fafafa","100":"#f5f5f5","200":"#eeeeee","300":"#e0e0e0","400":"#bdbdbd","500":"#9e9e9e","600":"#757575","700":"#616161","800":"#424242","900":"#212121"};
var blueGrey = {"50":"#eceff1","100":"#cfd8dc","200":"#b0bec5","300":"#90a4ae","400":"#78909c","500":"#607d8b","600":"#546e7a","700":"#455a64","800":"#37474f","900":"#263238"};
var darkText = {"primary":"rgba(0, 0, 0, 0.87)","secondary":"rgba(0, 0, 0, 0.54)","disabled":"rgba(0, 0, 0, 0.38)","dividers":"rgba(0, 0, 0, 0.12)"};
var lightText = {"primary":"rgba(255, 255, 255, 1)","secondary":"rgba(255, 255, 255, 0.7)","disabled":"rgba(255, 255, 255, 0.5)","dividers":"rgba(255, 255, 255, 0.12)"};
var darkIcons = {"active":"rgba(0, 0, 0, 0.54)","inactive":"rgba(0, 0, 0, 0.38)"};
var lightIcons = {"active":"rgba(255, 255, 255, 1)","inactive":"rgba(255, 255, 255, 0.5)"};
var white = "#ffffff";
var black = "#000000";
/* harmony default export */ __webpack_exports__["default"] = ({
red: red,
pink: pink,
purple: purple,
deepPurple: deepPurple,
indigo: indigo,
blue: blue,
lightBlue: lightBlue,
cyan: cyan,
teal: teal,
green: green,
lightGreen: lightGreen,
lime: lime,
yellow: yellow,
amber: amber,
orange: orange,
deepOrange: deepOrange,
brown: brown,
grey: grey,
blueGrey: blueGrey,
darkText: darkText,
lightText: lightText,
darkIcons: darkIcons,
lightIcons: lightIcons,
white: white,
black: black
});
/***/ }),
/***/ "./node_modules/mousetrap/mousetrap.js":
/*!*********************************************!*\
!*** ./node_modules/mousetrap/mousetrap.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_RESULT__;/*global define:false */
/**
* Copyright 2012-2017 Craig Campbell
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Mousetrap is a simple keyboard shortcut library for Javascript with
* no external dependencies
*
* @version 1.6.2
* @url craig.is/killing/mice
*/
(function(window, document, undefined) {
// Check if mousetrap is used inside browser, if not, return
if (!window) {
return;
}
/**
* mapping of special keycodes to their corresponding keys
*
* everything in this dictionary cannot use keypress events
* so it has to be here to map to the correct keycodes for
* keyup/keydown events
*
* @type {Object}
*/
var _MAP = {
8: 'backspace',
9: 'tab',
13: 'enter',
16: 'shift',
17: 'ctrl',
18: 'alt',
20: 'capslock',
27: 'esc',
32: 'space',
33: 'pageup',
34: 'pagedown',
35: 'end',
36: 'home',
37: 'left',
38: 'up',
39: 'right',
40: 'down',
45: 'ins',
46: 'del',
91: 'meta',
93: 'meta',
224: 'meta'
};
/**
* mapping for special characters so they can support
*
* this dictionary is only used incase you want to bind a
* keyup or keydown event to one of these keys
*
* @type {Object}
*/
var _KEYCODE_MAP = {
106: '*',
107: '+',
109: '-',
110: '.',
111 : '/',
186: ';',
187: '=',
188: ',',
189: '-',
190: '.',
191: '/',
192: '`',
219: '[',
220: '\\',
221: ']',
222: '\''
};
/**
* this is a mapping of keys that require shift on a US keypad
* back to the non shift equivelents
*
* this is so you can use keyup events with these keys
*
* note that this will only work reliably on US keyboards
*
* @type {Object}
*/
var _SHIFT_MAP = {
'~': '`',
'!': '1',
'@': '2',
'#': '3',
'$': '4',
'%': '5',
'^': '6',
'&': '7',
'*': '8',
'(': '9',
')': '0',
'_': '-',
'+': '=',
':': ';',
'\"': '\'',
'<': ',',
'>': '.',
'?': '/',
'|': '\\'
};
/**
* this is a list of special strings you can use to map
* to modifier keys when you specify your keyboard shortcuts
*
* @type {Object}
*/
var _SPECIAL_ALIASES = {
'option': 'alt',
'command': 'meta',
'return': 'enter',
'escape': 'esc',
'plus': '+',
'mod': /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? 'meta' : 'ctrl'
};
/**
* variable to store the flipped version of _MAP from above
* needed to check if we should use keypress or not when no action
* is specified
*
* @type {Object|undefined}
*/
var _REVERSE_MAP;
/**
* loop through the f keys, f1 to f19 and add them to the map
* programatically
*/
for (var i = 1; i < 20; ++i) {
_MAP[111 + i] = 'f' + i;
}
/**
* loop through to map numbers on the numeric keypad
*/
for (i = 0; i <= 9; ++i) {
// This needs to use a string cause otherwise since 0 is falsey
// mousetrap will never fire for numpad 0 pressed as part of a keydown
// event.
//
// @see https://github.com/ccampbell/mousetrap/pull/258
_MAP[i + 96] = i.toString();
}
/**
* cross browser add event method
*
* @param {Element|HTMLDocument} object
* @param {string} type
* @param {Function} callback
* @returns void
*/
function _addEvent(object, type, callback) {
if (object.addEventListener) {
object.addEventListener(type, callback, false);
return;
}
object.attachEvent('on' + type, callback);
}
/**
* takes the event and returns the key character
*
* @param {Event} e
* @return {string}
*/
function _characterFromEvent(e) {
// for keypress events we should return the character as is
if (e.type == 'keypress') {
var character = String.fromCharCode(e.which);
// if the shift key is not pressed then it is safe to assume
// that we want the character to be lowercase. this means if
// you accidentally have caps lock on then your key bindings
// will continue to work
//
// the only side effect that might not be desired is if you
// bind something like 'A' cause you want to trigger an
// event when capital A is pressed caps lock will no longer
// trigger the event. shift+a will though.
if (!e.shiftKey) {
character = character.toLowerCase();
}
return character;
}
// for non keypress events the special maps are needed
if (_MAP[e.which]) {
return _MAP[e.which];
}
if (_KEYCODE_MAP[e.which]) {
return _KEYCODE_MAP[e.which];
}
// if it is not in the special map
// with keydown and keyup events the character seems to always
// come in as an uppercase character whether you are pressing shift
// or not. we should make sure it is always lowercase for comparisons
return String.fromCharCode(e.which).toLowerCase();
}
/**
* checks if two arrays are equal
*
* @param {Array} modifiers1
* @param {Array} modifiers2
* @returns {boolean}
*/
function _modifiersMatch(modifiers1, modifiers2) {
return modifiers1.sort().join(',') === modifiers2.sort().join(',');
}
/**
* takes a key event and figures out what the modifiers are
*
* @param {Event} e
* @returns {Array}
*/
function _eventModifiers(e) {
var modifiers = [];
if (e.shiftKey) {
modifiers.push('shift');
}
if (e.altKey) {
modifiers.push('alt');
}
if (e.ctrlKey) {
modifiers.push('ctrl');
}
if (e.metaKey) {
modifiers.push('meta');
}
return modifiers;
}
/**
* prevents default for this event
*
* @param {Event} e
* @returns void
*/
function _preventDefault(e) {
if (e.preventDefault) {
e.preventDefault();
return;
}
e.returnValue = false;
}
/**
* stops propogation for this event
*
* @param {Event} e
* @returns void
*/
function _stopPropagation(e) {
if (e.stopPropagation) {
e.stopPropagation();
return;
}
e.cancelBubble = true;
}
/**
* determines if the keycode specified is a modifier key or not
*
* @param {string} key
* @returns {boolean}
*/
function _isModifier(key) {
return key == 'shift' || key == 'ctrl' || key == 'alt' || key == 'meta';
}
/**
* reverses the map lookup so that we can look for specific keys
* to see what can and can't use keypress
*
* @return {Object}
*/
function _getReverseMap() {
if (!_REVERSE_MAP) {
_REVERSE_MAP = {};
for (var key in _MAP) {
// pull out the numeric keypad from here cause keypress should
// be able to detect the keys from the character
if (key > 95 && key < 112) {
continue;
}
if (_MAP.hasOwnProperty(key)) {
_REVERSE_MAP[_MAP[key]] = key;
}
}
}
return _REVERSE_MAP;
}
/**
* picks the best action based on the key combination
*
* @param {string} key - character for key
* @param {Array} modifiers
* @param {string=} action passed in
*/
function _pickBestAction(key, modifiers, action) {
// if no action was picked in we should try to pick the one
// that we think would work best for this key
if (!action) {
action = _getReverseMap()[key] ? 'keydown' : 'keypress';
}
// modifier keys don't work as expected with keypress,
// switch to keydown
if (action == 'keypress' && modifiers.length) {
action = 'keydown';
}
return action;
}
/**
* Converts from a string key combination to an array
*
* @param {string} combination like "command+shift+l"
* @return {Array}
*/
function _keysFromString(combination) {
if (combination === '+') {
return ['+'];
}
combination = combination.replace(/\+{2}/g, '+plus');
return combination.split('+');
}
/**
* Gets info for a specific key combination
*
* @param {string} combination key combination ("command+s" or "a" or "*")
* @param {string=} action
* @returns {Object}
*/
function _getKeyInfo(combination, action) {
var keys;
var key;
var i;
var modifiers = [];
// take the keys from this pattern and figure out what the actual
// pattern is all about
keys = _keysFromString(combination);
for (i = 0; i < keys.length; ++i) {
key = keys[i];
// normalize key names
if (_SPECIAL_ALIASES[key]) {
key = _SPECIAL_ALIASES[key];
}
// if this is not a keypress event then we should
// be smart about using shift keys
// this will only work for US keyboards however
if (action && action != 'keypress' && _SHIFT_MAP[key]) {
key = _SHIFT_MAP[key];
modifiers.push('shift');
}
// if this key is a modifier then add it to the list of modifiers
if (_isModifier(key)) {
modifiers.push(key);
}
}
// depending on what the key combination is
// we will try to pick the best event for it
action = _pickBestAction(key, modifiers, action);
return {
key: key,
modifiers: modifiers,
action: action
};
}
function _belongsTo(element, ancestor) {
if (element === null || element === document) {
return false;
}
if (element === ancestor) {
return true;
}
return _belongsTo(element.parentNode, ancestor);
}
function Mousetrap(targetElement) {
var self = this;
targetElement = targetElement || document;
if (!(self instanceof Mousetrap)) {
return new Mousetrap(targetElement);
}
/**
* element to attach key events to
*
* @type {Element}
*/
self.target = targetElement;
/**
* a list of all the callbacks setup via Mousetrap.bind()
*
* @type {Object}
*/
self._callbacks = {};
/**
* direct map of string combinations to callbacks used for trigger()
*
* @type {Object}
*/
self._directMap = {};
/**
* keeps track of what level each sequence is at since multiple
* sequences can start out with the same sequence
*
* @type {Object}
*/
var _sequenceLevels = {};
/**
* variable to store the setTimeout call
*
* @type {null|number}
*/
var _resetTimer;
/**
* temporary state where we will ignore the next keyup
*
* @type {boolean|string}
*/
var _ignoreNextKeyup = false;
/**
* temporary state where we will ignore the next keypress
*
* @type {boolean}
*/
var _ignoreNextKeypress = false;
/**
* are we currently inside of a sequence?
* type of action ("keyup" or "keydown" or "keypress") or false
*
* @type {boolean|string}
*/
var _nextExpectedAction = false;
/**
* resets all sequence counters except for the ones passed in
*
* @param {Object} doNotReset
* @returns void
*/
function _resetSequences(doNotReset) {
doNotReset = doNotReset || {};
var activeSequences = false,
key;
for (key in _sequenceLevels) {
if (doNotReset[key]) {
activeSequences = true;
continue;
}
_sequenceLevels[key] = 0;
}
if (!activeSequences) {
_nextExpectedAction = false;
}
}
/**
* finds all callbacks that match based on the keycode, modifiers,
* and action
*
* @param {string} character
* @param {Array} modifiers
* @param {Event|Object} e
* @param {string=} sequenceName - name of the sequence we are looking for
* @param {string=} combination
* @param {number=} level
* @returns {Array}
*/
function _getMatches(character, modifiers, e, sequenceName, combination, level) {
var i;
var callback;
var matches = [];
var action = e.type;
// if there are no events related to this keycode
if (!self._callbacks[character]) {
return [];
}
// if a modifier key is coming up on its own we should allow it
if (action == 'keyup' && _isModifier(character)) {
modifiers = [character];
}
// loop through all callbacks for the key that was pressed
// and see if any of them match
for (i = 0; i < self._callbacks[character].length; ++i) {
callback = self._callbacks[character][i];
// if a sequence name is not specified, but this is a sequence at
// the wrong level then move onto the next match
if (!sequenceName && callback.seq && _sequenceLevels[callback.seq] != callback.level) {
continue;
}
// if the action we are looking for doesn't match the action we got
// then we should keep going
if (action != callback.action) {
continue;
}
// if this is a keypress event and the meta key and control key
// are not pressed that means that we need to only look at the
// character, otherwise check the modifiers as well
//
// chrome will not fire a keypress if meta or control is down
// safari will fire a keypress if meta or meta+shift is down
// firefox will fire a keypress if meta or control is down
if ((action == 'keypress' && !e.metaKey && !e.ctrlKey) || _modifiersMatch(modifiers, callback.modifiers)) {
// when you bind a combination or sequence a second time it
// should overwrite the first one. if a sequenceName or
// combination is specified in this call it does just that
//
// @todo make deleting its own method?
var deleteCombo = !sequenceName && callback.combo == combination;
var deleteSequence = sequenceName && callback.seq == sequenceName && callback.level == level;
if (deleteCombo || deleteSequence) {
self._callbacks[character].splice(i, 1);
}
matches.push(callback);
}
}
return matches;
}
/**
* actually calls the callback function
*
* if your callback function returns false this will use the jquery
* convention - prevent default and stop propogation on the event
*
* @param {Function} callback
* @param {Event} e
* @returns void
*/
function _fireCallback(callback, e, combo, sequence) {
// if this event should not happen stop here
if (self.stopCallback(e, e.target || e.srcElement, combo, sequence)) {
return;
}
if (callback(e, combo) === false) {
_preventDefault(e);
_stopPropagation(e);
}
}
/**
* handles a character key event
*
* @param {string} character
* @param {Array} modifiers
* @param {Event} e
* @returns void
*/
self._handleKey = function(character, modifiers, e) {
var callbacks = _getMatches(character, modifiers, e);
var i;
var doNotReset = {};
var maxLevel = 0;
var processedSequenceCallback = false;
// Calculate the maxLevel for sequences so we can only execute the longest callback sequence
for (i = 0; i < callbacks.length; ++i) {
if (callbacks[i].seq) {
maxLevel = Math.max(maxLevel, callbacks[i].level);
}
}
// loop through matching callbacks for this key event
for (i = 0; i < callbacks.length; ++i) {
// fire for all sequence callbacks
// this is because if for example you have multiple sequences
// bound such as "g i" and "g t" they both need to fire the
// callback for matching g cause otherwise you can only ever
// match the first one
if (callbacks[i].seq) {
// only fire callbacks for the maxLevel to prevent
// subsequences from also firing
//
// for example 'a option b' should not cause 'option b' to fire
// even though 'option b' is part of the other sequence
//
// any sequences that do not match here will be discarded
// below by the _resetSequences call
if (callbacks[i].level != maxLevel) {
continue;
}
processedSequenceCallback = true;
// keep a list of which sequences were matches for later
doNotReset[callbacks[i].seq] = 1;
_fireCallback(callbacks[i].callback, e, callbacks[i].combo, callbacks[i].seq);
continue;
}
// if there were no sequence matches but we are still here
// that means this is a regular match so we should fire that
if (!processedSequenceCallback) {
_fireCallback(callbacks[i].callback, e, callbacks[i].combo);
}
}
// if the key you pressed matches the type of sequence without
// being a modifier (ie "keyup" or "keypress") then we should
// reset all sequences that were not matched by this event
//
// this is so, for example, if you have the sequence "h a t" and you
// type "h e a r t" it does not match. in this case the "e" will
// cause the sequence to reset
//
// modifier keys are ignored because you can have a sequence
// that contains modifiers such as "enter ctrl+space" and in most
// cases the modifier key will be pressed before the next key
//
// also if you have a sequence such as "ctrl+b a" then pressing the
// "b" key will trigger a "keypress" and a "keydown"
//
// the "keydown" is expected when there is a modifier, but the
// "keypress" ends up matching the _nextExpectedAction since it occurs
// after and that causes the sequence to reset
//
// we ignore keypresses in a sequence that directly follow a keydown
// for the same character
var ignoreThisKeypress = e.type == 'keypress' && _ignoreNextKeypress;
if (e.type == _nextExpectedAction && !_isModifier(character) && !ignoreThisKeypress) {
_resetSequences(doNotReset);
}
_ignoreNextKeypress = processedSequenceCallback && e.type == 'keydown';
};
/**
* handles a keydown event
*
* @param {Event} e
* @returns void
*/
function _handleKeyEvent(e) {
// normalize e.which for key events
// @see http://stackoverflow.com/questions/4285627/javascript-keycode-vs-charcode-utter-confusion
if (typeof e.which !== 'number') {
e.which = e.keyCode;
}
var character = _characterFromEvent(e);
// no character found then stop
if (!character) {
return;
}
// need to use === for the character check because the character can be 0
if (e.type == 'keyup' && _ignoreNextKeyup === character) {
_ignoreNextKeyup = false;
return;
}
self.handleKey(character, _eventModifiers(e), e);
}
/**
* called to set a 1 second timeout on the specified sequence
*
* this is so after each key press in the sequence you have 1 second
* to press the next key before you have to start over
*
* @returns void
*/
function _resetSequenceTimer() {
clearTimeout(_resetTimer);
_resetTimer = setTimeout(_resetSequences, 1000);
}
/**
* binds a key sequence to an event
*
* @param {string} combo - combo specified in bind call
* @param {Array} keys
* @param {Function} callback
* @param {string=} action
* @returns void
*/
function _bindSequence(combo, keys, callback, action) {
// start off by adding a sequence level record for this combination
// and setting the level to 0
_sequenceLevels[combo] = 0;
/**
* callback to increase the sequence level for this sequence and reset
* all other sequences that were active
*
* @param {string} nextAction
* @returns {Function}
*/
function _increaseSequence(nextAction) {
return function() {
_nextExpectedAction = nextAction;
++_sequenceLevels[combo];
_resetSequenceTimer();
};
}
/**
* wraps the specified callback inside of another function in order
* to reset all sequence counters as soon as this sequence is done
*
* @param {Event} e
* @returns void
*/
function _callbackAndReset(e) {
_fireCallback(callback, e, combo);
// we should ignore the next key up if the action is key down
// or keypress. this is so if you finish a sequence and
// release the key the final key will not trigger a keyup
if (action !== 'keyup') {
_ignoreNextKeyup = _characterFromEvent(e);
}
// weird race condition if a sequence ends with the key
// another sequence begins with
setTimeout(_resetSequences, 10);
}
// loop through keys one at a time and bind the appropriate callback
// function. for any key leading up to the final one it should
// increase the sequence. after the final, it should reset all sequences
//
// if an action is specified in the original bind call then that will
// be used throughout. otherwise we will pass the action that the
// next key in the sequence should match. this allows a sequence
// to mix and match keypress and keydown events depending on which
// ones are better suited to the key provided
for (var i = 0; i < keys.length; ++i) {
var isFinal = i + 1 === keys.length;
var wrappedCallback = isFinal ? _callbackAndReset : _increaseSequence(action || _getKeyInfo(keys[i + 1]).action);
_bindSingle(keys[i], wrappedCallback, action, combo, i);
}
}
/**
* binds a single keyboard combination
*
* @param {string} combination
* @param {Function} callback
* @param {string=} action
* @param {string=} sequenceName - name of sequence if part of sequence
* @param {number=} level - what part of the sequence the command is
* @returns void
*/
function _bindSingle(combination, callback, action, sequenceName, level) {
// store a direct mapped reference for use with Mousetrap.trigger
self._directMap[combination + ':' + action] = callback;
// make sure multiple spaces in a row become a single space
combination = combination.replace(/\s+/g, ' ');
var sequence = combination.split(' ');
var info;
// if this pattern is a sequence of keys then run through this method
// to reprocess each pattern one key at a time
if (sequence.length > 1) {
_bindSequence(combination, sequence, callback, action);
return;
}
info = _getKeyInfo(combination, action);
// make sure to initialize array if this is the first time
// a callback is added for this key
self._callbacks[info.key] = self._callbacks[info.key] || [];
// remove an existing match if there is one
_getMatches(info.key, info.modifiers, {type: info.action}, sequenceName, combination, level);
// add this call back to the array
// if it is a sequence put it at the beginning
// if not put it at the end
//
// this is important because the way these are processed expects
// the sequence ones to come first
self._callbacks[info.key][sequenceName ? 'unshift' : 'push']({
callback: callback,
modifiers: info.modifiers,
action: info.action,
seq: sequenceName,
level: level,
combo: combination
});
}
/**
* binds multiple combinations to the same callback
*
* @param {Array} combinations
* @param {Function} callback
* @param {string|undefined} action
* @returns void
*/
self._bindMultiple = function(combinations, callback, action) {
for (var i = 0; i < combinations.length; ++i) {
_bindSingle(combinations[i], callback, action);
}
};
// start!
_addEvent(targetElement, 'keypress', _handleKeyEvent);
_addEvent(targetElement, 'keydown', _handleKeyEvent);
_addEvent(targetElement, 'keyup', _handleKeyEvent);
}
/**
* binds an event to mousetrap
*
* can be a single key, a combination of keys separated with +,
* an array of keys, or a sequence of keys separated by spaces
*
* be sure to list the modifier keys first to make sure that the
* correct key ends up getting bound (the last key in the pattern)
*
* @param {string|Array} keys
* @param {Function} callback
* @param {string=} action - 'keypress', 'keydown', or 'keyup'
* @returns void
*/
Mousetrap.prototype.bind = function(keys, callback, action) {
var self = this;
keys = keys instanceof Array ? keys : [keys];
self._bindMultiple.call(self, keys, callback, action);
return self;
};
/**
* unbinds an event to mousetrap
*
* the unbinding sets the callback function of the specified key combo
* to an empty function and deletes the corresponding key in the
* _directMap dict.
*
* TODO: actually remove this from the _callbacks dictionary instead
* of binding an empty function
*
* the keycombo+action has to be exactly the same as
* it was defined in the bind method
*
* @param {string|Array} keys
* @param {string} action
* @returns void
*/
Mousetrap.prototype.unbind = function(keys, action) {
var self = this;
return self.bind.call(self, keys, function() {}, action);
};
/**
* triggers an event that has already been bound
*
* @param {string} keys
* @param {string=} action
* @returns void
*/
Mousetrap.prototype.trigger = function(keys, action) {
var self = this;
if (self._directMap[keys + ':' + action]) {
self._directMap[keys + ':' + action]({}, keys);
}
return self;
};
/**
* resets the library back to its initial state. this is useful
* if you want to clear out the current keyboard shortcuts and bind
* new ones - for example if you switch to another page
*
* @returns void
*/
Mousetrap.prototype.reset = function() {
var self = this;
self._callbacks = {};
self._directMap = {};
return self;
};
/**
* should we stop this event before firing off callbacks
*
* @param {Event} e
* @param {Element} element
* @return {boolean}
*/
Mousetrap.prototype.stopCallback = function(e, element) {
var self = this;
// if the element has the class "mousetrap" then no need to stop
if ((' ' + element.className + ' ').indexOf(' mousetrap ') > -1) {
return false;
}
if (_belongsTo(element, self.target)) {
return false;
}
// stop for input, select, and textarea
return element.tagName == 'INPUT' || element.tagName == 'SELECT' || element.tagName == 'TEXTAREA' || element.isContentEditable;
};
/**
* exposes _handleKey publicly so it can be overwritten by extensions
*/
Mousetrap.prototype.handleKey = function() {
var self = this;
return self._handleKey.apply(self, arguments);
};
/**
* allow custom key mappings
*/
Mousetrap.addKeycodes = function(object) {
for (var key in object) {
if (object.hasOwnProperty(key)) {
_MAP[key] = object[key];
}
}
_REVERSE_MAP = null;
};
/**
* Init the global mousetrap functions
*
* This method is needed to allow the global mousetrap functions to work
* now that mousetrap is a constructor function.
*/
Mousetrap.init = function() {
var documentMousetrap = Mousetrap(document);
for (var method in documentMousetrap) {
if (method.charAt(0) !== '_') {
Mousetrap[method] = (function(method) {
return function() {
return documentMousetrap[method].apply(documentMousetrap, arguments);
};
} (method));
}
}
};
Mousetrap.init();
// expose mousetrap to the global object
window.Mousetrap = Mousetrap;
// expose as a common js module
if ( true && module.exports) {
module.exports = Mousetrap;
}
// expose mousetrap as an AMD module
if (true) {
!(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
return Mousetrap;
}).call(exports, __webpack_require__, exports, module),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
}
}) (typeof window !== 'undefined' ? window : null, typeof window !== 'undefined' ? document : null);
/***/ }),
/***/ "./node_modules/mousetrap/plugins/global-bind/mousetrap-global-bind.js":
/*!*****************************************************************************!*\
!*** ./node_modules/mousetrap/plugins/global-bind/mousetrap-global-bind.js ***!
\*****************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* adds a bindGlobal method to Mousetrap that allows you to
* bind specific keyboard shortcuts that will still work
* inside a text input field
*
* usage:
* Mousetrap.bindGlobal('ctrl+s', _saveChanges);
*/
/* global Mousetrap:true */
(function(Mousetrap) {
var _globalCallbacks = {};
var _originalStopCallback = Mousetrap.prototype.stopCallback;
Mousetrap.prototype.stopCallback = function(e, element, combo, sequence) {
var self = this;
if (self.paused) {
return true;
}
if (_globalCallbacks[combo] || _globalCallbacks[sequence]) {
return false;
}
return _originalStopCallback.call(self, e, element, combo);
};
Mousetrap.prototype.bindGlobal = function(keys, callback, action) {
var self = this;
self.bind(keys, callback, action);
if (keys instanceof Array) {
for (var i = 0; i < keys.length; i++) {
_globalCallbacks[keys[i]] = true;
}
return;
}
_globalCallbacks[keys] = true;
};
Mousetrap.init();
}) (Mousetrap);
/***/ }),
/***/ "./node_modules/object-assign/index.js":
/*!*********************************************!*\
!*** ./node_modules/object-assign/index.js ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
/* eslint-disable no-unused-vars */
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
function toObject(val) {
if (val === null || val === undefined) {
throw new TypeError('Object.assign cannot be called with null or undefined');
}
return Object(val);
}
function shouldUseNative() {
try {
if (!Object.assign) {
return false;
}
// Detect buggy property enumeration order in older V8 versions.
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
test1[5] = 'de';
if (Object.getOwnPropertyNames(test1)[0] === '5') {
return false;
}
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test2 = {};
for (var i = 0; i < 10; i++) {
test2['_' + String.fromCharCode(i)] = i;
}
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
return test2[n];
});
if (order2.join('') !== '0123456789') {
return false;
}
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test3 = {};
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
test3[letter] = letter;
});
if (Object.keys(Object.assign({}, test3)).join('') !==
'abcdefghijklmnopqrst') {
return false;
}
return true;
} catch (err) {
// We don't expect any of the above to throw, but better to be safe.
return false;
}
}
module.exports = shouldUseNative() ? Object.assign : function (target, source) {
var from;
var to = toObject(target);
var symbols;
for (var s = 1; s < arguments.length; s++) {
from = Object(arguments[s]);
for (var key in from) {
if (hasOwnProperty.call(from, key)) {
to[key] = from[key];
}
}
if (getOwnPropertySymbols) {
symbols = getOwnPropertySymbols(from);
for (var i = 0; i < symbols.length; i++) {
if (propIsEnumerable.call(from, symbols[i])) {
to[symbols[i]] = from[symbols[i]];
}
}
}
}
return to;
};
/***/ }),
/***/ "./node_modules/popper.js/dist/esm/popper.js":
/*!***************************************************!*\
!*** ./node_modules/popper.js/dist/esm/popper.js ***!
\***************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* WEBPACK VAR INJECTION */(function(global) {/**!
* @fileOverview Kickass library to create and place poppers near their reference elements.
* @version 1.14.6
* @license
* Copyright (c) 2016 Federico Zivolo and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
var timeoutDuration = 0;
for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
timeoutDuration = 1;
break;
}
}
function microtaskDebounce(fn) {
var called = false;
return function () {
if (called) {
return;
}
called = true;
window.Promise.resolve().then(function () {
called = false;
fn();
});
};
}
function taskDebounce(fn) {
var scheduled = false;
return function () {
if (!scheduled) {
scheduled = true;
setTimeout(function () {
scheduled = false;
fn();
}, timeoutDuration);
}
};
}
var supportsMicroTasks = isBrowser && window.Promise;
/**
* Create a debounced version of a method, that's asynchronously deferred
* but called in the minimum time possible.
*
* @method
* @memberof Popper.Utils
* @argument {Function} fn
* @returns {Function}
*/
var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;
/**
* Check if the given variable is a function
* @method
* @memberof Popper.Utils
* @argument {Any} functionToCheck - variable to check
* @returns {Boolean} answer to: is a function?
*/
function isFunction(functionToCheck) {
var getType = {};
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
}
/**
* Get CSS computed property of the given element
* @method
* @memberof Popper.Utils
* @argument {Eement} element
* @argument {String} property
*/
function getStyleComputedProperty(element, property) {
if (element.nodeType !== 1) {
return [];
}
// NOTE: 1 DOM access here
var window = element.ownerDocument.defaultView;
var css = window.getComputedStyle(element, null);
return property ? css[property] : css;
}
/**
* Returns the parentNode or the host of the element
* @method
* @memberof Popper.Utils
* @argument {Element} element
* @returns {Element} parent
*/
function getParentNode(element) {
if (element.nodeName === 'HTML') {
return element;
}
return element.parentNode || element.host;
}
/**
* Returns the scrolling parent of the given element
* @method
* @memberof Popper.Utils
* @argument {Element} element
* @returns {Element} scroll parent
*/
function getScrollParent(element) {
// Return body, `getScroll` will take care to get the correct `scrollTop` from it
if (!element) {
return document.body;
}
switch (element.nodeName) {
case 'HTML':
case 'BODY':
return element.ownerDocument.body;
case '#document':
return element.body;
}
// Firefox want us to check `-x` and `-y` variations as well
var _getStyleComputedProp = getStyleComputedProperty(element),
overflow = _getStyleComputedProp.overflow,
overflowX = _getStyleComputedProp.overflowX,
overflowY = _getStyleComputedProp.overflowY;
if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
return element;
}
return getScrollParent(getParentNode(element));
}
var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);
var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);
/**
* Determines if the browser is Internet Explorer
* @method
* @memberof Popper.Utils
* @param {Number} version to check
* @returns {Boolean} isIE
*/
function isIE(version) {
if (version === 11) {
return isIE11;
}
if (version === 10) {
return isIE10;
}
return isIE11 || isIE10;
}
/**
* Returns the offset parent of the given element
* @method
* @memberof Popper.Utils
* @argument {Element} element
* @returns {Element} offset parent
*/
function getOffsetParent(element) {
if (!element) {
return document.documentElement;
}
var noOffsetParent = isIE(10) ? document.body : null;
// NOTE: 1 DOM access here
var offsetParent = element.offsetParent || null;
// Skip hidden elements which don't have an offsetParent
while (offsetParent === noOffsetParent && element.nextElementSibling) {
offsetParent = (element = element.nextElementSibling).offsetParent;
}
var nodeName = offsetParent && offsetParent.nodeName;
if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
return element ? element.ownerDocument.documentElement : document.documentElement;
}
// .offsetParent will return the closest TH, TD or TABLE in case
// no offsetParent is present, I hate this job...
if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
return getOffsetParent(offsetParent);
}
return offsetParent;
}
function isOffsetContainer(element) {
var nodeName = element.nodeName;
if (nodeName === 'BODY') {
return false;
}
return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
}
/**
* Finds the root node (document, shadowDOM root) of the given element
* @method
* @memberof Popper.Utils
* @argument {Element} node
* @returns {Element} root node
*/
function getRoot(node) {
if (node.parentNode !== null) {
return getRoot(node.parentNode);
}
return node;
}
/**
* Finds the offset parent common to the two provided nodes
* @method
* @memberof Popper.Utils
* @argument {Element} element1
* @argument {Element} element2
* @returns {Element} common offset parent
*/
function findCommonOffsetParent(element1, element2) {
// This check is needed to avoid errors in case one of the elements isn't defined for any reason
if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
return document.documentElement;
}
// Here we make sure to give as "start" the element that comes first in the DOM
var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
var start = order ? element1 : element2;
var end = order ? element2 : element1;
// Get common ancestor container
var range = document.createRange();
range.setStart(start, 0);
range.setEnd(end, 0);
var commonAncestorContainer = range.commonAncestorContainer;
// Both nodes are inside #document
if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
if (isOffsetContainer(commonAncestorContainer)) {
return commonAncestorContainer;
}
return getOffsetParent(commonAncestorContainer);
}
// one of the nodes is inside shadowDOM, find which one
var element1root = getRoot(element1);
if (element1root.host) {
return findCommonOffsetParent(element1root.host, element2);
} else {
return findCommonOffsetParent(element1, getRoot(element2).host);
}
}
/**
* Gets the scroll value of the given element in the given side (top and left)
* @method
* @memberof Popper.Utils
* @argument {Element} element
* @argument {String} side `top` or `left`
* @returns {number} amount of scrolled pixels
*/
function getScroll(element) {
var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
var nodeName = element.nodeName;
if (nodeName === 'BODY' || nodeName === 'HTML') {
var html = element.ownerDocument.documentElement;
var scrollingElement = element.ownerDocument.scrollingElement || html;
return scrollingElement[upperSide];
}
return element[upperSide];
}
/*
* Sum or subtract the element scroll values (left and top) from a given rect object
* @method
* @memberof Popper.Utils
* @param {Object} rect - Rect object you want to change
* @param {HTMLElement} element - The element from the function reads the scroll values
* @param {Boolean} subtract - set to true if you want to subtract the scroll values
* @return {Object} rect - The modifier rect object
*/
function includeScroll(rect, element) {
var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
var scrollTop = getScroll(element, 'top');
var scrollLeft = getScroll(element, 'left');
var modifier = subtract ? -1 : 1;
rect.top += scrollTop * modifier;
rect.bottom += scrollTop * modifier;
rect.left += scrollLeft * modifier;
rect.right += scrollLeft * modifier;
return rect;
}
/*
* Helper to detect borders of a given element
* @method
* @memberof Popper.Utils
* @param {CSSStyleDeclaration} styles
* Result of `getStyleComputedProperty` on the given element
* @param {String} axis - `x` or `y`
* @return {number} borders - The borders size of the given axis
*/
function getBordersSize(styles, axis) {
var sideA = axis === 'x' ? 'Left' : 'Top';
var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10);
}
function getSize(axis, body, html, computedStyle) {
return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);
}
function getWindowSizes(document) {
var body = document.body;
var html = document.documentElement;
var computedStyle = isIE(10) && getComputedStyle(html);
return {
height: getSize('Height', body, html, computedStyle),
width: getSize('Width', body, html, computedStyle)
};
}
var classCallCheck = function (instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
};
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;
};
}();
var defineProperty = function (obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
};
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;
};
/**
* Given element offsets, generate an output similar to getBoundingClientRect
* @method
* @memberof Popper.Utils
* @argument {Object} offsets
* @returns {Object} ClientRect like output
*/
function getClientRect(offsets) {
return _extends({}, offsets, {
right: offsets.left + offsets.width,
bottom: offsets.top + offsets.height
});
}
/**
* Get bounding client rect of given element
* @method
* @memberof Popper.Utils
* @param {HTMLElement} element
* @return {Object} client rect
*/
function getBoundingClientRect(element) {
var rect = {};
// IE10 10 FIX: Please, don't ask, the element isn't
// considered in DOM in some circumstances...
// This isn't reproducible in IE10 compatibility mode of IE11
try {
if (isIE(10)) {
rect = element.getBoundingClientRect();
var scrollTop = getScroll(element, 'top');
var scrollLeft = getScroll(element, 'left');
rect.top += scrollTop;
rect.left += scrollLeft;
rect.bottom += scrollTop;
rect.right += scrollLeft;
} else {
rect = element.getBoundingClientRect();
}
} catch (e) {}
var result = {
left: rect.left,
top: rect.top,
width: rect.right - rect.left,
height: rect.bottom - rect.top
};
// subtract scrollbar size from sizes
var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};
var width = sizes.width || element.clientWidth || result.right - result.left;
var height = sizes.height || element.clientHeight || result.bottom - result.top;
var horizScrollbar = element.offsetWidth - width;
var vertScrollbar = element.offsetHeight - height;
// if an hypothetical scrollbar is detected, we must be sure it's not a `border`
// we make this check conditional for performance reasons
if (horizScrollbar || vertScrollbar) {
var styles = getStyleComputedProperty(element);
horizScrollbar -= getBordersSize(styles, 'x');
vertScrollbar -= getBordersSize(styles, 'y');
result.width -= horizScrollbar;
result.height -= vertScrollbar;
}
return getClientRect(result);
}
function getOffsetRectRelativeToArbitraryNode(children, parent) {
var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
var isIE10 = isIE(10);
var isHTML = parent.nodeName === 'HTML';
var childrenRect = getBoundingClientRect(children);
var parentRect = getBoundingClientRect(parent);
var scrollParent = getScrollParent(children);
var styles = getStyleComputedProperty(parent);
var borderTopWidth = parseFloat(styles.borderTopWidth, 10);
var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10);
// In cases where the parent is fixed, we must ignore negative scroll in offset calc
if (fixedPosition && isHTML) {
parentRect.top = Math.max(parentRect.top, 0);
parentRect.left = Math.max(parentRect.left, 0);
}
var offsets = getClientRect({
top: childrenRect.top - parentRect.top - borderTopWidth,
left: childrenRect.left - parentRect.left - borderLeftWidth,
width: childrenRect.width,
height: childrenRect.height
});
offsets.marginTop = 0;
offsets.marginLeft = 0;
// Subtract margins of documentElement in case it's being used as parent
// we do this only on HTML because it's the only element that behaves
// differently when margins are applied to it. The margins are included in
// the box of the documentElement, in the other cases not.
if (!isIE10 && isHTML) {
var marginTop = parseFloat(styles.marginTop, 10);
var marginLeft = parseFloat(styles.marginLeft, 10);
offsets.top -= borderTopWidth - marginTop;
offsets.bottom -= borderTopWidth - marginTop;
offsets.left -= borderLeftWidth - marginLeft;
offsets.right -= borderLeftWidth - marginLeft;
// Attach marginTop and marginLeft because in some circumstances we may need them
offsets.marginTop = marginTop;
offsets.marginLeft = marginLeft;
}
if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
offsets = includeScroll(offsets, parent);
}
return offsets;
}
function getViewportOffsetRectRelativeToArtbitraryNode(element) {
var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
var html = element.ownerDocument.documentElement;
var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
var width = Math.max(html.clientWidth, window.innerWidth || 0);
var height = Math.max(html.clientHeight, window.innerHeight || 0);
var scrollTop = !excludeScroll ? getScroll(html) : 0;
var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;
var offset = {
top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
width: width,
height: height
};
return getClientRect(offset);
}
/**
* Check if the given element is fixed or is inside a fixed parent
* @method
* @memberof Popper.Utils
* @argument {Element} element
* @argument {Element} customContainer
* @returns {Boolean} answer to "isFixed?"
*/
function isFixed(element) {
var nodeName = element.nodeName;
if (nodeName === 'BODY' || nodeName === 'HTML') {
return false;
}
if (getStyleComputedProperty(element, 'position') === 'fixed') {
return true;
}
return isFixed(getParentNode(element));
}
/**
* Finds the first parent of an element that has a transformed property defined
* @method
* @memberof Popper.Utils
* @argument {Element} element
* @returns {Element} first transformed parent or documentElement
*/
function getFixedPositionOffsetParent(element) {
// This check is needed to avoid errors in case one of the elements isn't defined for any reason
if (!element || !element.parentElement || isIE()) {
return document.documentElement;
}
var el = element.parentElement;
while (el && getStyleComputedProperty(el, 'transform') === 'none') {
el = el.parentElement;
}
return el || document.documentElement;
}
/**
* Computed the boundaries limits and return them
* @method
* @memberof Popper.Utils
* @param {HTMLElement} popper
* @param {HTMLElement} reference
* @param {number} padding
* @param {HTMLElement} boundariesElement - Element used to define the boundaries
* @param {Boolean} fixedPosition - Is in fixed position mode
* @returns {Object} Coordinates of the boundaries
*/
function getBoundaries(popper, reference, padding, boundariesElement) {
var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
// NOTE: 1 DOM access here
var boundaries = { top: 0, left: 0 };
var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
// Handle viewport case
if (boundariesElement === 'viewport') {
boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
} else {
// Handle other cases based on DOM element used as boundaries
var boundariesNode = void 0;
if (boundariesElement === 'scrollParent') {
boundariesNode = getScrollParent(getParentNode(reference));
if (boundariesNode.nodeName === 'BODY') {
boundariesNode = popper.ownerDocument.documentElement;
}
} else if (boundariesElement === 'window') {
boundariesNode = popper.ownerDocument.documentElement;
} else {
boundariesNode = boundariesElement;
}
var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);
// In case of HTML, we need a different computation
if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
var _getWindowSizes = getWindowSizes(popper.ownerDocument),
height = _getWindowSizes.height,
width = _getWindowSizes.width;
boundaries.top += offsets.top - offsets.marginTop;
boundaries.bottom = height + offsets.top;
boundaries.left += offsets.left - offsets.marginLeft;
boundaries.right = width + offsets.left;
} else {
// for all the other DOM elements, this one is good
boundaries = offsets;
}
}
// Add paddings
padding = padding || 0;
var isPaddingNumber = typeof padding === 'number';
boundaries.left += isPaddingNumber ? padding : padding.left || 0;
boundaries.top += isPaddingNumber ? padding : padding.top || 0;
boundaries.right -= isPaddingNumber ? padding : padding.right || 0;
boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;
return boundaries;
}
function getArea(_ref) {
var width = _ref.width,
height = _ref.height;
return width * height;
}
/**
* Utility used to transform the `auto` placement to the placement with more
* available space.
* @method
* @memberof Popper.Utils
* @argument {Object} data - The data object generated by update method
* @argument {Object} options - Modifiers configuration and options
* @returns {Object} The data object, properly modified
*/
function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
if (placement.indexOf('auto') === -1) {
return placement;
}
var boundaries = getBoundaries(popper, reference, padding, boundariesElement);
var rects = {
top: {
width: boundaries.width,
height: refRect.top - boundaries.top
},
right: {
width: boundaries.right - refRect.right,
height: boundaries.height
},
bottom: {
width: boundaries.width,
height: boundaries.bottom - refRect.bottom
},
left: {
width: refRect.left - boundaries.left,
height: boundaries.height
}
};
var sortedAreas = Object.keys(rects).map(function (key) {
return _extends({
key: key
}, rects[key], {
area: getArea(rects[key])
});
}).sort(function (a, b) {
return b.area - a.area;
});
var filteredAreas = sortedAreas.filter(function (_ref2) {
var width = _ref2.width,
height = _ref2.height;
return width >= popper.clientWidth && height >= popper.clientHeight;
});
var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;
var variation = placement.split('-')[1];
return computedPlacement + (variation ? '-' + variation : '');
}
/**
* Get offsets to the reference element
* @method
* @memberof Popper.Utils
* @param {Object} state
* @param {Element} popper - the popper element
* @param {Element} reference - the reference element (the popper will be relative to this)
* @param {Element} fixedPosition - is in fixed position mode
* @returns {Object} An object containing the offsets which will be applied to the popper
*/
function getReferenceOffsets(state, popper, reference) {
var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
}
/**
* Get the outer sizes of the given element (offset size + margins)
* @method
* @memberof Popper.Utils
* @argument {Element} element
* @returns {Object} object containing width and height properties
*/
function getOuterSizes(element) {
var window = element.ownerDocument.defaultView;
var styles = window.getComputedStyle(element);
var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);
var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);
var result = {
width: element.offsetWidth + y,
height: element.offsetHeight + x
};
return result;
}
/**
* Get the opposite placement of the given one
* @method
* @memberof Popper.Utils
* @argument {String} placement
* @returns {String} flipped placement
*/
function getOppositePlacement(placement) {
var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
return placement.replace(/left|right|bottom|top/g, function (matched) {
return hash[matched];
});
}
/**
* Get offsets to the popper
* @method
* @memberof Popper.Utils
* @param {Object} position - CSS position the Popper will get applied
* @param {HTMLElement} popper - the popper element
* @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
* @param {String} placement - one of the valid placement options
* @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper
*/
function getPopperOffsets(popper, referenceOffsets, placement) {
placement = placement.split('-')[0];
// Get popper node sizes
var popperRect = getOuterSizes(popper);
// Add position, width and height to our offsets object
var popperOffsets = {
width: popperRect.width,
height: popperRect.height
};
// depending by the popper placement we have to compute its offsets slightly differently
var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
var mainSide = isHoriz ? 'top' : 'left';
var secondarySide = isHoriz ? 'left' : 'top';
var measurement = isHoriz ? 'height' : 'width';
var secondaryMeasurement = !isHoriz ? 'height' : 'width';
popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
if (placement === secondarySide) {
popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
} else {
popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];
}
return popperOffsets;
}
/**
* Mimics the `find` method of Array
* @method
* @memberof Popper.Utils
* @argument {Array} arr
* @argument prop
* @argument value
* @returns index or -1
*/
function find(arr, check) {
// use native find if supported
if (Array.prototype.find) {
return arr.find(check);
}
// use `filter` to obtain the same behavior of `find`
return arr.filter(check)[0];
}
/**
* Return the index of the matching object
* @method
* @memberof Popper.Utils
* @argument {Array} arr
* @argument prop
* @argument value
* @returns index or -1
*/
function findIndex(arr, prop, value) {
// use native findIndex if supported
if (Array.prototype.findIndex) {
return arr.findIndex(function (cur) {
return cur[prop] === value;
});
}
// use `find` + `indexOf` if `findIndex` isn't supported
var match = find(arr, function (obj) {
return obj[prop] === value;
});
return arr.indexOf(match);
}
/**
* Loop trough the list of modifiers and run them in order,
* each of them will then edit the data object.
* @method
* @memberof Popper.Utils
* @param {dataObject} data
* @param {Array} modifiers
* @param {String} ends - Optional modifier name used as stopper
* @returns {dataObject}
*/
function runModifiers(modifiers, data, ends) {
var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));
modifiersToRun.forEach(function (modifier) {
if (modifier['function']) {
// eslint-disable-line dot-notation
console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
}
var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation
if (modifier.enabled && isFunction(fn)) {
// Add properties to offsets to make them a complete clientRect object
// we do this before each modifier to make sure the previous one doesn't
// mess with these values
data.offsets.popper = getClientRect(data.offsets.popper);
data.offsets.reference = getClientRect(data.offsets.reference);
data = fn(data, modifier);
}
});
return data;
}
/**
* Updates the position of the popper, computing the new offsets and applying
* the new style.<br />
* Prefer `scheduleUpdate` over `update` because of performance reasons.
* @method
* @memberof Popper
*/
function update() {
// if popper is destroyed, don't perform any further update
if (this.state.isDestroyed) {
return;
}
var data = {
instance: this,
styles: {},
arrowStyles: {},
attributes: {},
flipped: false,
offsets: {}
};
// compute reference element offsets
data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);
// compute auto placement, store placement inside the data object,
// modifiers will be able to edit `placement` if needed
// and refer to originalPlacement to know the original value
data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);
// store the computed placement inside `originalPlacement`
data.originalPlacement = data.placement;
data.positionFixed = this.options.positionFixed;
// compute the popper offsets
data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';
// run the modifiers
data = runModifiers(this.modifiers, data);
// the first `update` will call `onCreate` callback
// the other ones will call `onUpdate` callback
if (!this.state.isCreated) {
this.state.isCreated = true;
this.options.onCreate(data);
} else {
this.options.onUpdate(data);
}
}
/**
* Helper used to know if the given modifier is enabled.
* @method
* @memberof Popper.Utils
* @returns {Boolean}
*/
function isModifierEnabled(modifiers, modifierName) {
return modifiers.some(function (_ref) {
var name = _ref.name,
enabled = _ref.enabled;
return enabled && name === modifierName;
});
}
/**
* Get the prefixed supported property name
* @method
* @memberof Popper.Utils
* @argument {String} property (camelCase)
* @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)
*/
function getSupportedPropertyName(property) {
var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
for (var i = 0; i < prefixes.length; i++) {
var prefix = prefixes[i];
var toCheck = prefix ? '' + prefix + upperProp : property;
if (typeof document.body.style[toCheck] !== 'undefined') {
return toCheck;
}
}
return null;
}
/**
* Destroys the popper.
* @method
* @memberof Popper
*/
function destroy() {
this.state.isDestroyed = true;
// touch DOM only if `applyStyle` modifier is enabled
if (isModifierEnabled(this.modifiers, 'applyStyle')) {
this.popper.removeAttribute('x-placement');
this.popper.style.position = '';
this.popper.style.top = '';
this.popper.style.left = '';
this.popper.style.right = '';
this.popper.style.bottom = '';
this.popper.style.willChange = '';
this.popper.style[getSupportedPropertyName('transform')] = '';
}
this.disableEventListeners();
// remove the popper if user explicity asked for the deletion on destroy
// do not use `remove` because IE11 doesn't support it
if (this.options.removeOnDestroy) {
this.popper.parentNode.removeChild(this.popper);
}
return this;
}
/**
* Get the window associated with the element
* @argument {Element} element
* @returns {Window}
*/
function getWindow(element) {
var ownerDocument = element.ownerDocument;
return ownerDocument ? ownerDocument.defaultView : window;
}
function attachToScrollParents(scrollParent, event, callback, scrollParents) {
var isBody = scrollParent.nodeName === 'BODY';
var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
target.addEventListener(event, callback, { passive: true });
if (!isBody) {
attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
}
scrollParents.push(target);
}
/**
* Setup needed event listeners used to update the popper position
* @method
* @memberof Popper.Utils
* @private
*/
function setupEventListeners(reference, options, state, updateBound) {
// Resize event listener on window
state.updateBound = updateBound;
getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });
// Scroll event listener on scroll parents
var scrollElement = getScrollParent(reference);
attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
state.scrollElement = scrollElement;
state.eventsEnabled = true;
return state;
}
/**
* It will add resize/scroll events and start recalculating
* position of the popper element when they are triggered.
* @method
* @memberof Popper
*/
function enableEventListeners() {
if (!this.state.eventsEnabled) {
this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
}
}
/**
* Remove event listeners used to update the popper position
* @method
* @memberof Popper.Utils
* @private
*/
function removeEventListeners(reference, state) {
// Remove resize event listener on window
getWindow(reference).removeEventListener('resize', state.updateBound);
// Remove scroll event listener on scroll parents
state.scrollParents.forEach(function (target) {
target.removeEventListener('scroll', state.updateBound);
});
// Reset state
state.updateBound = null;
state.scrollParents = [];
state.scrollElement = null;
state.eventsEnabled = false;
return state;
}
/**
* It will remove resize/scroll events and won't recalculate popper position
* when they are triggered. It also won't trigger `onUpdate` callback anymore,
* unless you call `update` method manually.
* @method
* @memberof Popper
*/
function disableEventListeners() {
if (this.state.eventsEnabled) {
cancelAnimationFrame(this.scheduleUpdate);
this.state = removeEventListeners(this.reference, this.state);
}
}
/**
* Tells if a given input is a number
* @method
* @memberof Popper.Utils
* @param {*} input to check
* @return {Boolean}
*/
function isNumeric(n) {
return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
}
/**
* Set the style to the given popper
* @method
* @memberof Popper.Utils
* @argument {Element} element - Element to apply the style to
* @argument {Object} styles
* Object with a list of properties and values which will be applied to the element
*/
function setStyles(element, styles) {
Object.keys(styles).forEach(function (prop) {
var unit = '';
// add unit if the value is numeric and is one of the following
if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
unit = 'px';
}
element.style[prop] = styles[prop] + unit;
});
}
/**
* Set the attributes to the given popper
* @method
* @memberof Popper.Utils
* @argument {Element} element - Element to apply the attributes to
* @argument {Object} styles
* Object with a list of properties and values which will be applied to the element
*/
function setAttributes(element, attributes) {
Object.keys(attributes).forEach(function (prop) {
var value = attributes[prop];
if (value !== false) {
element.setAttribute(prop, attributes[prop]);
} else {
element.removeAttribute(prop);
}
});
}
/**
* @function
* @memberof Modifiers
* @argument {Object} data - The data object generated by `update` method
* @argument {Object} data.styles - List of style properties - values to apply to popper element
* @argument {Object} data.attributes - List of attribute properties - values to apply to popper element
* @argument {Object} options - Modifiers configuration and options
* @returns {Object} The same data object
*/
function applyStyle(data) {
// any property present in `data.styles` will be applied to the popper,
// in this way we can make the 3rd party modifiers add custom styles to it
// Be aware, modifiers could override the properties defined in the previous
// lines of this modifier!
setStyles(data.instance.popper, data.styles);
// any property present in `data.attributes` will be applied to the popper,
// they will be set as HTML attributes of the element
setAttributes(data.instance.popper, data.attributes);
// if arrowElement is defined and arrowStyles has some properties
if (data.arrowElement && Object.keys(data.arrowStyles).length) {
setStyles(data.arrowElement, data.arrowStyles);
}
return data;
}
/**
* Set the x-placement attribute before everything else because it could be used
* to add margins to the popper margins needs to be calculated to get the
* correct popper offsets.
* @method
* @memberof Popper.modifiers
* @param {HTMLElement} reference - The reference element used to position the popper
* @param {HTMLElement} popper - The HTML element used as popper
* @param {Object} options - Popper.js options
*/
function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
// compute reference element offsets
var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);
// compute auto placement, store placement inside the data object,
// modifiers will be able to edit `placement` if needed
// and refer to originalPlacement to know the original value
var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
popper.setAttribute('x-placement', placement);
// Apply `position` to popper before anything else because
// without the position applied we can't guarantee correct computations
setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });
return options;
}
/**
* @function
* @memberof Popper.Utils
* @argument {Object} data - The data object generated by `update` method
* @argument {Boolean} shouldRound - If the offsets should be rounded at all
* @returns {Object} The popper's position offsets rounded
*
* The tale of pixel-perfect positioning. It's still not 100% perfect, but as
* good as it can be within reason.
* Discussion here: https://github.com/FezVrasta/popper.js/pull/715
*
* Low DPI screens cause a popper to be blurry if not using full pixels (Safari
* as well on High DPI screens).
*
* Firefox prefers no rounding for positioning and does not have blurriness on
* high DPI screens.
*
* Only horizontal placement and left/right values need to be considered.
*/
function getRoundedOffsets(data, shouldRound) {
var _data$offsets = data.offsets,
popper = _data$offsets.popper,
reference = _data$offsets.reference;
var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;
var isVariation = data.placement.indexOf('-') !== -1;
var sameWidthOddness = reference.width % 2 === popper.width % 2;
var bothOddWidth = reference.width % 2 === 1 && popper.width % 2 === 1;
var noRound = function noRound(v) {
return v;
};
var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthOddness ? Math.round : Math.floor;
var verticalToInteger = !shouldRound ? noRound : Math.round;
return {
left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),
top: verticalToInteger(popper.top),
bottom: verticalToInteger(popper.bottom),
right: horizontalToInteger(popper.right)
};
}
var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);
/**
* @function
* @memberof Modifiers
* @argument {Object} data - The data object generated by `update` method
* @argument {Object} options - Modifiers configuration and options
* @returns {Object} The data object, properly modified
*/
function computeStyle(data, options) {
var x = options.x,
y = options.y;
var popper = data.offsets.popper;
// Remove this legacy support in Popper.js v2
var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {
return modifier.name === 'applyStyle';
}).gpuAcceleration;
if (legacyGpuAccelerationOption !== undefined) {
console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
}
var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;
var offsetParent = getOffsetParent(data.instance.popper);
var offsetParentRect = getBoundingClientRect(offsetParent);
// Styles
var styles = {
position: popper.position
};
var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);
var sideA = x === 'bottom' ? 'top' : 'bottom';
var sideB = y === 'right' ? 'left' : 'right';
// if gpuAcceleration is set to `true` and transform is supported,
// we use `translate3d` to apply the position to the popper we
// automatically use the supported prefixed version if needed
var prefixedProperty = getSupportedPropertyName('transform');
// now, let's make a step back and look at this code closely (wtf?)
// If the content of the popper grows once it's been positioned, it
// may happen that the popper gets misplaced because of the new content
// overflowing its reference element
// To avoid this problem, we provide two options (x and y), which allow
// the consumer to define the offset origin.
// If we position a popper on top of a reference element, we can set
// `x` to `top` to make the popper grow towards its top instead of
// its bottom.
var left = void 0,
top = void 0;
if (sideA === 'bottom') {
// when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar)
// and not the bottom of the html element
if (offsetParent.nodeName === 'HTML') {
top = -offsetParent.clientHeight + offsets.bottom;
} else {
top = -offsetParentRect.height + offsets.bottom;
}
} else {
top = offsets.top;
}
if (sideB === 'right') {
if (offsetParent.nodeName === 'HTML') {
left = -offsetParent.clientWidth + offsets.right;
} else {
left = -offsetParentRect.width + offsets.right;
}
} else {
left = offsets.left;
}
if (gpuAcceleration && prefixedProperty) {
styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
styles[sideA] = 0;
styles[sideB] = 0;
styles.willChange = 'transform';
} else {
// othwerise, we use the standard `top`, `left`, `bottom` and `right` properties
var invertTop = sideA === 'bottom' ? -1 : 1;
var invertLeft = sideB === 'right' ? -1 : 1;
styles[sideA] = top * invertTop;
styles[sideB] = left * invertLeft;
styles.willChange = sideA + ', ' + sideB;
}
// Attributes
var attributes = {
'x-placement': data.placement
};
// Update `data` attributes, styles and arrowStyles
data.attributes = _extends({}, attributes, data.attributes);
data.styles = _extends({}, styles, data.styles);
data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);
return data;
}
/**
* Helper used to know if the given modifier depends from another one.<br />
* It checks if the needed modifier is listed and enabled.
* @method
* @memberof Popper.Utils
* @param {Array} modifiers - list of modifiers
* @param {String} requestingName - name of requesting modifier
* @param {String} requestedName - name of requested modifier
* @returns {Boolean}
*/
function isModifierRequired(modifiers, requestingName, requestedName) {
var requesting = find(modifiers, function (_ref) {
var name = _ref.name;
return name === requestingName;
});
var isRequired = !!requesting && modifiers.some(function (modifier) {
return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
});
if (!isRequired) {
var _requesting = '`' + requestingName + '`';
var requested = '`' + requestedName + '`';
console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');
}
return isRequired;
}
/**
* @function
* @memberof Modifiers
* @argument {Object} data - The data object generated by update method
* @argument {Object} options - Modifiers configuration and options
* @returns {Object} The data object, properly modified
*/
function arrow(data, options) {
var _data$offsets$arrow;
// arrow depends on keepTogether in order to work
if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
return data;
}
var arrowElement = options.element;
// if arrowElement is a string, suppose it's a CSS selector
if (typeof arrowElement === 'string') {
arrowElement = data.instance.popper.querySelector(arrowElement);
// if arrowElement is not found, don't run the modifier
if (!arrowElement) {
return data;
}
} else {
// if the arrowElement isn't a query selector we must check that the
// provided DOM node is child of its popper node
if (!data.instance.popper.contains(arrowElement)) {
console.warn('WARNING: `arrow.element` must be child of its popper element!');
return data;
}
}
var placement = data.placement.split('-')[0];
var _data$offsets = data.offsets,
popper = _data$offsets.popper,
reference = _data$offsets.reference;
var isVertical = ['left', 'right'].indexOf(placement) !== -1;
var len = isVertical ? 'height' : 'width';
var sideCapitalized = isVertical ? 'Top' : 'Left';
var side = sideCapitalized.toLowerCase();
var altSide = isVertical ? 'left' : 'top';
var opSide = isVertical ? 'bottom' : 'right';
var arrowElementSize = getOuterSizes(arrowElement)[len];
//
// extends keepTogether behavior making sure the popper and its
// reference have enough pixels in conjunction
//
// top/left side
if (reference[opSide] - arrowElementSize < popper[side]) {
data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
}
// bottom/right side
if (reference[side] + arrowElementSize > popper[opSide]) {
data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
}
data.offsets.popper = getClientRect(data.offsets.popper);
// compute center of the popper
var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;
// Compute the sideValue using the updated popper offsets
// take popper margin in account because we don't have this info available
var css = getStyleComputedProperty(data.instance.popper);
var popperMarginSide = parseFloat(css['margin' + sideCapitalized], 10);
var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10);
var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;
// prevent arrowElement from being placed not contiguously to its popper
sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);
data.arrowElement = arrowElement;
data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);
return data;
}
/**
* Get the opposite placement variation of the given one
* @method
* @memberof Popper.Utils
* @argument {String} placement variation
* @returns {String} flipped placement variation
*/
function getOppositeVariation(variation) {
if (variation === 'end') {
return 'start';
} else if (variation === 'start') {
return 'end';
}
return variation;
}
/**
* List of accepted placements to use as values of the `placement` option.<br />
* Valid placements are:
* - `auto`
* - `top`
* - `right`
* - `bottom`
* - `left`
*
* Each placement can have a variation from this list:
* - `-start`
* - `-end`
*
* Variations are interpreted easily if you think of them as the left to right
* written languages. Horizontally (`top` and `bottom`), `start` is left and `end`
* is right.<br />
* Vertically (`left` and `right`), `start` is top and `end` is bottom.
*
* Some valid examples are:
* - `top-end` (on top of reference, right aligned)
* - `right-start` (on right of reference, top aligned)
* - `bottom` (on bottom, centered)
* - `auto-end` (on the side with more space available, alignment depends by placement)
*
* @static
* @type {Array}
* @enum {String}
* @readonly
* @method placements
* @memberof Popper
*/
var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
// Get rid of `auto` `auto-start` and `auto-end`
var validPlacements = placements.slice(3);
/**
* Given an initial placement, returns all the subsequent placements
* clockwise (or counter-clockwise).
*
* @method
* @memberof Popper.Utils
* @argument {String} placement - A valid placement (it accepts variations)
* @argument {Boolean} counter - Set to true to walk the placements counterclockwise
* @returns {Array} placements including their variations
*/
function clockwise(placement) {
var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
var index = validPlacements.indexOf(placement);
var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
return counter ? arr.reverse() : arr;
}
var BEHAVIORS = {
FLIP: 'flip',
CLOCKWISE: 'clockwise',
COUNTERCLOCKWISE: 'counterclockwise'
};
/**
* @function
* @memberof Modifiers
* @argument {Object} data - The data object generated by update method
* @argument {Object} options - Modifiers configuration and options
* @returns {Object} The data object, properly modified
*/
function flip(data, options) {
// if `inner` modifier is enabled, we can't use the `flip` modifier
if (isModifierEnabled(data.instance.modifiers, 'inner')) {
return data;
}
if (data.flipped && data.placement === data.originalPlacement) {
// seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
return data;
}
var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);
var placement = data.placement.split('-')[0];
var placementOpposite = getOppositePlacement(placement);
var variation = data.placement.split('-')[1] || '';
var flipOrder = [];
switch (options.behavior) {
case BEHAVIORS.FLIP:
flipOrder = [placement, placementOpposite];
break;
case BEHAVIORS.CLOCKWISE:
flipOrder = clockwise(placement);
break;
case BEHAVIORS.COUNTERCLOCKWISE:
flipOrder = clockwise(placement, true);
break;
default:
flipOrder = options.behavior;
}
flipOrder.forEach(function (step, index) {
if (placement !== step || flipOrder.length === index + 1) {
return data;
}
placement = data.placement.split('-')[0];
placementOpposite = getOppositePlacement(placement);
var popperOffsets = data.offsets.popper;
var refOffsets = data.offsets.reference;
// using floor because the reference offsets may contain decimals we are not going to consider here
var floor = Math.floor;
var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);
var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);
var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;
// flip the variation if required
var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
var flippedVariation = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);
if (overlapsRef || overflowsBoundaries || flippedVariation) {
// this boolean to detect any flip loop
data.flipped = true;
if (overlapsRef || overflowsBoundaries) {
placement = flipOrder[index + 1];
}
if (flippedVariation) {
variation = getOppositeVariation(variation);
}
data.placement = placement + (variation ? '-' + variation : '');
// this object contains `position`, we want to preserve it along with
// any additional property we may add in the future
data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
data = runModifiers(data.instance.modifiers, data, 'flip');
}
});
return data;
}
/**
* @function
* @memberof Modifiers
* @argument {Object} data - The data object generated by update method
* @argument {Object} options - Modifiers configuration and options
* @returns {Object} The data object, properly modified
*/
function keepTogether(data) {
var _data$offsets = data.offsets,
popper = _data$offsets.popper,
reference = _data$offsets.reference;
var placement = data.placement.split('-')[0];
var floor = Math.floor;
var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
var side = isVertical ? 'right' : 'bottom';
var opSide = isVertical ? 'left' : 'top';
var measurement = isVertical ? 'width' : 'height';
if (popper[side] < floor(reference[opSide])) {
data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
}
if (popper[opSide] > floor(reference[side])) {
data.offsets.popper[opSide] = floor(reference[side]);
}
return data;
}
/**
* Converts a string containing value + unit into a px value number
* @function
* @memberof {modifiers~offset}
* @private
* @argument {String} str - Value + unit string
* @argument {String} measurement - `height` or `width`
* @argument {Object} popperOffsets
* @argument {Object} referenceOffsets
* @returns {Number|String}
* Value in pixels, or original string if no values were extracted
*/
function toValue(str, measurement, popperOffsets, referenceOffsets) {
// separate value from unit
var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
var value = +split[1];
var unit = split[2];
// If it's not a number it's an operator, I guess
if (!value) {
return str;
}
if (unit.indexOf('%') === 0) {
var element = void 0;
switch (unit) {
case '%p':
element = popperOffsets;
break;
case '%':
case '%r':
default:
element = referenceOffsets;
}
var rect = getClientRect(element);
return rect[measurement] / 100 * value;
} else if (unit === 'vh' || unit === 'vw') {
// if is a vh or vw, we calculate the size based on the viewport
var size = void 0;
if (unit === 'vh') {
size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
} else {
size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
}
return size / 100 * value;
} else {
// if is an explicit pixel unit, we get rid of the unit and keep the value
// if is an implicit unit, it's px, and we return just the value
return value;
}
}
/**
* Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
* @function
* @memberof {modifiers~offset}
* @private
* @argument {String} offset
* @argument {Object} popperOffsets
* @argument {Object} referenceOffsets
* @argument {String} basePlacement
* @returns {Array} a two cells array with x and y offsets in numbers
*/
function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
var offsets = [0, 0];
// Use height if placement is left or right and index is 0 otherwise use width
// in this way the first offset will use an axis and the second one
// will use the other one
var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;
// Split the offset string to obtain a list of values and operands
// The regex addresses values with the plus or minus sign in front (+10, -20, etc)
var fragments = offset.split(/(\+|\-)/).map(function (frag) {
return frag.trim();
});
// Detect if the offset string contains a pair of values or a single one
// they could be separated by comma or space
var divider = fragments.indexOf(find(fragments, function (frag) {
return frag.search(/,|\s/) !== -1;
}));
if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
}
// If divider is found, we divide the list of values and operands to divide
// them by ofset X and Y.
var splitRegex = /\s*,\s*|\s+/;
var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];
// Convert the values with units to absolute pixels to allow our computations
ops = ops.map(function (op, index) {
// Most of the units rely on the orientation of the popper
var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
var mergeWithPrevious = false;
return op
// This aggregates any `+` or `-` sign that aren't considered operators
// e.g.: 10 + +5 => [10, +, +5]
.reduce(function (a, b) {
if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
a[a.length - 1] = b;
mergeWithPrevious = true;
return a;
} else if (mergeWithPrevious) {
a[a.length - 1] += b;
mergeWithPrevious = false;
return a;
} else {
return a.concat(b);
}
}, [])
// Here we convert the string values into number values (in px)
.map(function (str) {
return toValue(str, measurement, popperOffsets, referenceOffsets);
});
});
// Loop trough the offsets arrays and execute the operations
ops.forEach(function (op, index) {
op.forEach(function (frag, index2) {
if (isNumeric(frag)) {
offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
}
});
});
return offsets;
}
/**
* @function
* @memberof Modifiers
* @argument {Object} data - The data object generated by update method
* @argument {Object} options - Modifiers configuration and options
* @argument {Number|String} options.offset=0
* The offset value as described in the modifier description
* @returns {Object} The data object, properly modified
*/
function offset(data, _ref) {
var offset = _ref.offset;
var placement = data.placement,
_data$offsets = data.offsets,
popper = _data$offsets.popper,
reference = _data$offsets.reference;
var basePlacement = placement.split('-')[0];
var offsets = void 0;
if (isNumeric(+offset)) {
offsets = [+offset, 0];
} else {
offsets = parseOffset(offset, popper, reference, basePlacement);
}
if (basePlacement === 'left') {
popper.top += offsets[0];
popper.left -= offsets[1];
} else if (basePlacement === 'right') {
popper.top += offsets[0];
popper.left += offsets[1];
} else if (basePlacement === 'top') {
popper.left += offsets[0];
popper.top -= offsets[1];
} else if (basePlacement === 'bottom') {
popper.left += offsets[0];
popper.top += offsets[1];
}
data.popper = popper;
return data;
}
/**
* @function
* @memberof Modifiers
* @argument {Object} data - The data object generated by `update` method
* @argument {Object} options - Modifiers configuration and options
* @returns {Object} The data object, properly modified
*/
function preventOverflow(data, options) {
var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);
// If offsetParent is the reference element, we really want to
// go one step up and use the next offsetParent as reference to
// avoid to make this modifier completely useless and look like broken
if (data.instance.reference === boundariesElement) {
boundariesElement = getOffsetParent(boundariesElement);
}
// NOTE: DOM access here
// resets the popper's position so that the document size can be calculated excluding
// the size of the popper element itself
var transformProp = getSupportedPropertyName('transform');
var popperStyles = data.instance.popper.style; // assignment to help minification
var top = popperStyles.top,
left = popperStyles.left,
transform = popperStyles[transformProp];
popperStyles.top = '';
popperStyles.left = '';
popperStyles[transformProp] = '';
var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);
// NOTE: DOM access here
// restores the original style properties after the offsets have been computed
popperStyles.top = top;
popperStyles.left = left;
popperStyles[transformProp] = transform;
options.boundaries = boundaries;
var order = options.priority;
var popper = data.offsets.popper;
var check = {
primary: function primary(placement) {
var value = popper[placement];
if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
value = Math.max(popper[placement], boundaries[placement]);
}
return defineProperty({}, placement, value);
},
secondary: function secondary(placement) {
var mainSide = placement === 'right' ? 'left' : 'top';
var value = popper[mainSide];
if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
}
return defineProperty({}, mainSide, value);
}
};
order.forEach(function (placement) {
var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
popper = _extends({}, popper, check[side](placement));
});
data.offsets.popper = popper;
return data;
}
/**
* @function
* @memberof Modifiers
* @argument {Object} data - The data object generated by `update` method
* @argument {Object} options - Modifiers configuration and options
* @returns {Object} The data object, properly modified
*/
function shift(data) {
var placement = data.placement;
var basePlacement = placement.split('-')[0];
var shiftvariation = placement.split('-')[1];
// if shift shiftvariation is specified, run the modifier
if (shiftvariation) {
var _data$offsets = data.offsets,
reference = _data$offsets.reference,
popper = _data$offsets.popper;
var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
var side = isVertical ? 'left' : 'top';
var measurement = isVertical ? 'width' : 'height';
var shiftOffsets = {
start: defineProperty({}, side, reference[side]),
end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
};
data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);
}
return data;
}
/**
* @function
* @memberof Modifiers
* @argument {Object} data - The data object generated by update method
* @argument {Object} options - Modifiers configuration and options
* @returns {Object} The data object, properly modified
*/
function hide(data) {
if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
return data;
}
var refRect = data.offsets.reference;
var bound = find(data.instance.modifiers, function (modifier) {
return modifier.name === 'preventOverflow';
}).boundaries;
if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
// Avoid unnecessary DOM access if visibility hasn't changed
if (data.hide === true) {
return data;
}
data.hide = true;
data.attributes['x-out-of-boundaries'] = '';
} else {
// Avoid unnecessary DOM access if visibility hasn't changed
if (data.hide === false) {
return data;
}
data.hide = false;
data.attributes['x-out-of-boundaries'] = false;
}
return data;
}
/**
* @function
* @memberof Modifiers
* @argument {Object} data - The data object generated by `update` method
* @argument {Object} options - Modifiers configuration and options
* @returns {Object} The data object, properly modified
*/
function inner(data) {
var placement = data.placement;
var basePlacement = placement.split('-')[0];
var _data$offsets = data.offsets,
popper = _data$offsets.popper,
reference = _data$offsets.reference;
var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;
var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;
popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);
data.placement = getOppositePlacement(placement);
data.offsets.popper = getClientRect(popper);
return data;
}
/**
* Modifier function, each modifier can have a function of this type assigned
* to its `fn` property.<br />
* These functions will be called on each update, this means that you must
* make sure they are performant enough to avoid performance bottlenecks.
*
* @function ModifierFn
* @argument {dataObject} data - The data object generated by `update` method
* @argument {Object} options - Modifiers configuration and options
* @returns {dataObject} The data object, properly modified
*/
/**
* Modifiers are plugins used to alter the behavior of your poppers.<br />
* Popper.js uses a set of 9 modifiers to provide all the basic functionalities
* needed by the library.
*
* Usually you don't want to override the `order`, `fn` and `onLoad` props.
* All the other properties are configurations that could be tweaked.
* @namespace modifiers
*/
var modifiers = {
/**
* Modifier used to shift the popper on the start or end of its reference
* element.<br />
* It will read the variation of the `placement` property.<br />
* It can be one either `-end` or `-start`.
* @memberof modifiers
* @inner
*/
shift: {
/** @prop {number} order=100 - Index used to define the order of execution */
order: 100,
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
enabled: true,
/** @prop {ModifierFn} */
fn: shift
},
/**
* The `offset` modifier can shift your popper on both its axis.
*
* It accepts the following units:
* - `px` or unit-less, interpreted as pixels
* - `%` or `%r`, percentage relative to the length of the reference element
* - `%p`, percentage relative to the length of the popper element
* - `vw`, CSS viewport width unit
* - `vh`, CSS viewport height unit
*
* For length is intended the main axis relative to the placement of the popper.<br />
* This means that if the placement is `top` or `bottom`, the length will be the
* `width`. In case of `left` or `right`, it will be the `height`.
*
* You can provide a single value (as `Number` or `String`), or a pair of values
* as `String` divided by a comma or one (or more) white spaces.<br />
* The latter is a deprecated method because it leads to confusion and will be
* removed in v2.<br />
* Additionally, it accepts additions and subtractions between different units.
* Note that multiplications and divisions aren't supported.
*
* Valid examples are:
* ```
* 10
* '10%'
* '10, 10'
* '10%, 10'
* '10 + 10%'
* '10 - 5vh + 3%'
* '-10px + 5vh, 5px - 6%'
* ```
* > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap
* > with their reference element, unfortunately, you will have to disable the `flip` modifier.
* > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).
*
* @memberof modifiers
* @inner
*/
offset: {
/** @prop {number} order=200 - Index used to define the order of execution */
order: 200,
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
enabled: true,
/** @prop {ModifierFn} */
fn: offset,
/** @prop {Number|String} offset=0
* The offset value as described in the modifier description
*/
offset: 0
},
/**
* Modifier used to prevent the popper from being positioned outside the boundary.
*
* A scenario exists where the reference itself is not within the boundaries.<br />
* We can say it has "escaped the boundaries" or just "escaped".<br />
* In this case we need to decide whether the popper should either:
*
* - detach from the reference and remain "trapped" in the boundaries, or
* - if it should ignore the boundary and "escape with its reference"
*
* When `escapeWithReference` is set to`true` and reference is completely
* outside its boundaries, the popper will overflow (or completely leave)
* the boundaries in order to remain attached to the edge of the reference.
*
* @memberof modifiers
* @inner
*/
preventOverflow: {
/** @prop {number} order=300 - Index used to define the order of execution */
order: 300,
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
enabled: true,
/** @prop {ModifierFn} */
fn: preventOverflow,
/**
* @prop {Array} [priority=['left','right','top','bottom']]
* Popper will try to prevent overflow following these priorities by default,
* then, it could overflow on the left and on top of the `boundariesElement`
*/
priority: ['left', 'right', 'top', 'bottom'],
/**
* @prop {number} padding=5
* Amount of pixel used to define a minimum distance between the boundaries
* and the popper. This makes sure the popper always has a little padding
* between the edges of its container
*/
padding: 5,
/**
* @prop {String|HTMLElement} boundariesElement='scrollParent'
* Boundaries used by the modifier. Can be `scrollParent`, `window`,
* `viewport` or any DOM element.
*/
boundariesElement: 'scrollParent'
},
/**
* Modifier used to make sure the reference and its popper stay near each other
* without leaving any gap between the two. Especially useful when the arrow is
* enabled and you want to ensure that it points to its reference element.
* It cares only about the first axis. You can still have poppers with margin
* between the popper and its reference element.
* @memberof modifiers
* @inner
*/
keepTogether: {
/** @prop {number} order=400 - Index used to define the order of execution */
order: 400,
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
enabled: true,
/** @prop {ModifierFn} */
fn: keepTogether
},
/**
* This modifier is used to move the `arrowElement` of the popper to make
* sure it is positioned between the reference element and its popper element.
* It will read the outer size of the `arrowElement` node to detect how many
* pixels of conjunction are needed.
*
* It has no effect if no `arrowElement` is provided.
* @memberof modifiers
* @inner
*/
arrow: {
/** @prop {number} order=500 - Index used to define the order of execution */
order: 500,
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
enabled: true,
/** @prop {ModifierFn} */
fn: arrow,
/** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */
element: '[x-arrow]'
},
/**
* Modifier used to flip the popper's placement when it starts to overlap its
* reference element.
*
* Requires the `preventOverflow` modifier before it in order to work.
*
* **NOTE:** this modifier will interrupt the current update cycle and will
* restart it if it detects the need to flip the placement.
* @memberof modifiers
* @inner
*/
flip: {
/** @prop {number} order=600 - Index used to define the order of execution */
order: 600,
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
enabled: true,
/** @prop {ModifierFn} */
fn: flip,
/**
* @prop {String|Array} behavior='flip'
* The behavior used to change the popper's placement. It can be one of
* `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
* placements (with optional variations)
*/
behavior: 'flip',
/**
* @prop {number} padding=5
* The popper will flip if it hits the edges of the `boundariesElement`
*/
padding: 5,
/**
* @prop {String|HTMLElement} boundariesElement='viewport'
* The element which will define the boundaries of the popper position.
* The popper will never be placed outside of the defined boundaries
* (except if `keepTogether` is enabled)
*/
boundariesElement: 'viewport'
},
/**
* Modifier used to make the popper flow toward the inner of the reference element.
* By default, when this modifier is disabled, the popper will be placed outside
* the reference element.
* @memberof modifiers
* @inner
*/
inner: {
/** @prop {number} order=700 - Index used to define the order of execution */
order: 700,
/** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */
enabled: false,
/** @prop {ModifierFn} */
fn: inner
},
/**
* Modifier used to hide the popper when its reference element is outside of the
* popper boundaries. It will set a `x-out-of-boundaries` attribute which can
* be used to hide with a CSS selector the popper when its reference is
* out of boundaries.
*
* Requires the `preventOverflow` modifier before it in order to work.
* @memberof modifiers
* @inner
*/
hide: {
/** @prop {number} order=800 - Index used to define the order of execution */
order: 800,
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
enabled: true,
/** @prop {ModifierFn} */
fn: hide
},
/**
* Computes the style that will be applied to the popper element to gets
* properly positioned.
*
* Note that this modifier will not touch the DOM, it just prepares the styles
* so that `applyStyle` modifier can apply it. This separation is useful
* in case you need to replace `applyStyle` with a custom implementation.
*
* This modifier has `850` as `order` value to maintain backward compatibility
* with previous versions of Popper.js. Expect the modifiers ordering method
* to change in future major versions of the library.
*
* @memberof modifiers
* @inner
*/
computeStyle: {
/** @prop {number} order=850 - Index used to define the order of execution */
order: 850,
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
enabled: true,
/** @prop {ModifierFn} */
fn: computeStyle,
/**
* @prop {Boolean} gpuAcceleration=true
* If true, it uses the CSS 3D transformation to position the popper.
* Otherwise, it will use the `top` and `left` properties
*/
gpuAcceleration: true,
/**
* @prop {string} [x='bottom']
* Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
* Change this if your popper should grow in a direction different from `bottom`
*/
x: 'bottom',
/**
* @prop {string} [x='left']
* Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
* Change this if your popper should grow in a direction different from `right`
*/
y: 'right'
},
/**
* Applies the computed styles to the popper element.
*
* All the DOM manipulations are limited to this modifier. This is useful in case
* you want to integrate Popper.js inside a framework or view library and you
* want to delegate all the DOM manipulations to it.
*
* Note that if you disable this modifier, you must make sure the popper element
* has its position set to `absolute` before Popper.js can do its work!
*
* Just disable this modifier and define your own to achieve the desired effect.
*
* @memberof modifiers
* @inner
*/
applyStyle: {
/** @prop {number} order=900 - Index used to define the order of execution */
order: 900,
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
enabled: true,
/** @prop {ModifierFn} */
fn: applyStyle,
/** @prop {Function} */
onLoad: applyStyleOnLoad,
/**
* @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
* @prop {Boolean} gpuAcceleration=true
* If true, it uses the CSS 3D transformation to position the popper.
* Otherwise, it will use the `top` and `left` properties
*/
gpuAcceleration: undefined
}
};
/**
* The `dataObject` is an object containing all the information used by Popper.js.
* This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.
* @name dataObject
* @property {Object} data.instance The Popper.js instance
* @property {String} data.placement Placement applied to popper
* @property {String} data.originalPlacement Placement originally defined on init
* @property {Boolean} data.flipped True if popper has been flipped by flip modifier
* @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper
* @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier
* @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)
* @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)
* @property {Object} data.boundaries Offsets of the popper boundaries
* @property {Object} data.offsets The measurements of popper, reference and arrow elements
* @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values
* @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values
* @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0
*/
/**
* Default options provided to Popper.js constructor.<br />
* These can be overridden using the `options` argument of Popper.js.<br />
* To override an option, simply pass an object with the same
* structure of the `options` object, as the 3rd argument. For example:
* ```
* new Popper(ref, pop, {
* modifiers: {
* preventOverflow: { enabled: false }
* }
* })
* ```
* @type {Object}
* @static
* @memberof Popper
*/
var Defaults = {
/**
* Popper's placement.
* @prop {Popper.placements} placement='bottom'
*/
placement: 'bottom',
/**
* Set this to true if you want popper to position it self in 'fixed' mode
* @prop {Boolean} positionFixed=false
*/
positionFixed: false,
/**
* Whether events (resize, scroll) are initially enabled.
* @prop {Boolean} eventsEnabled=true
*/
eventsEnabled: true,
/**
* Set to true if you want to automatically remove the popper when
* you call the `destroy` method.
* @prop {Boolean} removeOnDestroy=false
*/
removeOnDestroy: false,
/**
* Callback called when the popper is created.<br />
* By default, it is set to no-op.<br />
* Access Popper.js instance with `data.instance`.
* @prop {onCreate}
*/
onCreate: function onCreate() {},
/**
* Callback called when the popper is updated. This callback is not called
* on the initialization/creation of the popper, but only on subsequent
* updates.<br />
* By default, it is set to no-op.<br />
* Access Popper.js instance with `data.instance`.
* @prop {onUpdate}
*/
onUpdate: function onUpdate() {},
/**
* List of modifiers used to modify the offsets before they are applied to the popper.
* They provide most of the functionalities of Popper.js.
* @prop {modifiers}
*/
modifiers: modifiers
};
/**
* @callback onCreate
* @param {dataObject} data
*/
/**
* @callback onUpdate
* @param {dataObject} data
*/
// Utils
// Methods
var Popper = function () {
/**
* Creates a new Popper.js instance.
* @class Popper
* @param {HTMLElement|referenceObject} reference - The reference element used to position the popper
* @param {HTMLElement} popper - The HTML element used as the popper
* @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
* @return {Object} instance - The generated Popper.js instance
*/
function Popper(reference, popper) {
var _this = this;
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
classCallCheck(this, Popper);
this.scheduleUpdate = function () {
return requestAnimationFrame(_this.update);
};
// make update() debounced, so that it only runs at most once-per-tick
this.update = debounce(this.update.bind(this));
// with {} we create a new object with the options inside it
this.options = _extends({}, Popper.Defaults, options);
// init state
this.state = {
isDestroyed: false,
isCreated: false,
scrollParents: []
};
// get reference and popper elements (allow jQuery wrappers)
this.reference = reference && reference.jquery ? reference[0] : reference;
this.popper = popper && popper.jquery ? popper[0] : popper;
// Deep merge modifiers options
this.options.modifiers = {};
Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
_this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
});
// Refactoring modifiers' list (Object => Array)
this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
return _extends({
name: name
}, _this.options.modifiers[name]);
})
// sort the modifiers by order
.sort(function (a, b) {
return a.order - b.order;
});
// modifiers have the ability to execute arbitrary code when Popper.js get inited
// such code is executed in the same order of its modifier
// they could add new properties to their options configuration
// BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!
this.modifiers.forEach(function (modifierOptions) {
if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {
modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
}
});
// fire the first update to position the popper in the right place
this.update();
var eventsEnabled = this.options.eventsEnabled;
if (eventsEnabled) {
// setup event listeners, they will take care of update the position in specific situations
this.enableEventListeners();
}
this.state.eventsEnabled = eventsEnabled;
}
// We can't use class properties because they don't get listed in the
// class prototype and break stuff like Sinon stubs
createClass(Popper, [{
key: 'update',
value: function update$$1() {
return update.call(this);
}
}, {
key: 'destroy',
value: function destroy$$1() {
return destroy.call(this);
}
}, {
key: 'enableEventListeners',
value: function enableEventListeners$$1() {
return enableEventListeners.call(this);
}
}, {
key: 'disableEventListeners',
value: function disableEventListeners$$1() {
return disableEventListeners.call(this);
}
/**
* Schedules an update. It will run on the next UI update available.
* @method scheduleUpdate
* @memberof Popper
*/
/**
* Collection of utilities useful when writing custom modifiers.
* Starting from version 1.7, this method is available only if you
* include `popper-utils.js` before `popper.js`.
*
* **DEPRECATION**: This way to access PopperUtils is deprecated
* and will be removed in v2! Use the PopperUtils module directly instead.
* Due to the high instability of the methods contained in Utils, we can't
* guarantee them to follow semver. Use them at your own risk!
* @static
* @private
* @type {Object}
* @deprecated since version 1.8
* @member Utils
* @memberof Popper
*/
}]);
return Popper;
}();
/**
* The `referenceObject` is an object that provides an interface compatible with Popper.js
* and lets you use it as replacement of a real DOM node.<br />
* You can use this method to position a popper relatively to a set of coordinates
* in case you don't have a DOM node to use as reference.
*
* ```
* new Popper(referenceObject, popperNode);
* ```
*
* NB: This feature isn't supported in Internet Explorer 10.
* @name referenceObject
* @property {Function} data.getBoundingClientRect
* A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.
* @property {number} data.clientWidth
* An ES6 getter that will return the width of the virtual reference element.
* @property {number} data.clientHeight
* An ES6 getter that will return the height of the virtual reference element.
*/
Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;
Popper.placements = placements;
Popper.Defaults = Defaults;
/* harmony default export */ __webpack_exports__["default"] = (Popper);
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "./node_modules/prop-types/checkPropTypes.js":
/*!***************************************************!*\
!*** ./node_modules/prop-types/checkPropTypes.js ***!
\***************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var printWarning = function() {};
if (true) {
var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js");
var loggedTypeFailures = {};
printWarning = function(text) {
var message = 'Warning: ' + text;
if (typeof console !== 'undefined') {
console.error(message);
}
try {
// --- Welcome to debugging React ---
// This error was thrown as a convenience so that you can use this stack
// to find the callsite that caused this warning to fire.
throw new Error(message);
} catch (x) {}
};
}
/**
* Assert that the values match with the type specs.
* Error messages are memorized and will only be shown once.
*
* @param {object} typeSpecs Map of name to a ReactPropType
* @param {object} values Runtime values that need to be type-checked
* @param {string} location e.g. "prop", "context", "child context"
* @param {string} componentName Name of the component for error messages.
* @param {?Function} getStack Returns the component stack.
* @private
*/
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
if (true) {
for (var typeSpecName in typeSpecs) {
if (typeSpecs.hasOwnProperty(typeSpecName)) {
var error;
// Prop type validation may throw. In case they do, we don't want to
// fail the render phase where it didn't fail before. So we log it.
// After these have been cleaned up, we'll let them throw.
try {
// This is intentionally an invariant that gets caught. It's the same
// behavior as without this statement except with a better message.
if (typeof typeSpecs[typeSpecName] !== 'function') {
var err = Error(
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
);
err.name = 'Invariant Violation';
throw err;
}
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
} catch (ex) {
error = ex;
}
if (error && !(error instanceof Error)) {
printWarning(
(componentName || 'React class') + ': type specification of ' +
location + ' `' + typeSpecName + '` is invalid; the type checker ' +
'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
'You may have forgotten to pass an argument to the type checker ' +
'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
'shape all require an argument).'
)
}
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
// Only monitor this failure once because there tends to be a lot of the
// same error.
loggedTypeFailures[error.message] = true;
var stack = getStack ? getStack() : '';
printWarning(
'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
);
}
}
}
}
}
module.exports = checkPropTypes;
/***/ }),
/***/ "./node_modules/prop-types/factoryWithTypeCheckers.js":
/*!************************************************************!*\
!*** ./node_modules/prop-types/factoryWithTypeCheckers.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js");
var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js");
var checkPropTypes = __webpack_require__(/*! ./checkPropTypes */ "./node_modules/prop-types/checkPropTypes.js");
var printWarning = function() {};
if (true) {
printWarning = function(text) {
var message = 'Warning: ' + text;
if (typeof console !== 'undefined') {
console.error(message);
}
try {
// --- Welcome to debugging React ---
// This error was thrown as a convenience so that you can use this stack
// to find the callsite that caused this warning to fire.
throw new Error(message);
} catch (x) {}
};
}
function emptyFunctionThatReturnsNull() {
return null;
}
module.exports = function(isValidElement, throwOnDirectAccess) {
/* global Symbol */
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
/**
* Returns the iterator method function contained on the iterable object.
*
* Be sure to invoke the function with the iterable as context:
*
* var iteratorFn = getIteratorFn(myIterable);
* if (iteratorFn) {
* var iterator = iteratorFn.call(myIterable);
* ...
* }
*
* @param {?object} maybeIterable
* @return {?function}
*/
function getIteratorFn(maybeIterable) {
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
if (typeof iteratorFn === 'function') {
return iteratorFn;
}
}
/**
* Collection of methods that allow declaration and validation of props that are
* supplied to React components. Example usage:
*
* var Props = require('ReactPropTypes');
* var MyArticle = React.createClass({
* propTypes: {
* // An optional string prop named "description".
* description: Props.string,
*
* // A required enum prop named "category".
* category: Props.oneOf(['News','Photos']).isRequired,
*
* // A prop named "dialog" that requires an instance of Dialog.
* dialog: Props.instanceOf(Dialog).isRequired
* },
* render: function() { ... }
* });
*
* A more formal specification of how these methods are used:
*
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
* decl := ReactPropTypes.{type}(.isRequired)?
*
* Each and every declaration produces a function with the same signature. This
* allows the creation of custom validation functions. For example:
*
* var MyLink = React.createClass({
* propTypes: {
* // An optional string or URI prop named "href".
* href: function(props, propName, componentName) {
* var propValue = props[propName];
* if (propValue != null && typeof propValue !== 'string' &&
* !(propValue instanceof URI)) {
* return new Error(
* 'Expected a string or an URI for ' + propName + ' in ' +
* componentName
* );
* }
* }
* },
* render: function() {...}
* });
*
* @internal
*/
var ANONYMOUS = '<<anonymous>>';
// Important!
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
var ReactPropTypes = {
array: createPrimitiveTypeChecker('array'),
bool: createPrimitiveTypeChecker('boolean'),
func: createPrimitiveTypeChecker('function'),
number: createPrimitiveTypeChecker('number'),
object: createPrimitiveTypeChecker('object'),
string: createPrimitiveTypeChecker('string'),
symbol: createPrimitiveTypeChecker('symbol'),
any: createAnyTypeChecker(),
arrayOf: createArrayOfTypeChecker,
element: createElementTypeChecker(),
instanceOf: createInstanceTypeChecker,
node: createNodeChecker(),
objectOf: createObjectOfTypeChecker,
oneOf: createEnumTypeChecker,
oneOfType: createUnionTypeChecker,
shape: createShapeTypeChecker,
exact: createStrictShapeTypeChecker,
};
/**
* inlined Object.is polyfill to avoid requiring consumers ship their own
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
*/
/*eslint-disable no-self-compare*/
function is(x, y) {
// SameValue algorithm
if (x === y) {
// Steps 1-5, 7-10
// Steps 6.b-6.e: +0 != -0
return x !== 0 || 1 / x === 1 / y;
} else {
// Step 6.a: NaN == NaN
return x !== x && y !== y;
}
}
/*eslint-enable no-self-compare*/
/**
* We use an Error-like object for backward compatibility as people may call
* PropTypes directly and inspect their output. However, we don't use real
* Errors anymore. We don't inspect their stack anyway, and creating them
* is prohibitively expensive if they are created too often, such as what
* happens in oneOfType() for any type before the one that matched.
*/
function PropTypeError(message) {
this.message = message;
this.stack = '';
}
// Make `instanceof Error` still work for returned errors.
PropTypeError.prototype = Error.prototype;
function createChainableTypeChecker(validate) {
if (true) {
var manualPropTypeCallCache = {};
var manualPropTypeWarningCount = 0;
}
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
componentName = componentName || ANONYMOUS;
propFullName = propFullName || propName;
if (secret !== ReactPropTypesSecret) {
if (throwOnDirectAccess) {
// New behavior only for users of `prop-types` package
var err = new Error(
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
'Use `PropTypes.checkPropTypes()` to call them. ' +
'Read more at http://fb.me/use-check-prop-types'
);
err.name = 'Invariant Violation';
throw err;
} else if ( true && typeof console !== 'undefined') {
// Old behavior for people using React.PropTypes
var cacheKey = componentName + ':' + propName;
if (
!manualPropTypeCallCache[cacheKey] &&
// Avoid spamming the console because they are often not actionable except for lib authors
manualPropTypeWarningCount < 3
) {
printWarning(
'You are manually calling a React.PropTypes validation ' +
'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
'and will throw in the standalone `prop-types` package. ' +
'You may be seeing this warning due to a third-party PropTypes ' +
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
);
manualPropTypeCallCache[cacheKey] = true;
manualPropTypeWarningCount++;
}
}
}
if (props[propName] == null) {
if (isRequired) {
if (props[propName] === null) {
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
}
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
}
return null;
} else {
return validate(props, propName, componentName, location, propFullName);
}
}
var chainedCheckType = checkType.bind(null, false);
chainedCheckType.isRequired = checkType.bind(null, true);
return chainedCheckType;
}
function createPrimitiveTypeChecker(expectedType) {
function validate(props, propName, componentName, location, propFullName, secret) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== expectedType) {
// `propValue` being instance of, say, date/regexp, pass the 'object'
// check, but we can offer a more precise error message here rather than
// 'of type `object`'.
var preciseType = getPreciseType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createAnyTypeChecker() {
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
}
function createArrayOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
}
var propValue = props[propName];
if (!Array.isArray(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
}
for (var i = 0; i < propValue.length; i++) {
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
if (error instanceof Error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createElementTypeChecker() {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
if (!isValidElement(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createInstanceTypeChecker(expectedClass) {
function validate(props, propName, componentName, location, propFullName) {
if (!(props[propName] instanceof expectedClass)) {
var expectedClassName = expectedClass.name || ANONYMOUS;
var actualClassName = getClassName(props[propName]);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createEnumTypeChecker(expectedValues) {
if (!Array.isArray(expectedValues)) {
true ? printWarning('Invalid argument supplied to oneOf, expected an instance of array.') : undefined;
return emptyFunctionThatReturnsNull;
}
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
for (var i = 0; i < expectedValues.length; i++) {
if (is(propValue, expectedValues[i])) {
return null;
}
}
var valuesString = JSON.stringify(expectedValues);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
}
return createChainableTypeChecker(validate);
}
function createObjectOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
}
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
}
for (var key in propValue) {
if (propValue.hasOwnProperty(key)) {
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error instanceof Error) {
return error;
}
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createUnionTypeChecker(arrayOfTypeCheckers) {
if (!Array.isArray(arrayOfTypeCheckers)) {
true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : undefined;
return emptyFunctionThatReturnsNull;
}
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
if (typeof checker !== 'function') {
printWarning(
'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
);
return emptyFunctionThatReturnsNull;
}
}
function validate(props, propName, componentName, location, propFullName) {
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
return null;
}
}
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
}
return createChainableTypeChecker(validate);
}
function createNodeChecker() {
function validate(props, propName, componentName, location, propFullName) {
if (!isNode(props[propName])) {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createShapeTypeChecker(shapeTypes) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
}
for (var key in shapeTypes) {
var checker = shapeTypes[key];
if (!checker) {
continue;
}
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createStrictShapeTypeChecker(shapeTypes) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
}
// We need to check all keys in case some are required but missing from
// props.
var allKeys = assign({}, props[propName], shapeTypes);
for (var key in allKeys) {
var checker = shapeTypes[key];
if (!checker) {
return new PropTypeError(
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
);
}
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function isNode(propValue) {
switch (typeof propValue) {
case 'number':
case 'string':
case 'undefined':
return true;
case 'boolean':
return !propValue;
case 'object':
if (Array.isArray(propValue)) {
return propValue.every(isNode);
}
if (propValue === null || isValidElement(propValue)) {
return true;
}
var iteratorFn = getIteratorFn(propValue);
if (iteratorFn) {
var iterator = iteratorFn.call(propValue);
var step;
if (iteratorFn !== propValue.entries) {
while (!(step = iterator.next()).done) {
if (!isNode(step.value)) {
return false;
}
}
} else {
// Iterator will provide entry [k,v] tuples rather than values.
while (!(step = iterator.next()).done) {
var entry = step.value;
if (entry) {
if (!isNode(entry[1])) {
return false;
}
}
}
}
} else {
return false;
}
return true;
default:
return false;
}
}
function isSymbol(propType, propValue) {
// Native Symbol.
if (propType === 'symbol') {
return true;
}
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
if (propValue['@@toStringTag'] === 'Symbol') {
return true;
}
// Fallback for non-spec compliant Symbols which are polyfilled.
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
return true;
}
return false;
}
// Equivalent of `typeof` but with special handling for array and regexp.
function getPropType(propValue) {
var propType = typeof propValue;
if (Array.isArray(propValue)) {
return 'array';
}
if (propValue instanceof RegExp) {
// Old webkits (at least until Android 4.0) return 'function' rather than
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
// passes PropTypes.object.
return 'object';
}
if (isSymbol(propType, propValue)) {
return 'symbol';
}
return propType;
}
// This handles more types than `getPropType`. Only used for error messages.
// See `createPrimitiveTypeChecker`.
function getPreciseType(propValue) {
if (typeof propValue === 'undefined' || propValue === null) {
return '' + propValue;
}
var propType = getPropType(propValue);
if (propType === 'object') {
if (propValue instanceof Date) {
return 'date';
} else if (propValue instanceof RegExp) {
return 'regexp';
}
}
return propType;
}
// Returns a string that is postfixed to a warning about an invalid type.
// For example, "undefined" or "of type array"
function getPostfixForTypeWarning(value) {
var type = getPreciseType(value);
switch (type) {
case 'array':
case 'object':
return 'an ' + type;
case 'boolean':
case 'date':
case 'regexp':
return 'a ' + type;
default:
return type;
}
}
// Returns class name of the object, if any.
function getClassName(propValue) {
if (!propValue.constructor || !propValue.constructor.name) {
return ANONYMOUS;
}
return propValue.constructor.name;
}
ReactPropTypes.checkPropTypes = checkPropTypes;
ReactPropTypes.PropTypes = ReactPropTypes;
return ReactPropTypes;
};
/***/ }),
/***/ "./node_modules/prop-types/index.js":
/*!******************************************!*\
!*** ./node_modules/prop-types/index.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
if (true) {
var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&
Symbol.for &&
Symbol.for('react.element')) ||
0xeac7;
var isValidElement = function(object) {
return typeof object === 'object' &&
object !== null &&
object.$$typeof === REACT_ELEMENT_TYPE;
};
// By explicitly using `prop-types` you are opting into new development behavior.
// http://fb.me/prop-types-in-prod
var throwOnDirectAccess = true;
module.exports = __webpack_require__(/*! ./factoryWithTypeCheckers */ "./node_modules/prop-types/factoryWithTypeCheckers.js")(isValidElement, throwOnDirectAccess);
} else {}
/***/ }),
/***/ "./node_modules/prop-types/lib/ReactPropTypesSecret.js":
/*!*************************************************************!*\
!*** ./node_modules/prop-types/lib/ReactPropTypesSecret.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
module.exports = ReactPropTypesSecret;
/***/ }),
/***/ "./node_modules/re-resizable/lib/index.js":
/*!************************************************!*\
!*** ./node_modules/re-resizable/lib/index.js ***!
\************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
var classCallCheck = function (instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
};
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;
};
}();
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;
};
var inherits = function (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;
};
var possibleConstructorReturn = function (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;
};
var styles = {
base: {
position: 'absolute',
userSelect: 'none',
MsUserSelect: 'none'
},
top: {
width: '100%',
height: '10px',
top: '-5px',
left: '0px',
cursor: 'row-resize'
},
right: {
width: '10px',
height: '100%',
top: '0px',
right: '-5px',
cursor: 'col-resize'
},
bottom: {
width: '100%',
height: '10px',
bottom: '-5px',
left: '0px',
cursor: 'row-resize'
},
left: {
width: '10px',
height: '100%',
top: '0px',
left: '-5px',
cursor: 'col-resize'
},
topRight: {
width: '20px',
height: '20px',
position: 'absolute',
right: '-10px',
top: '-10px',
cursor: 'ne-resize'
},
bottomRight: {
width: '20px',
height: '20px',
position: 'absolute',
right: '-10px',
bottom: '-10px',
cursor: 'se-resize'
},
bottomLeft: {
width: '20px',
height: '20px',
position: 'absolute',
left: '-10px',
bottom: '-10px',
cursor: 'sw-resize'
},
topLeft: {
width: '20px',
height: '20px',
position: 'absolute',
left: '-10px',
top: '-10px',
cursor: 'nw-resize'
}
};
var Resizer = (function (props) {
return Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])(
'div',
{
className: props.className,
style: _extends({}, styles.base, styles[props.direction], props.replaceStyles || {}),
onMouseDown: function onMouseDown(e) {
props.onResizeStart(e, props.direction);
},
onTouchStart: function onTouchStart(e) {
props.onResizeStart(e, props.direction);
}
},
props.children
);
});
var userSelectNone = {
userSelect: 'none',
MozUserSelect: 'none',
WebkitUserSelect: 'none',
MsUserSelect: 'none'
};
var userSelectAuto = {
userSelect: 'auto',
MozUserSelect: 'auto',
WebkitUserSelect: 'auto',
MsUserSelect: 'auto'
};
var clamp = function clamp(n, min, max) {
return Math.max(Math.min(n, max), min);
};
var snap = function snap(n, size) {
return Math.round(n / size) * size;
};
var findClosestSnap = function findClosestSnap(n, snapArray) {
return snapArray.reduce(function (prev, curr) {
return Math.abs(curr - n) < Math.abs(prev - n) ? curr : prev;
});
};
var endsWith = function endsWith(str, searchStr) {
return str.substr(str.length - searchStr.length, searchStr.length) === searchStr;
};
var getStringSize = function getStringSize(n) {
if (n.toString() === 'auto') return n.toString();
if (endsWith(n.toString(), 'px')) return n.toString();
if (endsWith(n.toString(), '%')) return n.toString();
if (endsWith(n.toString(), 'vh')) return n.toString();
if (endsWith(n.toString(), 'vw')) return n.toString();
if (endsWith(n.toString(), 'vmax')) return n.toString();
if (endsWith(n.toString(), 'vmin')) return n.toString();
return n + 'px';
};
var definedProps = ['style', 'className', 'grid', 'snap', 'bounds', 'size', 'defaultSize', 'minWidth', 'minHeight', 'maxWidth', 'maxHeight', 'lockAspectRatio', 'lockAspectRatioExtraWidth', 'lockAspectRatioExtraHeight', 'enable', 'handleStyles', 'handleClasses', 'handleWrapperStyle', 'handleWrapperClass', 'children', 'onResizeStart', 'onResize', 'onResizeStop', 'handleComponent', 'scale'];
var baseClassName = '__resizable_base__';
var Resizable = function (_React$Component) {
inherits(Resizable, _React$Component);
function Resizable(props) {
classCallCheck(this, Resizable);
var _this = possibleConstructorReturn(this, (Resizable.__proto__ || Object.getPrototypeOf(Resizable)).call(this, props));
_this.state = {
isResizing: false,
resizeCursor: 'auto',
width: typeof (_this.propsSize && _this.propsSize.width) === 'undefined' ? 'auto' : _this.propsSize && _this.propsSize.width,
height: typeof (_this.propsSize && _this.propsSize.height) === 'undefined' ? 'auto' : _this.propsSize && _this.propsSize.height,
direction: 'right',
original: {
x: 0,
y: 0,
width: 0,
height: 0
}
};
_this.updateExtendsProps(props);
_this.onResizeStart = _this.onResizeStart.bind(_this);
_this.onMouseMove = _this.onMouseMove.bind(_this);
_this.onMouseUp = _this.onMouseUp.bind(_this);
if (typeof window !== 'undefined') {
window.addEventListener('mouseup', _this.onMouseUp);
window.addEventListener('mousemove', _this.onMouseMove);
window.addEventListener('mouseleave', _this.onMouseUp);
window.addEventListener('touchmove', _this.onMouseMove);
window.addEventListener('touchend', _this.onMouseUp);
}
return _this;
}
createClass(Resizable, [{
key: 'updateExtendsProps',
value: function updateExtendsProps(props) {
this.extendsProps = Object.keys(props).reduce(function (acc, key) {
if (definedProps.indexOf(key) !== -1) return acc;
acc[key] = props[key];
return acc;
}, {});
}
}, {
key: 'getParentSize',
value: function getParentSize() {
var base = this.base;
if (!base) return { width: window.innerWidth, height: window.innerHeight };
// INFO: To calculate parent width with flex layout
var wrapChanged = false;
var wrap = this.parentNode.style.flexWrap;
var minWidth = base.style.minWidth;
if (wrap !== 'wrap') {
wrapChanged = true;
this.parentNode.style.flexWrap = 'wrap';
// HACK: Use relative to get parent padding size
}
base.style.position = 'relative';
base.style.minWidth = '100%';
var size = {
width: base.offsetWidth,
height: base.offsetHeight
};
base.style.position = 'absolute';
if (wrapChanged) this.parentNode.style.flexWrap = wrap;
base.style.minWidth = minWidth;
return size;
}
}, {
key: 'componentDidMount',
value: function componentDidMount() {
var size = this.size;
this.setState({
width: this.state.width || size.width,
height: this.state.height || size.height
});
var parent = this.parentNode;
if (!(parent instanceof HTMLElement)) return;
if (this.base) return;
var element = document.createElement('div');
element.style.width = '100%';
element.style.height = '100%';
element.style.position = 'absolute';
element.style.transform = 'scale(0, 0)';
element.style.left = '0';
element.style.flex = '0';
if (element.classList) {
element.classList.add(baseClassName);
} else {
element.className += baseClassName;
}
parent.appendChild(element);
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(next) {
this.updateExtendsProps(next);
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
if (typeof window !== 'undefined') {
window.removeEventListener('mouseup', this.onMouseUp);
window.removeEventListener('mousemove', this.onMouseMove);
window.removeEventListener('mouseleave', this.onMouseUp);
window.removeEventListener('touchmove', this.onMouseMove);
window.removeEventListener('touchend', this.onMouseUp);
var parent = this.parentNode;
var base = this.base;
if (!base || !parent) return;
if (!(parent instanceof HTMLElement) || !(base instanceof Node)) return;
parent.removeChild(base);
}
}
}, {
key: 'calculateNewSize',
value: function calculateNewSize(newSize, kind) {
var propsSize = this.propsSize && this.propsSize[kind];
return this.state[kind] === 'auto' && this.state.original[kind] === newSize && (typeof propsSize === 'undefined' || propsSize === 'auto') ? 'auto' : newSize;
}
}, {
key: 'onResizeStart',
value: function onResizeStart(event, direction) {
var clientX = 0;
var clientY = 0;
if (event.nativeEvent instanceof MouseEvent) {
clientX = event.nativeEvent.clientX;
clientY = event.nativeEvent.clientY;
// When user click with right button the resize is stuck in resizing mode
// until users clicks again, dont continue if right click is used.
// HACK: MouseEvent does not have `which` from flow-bin v0.68.
if (event.nativeEvent.which === 3) {
return;
}
} else if (event.nativeEvent instanceof TouchEvent) {
clientX = event.nativeEvent.touches[0].clientX;
clientY = event.nativeEvent.touches[0].clientY;
}
if (this.props.onResizeStart) {
this.props.onResizeStart(event, direction, this.resizable);
}
// Fix #168
if (this.props.size) {
if (typeof this.props.size.height !== 'undefined' && this.props.size.height !== this.state.height) {
this.setState({ height: this.props.size.height });
}
if (typeof this.props.size.width !== 'undefined' && this.props.size.width !== this.state.width) {
this.setState({ width: this.props.size.width });
}
}
this.setState({
original: {
x: clientX,
y: clientY,
width: this.size.width,
height: this.size.height
},
isResizing: true,
resizeCursor: window.getComputedStyle(event.target).cursor,
direction: direction
});
}
}, {
key: 'onMouseMove',
value: function onMouseMove(event) {
if (!this.state.isResizing) return;
var clientX = event instanceof MouseEvent ? event.clientX : event.touches[0].clientX;
var clientY = event instanceof MouseEvent ? event.clientY : event.touches[0].clientY;
var _state = this.state,
direction = _state.direction,
original = _state.original,
width = _state.width,
height = _state.height;
var _props = this.props,
lockAspectRatio = _props.lockAspectRatio,
lockAspectRatioExtraHeight = _props.lockAspectRatioExtraHeight,
lockAspectRatioExtraWidth = _props.lockAspectRatioExtraWidth;
var scale = this.props.scale || 1;
var _props2 = this.props,
maxWidth = _props2.maxWidth,
maxHeight = _props2.maxHeight,
minWidth = _props2.minWidth,
minHeight = _props2.minHeight;
// TODO: refactor
var parentSize = this.getParentSize();
if (maxWidth && typeof maxWidth === 'string' && endsWith(maxWidth, '%')) {
var _ratio = Number(maxWidth.replace('%', '')) / 100;
maxWidth = parentSize.width * _ratio;
}
if (maxHeight && typeof maxHeight === 'string' && endsWith(maxHeight, '%')) {
var _ratio2 = Number(maxHeight.replace('%', '')) / 100;
maxHeight = parentSize.height * _ratio2;
}
if (minWidth && typeof minWidth === 'string' && endsWith(minWidth, '%')) {
var _ratio3 = Number(minWidth.replace('%', '')) / 100;
minWidth = parentSize.width * _ratio3;
}
if (minHeight && typeof minHeight === 'string' && endsWith(minHeight, '%')) {
var _ratio4 = Number(minHeight.replace('%', '')) / 100;
minHeight = parentSize.height * _ratio4;
}
maxWidth = typeof maxWidth === 'undefined' ? undefined : Number(maxWidth);
maxHeight = typeof maxHeight === 'undefined' ? undefined : Number(maxHeight);
minWidth = typeof minWidth === 'undefined' ? undefined : Number(minWidth);
minHeight = typeof minHeight === 'undefined' ? undefined : Number(minHeight);
var ratio = typeof lockAspectRatio === 'number' ? lockAspectRatio : original.width / original.height;
var newWidth = original.width;
var newHeight = original.height;
if (/right/i.test(direction)) {
newWidth = original.width + (clientX - original.x) / scale;
if (lockAspectRatio) newHeight = (newWidth - lockAspectRatioExtraWidth) / ratio + lockAspectRatioExtraHeight;
}
if (/left/i.test(direction)) {
newWidth = original.width - (clientX - original.x) / scale;
if (lockAspectRatio) newHeight = (newWidth - lockAspectRatioExtraWidth) / ratio + lockAspectRatioExtraHeight;
}
if (/bottom/i.test(direction)) {
newHeight = original.height + (clientY - original.y) / scale;
if (lockAspectRatio) newWidth = (newHeight - lockAspectRatioExtraHeight) * ratio + lockAspectRatioExtraWidth;
}
if (/top/i.test(direction)) {
newHeight = original.height - (clientY - original.y) / scale;
if (lockAspectRatio) newWidth = (newHeight - lockAspectRatioExtraHeight) * ratio + lockAspectRatioExtraWidth;
}
if (this.props.bounds === 'parent') {
var parent = this.parentNode;
if (parent instanceof HTMLElement) {
var parentRect = parent.getBoundingClientRect();
var parentLeft = parentRect.left;
var parentTop = parentRect.top;
var _resizable$getBoundin = this.resizable.getBoundingClientRect(),
_left = _resizable$getBoundin.left,
_top = _resizable$getBoundin.top;
var boundWidth = parent.offsetWidth + (parentLeft - _left);
var boundHeight = parent.offsetHeight + (parentTop - _top);
maxWidth = maxWidth && maxWidth < boundWidth ? maxWidth : boundWidth;
maxHeight = maxHeight && maxHeight < boundHeight ? maxHeight : boundHeight;
}
} else if (this.props.bounds === 'window') {
if (typeof window !== 'undefined') {
var _resizable$getBoundin2 = this.resizable.getBoundingClientRect(),
_left2 = _resizable$getBoundin2.left,
_top2 = _resizable$getBoundin2.top;
var _boundWidth = window.innerWidth - _left2;
var _boundHeight = window.innerHeight - _top2;
maxWidth = maxWidth && maxWidth < _boundWidth ? maxWidth : _boundWidth;
maxHeight = maxHeight && maxHeight < _boundHeight ? maxHeight : _boundHeight;
}
} else if (this.props.bounds instanceof HTMLElement) {
var targetRect = this.props.bounds.getBoundingClientRect();
var targetLeft = targetRect.left;
var targetTop = targetRect.top;
var _resizable$getBoundin3 = this.resizable.getBoundingClientRect(),
_left3 = _resizable$getBoundin3.left,
_top3 = _resizable$getBoundin3.top;
if (!(this.props.bounds instanceof HTMLElement)) return;
var _boundWidth2 = this.props.bounds.offsetWidth + (targetLeft - _left3);
var _boundHeight2 = this.props.bounds.offsetHeight + (targetTop - _top3);
maxWidth = maxWidth && maxWidth < _boundWidth2 ? maxWidth : _boundWidth2;
maxHeight = maxHeight && maxHeight < _boundHeight2 ? maxHeight : _boundHeight2;
}
var computedMinWidth = typeof minWidth === 'undefined' ? 10 : minWidth;
var computedMaxWidth = typeof maxWidth === 'undefined' || maxWidth < 0 ? newWidth : maxWidth;
var computedMinHeight = typeof minHeight === 'undefined' ? 10 : minHeight;
var computedMaxHeight = typeof maxHeight === 'undefined' || maxHeight < 0 ? newHeight : maxHeight;
if (lockAspectRatio) {
var extraMinWidth = (computedMinHeight - lockAspectRatioExtraHeight) * ratio + lockAspectRatioExtraWidth;
var extraMaxWidth = (computedMaxHeight - lockAspectRatioExtraHeight) * ratio + lockAspectRatioExtraWidth;
var extraMinHeight = (computedMinWidth - lockAspectRatioExtraWidth) / ratio + lockAspectRatioExtraHeight;
var extraMaxHeight = (computedMaxWidth - lockAspectRatioExtraWidth) / ratio + lockAspectRatioExtraHeight;
var lockedMinWidth = Math.max(computedMinWidth, extraMinWidth);
var lockedMaxWidth = Math.min(computedMaxWidth, extraMaxWidth);
var lockedMinHeight = Math.max(computedMinHeight, extraMinHeight);
var lockedMaxHeight = Math.min(computedMaxHeight, extraMaxHeight);
newWidth = clamp(newWidth, lockedMinWidth, lockedMaxWidth);
newHeight = clamp(newHeight, lockedMinHeight, lockedMaxHeight);
} else {
newWidth = clamp(newWidth, computedMinWidth, computedMaxWidth);
newHeight = clamp(newHeight, computedMinHeight, computedMaxHeight);
}
if (this.props.grid) {
newWidth = snap(newWidth, this.props.grid[0]);
}
if (this.props.grid) {
newHeight = snap(newHeight, this.props.grid[1]);
}
if (this.props.snap && this.props.snap.x) {
newWidth = findClosestSnap(newWidth, this.props.snap.x);
}
if (this.props.snap && this.props.snap.y) {
newHeight = findClosestSnap(newHeight, this.props.snap.y);
}
var delta = {
width: newWidth - original.width,
height: newHeight - original.height
};
if (width && typeof width === 'string' && endsWith(width, '%')) {
var percent = newWidth / parentSize.width * 100;
newWidth = percent + '%';
}
if (height && typeof height === 'string' && endsWith(height, '%')) {
var _percent = newHeight / parentSize.height * 100;
newHeight = _percent + '%';
}
this.setState({
width: this.calculateNewSize(newWidth, 'width'),
height: this.calculateNewSize(newHeight, 'height')
});
if (this.props.onResize) {
this.props.onResize(event, direction, this.resizable, delta);
}
}
}, {
key: 'onMouseUp',
value: function onMouseUp(event) {
var _state2 = this.state,
isResizing = _state2.isResizing,
direction = _state2.direction,
original = _state2.original;
if (!isResizing) return;
var delta = {
width: this.size.width - original.width,
height: this.size.height - original.height
};
if (this.props.onResizeStop) {
this.props.onResizeStop(event, direction, this.resizable, delta);
}
if (this.props.size) {
this.setState(this.props.size);
}
this.setState({ isResizing: false, resizeCursor: 'auto' });
}
}, {
key: 'updateSize',
value: function updateSize(size) {
this.setState({ width: size.width, height: size.height });
}
}, {
key: 'renderResizer',
value: function renderResizer() {
var _this2 = this;
var _props3 = this.props,
enable = _props3.enable,
handleStyles = _props3.handleStyles,
handleClasses = _props3.handleClasses,
handleWrapperStyle = _props3.handleWrapperStyle,
handleWrapperClass = _props3.handleWrapperClass,
handleComponent = _props3.handleComponent;
if (!enable) return null;
var resizers = Object.keys(enable).map(function (dir) {
if (enable[dir] !== false) {
return Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])(
Resizer,
{
key: dir,
direction: dir,
onResizeStart: _this2.onResizeStart,
replaceStyles: handleStyles && handleStyles[dir],
className: handleClasses && handleClasses[dir]
},
handleComponent && handleComponent[dir] ? Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])(handleComponent[dir]) : null
);
}
return null;
});
// #93 Wrap the resize box in span (will not break 100% width/height)
return Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])(
'span',
{ className: handleWrapperClass, style: handleWrapperStyle },
resizers
);
}
}, {
key: 'render',
value: function render() {
var _this3 = this;
var userSelect = this.state.isResizing ? userSelectNone : userSelectAuto;
return Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])(
'div',
_extends({
ref: function ref(c) {
if (c) {
_this3.resizable = c;
}
},
style: _extends({
position: 'relative'
}, userSelect, this.props.style, this.sizeStyle, {
maxWidth: this.props.maxWidth,
maxHeight: this.props.maxHeight,
minWidth: this.props.minWidth,
minHeight: this.props.minHeight,
boxSizing: 'border-box'
}),
className: this.props.className
}, this.extendsProps),
this.state.isResizing && Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])('div', {
style: {
height: '100%',
width: '100%',
backgroundColor: 'rgba(0,0,0,0)',
cursor: '' + (this.state.resizeCursor || 'auto'),
opacity: '0',
position: 'fixed',
zIndex: '9999',
top: '0',
left: '0',
bottom: '0',
right: '0'
}
}),
this.props.children,
this.renderResizer()
);
}
}, {
key: 'parentNode',
get: function get$$1() {
return this.resizable.parentNode;
}
}, {
key: 'propsSize',
get: function get$$1() {
return this.props.size || this.props.defaultSize;
}
}, {
key: 'base',
get: function get$$1() {
var parent = this.parentNode;
if (!parent) return undefined;
var children = [].slice.call(parent.children);
for (var i = 0; i < children.length; i += 1) {
var n = children[i];
if (n instanceof HTMLElement) {
if (n.classList.contains(baseClassName)) {
return n;
}
}
}
return undefined;
}
}, {
key: 'size',
get: function get$$1() {
var width = 0;
var height = 0;
if (typeof window !== 'undefined') {
var orgWidth = this.resizable.offsetWidth;
var orgHeight = this.resizable.offsetHeight;
// HACK: Set position `relative` to get parent size.
// This is because when re-resizable set `absolute`, I can not get base width correctly.
var orgPosition = this.resizable.style.position;
if (orgPosition !== 'relative') {
this.resizable.style.position = 'relative';
}
// INFO: Use original width or height if set auto.
width = this.resizable.style.width !== 'auto' ? this.resizable.offsetWidth : orgWidth;
height = this.resizable.style.height !== 'auto' ? this.resizable.offsetHeight : orgHeight;
// Restore original position
this.resizable.style.position = orgPosition;
}
return { width: width, height: height };
}
}, {
key: 'sizeStyle',
get: function get$$1() {
var _this4 = this;
var size = this.props.size;
var getSize = function getSize(key) {
if (typeof _this4.state[key] === 'undefined' || _this4.state[key] === 'auto') return 'auto';
if (_this4.propsSize && _this4.propsSize[key] && endsWith(_this4.propsSize[key].toString(), '%')) {
if (endsWith(_this4.state[key].toString(), '%')) return _this4.state[key].toString();
var parentSize = _this4.getParentSize();
var value = Number(_this4.state[key].toString().replace('px', ''));
var percent = value / parentSize[key] * 100;
return percent + '%';
}
return getStringSize(_this4.state[key]);
};
var width = size && typeof size.width !== 'undefined' && !this.state.isResizing ? getStringSize(size.width) : getSize('width');
var height = size && typeof size.height !== 'undefined' && !this.state.isResizing ? getStringSize(size.height) : getSize('height');
return { width: width, height: height };
}
}]);
return Resizable;
}(react__WEBPACK_IMPORTED_MODULE_0__["Component"]);
Resizable.defaultProps = {
onResizeStart: function onResizeStart() {},
onResize: function onResize() {},
onResizeStop: function onResizeStop() {},
enable: {
top: true,
right: true,
bottom: true,
left: true,
topRight: true,
bottomRight: true,
bottomLeft: true,
topLeft: true
},
style: {},
grid: [1, 1],
lockAspectRatio: false,
lockAspectRatioExtraWidth: 0,
lockAspectRatioExtraHeight: 0,
scale: 1
};
/* harmony default export */ __webpack_exports__["default"] = (Resizable);
/***/ }),
/***/ "./node_modules/react-click-outside/dist/index.js":
/*!********************************************************!*\
!*** ./node_modules/react-click-outside/dist/index.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
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; };
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; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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; }
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; }
var hoistNonReactStatic = __webpack_require__(/*! hoist-non-react-statics */ "./node_modules/hoist-non-react-statics/index.js");
var React = __webpack_require__(/*! react */ "react");
var ReactDOM = __webpack_require__(/*! react-dom */ "react-dom");
module.exports = function enhanceWithClickOutside(WrappedComponent) {
var componentName = WrappedComponent.displayName || WrappedComponent.name;
var EnhancedComponent = function (_React$Component) {
_inherits(EnhancedComponent, _React$Component);
function EnhancedComponent(props) {
_classCallCheck(this, EnhancedComponent);
var _this = _possibleConstructorReturn(this, (EnhancedComponent.__proto__ || Object.getPrototypeOf(EnhancedComponent)).call(this, props));
_this.handleClickOutside = _this.handleClickOutside.bind(_this);
return _this;
}
_createClass(EnhancedComponent, [{
key: 'componentDidMount',
value: function componentDidMount() {
document.addEventListener('click', this.handleClickOutside, true);
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
document.removeEventListener('click', this.handleClickOutside, true);
}
}, {
key: 'handleClickOutside',
value: function handleClickOutside(e) {
var domNode = this.__domNode;
if ((!domNode || !domNode.contains(e.target)) && typeof this.__wrappedComponent.handleClickOutside === 'function') {
this.__wrappedComponent.handleClickOutside(e);
}
}
}, {
key: 'render',
value: function render() {
var _this2 = this;
return React.createElement(WrappedComponent, _extends({}, this.props, {
ref: function ref(c) {
_this2.__wrappedComponent = c;
_this2.__domNode = ReactDOM.findDOMNode(c);
}
}));
}
}]);
return EnhancedComponent;
}(React.Component);
EnhancedComponent.displayName = 'Wrapped' + componentName;
return hoistNonReactStatic(EnhancedComponent, WrappedComponent);
};
/***/ }),
/***/ "./node_modules/react-color/lib/components/alpha/Alpha.js":
/*!****************************************************************!*\
!*** ./node_modules/react-color/lib/components/alpha/Alpha.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AlphaPicker = undefined;
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; };
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
var _common = __webpack_require__(/*! ../common */ "./node_modules/react-color/lib/components/common/index.js");
var _AlphaPointer = __webpack_require__(/*! ./AlphaPointer */ "./node_modules/react-color/lib/components/alpha/AlphaPointer.js");
var _AlphaPointer2 = _interopRequireDefault(_AlphaPointer);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var AlphaPicker = exports.AlphaPicker = function AlphaPicker(_ref) {
var rgb = _ref.rgb,
hsl = _ref.hsl,
width = _ref.width,
height = _ref.height,
onChange = _ref.onChange,
direction = _ref.direction,
style = _ref.style,
renderers = _ref.renderers,
pointer = _ref.pointer,
_ref$className = _ref.className,
className = _ref$className === undefined ? '' : _ref$className;
var styles = (0, _reactcss2.default)({
'default': {
picker: {
position: 'relative',
width: width,
height: height
},
alpha: {
radius: '2px',
style: style
}
}
});
return _react2.default.createElement(
'div',
{ style: styles.picker, className: 'alpha-picker ' + className },
_react2.default.createElement(_common.Alpha, _extends({}, styles.alpha, {
rgb: rgb,
hsl: hsl,
pointer: pointer,
renderers: renderers,
onChange: onChange,
direction: direction
}))
);
};
AlphaPicker.defaultProps = {
width: '316px',
height: '16px',
direction: 'horizontal',
pointer: _AlphaPointer2.default
};
exports.default = (0, _common.ColorWrap)(AlphaPicker);
/***/ }),
/***/ "./node_modules/react-color/lib/components/alpha/AlphaPointer.js":
/*!***********************************************************************!*\
!*** ./node_modules/react-color/lib/components/alpha/AlphaPointer.js ***!
\***********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AlphaPointer = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var AlphaPointer = exports.AlphaPointer = function AlphaPointer(_ref) {
var direction = _ref.direction;
var styles = (0, _reactcss2.default)({
'default': {
picker: {
width: '18px',
height: '18px',
borderRadius: '50%',
transform: 'translate(-9px, -1px)',
backgroundColor: 'rgb(248, 248, 248)',
boxShadow: '0 1px 4px 0 rgba(0, 0, 0, 0.37)'
}
},
'vertical': {
picker: {
transform: 'translate(-3px, -9px)'
}
}
}, { vertical: direction === 'vertical' });
return _react2.default.createElement('div', { style: styles.picker });
};
exports.default = AlphaPointer;
/***/ }),
/***/ "./node_modules/react-color/lib/components/block/Block.js":
/*!****************************************************************!*\
!*** ./node_modules/react-color/lib/components/block/Block.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Block = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
var _color = __webpack_require__(/*! ../../helpers/color */ "./node_modules/react-color/lib/helpers/color.js");
var _color2 = _interopRequireDefault(_color);
var _common = __webpack_require__(/*! ../common */ "./node_modules/react-color/lib/components/common/index.js");
var _BlockSwatches = __webpack_require__(/*! ./BlockSwatches */ "./node_modules/react-color/lib/components/block/BlockSwatches.js");
var _BlockSwatches2 = _interopRequireDefault(_BlockSwatches);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var Block = exports.Block = function Block(_ref) {
var onChange = _ref.onChange,
onSwatchHover = _ref.onSwatchHover,
hex = _ref.hex,
colors = _ref.colors,
width = _ref.width,
triangle = _ref.triangle,
_ref$className = _ref.className,
className = _ref$className === undefined ? '' : _ref$className;
var transparent = hex === 'transparent';
var handleChange = function handleChange(hexCode, e) {
_color2.default.isValidHex(hexCode) && onChange({
hex: hexCode,
source: 'hex'
}, e);
};
var styles = (0, _reactcss2.default)({
'default': {
card: {
width: width,
background: '#fff',
boxShadow: '0 1px rgba(0,0,0,.1)',
borderRadius: '6px',
position: 'relative'
},
head: {
height: '110px',
background: hex,
borderRadius: '6px 6px 0 0',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
position: 'relative'
},
body: {
padding: '10px'
},
label: {
fontSize: '18px',
color: _color2.default.getContrastingColor(hex),
position: 'relative'
},
triangle: {
width: '0px',
height: '0px',
borderStyle: 'solid',
borderWidth: '0 10px 10px 10px',
borderColor: 'transparent transparent ' + hex + ' transparent',
position: 'absolute',
top: '-10px',
left: '50%',
marginLeft: '-10px'
},
input: {
width: '100%',
fontSize: '12px',
color: '#666',
border: '0px',
outline: 'none',
height: '22px',
boxShadow: 'inset 0 0 0 1px #ddd',
borderRadius: '4px',
padding: '0 7px',
boxSizing: 'border-box'
}
},
'hide-triangle': {
triangle: {
display: 'none'
}
}
}, { 'hide-triangle': triangle === 'hide' });
return _react2.default.createElement(
'div',
{ style: styles.card, className: 'block-picker ' + className },
_react2.default.createElement('div', { style: styles.triangle }),
_react2.default.createElement(
'div',
{ style: styles.head },
transparent && _react2.default.createElement(_common.Checkboard, { borderRadius: '6px 6px 0 0' }),
_react2.default.createElement(
'div',
{ style: styles.label },
hex
)
),
_react2.default.createElement(
'div',
{ style: styles.body },
_react2.default.createElement(_BlockSwatches2.default, { colors: colors, onClick: handleChange, onSwatchHover: onSwatchHover }),
_react2.default.createElement(_common.EditableInput, {
style: { input: styles.input },
value: hex,
onChange: handleChange
})
)
);
};
Block.propTypes = {
width: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),
colors: _propTypes2.default.arrayOf(_propTypes2.default.string),
triangle: _propTypes2.default.oneOf(['top', 'hide'])
};
Block.defaultProps = {
width: 170,
colors: ['#D9E3F0', '#F47373', '#697689', '#37D67A', '#2CCCE4', '#555555', '#dce775', '#ff8a65', '#ba68c8'],
triangle: 'top'
};
exports.default = (0, _common.ColorWrap)(Block);
/***/ }),
/***/ "./node_modules/react-color/lib/components/block/BlockSwatches.js":
/*!************************************************************************!*\
!*** ./node_modules/react-color/lib/components/block/BlockSwatches.js ***!
\************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.BlockSwatches = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
var _map = __webpack_require__(/*! lodash/map */ "./node_modules/lodash/map.js");
var _map2 = _interopRequireDefault(_map);
var _common = __webpack_require__(/*! ../common */ "./node_modules/react-color/lib/components/common/index.js");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var BlockSwatches = exports.BlockSwatches = function BlockSwatches(_ref) {
var colors = _ref.colors,
onClick = _ref.onClick,
onSwatchHover = _ref.onSwatchHover;
var styles = (0, _reactcss2.default)({
'default': {
swatches: {
marginRight: '-10px'
},
swatch: {
width: '22px',
height: '22px',
float: 'left',
marginRight: '10px',
marginBottom: '10px',
borderRadius: '4px'
},
clear: {
clear: 'both'
}
}
});
return _react2.default.createElement(
'div',
{ style: styles.swatches },
(0, _map2.default)(colors, function (c) {
return _react2.default.createElement(_common.Swatch, {
key: c,
color: c,
style: styles.swatch,
onClick: onClick,
onHover: onSwatchHover,
focusStyle: {
boxShadow: '0 0 4px ' + c
}
});
}),
_react2.default.createElement('div', { style: styles.clear })
);
};
exports.default = BlockSwatches;
/***/ }),
/***/ "./node_modules/react-color/lib/components/chrome/Chrome.js":
/*!******************************************************************!*\
!*** ./node_modules/react-color/lib/components/chrome/Chrome.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Chrome = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
var _common = __webpack_require__(/*! ../common */ "./node_modules/react-color/lib/components/common/index.js");
var _ChromeFields = __webpack_require__(/*! ./ChromeFields */ "./node_modules/react-color/lib/components/chrome/ChromeFields.js");
var _ChromeFields2 = _interopRequireDefault(_ChromeFields);
var _ChromePointer = __webpack_require__(/*! ./ChromePointer */ "./node_modules/react-color/lib/components/chrome/ChromePointer.js");
var _ChromePointer2 = _interopRequireDefault(_ChromePointer);
var _ChromePointerCircle = __webpack_require__(/*! ./ChromePointerCircle */ "./node_modules/react-color/lib/components/chrome/ChromePointerCircle.js");
var _ChromePointerCircle2 = _interopRequireDefault(_ChromePointerCircle);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var Chrome = exports.Chrome = function Chrome(_ref) {
var onChange = _ref.onChange,
disableAlpha = _ref.disableAlpha,
rgb = _ref.rgb,
hsl = _ref.hsl,
hsv = _ref.hsv,
hex = _ref.hex,
renderers = _ref.renderers,
_ref$className = _ref.className,
className = _ref$className === undefined ? '' : _ref$className;
var styles = (0, _reactcss2.default)({
'default': {
picker: {
background: '#fff',
borderRadius: '2px',
boxShadow: '0 0 2px rgba(0,0,0,.3), 0 4px 8px rgba(0,0,0,.3)',
boxSizing: 'initial',
width: '225px',
fontFamily: 'Menlo'
},
saturation: {
width: '100%',
paddingBottom: '55%',
position: 'relative',
borderRadius: '2px 2px 0 0',
overflow: 'hidden'
},
Saturation: {
radius: '2px 2px 0 0'
},
body: {
padding: '16px 16px 12px'
},
controls: {
display: 'flex'
},
color: {
width: '32px'
},
swatch: {
marginTop: '6px',
width: '16px',
height: '16px',
borderRadius: '8px',
position: 'relative',
overflow: 'hidden'
},
active: {
absolute: '0px 0px 0px 0px',
borderRadius: '8px',
boxShadow: 'inset 0 0 0 1px rgba(0,0,0,.1)',
background: 'rgba(' + rgb.r + ', ' + rgb.g + ', ' + rgb.b + ', ' + rgb.a + ')',
zIndex: '2'
},
toggles: {
flex: '1'
},
hue: {
height: '10px',
position: 'relative',
marginBottom: '8px'
},
Hue: {
radius: '2px'
},
alpha: {
height: '10px',
position: 'relative'
},
Alpha: {
radius: '2px'
}
},
'disableAlpha': {
color: {
width: '22px'
},
alpha: {
display: 'none'
},
hue: {
marginBottom: '0px'
},
swatch: {
width: '10px',
height: '10px',
marginTop: '0px'
}
}
}, { disableAlpha: disableAlpha });
return _react2.default.createElement(
'div',
{ style: styles.picker, className: 'chrome-picker ' + className },
_react2.default.createElement(
'div',
{ style: styles.saturation },
_react2.default.createElement(_common.Saturation, {
style: styles.Saturation,
hsl: hsl,
hsv: hsv,
pointer: _ChromePointerCircle2.default,
onChange: onChange
})
),
_react2.default.createElement(
'div',
{ style: styles.body },
_react2.default.createElement(
'div',
{ style: styles.controls, className: 'flexbox-fix' },
_react2.default.createElement(
'div',
{ style: styles.color },
_react2.default.createElement(
'div',
{ style: styles.swatch },
_react2.default.createElement('div', { style: styles.active }),
_react2.default.createElement(_common.Checkboard, { renderers: renderers })
)
),
_react2.default.createElement(
'div',
{ style: styles.toggles },
_react2.default.createElement(
'div',
{ style: styles.hue },
_react2.default.createElement(_common.Hue, {
style: styles.Hue,
hsl: hsl,
pointer: _ChromePointer2.default,
onChange: onChange
})
),
_react2.default.createElement(
'div',
{ style: styles.alpha },
_react2.default.createElement(_common.Alpha, {
style: styles.Alpha,
rgb: rgb,
hsl: hsl,
pointer: _ChromePointer2.default,
renderers: renderers,
onChange: onChange
})
)
)
),
_react2.default.createElement(_ChromeFields2.default, {
rgb: rgb,
hsl: hsl,
hex: hex,
onChange: onChange,
disableAlpha: disableAlpha
})
)
);
};
Chrome.propTypes = {
disableAlpha: _propTypes2.default.bool
};
Chrome.defaultProps = {
disableAlpha: false
};
exports.default = (0, _common.ColorWrap)(Chrome);
/***/ }),
/***/ "./node_modules/react-color/lib/components/chrome/ChromeFields.js":
/*!************************************************************************!*\
!*** ./node_modules/react-color/lib/components/chrome/ChromeFields.js ***!
\************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ChromeFields = undefined;
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; }; }();
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
var _color = __webpack_require__(/*! ../../helpers/color */ "./node_modules/react-color/lib/helpers/color.js");
var _color2 = _interopRequireDefault(_color);
var _common = __webpack_require__(/*! ../common */ "./node_modules/react-color/lib/components/common/index.js");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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; }
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; } /* eslint-disable react/no-did-mount-set-state, no-param-reassign */
var ChromeFields = exports.ChromeFields = function (_React$Component) {
_inherits(ChromeFields, _React$Component);
function ChromeFields() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, ChromeFields);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = ChromeFields.__proto__ || Object.getPrototypeOf(ChromeFields)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
view: ''
}, _this.toggleViews = function () {
if (_this.state.view === 'hex') {
_this.setState({ view: 'rgb' });
} else if (_this.state.view === 'rgb') {
_this.setState({ view: 'hsl' });
} else if (_this.state.view === 'hsl') {
if (_this.props.hsl.a === 1) {
_this.setState({ view: 'hex' });
} else {
_this.setState({ view: 'rgb' });
}
}
}, _this.handleChange = function (data, e) {
if (data.hex) {
_color2.default.isValidHex(data.hex) && _this.props.onChange({
hex: data.hex,
source: 'hex'
}, e);
} else if (data.r || data.g || data.b) {
_this.props.onChange({
r: data.r || _this.props.rgb.r,
g: data.g || _this.props.rgb.g,
b: data.b || _this.props.rgb.b,
source: 'rgb'
}, e);
} else if (data.a) {
if (data.a < 0) {
data.a = 0;
} else if (data.a > 1) {
data.a = 1;
}
_this.props.onChange({
h: _this.props.hsl.h,
s: _this.props.hsl.s,
l: _this.props.hsl.l,
a: Math.round(data.a * 100) / 100,
source: 'rgb'
}, e);
} else if (data.h || data.s || data.l) {
_this.props.onChange({
h: data.h || _this.props.hsl.h,
s: Number(data.s && data.s || _this.props.hsl.s),
l: Number(data.l && data.l || _this.props.hsl.l),
source: 'hsl'
}, e);
}
}, _this.showHighlight = function (e) {
e.target.style.background = '#eee';
}, _this.hideHighlight = function (e) {
e.target.style.background = 'transparent';
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(ChromeFields, [{
key: 'componentDidMount',
value: function componentDidMount() {
if (this.props.hsl.a === 1 && this.state.view !== 'hex') {
this.setState({ view: 'hex' });
} else if (this.state.view !== 'rgb' && this.state.view !== 'hsl') {
this.setState({ view: 'rgb' });
}
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
if (nextProps.hsl.a !== 1 && this.state.view === 'hex') {
this.setState({ view: 'rgb' });
}
}
}, {
key: 'render',
value: function render() {
var _this2 = this;
var styles = (0, _reactcss2.default)({
'default': {
wrap: {
paddingTop: '16px',
display: 'flex'
},
fields: {
flex: '1',
display: 'flex',
marginLeft: '-6px'
},
field: {
paddingLeft: '6px',
width: '100%'
},
alpha: {
paddingLeft: '6px',
width: '100%'
},
toggle: {
width: '32px',
textAlign: 'right',
position: 'relative'
},
icon: {
marginRight: '-4px',
marginTop: '12px',
cursor: 'pointer',
position: 'relative'
},
iconHighlight: {
position: 'absolute',
width: '24px',
height: '28px',
background: '#eee',
borderRadius: '4px',
top: '10px',
left: '12px',
display: 'none'
},
input: {
fontSize: '11px',
color: '#333',
width: '100%',
borderRadius: '2px',
border: 'none',
boxShadow: 'inset 0 0 0 1px #dadada',
height: '21px',
textAlign: 'center'
},
label: {
textTransform: 'uppercase',
fontSize: '11px',
lineHeight: '11px',
color: '#969696',
textAlign: 'center',
display: 'block',
marginTop: '12px'
},
svg: {
width: '24px',
height: '24px',
border: '1px transparent solid',
borderRadius: '5px'
}
},
'disableAlpha': {
alpha: {
display: 'none'
}
}
}, this.props, this.state);
var fields = void 0;
if (this.state.view === 'hex') {
fields = _react2.default.createElement(
'div',
{ style: styles.fields, className: 'flexbox-fix' },
_react2.default.createElement(
'div',
{ style: styles.field },
_react2.default.createElement(_common.EditableInput, {
style: { input: styles.input, label: styles.label },
label: 'hex', value: this.props.hex,
onChange: this.handleChange
})
)
);
} else if (this.state.view === 'rgb') {
fields = _react2.default.createElement(
'div',
{ style: styles.fields, className: 'flexbox-fix' },
_react2.default.createElement(
'div',
{ style: styles.field },
_react2.default.createElement(_common.EditableInput, {
style: { input: styles.input, label: styles.label },
label: 'r',
value: this.props.rgb.r,
onChange: this.handleChange
})
),
_react2.default.createElement(
'div',
{ style: styles.field },
_react2.default.createElement(_common.EditableInput, {
style: { input: styles.input, label: styles.label },
label: 'g',
value: this.props.rgb.g,
onChange: this.handleChange
})
),
_react2.default.createElement(
'div',
{ style: styles.field },
_react2.default.createElement(_common.EditableInput, {
style: { input: styles.input, label: styles.label },
label: 'b',
value: this.props.rgb.b,
onChange: this.handleChange
})
),
_react2.default.createElement(
'div',
{ style: styles.alpha },
_react2.default.createElement(_common.EditableInput, {
style: { input: styles.input, label: styles.label },
label: 'a',
value: this.props.rgb.a,
arrowOffset: 0.01,
onChange: this.handleChange
})
)
);
} else if (this.state.view === 'hsl') {
fields = _react2.default.createElement(
'div',
{ style: styles.fields, className: 'flexbox-fix' },
_react2.default.createElement(
'div',
{ style: styles.field },
_react2.default.createElement(_common.EditableInput, {
style: { input: styles.input, label: styles.label },
label: 'h',
value: Math.round(this.props.hsl.h),
onChange: this.handleChange
})
),
_react2.default.createElement(
'div',
{ style: styles.field },
_react2.default.createElement(_common.EditableInput, {
style: { input: styles.input, label: styles.label },
label: 's',
value: Math.round(this.props.hsl.s * 100) + '%',
onChange: this.handleChange
})
),
_react2.default.createElement(
'div',
{ style: styles.field },
_react2.default.createElement(_common.EditableInput, {
style: { input: styles.input, label: styles.label },
label: 'l',
value: Math.round(this.props.hsl.l * 100) + '%',
onChange: this.handleChange
})
),
_react2.default.createElement(
'div',
{ style: styles.alpha },
_react2.default.createElement(_common.EditableInput, {
style: { input: styles.input, label: styles.label },
label: 'a',
value: this.props.hsl.a,
arrowOffset: 0.01,
onChange: this.handleChange
})
)
);
}
return _react2.default.createElement(
'div',
{ style: styles.wrap, className: 'flexbox-fix' },
fields,
_react2.default.createElement(
'div',
{ style: styles.toggle },
_react2.default.createElement(
'div',
{ style: styles.icon, onClick: this.toggleViews, ref: function ref(icon) {
return _this2.icon = icon;
} },
_react2.default.createElement(
'svg',
{
style: styles.svg,
viewBox: '0 0 24 24',
onMouseOver: this.showHighlight,
onMouseEnter: this.showHighlight,
onMouseOut: this.hideHighlight
},
_react2.default.createElement('path', {
ref: function ref(iconUp) {
return _this2.iconUp = iconUp;
},
fill: '#333',
d: 'M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z'
}),
_react2.default.createElement('path', {
ref: function ref(iconDown) {
return _this2.iconDown = iconDown;
},
fill: '#333',
d: 'M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15Z'
})
)
)
)
);
}
}]);
return ChromeFields;
}(_react2.default.Component);
exports.default = ChromeFields;
/***/ }),
/***/ "./node_modules/react-color/lib/components/chrome/ChromePointer.js":
/*!*************************************************************************!*\
!*** ./node_modules/react-color/lib/components/chrome/ChromePointer.js ***!
\*************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ChromePointer = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var ChromePointer = exports.ChromePointer = function ChromePointer() {
var styles = (0, _reactcss2.default)({
'default': {
picker: {
width: '12px',
height: '12px',
borderRadius: '6px',
transform: 'translate(-6px, -1px)',
backgroundColor: 'rgb(248, 248, 248)',
boxShadow: '0 1px 4px 0 rgba(0, 0, 0, 0.37)'
}
}
});
return _react2.default.createElement('div', { style: styles.picker });
};
exports.default = ChromePointer;
/***/ }),
/***/ "./node_modules/react-color/lib/components/chrome/ChromePointerCircle.js":
/*!*******************************************************************************!*\
!*** ./node_modules/react-color/lib/components/chrome/ChromePointerCircle.js ***!
\*******************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ChromePointerCircle = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var ChromePointerCircle = exports.ChromePointerCircle = function ChromePointerCircle() {
var styles = (0, _reactcss2.default)({
'default': {
picker: {
width: '12px',
height: '12px',
borderRadius: '6px',
boxShadow: 'inset 0 0 0 1px #fff',
transform: 'translate(-6px, -6px)'
}
}
});
return _react2.default.createElement('div', { style: styles.picker });
};
exports.default = ChromePointerCircle;
/***/ }),
/***/ "./node_modules/react-color/lib/components/circle/Circle.js":
/*!******************************************************************!*\
!*** ./node_modules/react-color/lib/components/circle/Circle.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Circle = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
var _map = __webpack_require__(/*! lodash/map */ "./node_modules/lodash/map.js");
var _map2 = _interopRequireDefault(_map);
var _materialColors = __webpack_require__(/*! material-colors */ "./node_modules/material-colors/dist/colors.es2015.js");
var material = _interopRequireWildcard(_materialColors);
var _common = __webpack_require__(/*! ../common */ "./node_modules/react-color/lib/components/common/index.js");
var _CircleSwatch = __webpack_require__(/*! ./CircleSwatch */ "./node_modules/react-color/lib/components/circle/CircleSwatch.js");
var _CircleSwatch2 = _interopRequireDefault(_CircleSwatch);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var Circle = exports.Circle = function Circle(_ref) {
var width = _ref.width,
onChange = _ref.onChange,
onSwatchHover = _ref.onSwatchHover,
colors = _ref.colors,
hex = _ref.hex,
circleSize = _ref.circleSize,
circleSpacing = _ref.circleSpacing,
_ref$className = _ref.className,
className = _ref$className === undefined ? '' : _ref$className;
var styles = (0, _reactcss2.default)({
'default': {
card: {
width: width,
display: 'flex',
flexWrap: 'wrap',
marginRight: -circleSpacing,
marginBottom: -circleSpacing
}
}
});
var handleChange = function handleChange(hexCode, e) {
return onChange({ hex: hexCode, source: 'hex' }, e);
};
return _react2.default.createElement(
'div',
{ style: styles.card, className: 'circle-picker ' + className },
(0, _map2.default)(colors, function (c) {
return _react2.default.createElement(_CircleSwatch2.default, {
key: c,
color: c,
onClick: handleChange,
onSwatchHover: onSwatchHover,
active: hex === c.toLowerCase(),
circleSize: circleSize,
circleSpacing: circleSpacing
});
})
);
};
Circle.propTypes = {
width: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),
circleSize: _propTypes2.default.number,
circleSpacing: _propTypes2.default.number
};
Circle.defaultProps = {
width: 252,
circleSize: 28,
circleSpacing: 14,
colors: [material.red['500'], material.pink['500'], material.purple['500'], material.deepPurple['500'], material.indigo['500'], material.blue['500'], material.lightBlue['500'], material.cyan['500'], material.teal['500'], material.green['500'], material.lightGreen['500'], material.lime['500'], material.yellow['500'], material.amber['500'], material.orange['500'], material.deepOrange['500'], material.brown['500'], material.blueGrey['500']]
};
exports.default = (0, _common.ColorWrap)(Circle);
/***/ }),
/***/ "./node_modules/react-color/lib/components/circle/CircleSwatch.js":
/*!************************************************************************!*\
!*** ./node_modules/react-color/lib/components/circle/CircleSwatch.js ***!
\************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.CircleSwatch = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
var _common = __webpack_require__(/*! ../common */ "./node_modules/react-color/lib/components/common/index.js");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var CircleSwatch = exports.CircleSwatch = function CircleSwatch(_ref) {
var color = _ref.color,
onClick = _ref.onClick,
onSwatchHover = _ref.onSwatchHover,
hover = _ref.hover,
active = _ref.active,
circleSize = _ref.circleSize,
circleSpacing = _ref.circleSpacing;
var styles = (0, _reactcss2.default)({
'default': {
swatch: {
width: circleSize,
height: circleSize,
marginRight: circleSpacing,
marginBottom: circleSpacing,
transform: 'scale(1)',
transition: '100ms transform ease'
},
Swatch: {
borderRadius: '50%',
background: 'transparent',
boxShadow: 'inset 0 0 0 ' + circleSize / 2 + 'px ' + color,
transition: '100ms box-shadow ease'
}
},
'hover': {
swatch: {
transform: 'scale(1.2)'
}
},
'active': {
Swatch: {
boxShadow: 'inset 0 0 0 3px ' + color
}
}
}, { hover: hover, active: active });
return _react2.default.createElement(
'div',
{ style: styles.swatch },
_react2.default.createElement(_common.Swatch, {
style: styles.Swatch,
color: color,
onClick: onClick,
onHover: onSwatchHover,
focusStyle: { boxShadow: styles.Swatch.boxShadow + ', 0 0 5px ' + color }
})
);
};
CircleSwatch.defaultProps = {
circleSize: 28,
circleSpacing: 14
};
exports.default = (0, _reactcss.handleHover)(CircleSwatch);
/***/ }),
/***/ "./node_modules/react-color/lib/components/common/Alpha.js":
/*!*****************************************************************!*\
!*** ./node_modules/react-color/lib/components/common/Alpha.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Alpha = undefined;
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; };
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; }; }();
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
var _alpha = __webpack_require__(/*! ../../helpers/alpha */ "./node_modules/react-color/lib/helpers/alpha.js");
var alpha = _interopRequireWildcard(_alpha);
var _Checkboard = __webpack_require__(/*! ./Checkboard */ "./node_modules/react-color/lib/components/common/Checkboard.js");
var _Checkboard2 = _interopRequireDefault(_Checkboard);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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; }
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; }
var Alpha = exports.Alpha = function (_ref) {
_inherits(Alpha, _ref);
function Alpha() {
var _ref2;
var _temp, _this, _ret;
_classCallCheck(this, Alpha);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref2 = Alpha.__proto__ || Object.getPrototypeOf(Alpha)).call.apply(_ref2, [this].concat(args))), _this), _this.handleChange = function (e, skip) {
var change = alpha.calculateChange(e, skip, _this.props, _this.container);
change && _this.props.onChange && _this.props.onChange(change, e);
}, _this.handleMouseDown = function (e) {
_this.handleChange(e, true);
window.addEventListener('mousemove', _this.handleChange);
window.addEventListener('mouseup', _this.handleMouseUp);
}, _this.handleMouseUp = function () {
_this.unbindEventListeners();
}, _this.unbindEventListeners = function () {
window.removeEventListener('mousemove', _this.handleChange);
window.removeEventListener('mouseup', _this.handleMouseUp);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Alpha, [{
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this.unbindEventListeners();
}
}, {
key: 'render',
value: function render() {
var _this2 = this;
var rgb = this.props.rgb;
var styles = (0, _reactcss2.default)({
'default': {
alpha: {
absolute: '0px 0px 0px 0px',
borderRadius: this.props.radius
},
checkboard: {
absolute: '0px 0px 0px 0px',
overflow: 'hidden',
borderRadius: this.props.radius
},
gradient: {
absolute: '0px 0px 0px 0px',
background: 'linear-gradient(to right, rgba(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ', 0) 0%,\n rgba(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ', 1) 100%)',
boxShadow: this.props.shadow,
borderRadius: this.props.radius
},
container: {
position: 'relative',
height: '100%',
margin: '0 3px'
},
pointer: {
position: 'absolute',
left: rgb.a * 100 + '%'
},
slider: {
width: '4px',
borderRadius: '1px',
height: '8px',
boxShadow: '0 0 2px rgba(0, 0, 0, .6)',
background: '#fff',
marginTop: '1px',
transform: 'translateX(-2px)'
}
},
'vertical': {
gradient: {
background: 'linear-gradient(to bottom, rgba(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ', 0) 0%,\n rgba(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ', 1) 100%)'
},
pointer: {
left: 0,
top: rgb.a * 100 + '%'
}
},
'overwrite': _extends({}, this.props.style)
}, {
vertical: this.props.direction === 'vertical',
overwrite: true
});
return _react2.default.createElement(
'div',
{ style: styles.alpha },
_react2.default.createElement(
'div',
{ style: styles.checkboard },
_react2.default.createElement(_Checkboard2.default, { renderers: this.props.renderers })
),
_react2.default.createElement('div', { style: styles.gradient }),
_react2.default.createElement(
'div',
{
style: styles.container,
ref: function ref(container) {
return _this2.container = container;
},
onMouseDown: this.handleMouseDown,
onTouchMove: this.handleChange,
onTouchStart: this.handleChange
},
_react2.default.createElement(
'div',
{ style: styles.pointer },
this.props.pointer ? _react2.default.createElement(this.props.pointer, this.props) : _react2.default.createElement('div', { style: styles.slider })
)
)
);
}
}]);
return Alpha;
}(_react.PureComponent || _react.Component);
exports.default = Alpha;
/***/ }),
/***/ "./node_modules/react-color/lib/components/common/Checkboard.js":
/*!**********************************************************************!*\
!*** ./node_modules/react-color/lib/components/common/Checkboard.js ***!
\**********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Checkboard = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
var _checkboard = __webpack_require__(/*! ../../helpers/checkboard */ "./node_modules/react-color/lib/helpers/checkboard.js");
var checkboard = _interopRequireWildcard(_checkboard);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var Checkboard = exports.Checkboard = function Checkboard(_ref) {
var white = _ref.white,
grey = _ref.grey,
size = _ref.size,
renderers = _ref.renderers,
borderRadius = _ref.borderRadius,
boxShadow = _ref.boxShadow;
var styles = (0, _reactcss2.default)({
'default': {
grid: {
borderRadius: borderRadius,
boxShadow: boxShadow,
absolute: '0px 0px 0px 0px',
background: 'url(' + checkboard.get(white, grey, size, renderers.canvas) + ') center left'
}
}
});
return _react2.default.createElement('div', { style: styles.grid });
};
Checkboard.defaultProps = {
size: 8,
white: 'transparent',
grey: 'rgba(0,0,0,.08)',
renderers: {}
};
exports.default = Checkboard;
/***/ }),
/***/ "./node_modules/react-color/lib/components/common/ColorWrap.js":
/*!*********************************************************************!*\
!*** ./node_modules/react-color/lib/components/common/ColorWrap.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ColorWrap = undefined;
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; };
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; }; }();
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _debounce = __webpack_require__(/*! lodash/debounce */ "./node_modules/lodash/debounce.js");
var _debounce2 = _interopRequireDefault(_debounce);
var _color = __webpack_require__(/*! ../../helpers/color */ "./node_modules/react-color/lib/helpers/color.js");
var _color2 = _interopRequireDefault(_color);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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; }
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; }
var ColorWrap = exports.ColorWrap = function ColorWrap(Picker) {
var ColorPicker = function (_ref) {
_inherits(ColorPicker, _ref);
function ColorPicker(props) {
_classCallCheck(this, ColorPicker);
var _this = _possibleConstructorReturn(this, (ColorPicker.__proto__ || Object.getPrototypeOf(ColorPicker)).call(this));
_this.handleChange = function (data, event) {
var isValidColor = _color2.default.simpleCheckForValidColor(data);
if (isValidColor) {
var colors = _color2.default.toState(data, data.h || _this.state.oldHue);
_this.setState(colors);
_this.props.onChangeComplete && _this.debounce(_this.props.onChangeComplete, colors, event);
_this.props.onChange && _this.props.onChange(colors, event);
}
};
_this.handleSwatchHover = function (data, event) {
var isValidColor = _color2.default.simpleCheckForValidColor(data);
if (isValidColor) {
var colors = _color2.default.toState(data, data.h || _this.state.oldHue);
_this.setState(colors);
_this.props.onSwatchHover && _this.props.onSwatchHover(colors, event);
}
};
_this.state = _extends({}, _color2.default.toState(props.color, 0));
_this.debounce = (0, _debounce2.default)(function (fn, data, event) {
fn(data, event);
}, 100);
return _this;
}
_createClass(ColorPicker, [{
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
this.setState(_extends({}, _color2.default.toState(nextProps.color, this.state.oldHue)));
}
}, {
key: 'render',
value: function render() {
var optionalEvents = {};
if (this.props.onSwatchHover) {
optionalEvents.onSwatchHover = this.handleSwatchHover;
}
return _react2.default.createElement(Picker, _extends({}, this.props, this.state, {
onChange: this.handleChange
}, optionalEvents));
}
}]);
return ColorPicker;
}(_react.PureComponent || _react.Component);
ColorPicker.propTypes = _extends({}, Picker.propTypes);
ColorPicker.defaultProps = _extends({}, Picker.defaultProps, {
color: {
h: 250,
s: 0.50,
l: 0.20,
a: 1
}
});
return ColorPicker;
};
exports.default = ColorWrap;
/***/ }),
/***/ "./node_modules/react-color/lib/components/common/EditableInput.js":
/*!*************************************************************************!*\
!*** ./node_modules/react-color/lib/components/common/EditableInput.js ***!
\*************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.EditableInput = undefined;
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; }; }();
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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; }
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; }
var EditableInput = exports.EditableInput = function (_ref) {
_inherits(EditableInput, _ref);
function EditableInput(props) {
_classCallCheck(this, EditableInput);
var _this = _possibleConstructorReturn(this, (EditableInput.__proto__ || Object.getPrototypeOf(EditableInput)).call(this));
_this.handleBlur = function () {
if (_this.state.blurValue) {
_this.setState({ value: _this.state.blurValue, blurValue: null });
}
};
_this.handleChange = function (e) {
if (_this.props.label) {
_this.props.onChange && _this.props.onChange(_defineProperty({}, _this.props.label, e.target.value), e);
} else {
_this.props.onChange && _this.props.onChange(e.target.value, e);
}
_this.setState({ value: e.target.value });
};
_this.handleKeyDown = function (e) {
// In case `e.target.value` is a percentage remove the `%` character
// and update accordingly with a percentage
// https://github.com/casesandberg/react-color/issues/383
var stringValue = String(e.target.value);
var isPercentage = stringValue.indexOf('%') > -1;
var number = Number(stringValue.replace(/%/g, ''));
if (!isNaN(number)) {
var amount = _this.props.arrowOffset || 1;
// Up
if (e.keyCode === 38) {
if (_this.props.label !== null) {
_this.props.onChange && _this.props.onChange(_defineProperty({}, _this.props.label, number + amount), e);
} else {
_this.props.onChange && _this.props.onChange(number + amount, e);
}
if (isPercentage) {
_this.setState({ value: number + amount + '%' });
} else {
_this.setState({ value: number + amount });
}
}
// Down
if (e.keyCode === 40) {
if (_this.props.label !== null) {
_this.props.onChange && _this.props.onChange(_defineProperty({}, _this.props.label, number - amount), e);
} else {
_this.props.onChange && _this.props.onChange(number - amount, e);
}
if (isPercentage) {
_this.setState({ value: number - amount + '%' });
} else {
_this.setState({ value: number - amount });
}
}
}
};
_this.handleDrag = function (e) {
if (_this.props.dragLabel) {
var newValue = Math.round(_this.props.value + e.movementX);
if (newValue >= 0 && newValue <= _this.props.dragMax) {
_this.props.onChange && _this.props.onChange(_defineProperty({}, _this.props.label, newValue), e);
}
}
};
_this.handleMouseDown = function (e) {
if (_this.props.dragLabel) {
e.preventDefault();
_this.handleDrag(e);
window.addEventListener('mousemove', _this.handleDrag);
window.addEventListener('mouseup', _this.handleMouseUp);
}
};
_this.handleMouseUp = function () {
_this.unbindEventListeners();
};
_this.unbindEventListeners = function () {
window.removeEventListener('mousemove', _this.handleDrag);
window.removeEventListener('mouseup', _this.handleMouseUp);
};
_this.state = {
value: String(props.value).toUpperCase(),
blurValue: String(props.value).toUpperCase()
};
return _this;
}
_createClass(EditableInput, [{
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
var input = this.input;
if (nextProps.value !== this.state.value) {
if (input === document.activeElement) {
this.setState({ blurValue: String(nextProps.value).toUpperCase() });
} else {
this.setState({ value: String(nextProps.value).toUpperCase(), blurValue: !this.state.blurValue && String(nextProps.value).toUpperCase() });
}
}
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this.unbindEventListeners();
}
}, {
key: 'render',
value: function render() {
var _this2 = this;
var styles = (0, _reactcss2.default)({
'default': {
wrap: {
position: 'relative'
}
},
'user-override': {
wrap: this.props.style && this.props.style.wrap ? this.props.style.wrap : {},
input: this.props.style && this.props.style.input ? this.props.style.input : {},
label: this.props.style && this.props.style.label ? this.props.style.label : {}
},
'dragLabel-true': {
label: {
cursor: 'ew-resize'
}
}
}, {
'user-override': true
}, this.props);
return _react2.default.createElement(
'div',
{ style: styles.wrap },
_react2.default.createElement('input', {
style: styles.input,
ref: function ref(input) {
return _this2.input = input;
},
value: this.state.value,
onKeyDown: this.handleKeyDown,
onChange: this.handleChange,
onBlur: this.handleBlur,
placeholder: this.props.placeholder,
spellCheck: 'false'
}),
this.props.label && !this.props.hideLabel ? _react2.default.createElement(
'span',
{ style: styles.label, onMouseDown: this.handleMouseDown },
this.props.label
) : null
);
}
}]);
return EditableInput;
}(_react.PureComponent || _react.Component);
exports.default = EditableInput;
/***/ }),
/***/ "./node_modules/react-color/lib/components/common/Hue.js":
/*!***************************************************************!*\
!*** ./node_modules/react-color/lib/components/common/Hue.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Hue = undefined;
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; }; }();
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
var _hue = __webpack_require__(/*! ../../helpers/hue */ "./node_modules/react-color/lib/helpers/hue.js");
var hue = _interopRequireWildcard(_hue);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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; }
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; }
var Hue = exports.Hue = function (_ref) {
_inherits(Hue, _ref);
function Hue() {
var _ref2;
var _temp, _this, _ret;
_classCallCheck(this, Hue);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref2 = Hue.__proto__ || Object.getPrototypeOf(Hue)).call.apply(_ref2, [this].concat(args))), _this), _this.handleChange = function (e, skip) {
var change = hue.calculateChange(e, skip, _this.props, _this.container);
change && _this.props.onChange && _this.props.onChange(change, e);
}, _this.handleMouseDown = function (e) {
_this.handleChange(e, true);
window.addEventListener('mousemove', _this.handleChange);
window.addEventListener('mouseup', _this.handleMouseUp);
}, _this.handleMouseUp = function () {
_this.unbindEventListeners();
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Hue, [{
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this.unbindEventListeners();
}
}, {
key: 'unbindEventListeners',
value: function unbindEventListeners() {
window.removeEventListener('mousemove', this.handleChange);
window.removeEventListener('mouseup', this.handleMouseUp);
}
}, {
key: 'render',
value: function render() {
var _this2 = this;
var _props$direction = this.props.direction,
direction = _props$direction === undefined ? 'horizontal' : _props$direction;
var styles = (0, _reactcss2.default)({
'default': {
hue: {
absolute: '0px 0px 0px 0px',
borderRadius: this.props.radius,
boxShadow: this.props.shadow
},
container: {
padding: '0 2px',
position: 'relative',
height: '100%',
borderRadius: this.props.radius
},
pointer: {
position: 'absolute',
left: this.props.hsl.h * 100 / 360 + '%'
},
slider: {
marginTop: '1px',
width: '4px',
borderRadius: '1px',
height: '8px',
boxShadow: '0 0 2px rgba(0, 0, 0, .6)',
background: '#fff',
transform: 'translateX(-2px)'
}
},
'vertical': {
pointer: {
left: '0px',
top: -(this.props.hsl.h * 100 / 360) + 100 + '%'
}
}
}, { vertical: direction === 'vertical' });
return _react2.default.createElement(
'div',
{ style: styles.hue },
_react2.default.createElement(
'div',
{
className: 'hue-' + direction,
style: styles.container,
ref: function ref(container) {
return _this2.container = container;
},
onMouseDown: this.handleMouseDown,
onTouchMove: this.handleChange,
onTouchStart: this.handleChange
},
_react2.default.createElement(
'style',
null,
'\n .hue-horizontal {\n background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0\n 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n background: -webkit-linear-gradient(to right, #f00 0%, #ff0\n 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n }\n\n .hue-vertical {\n background: linear-gradient(to top, #f00 0%, #ff0 17%, #0f0 33%,\n #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n background: -webkit-linear-gradient(to top, #f00 0%, #ff0 17%,\n #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n }\n '
),
_react2.default.createElement(
'div',
{ style: styles.pointer },
this.props.pointer ? _react2.default.createElement(this.props.pointer, this.props) : _react2.default.createElement('div', { style: styles.slider })
)
)
);
}
}]);
return Hue;
}(_react.PureComponent || _react.Component);
exports.default = Hue;
/***/ }),
/***/ "./node_modules/react-color/lib/components/common/Raised.js":
/*!******************************************************************!*\
!*** ./node_modules/react-color/lib/components/common/Raised.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Raised = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var Raised = exports.Raised = function Raised(_ref) {
var zDepth = _ref.zDepth,
radius = _ref.radius,
background = _ref.background,
children = _ref.children;
var styles = (0, _reactcss2.default)({
'default': {
wrap: {
position: 'relative',
display: 'inline-block'
},
content: {
position: 'relative'
},
bg: {
absolute: '0px 0px 0px 0px',
boxShadow: '0 ' + zDepth + 'px ' + zDepth * 4 + 'px rgba(0,0,0,.24)',
borderRadius: radius,
background: background
}
},
'zDepth-0': {
bg: {
boxShadow: 'none'
}
},
'zDepth-1': {
bg: {
boxShadow: '0 2px 10px rgba(0,0,0,.12), 0 2px 5px rgba(0,0,0,.16)'
}
},
'zDepth-2': {
bg: {
boxShadow: '0 6px 20px rgba(0,0,0,.19), 0 8px 17px rgba(0,0,0,.2)'
}
},
'zDepth-3': {
bg: {
boxShadow: '0 17px 50px rgba(0,0,0,.19), 0 12px 15px rgba(0,0,0,.24)'
}
},
'zDepth-4': {
bg: {
boxShadow: '0 25px 55px rgba(0,0,0,.21), 0 16px 28px rgba(0,0,0,.22)'
}
},
'zDepth-5': {
bg: {
boxShadow: '0 40px 77px rgba(0,0,0,.22), 0 27px 24px rgba(0,0,0,.2)'
}
},
'square': {
bg: {
borderRadius: '0'
}
},
'circle': {
bg: {
borderRadius: '50%'
}
}
}, { 'zDepth-1': zDepth === 1 });
return _react2.default.createElement(
'div',
{ style: styles.wrap },
_react2.default.createElement('div', { style: styles.bg }),
_react2.default.createElement(
'div',
{ style: styles.content },
children
)
);
};
Raised.propTypes = {
background: _propTypes2.default.string,
zDepth: _propTypes2.default.oneOf([0, 1, 2, 3, 4, 5]),
radius: _propTypes2.default.number
};
Raised.defaultProps = {
background: '#fff',
zDepth: 1,
radius: 2
};
exports.default = Raised;
/***/ }),
/***/ "./node_modules/react-color/lib/components/common/Saturation.js":
/*!**********************************************************************!*\
!*** ./node_modules/react-color/lib/components/common/Saturation.js ***!
\**********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Saturation = undefined;
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; }; }();
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
var _throttle = __webpack_require__(/*! lodash/throttle */ "./node_modules/lodash/throttle.js");
var _throttle2 = _interopRequireDefault(_throttle);
var _saturation = __webpack_require__(/*! ../../helpers/saturation */ "./node_modules/react-color/lib/helpers/saturation.js");
var saturation = _interopRequireWildcard(_saturation);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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; }
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; }
var Saturation = exports.Saturation = function (_ref) {
_inherits(Saturation, _ref);
function Saturation(props) {
_classCallCheck(this, Saturation);
var _this = _possibleConstructorReturn(this, (Saturation.__proto__ || Object.getPrototypeOf(Saturation)).call(this, props));
_this.handleChange = function (e, skip) {
_this.props.onChange && _this.throttle(_this.props.onChange, saturation.calculateChange(e, skip, _this.props, _this.container), e);
};
_this.handleMouseDown = function (e) {
_this.handleChange(e, true);
window.addEventListener('mousemove', _this.handleChange);
window.addEventListener('mouseup', _this.handleMouseUp);
};
_this.handleMouseUp = function () {
_this.unbindEventListeners();
};
_this.throttle = (0, _throttle2.default)(function (fn, data, e) {
fn(data, e);
}, 50);
return _this;
}
_createClass(Saturation, [{
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this.unbindEventListeners();
}
}, {
key: 'unbindEventListeners',
value: function unbindEventListeners() {
window.removeEventListener('mousemove', this.handleChange);
window.removeEventListener('mouseup', this.handleMouseUp);
}
}, {
key: 'render',
value: function render() {
var _this2 = this;
var _ref2 = this.props.style || {},
color = _ref2.color,
white = _ref2.white,
black = _ref2.black,
pointer = _ref2.pointer,
circle = _ref2.circle;
var styles = (0, _reactcss2.default)({
'default': {
color: {
absolute: '0px 0px 0px 0px',
background: 'hsl(' + this.props.hsl.h + ',100%, 50%)',
borderRadius: this.props.radius
},
white: {
absolute: '0px 0px 0px 0px',
borderRadius: this.props.radius
},
black: {
absolute: '0px 0px 0px 0px',
boxShadow: this.props.shadow,
borderRadius: this.props.radius
},
pointer: {
position: 'absolute',
top: -(this.props.hsv.v * 100) + 100 + '%',
left: this.props.hsv.s * 100 + '%',
cursor: 'default'
},
circle: {
width: '4px',
height: '4px',
boxShadow: '0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0,0,0,.3),\n 0 0 1px 2px rgba(0,0,0,.4)',
borderRadius: '50%',
cursor: 'hand',
transform: 'translate(-2px, -2px)'
}
},
'custom': {
color: color,
white: white,
black: black,
pointer: pointer,
circle: circle
}
}, { 'custom': !!this.props.style });
return _react2.default.createElement(
'div',
{
style: styles.color,
ref: function ref(container) {
return _this2.container = container;
},
onMouseDown: this.handleMouseDown,
onTouchMove: this.handleChange,
onTouchStart: this.handleChange
},
_react2.default.createElement(
'style',
null,
'\n .saturation-white {\n background: -webkit-linear-gradient(to right, #fff, rgba(255,255,255,0));\n background: linear-gradient(to right, #fff, rgba(255,255,255,0));\n }\n .saturation-black {\n background: -webkit-linear-gradient(to top, #000, rgba(0,0,0,0));\n background: linear-gradient(to top, #000, rgba(0,0,0,0));\n }\n '
),
_react2.default.createElement(
'div',
{ style: styles.white, className: 'saturation-white' },
_react2.default.createElement('div', { style: styles.black, className: 'saturation-black' }),
_react2.default.createElement(
'div',
{ style: styles.pointer },
this.props.pointer ? _react2.default.createElement(this.props.pointer, this.props) : _react2.default.createElement('div', { style: styles.circle })
)
)
);
}
}]);
return Saturation;
}(_react.PureComponent || _react.Component);
exports.default = Saturation;
/***/ }),
/***/ "./node_modules/react-color/lib/components/common/Swatch.js":
/*!******************************************************************!*\
!*** ./node_modules/react-color/lib/components/common/Swatch.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Swatch = undefined;
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; };
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
var _interaction = __webpack_require__(/*! ../../helpers/interaction */ "./node_modules/react-color/lib/helpers/interaction.js");
var _ = __webpack_require__(/*! ./ */ "./node_modules/react-color/lib/components/common/index.js");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var ENTER = 13;
var Swatch = exports.Swatch = function Swatch(_ref) {
var color = _ref.color,
style = _ref.style,
_ref$onClick = _ref.onClick,
onClick = _ref$onClick === undefined ? function () {} : _ref$onClick,
onHover = _ref.onHover,
_ref$title = _ref.title,
title = _ref$title === undefined ? color : _ref$title,
children = _ref.children,
focus = _ref.focus,
_ref$focusStyle = _ref.focusStyle,
focusStyle = _ref$focusStyle === undefined ? {} : _ref$focusStyle;
var transparent = color === 'transparent';
var styles = (0, _reactcss2.default)({
default: {
swatch: _extends({
background: color,
height: '100%',
width: '100%',
cursor: 'pointer',
position: 'relative',
outline: 'none'
}, style, focus ? focusStyle : {})
}
});
var handleClick = function handleClick(e) {
return onClick(color, e);
};
var handleKeyDown = function handleKeyDown(e) {
return e.keyCode === ENTER && onClick(color, e);
};
var handleHover = function handleHover(e) {
return onHover(color, e);
};
var optionalEvents = {};
if (onHover) {
optionalEvents.onMouseOver = handleHover;
}
return _react2.default.createElement(
'div',
_extends({
style: styles.swatch,
onClick: handleClick,
title: title,
tabIndex: 0,
onKeyDown: handleKeyDown
}, optionalEvents),
children,
transparent && _react2.default.createElement(_.Checkboard, {
borderRadius: styles.swatch.borderRadius,
boxShadow: 'inset 0 0 0 1px rgba(0,0,0,0.1)'
})
);
};
exports.default = (0, _interaction.handleFocus)(Swatch);
/***/ }),
/***/ "./node_modules/react-color/lib/components/common/index.js":
/*!*****************************************************************!*\
!*** ./node_modules/react-color/lib/components/common/index.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _Alpha = __webpack_require__(/*! ./Alpha */ "./node_modules/react-color/lib/components/common/Alpha.js");
Object.defineProperty(exports, 'Alpha', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Alpha).default;
}
});
var _Checkboard = __webpack_require__(/*! ./Checkboard */ "./node_modules/react-color/lib/components/common/Checkboard.js");
Object.defineProperty(exports, 'Checkboard', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Checkboard).default;
}
});
var _EditableInput = __webpack_require__(/*! ./EditableInput */ "./node_modules/react-color/lib/components/common/EditableInput.js");
Object.defineProperty(exports, 'EditableInput', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_EditableInput).default;
}
});
var _Hue = __webpack_require__(/*! ./Hue */ "./node_modules/react-color/lib/components/common/Hue.js");
Object.defineProperty(exports, 'Hue', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Hue).default;
}
});
var _Raised = __webpack_require__(/*! ./Raised */ "./node_modules/react-color/lib/components/common/Raised.js");
Object.defineProperty(exports, 'Raised', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Raised).default;
}
});
var _Saturation = __webpack_require__(/*! ./Saturation */ "./node_modules/react-color/lib/components/common/Saturation.js");
Object.defineProperty(exports, 'Saturation', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Saturation).default;
}
});
var _ColorWrap = __webpack_require__(/*! ./ColorWrap */ "./node_modules/react-color/lib/components/common/ColorWrap.js");
Object.defineProperty(exports, 'ColorWrap', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_ColorWrap).default;
}
});
var _Swatch = __webpack_require__(/*! ./Swatch */ "./node_modules/react-color/lib/components/common/Swatch.js");
Object.defineProperty(exports, 'Swatch', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Swatch).default;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ }),
/***/ "./node_modules/react-color/lib/components/compact/Compact.js":
/*!********************************************************************!*\
!*** ./node_modules/react-color/lib/components/compact/Compact.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Compact = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
var _map = __webpack_require__(/*! lodash/map */ "./node_modules/lodash/map.js");
var _map2 = _interopRequireDefault(_map);
var _color = __webpack_require__(/*! ../../helpers/color */ "./node_modules/react-color/lib/helpers/color.js");
var _color2 = _interopRequireDefault(_color);
var _common = __webpack_require__(/*! ../common */ "./node_modules/react-color/lib/components/common/index.js");
var _CompactColor = __webpack_require__(/*! ./CompactColor */ "./node_modules/react-color/lib/components/compact/CompactColor.js");
var _CompactColor2 = _interopRequireDefault(_CompactColor);
var _CompactFields = __webpack_require__(/*! ./CompactFields */ "./node_modules/react-color/lib/components/compact/CompactFields.js");
var _CompactFields2 = _interopRequireDefault(_CompactFields);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var Compact = exports.Compact = function Compact(_ref) {
var onChange = _ref.onChange,
onSwatchHover = _ref.onSwatchHover,
colors = _ref.colors,
hex = _ref.hex,
rgb = _ref.rgb,
_ref$className = _ref.className,
className = _ref$className === undefined ? '' : _ref$className;
var styles = (0, _reactcss2.default)({
'default': {
Compact: {
background: '#f6f6f6',
radius: '4px'
},
compact: {
paddingTop: '5px',
paddingLeft: '5px',
boxSizing: 'initial',
width: '240px'
},
clear: {
clear: 'both'
}
}
});
var handleChange = function handleChange(data, e) {
if (data.hex) {
_color2.default.isValidHex(data.hex) && onChange({
hex: data.hex,
source: 'hex'
}, e);
} else {
onChange(data, e);
}
};
return _react2.default.createElement(
_common.Raised,
{ style: styles.Compact },
_react2.default.createElement(
'div',
{ style: styles.compact, className: 'compact-picker ' + className },
_react2.default.createElement(
'div',
null,
(0, _map2.default)(colors, function (c) {
return _react2.default.createElement(_CompactColor2.default, {
key: c,
color: c,
active: c.toLowerCase() === hex,
onClick: handleChange,
onSwatchHover: onSwatchHover
});
}),
_react2.default.createElement('div', { style: styles.clear })
),
_react2.default.createElement(_CompactFields2.default, { hex: hex, rgb: rgb, onChange: handleChange })
)
);
};
Compact.propTypes = {
colors: _propTypes2.default.arrayOf(_propTypes2.default.string)
};
Compact.defaultProps = {
colors: ['#4D4D4D', '#999999', '#FFFFFF', '#F44E3B', '#FE9200', '#FCDC00', '#DBDF00', '#A4DD00', '#68CCCA', '#73D8FF', '#AEA1FF', '#FDA1FF', '#333333', '#808080', '#cccccc', '#D33115', '#E27300', '#FCC400', '#B0BC00', '#68BC00', '#16A5A5', '#009CE0', '#7B64FF', '#FA28FF', '#000000', '#666666', '#B3B3B3', '#9F0500', '#C45100', '#FB9E00', '#808900', '#194D33', '#0C797D', '#0062B1', '#653294', '#AB149E']
};
exports.default = (0, _common.ColorWrap)(Compact);
/***/ }),
/***/ "./node_modules/react-color/lib/components/compact/CompactColor.js":
/*!*************************************************************************!*\
!*** ./node_modules/react-color/lib/components/compact/CompactColor.js ***!
\*************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.CompactColor = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
var _color = __webpack_require__(/*! ../../helpers/color */ "./node_modules/react-color/lib/helpers/color.js");
var _color2 = _interopRequireDefault(_color);
var _common = __webpack_require__(/*! ../common */ "./node_modules/react-color/lib/components/common/index.js");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var CompactColor = exports.CompactColor = function CompactColor(_ref) {
var color = _ref.color,
_ref$onClick = _ref.onClick,
onClick = _ref$onClick === undefined ? function () {} : _ref$onClick,
onSwatchHover = _ref.onSwatchHover,
active = _ref.active;
var styles = (0, _reactcss2.default)({
'default': {
color: {
background: color,
width: '15px',
height: '15px',
float: 'left',
marginRight: '5px',
marginBottom: '5px',
position: 'relative',
cursor: 'pointer'
},
dot: {
absolute: '5px 5px 5px 5px',
background: _color2.default.getContrastingColor(color),
borderRadius: '50%',
opacity: '0'
}
},
'active': {
dot: {
opacity: '1'
}
},
'color-#FFFFFF': {
color: {
boxShadow: 'inset 0 0 0 1px #ddd'
},
dot: {
background: '#000'
}
},
'transparent': {
dot: {
background: '#000'
}
}
}, { active: active, 'color-#FFFFFF': color === '#FFFFFF', 'transparent': color === 'transparent' });
return _react2.default.createElement(
_common.Swatch,
{
style: styles.color,
color: color,
onClick: onClick,
onHover: onSwatchHover,
focusStyle: { boxShadow: '0 0 4px ' + color }
},
_react2.default.createElement('div', { style: styles.dot })
);
};
exports.default = CompactColor;
/***/ }),
/***/ "./node_modules/react-color/lib/components/compact/CompactFields.js":
/*!**************************************************************************!*\
!*** ./node_modules/react-color/lib/components/compact/CompactFields.js ***!
\**************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.CompactFields = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
var _common = __webpack_require__(/*! ../common */ "./node_modules/react-color/lib/components/common/index.js");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var CompactFields = exports.CompactFields = function CompactFields(_ref) {
var hex = _ref.hex,
rgb = _ref.rgb,
onChange = _ref.onChange;
var styles = (0, _reactcss2.default)({
'default': {
fields: {
display: 'flex',
paddingBottom: '6px',
paddingRight: '5px',
position: 'relative'
},
active: {
position: 'absolute',
top: '6px',
left: '5px',
height: '9px',
width: '9px',
background: hex
},
HEXwrap: {
flex: '6',
position: 'relative'
},
HEXinput: {
width: '80%',
padding: '0px',
paddingLeft: '20%',
border: 'none',
outline: 'none',
background: 'none',
fontSize: '12px',
color: '#333',
height: '16px'
},
HEXlabel: {
display: 'none'
},
RGBwrap: {
flex: '3',
position: 'relative'
},
RGBinput: {
width: '70%',
padding: '0px',
paddingLeft: '30%',
border: 'none',
outline: 'none',
background: 'none',
fontSize: '12px',
color: '#333',
height: '16px'
},
RGBlabel: {
position: 'absolute',
top: '3px',
left: '0px',
lineHeight: '16px',
textTransform: 'uppercase',
fontSize: '12px',
color: '#999'
}
}
});
var handleChange = function handleChange(data, e) {
if (data.r || data.g || data.b) {
onChange({
r: data.r || rgb.r,
g: data.g || rgb.g,
b: data.b || rgb.b,
source: 'rgb'
}, e);
} else {
onChange({
hex: data.hex,
source: 'hex'
}, e);
}
};
return _react2.default.createElement(
'div',
{ style: styles.fields, className: 'flexbox-fix' },
_react2.default.createElement('div', { style: styles.active }),
_react2.default.createElement(_common.EditableInput, {
style: { wrap: styles.HEXwrap, input: styles.HEXinput, label: styles.HEXlabel },
label: 'hex',
value: hex,
onChange: handleChange
}),
_react2.default.createElement(_common.EditableInput, {
style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel },
label: 'r',
value: rgb.r,
onChange: handleChange
}),
_react2.default.createElement(_common.EditableInput, {
style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel },
label: 'g',
value: rgb.g,
onChange: handleChange
}),
_react2.default.createElement(_common.EditableInput, {
style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel },
label: 'b',
value: rgb.b,
onChange: handleChange
})
);
};
exports.default = CompactFields;
/***/ }),
/***/ "./node_modules/react-color/lib/components/github/Github.js":
/*!******************************************************************!*\
!*** ./node_modules/react-color/lib/components/github/Github.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Github = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
var _map = __webpack_require__(/*! lodash/map */ "./node_modules/lodash/map.js");
var _map2 = _interopRequireDefault(_map);
var _common = __webpack_require__(/*! ../common */ "./node_modules/react-color/lib/components/common/index.js");
var _GithubSwatch = __webpack_require__(/*! ./GithubSwatch */ "./node_modules/react-color/lib/components/github/GithubSwatch.js");
var _GithubSwatch2 = _interopRequireDefault(_GithubSwatch);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var Github = exports.Github = function Github(_ref) {
var width = _ref.width,
colors = _ref.colors,
onChange = _ref.onChange,
onSwatchHover = _ref.onSwatchHover,
triangle = _ref.triangle,
_ref$className = _ref.className,
className = _ref$className === undefined ? '' : _ref$className;
var styles = (0, _reactcss2.default)({
'default': {
card: {
width: width,
background: '#fff',
border: '1px solid rgba(0,0,0,0.2)',
boxShadow: '0 3px 12px rgba(0,0,0,0.15)',
borderRadius: '4px',
position: 'relative',
padding: '5px',
display: 'flex',
flexWrap: 'wrap'
},
triangle: {
position: 'absolute',
border: '7px solid transparent',
borderBottomColor: '#fff'
},
triangleShadow: {
position: 'absolute',
border: '8px solid transparent',
borderBottomColor: 'rgba(0,0,0,0.15)'
}
},
'hide-triangle': {
triangle: {
display: 'none'
},
triangleShadow: {
display: 'none'
}
},
'top-left-triangle': {
triangle: {
top: '-14px',
left: '10px'
},
triangleShadow: {
top: '-16px',
left: '9px'
}
},
'top-right-triangle': {
triangle: {
top: '-14px',
right: '10px'
},
triangleShadow: {
top: '-16px',
right: '9px'
}
},
'bottom-left-triangle': {
triangle: {
top: '35px',
left: '10px',
transform: 'rotate(180deg)'
},
triangleShadow: {
top: '37px',
left: '9px',
transform: 'rotate(180deg)'
}
},
'bottom-right-triangle': {
triangle: {
top: '35px',
right: '10px',
transform: 'rotate(180deg)'
},
triangleShadow: {
top: '37px',
right: '9px',
transform: 'rotate(180deg)'
}
}
}, {
'hide-triangle': triangle === 'hide',
'top-left-triangle': triangle === 'top-left',
'top-right-triangle': triangle === 'top-right',
'bottom-left-triangle': triangle == 'bottom-left',
'bottom-right-triangle': triangle === 'bottom-right'
});
var handleChange = function handleChange(hex, e) {
return onChange({ hex: hex, source: 'hex' }, e);
};
return _react2.default.createElement(
'div',
{ style: styles.card, className: 'github-picker ' + className },
_react2.default.createElement('div', { style: styles.triangleShadow }),
_react2.default.createElement('div', { style: styles.triangle }),
(0, _map2.default)(colors, function (c) {
return _react2.default.createElement(_GithubSwatch2.default, {
color: c,
key: c,
onClick: handleChange,
onSwatchHover: onSwatchHover
});
})
);
};
Github.propTypes = {
width: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),
colors: _propTypes2.default.arrayOf(_propTypes2.default.string),
triangle: _propTypes2.default.oneOf(['hide', 'top-left', 'top-right', 'bottom-left', 'bottom-right'])
};
Github.defaultProps = {
width: 200,
colors: ['#B80000', '#DB3E00', '#FCCB00', '#008B02', '#006B76', '#1273DE', '#004DCF', '#5300EB', '#EB9694', '#FAD0C3', '#FEF3BD', '#C1E1C5', '#BEDADC', '#C4DEF6', '#BED3F3', '#D4C4FB'],
triangle: 'top-left'
};
exports.default = (0, _common.ColorWrap)(Github);
/***/ }),
/***/ "./node_modules/react-color/lib/components/github/GithubSwatch.js":
/*!************************************************************************!*\
!*** ./node_modules/react-color/lib/components/github/GithubSwatch.js ***!
\************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GithubSwatch = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
var _common = __webpack_require__(/*! ../common */ "./node_modules/react-color/lib/components/common/index.js");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var GithubSwatch = exports.GithubSwatch = function GithubSwatch(_ref) {
var hover = _ref.hover,
color = _ref.color,
onClick = _ref.onClick,
onSwatchHover = _ref.onSwatchHover;
var hoverSwatch = {
position: 'relative',
zIndex: '2',
outline: '2px solid #fff',
boxShadow: '0 0 5px 2px rgba(0,0,0,0.25)'
};
var styles = (0, _reactcss2.default)({
'default': {
swatch: {
width: '25px',
height: '25px',
fontSize: '0'
}
},
'hover': {
swatch: hoverSwatch
}
}, { hover: hover });
return _react2.default.createElement(
'div',
{ style: styles.swatch },
_react2.default.createElement(_common.Swatch, {
color: color,
onClick: onClick,
onHover: onSwatchHover,
focusStyle: hoverSwatch
})
);
};
exports.default = (0, _reactcss.handleHover)(GithubSwatch);
/***/ }),
/***/ "./node_modules/react-color/lib/components/hue/Hue.js":
/*!************************************************************!*\
!*** ./node_modules/react-color/lib/components/hue/Hue.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.HuePicker = undefined;
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; };
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
var _common = __webpack_require__(/*! ../common */ "./node_modules/react-color/lib/components/common/index.js");
var _HuePointer = __webpack_require__(/*! ./HuePointer */ "./node_modules/react-color/lib/components/hue/HuePointer.js");
var _HuePointer2 = _interopRequireDefault(_HuePointer);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var HuePicker = exports.HuePicker = function HuePicker(_ref) {
var width = _ref.width,
height = _ref.height,
onChange = _ref.onChange,
hsl = _ref.hsl,
direction = _ref.direction,
pointer = _ref.pointer,
_ref$className = _ref.className,
className = _ref$className === undefined ? '' : _ref$className;
var styles = (0, _reactcss2.default)({
'default': {
picker: {
position: 'relative',
width: width,
height: height
},
hue: {
radius: '2px'
}
}
});
// Overwrite to provide pure hue color
var handleChange = function handleChange(data) {
return onChange({ a: 1, h: data.h, l: 0.5, s: 1 });
};
return _react2.default.createElement(
'div',
{ style: styles.picker, className: 'hue-picker ' + className },
_react2.default.createElement(_common.Hue, _extends({}, styles.hue, {
hsl: hsl,
pointer: pointer,
onChange: handleChange,
direction: direction
}))
);
};
HuePicker.defaultProps = {
width: '316px',
height: '16px',
direction: 'horizontal',
pointer: _HuePointer2.default
};
exports.default = (0, _common.ColorWrap)(HuePicker);
/***/ }),
/***/ "./node_modules/react-color/lib/components/hue/HuePointer.js":
/*!*******************************************************************!*\
!*** ./node_modules/react-color/lib/components/hue/HuePointer.js ***!
\*******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SliderPointer = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var SliderPointer = exports.SliderPointer = function SliderPointer(_ref) {
var direction = _ref.direction;
var styles = (0, _reactcss2.default)({
'default': {
picker: {
width: '18px',
height: '18px',
borderRadius: '50%',
transform: 'translate(-9px, -1px)',
backgroundColor: 'rgb(248, 248, 248)',
boxShadow: '0 1px 4px 0 rgba(0, 0, 0, 0.37)'
}
},
'vertical': {
picker: {
transform: 'translate(-3px, -9px)'
}
}
}, { vertical: direction === 'vertical' });
return _react2.default.createElement('div', { style: styles.picker });
};
exports.default = SliderPointer;
/***/ }),
/***/ "./node_modules/react-color/lib/components/material/Material.js":
/*!**********************************************************************!*\
!*** ./node_modules/react-color/lib/components/material/Material.js ***!
\**********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Material = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
var _color = __webpack_require__(/*! ../../helpers/color */ "./node_modules/react-color/lib/helpers/color.js");
var _color2 = _interopRequireDefault(_color);
var _common = __webpack_require__(/*! ../common */ "./node_modules/react-color/lib/components/common/index.js");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var Material = exports.Material = function Material(_ref) {
var onChange = _ref.onChange,
hex = _ref.hex,
rgb = _ref.rgb,
_ref$className = _ref.className,
className = _ref$className === undefined ? '' : _ref$className;
var styles = (0, _reactcss2.default)({
'default': {
material: {
width: '98px',
height: '98px',
padding: '16px',
fontFamily: 'Roboto'
},
HEXwrap: {
position: 'relative'
},
HEXinput: {
width: '100%',
marginTop: '12px',
fontSize: '15px',
color: '#333',
padding: '0px',
border: '0px',
borderBottom: '2px solid ' + hex,
outline: 'none',
height: '30px'
},
HEXlabel: {
position: 'absolute',
top: '0px',
left: '0px',
fontSize: '11px',
color: '#999999',
textTransform: 'capitalize'
},
Hex: {
style: {}
},
RGBwrap: {
position: 'relative'
},
RGBinput: {
width: '100%',
marginTop: '12px',
fontSize: '15px',
color: '#333',
padding: '0px',
border: '0px',
borderBottom: '1px solid #eee',
outline: 'none',
height: '30px'
},
RGBlabel: {
position: 'absolute',
top: '0px',
left: '0px',
fontSize: '11px',
color: '#999999',
textTransform: 'capitalize'
},
split: {
display: 'flex',
marginRight: '-10px',
paddingTop: '11px'
},
third: {
flex: '1',
paddingRight: '10px'
}
}
});
var handleChange = function handleChange(data, e) {
if (data.hex) {
_color2.default.isValidHex(data.hex) && onChange({
hex: data.hex,
source: 'hex'
}, e);
} else if (data.r || data.g || data.b) {
onChange({
r: data.r || rgb.r,
g: data.g || rgb.g,
b: data.b || rgb.b,
source: 'rgb'
}, e);
}
};
return _react2.default.createElement(
_common.Raised,
null,
_react2.default.createElement(
'div',
{ style: styles.material, className: 'material-picker ' + className },
_react2.default.createElement(_common.EditableInput, {
style: { wrap: styles.HEXwrap, input: styles.HEXinput, label: styles.HEXlabel },
label: 'hex',
value: hex,
onChange: handleChange
}),
_react2.default.createElement(
'div',
{ style: styles.split, className: 'flexbox-fix' },
_react2.default.createElement(
'div',
{ style: styles.third },
_react2.default.createElement(_common.EditableInput, {
style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel },
label: 'r', value: rgb.r,
onChange: handleChange
})
),
_react2.default.createElement(
'div',
{ style: styles.third },
_react2.default.createElement(_common.EditableInput, {
style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel },
label: 'g',
value: rgb.g,
onChange: handleChange
})
),
_react2.default.createElement(
'div',
{ style: styles.third },
_react2.default.createElement(_common.EditableInput, {
style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel },
label: 'b',
value: rgb.b,
onChange: handleChange
})
)
)
)
);
};
exports.default = (0, _common.ColorWrap)(Material);
/***/ }),
/***/ "./node_modules/react-color/lib/components/photoshop/Photoshop.js":
/*!************************************************************************!*\
!*** ./node_modules/react-color/lib/components/photoshop/Photoshop.js ***!
\************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Photoshop = undefined;
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; }; }();
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
var _common = __webpack_require__(/*! ../common */ "./node_modules/react-color/lib/components/common/index.js");
var _PhotoshopFields = __webpack_require__(/*! ./PhotoshopFields */ "./node_modules/react-color/lib/components/photoshop/PhotoshopFields.js");
var _PhotoshopFields2 = _interopRequireDefault(_PhotoshopFields);
var _PhotoshopPointerCircle = __webpack_require__(/*! ./PhotoshopPointerCircle */ "./node_modules/react-color/lib/components/photoshop/PhotoshopPointerCircle.js");
var _PhotoshopPointerCircle2 = _interopRequireDefault(_PhotoshopPointerCircle);
var _PhotoshopPointer = __webpack_require__(/*! ./PhotoshopPointer */ "./node_modules/react-color/lib/components/photoshop/PhotoshopPointer.js");
var _PhotoshopPointer2 = _interopRequireDefault(_PhotoshopPointer);
var _PhotoshopButton = __webpack_require__(/*! ./PhotoshopButton */ "./node_modules/react-color/lib/components/photoshop/PhotoshopButton.js");
var _PhotoshopButton2 = _interopRequireDefault(_PhotoshopButton);
var _PhotoshopPreviews = __webpack_require__(/*! ./PhotoshopPreviews */ "./node_modules/react-color/lib/components/photoshop/PhotoshopPreviews.js");
var _PhotoshopPreviews2 = _interopRequireDefault(_PhotoshopPreviews);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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; }
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; }
var Photoshop = exports.Photoshop = function (_React$Component) {
_inherits(Photoshop, _React$Component);
function Photoshop(props) {
_classCallCheck(this, Photoshop);
var _this = _possibleConstructorReturn(this, (Photoshop.__proto__ || Object.getPrototypeOf(Photoshop)).call(this));
_this.state = {
currentColor: props.hex
};
return _this;
}
_createClass(Photoshop, [{
key: 'render',
value: function render() {
var _props$className = this.props.className,
className = _props$className === undefined ? '' : _props$className;
var styles = (0, _reactcss2.default)({
'default': {
picker: {
background: '#DCDCDC',
borderRadius: '4px',
boxShadow: '0 0 0 1px rgba(0,0,0,.25), 0 8px 16px rgba(0,0,0,.15)',
boxSizing: 'initial',
width: '513px'
},
head: {
backgroundImage: 'linear-gradient(-180deg, #F0F0F0 0%, #D4D4D4 100%)',
borderBottom: '1px solid #B1B1B1',
boxShadow: 'inset 0 1px 0 0 rgba(255,255,255,.2), inset 0 -1px 0 0 rgba(0,0,0,.02)',
height: '23px',
lineHeight: '24px',
borderRadius: '4px 4px 0 0',
fontSize: '13px',
color: '#4D4D4D',
textAlign: 'center'
},
body: {
padding: '15px 15px 0',
display: 'flex'
},
saturation: {
width: '256px',
height: '256px',
position: 'relative',
border: '2px solid #B3B3B3',
borderBottom: '2px solid #F0F0F0',
overflow: 'hidden'
},
hue: {
position: 'relative',
height: '256px',
width: '19px',
marginLeft: '10px',
border: '2px solid #B3B3B3',
borderBottom: '2px solid #F0F0F0'
},
controls: {
width: '180px',
marginLeft: '10px'
},
top: {
display: 'flex'
},
previews: {
width: '60px'
},
actions: {
flex: '1',
marginLeft: '20px'
}
}
});
return _react2.default.createElement(
'div',
{ style: styles.picker, className: 'photoshop-picker ' + className },
_react2.default.createElement(
'div',
{ style: styles.head },
this.props.header
),
_react2.default.createElement(
'div',
{ style: styles.body, className: 'flexbox-fix' },
_react2.default.createElement(
'div',
{ style: styles.saturation },
_react2.default.createElement(_common.Saturation, {
hsl: this.props.hsl,
hsv: this.props.hsv,
pointer: _PhotoshopPointerCircle2.default,
onChange: this.props.onChange
})
),
_react2.default.createElement(
'div',
{ style: styles.hue },
_react2.default.createElement(_common.Hue, {
direction: 'vertical',
hsl: this.props.hsl,
pointer: _PhotoshopPointer2.default,
onChange: this.props.onChange
})
),
_react2.default.createElement(
'div',
{ style: styles.controls },
_react2.default.createElement(
'div',
{ style: styles.top, className: 'flexbox-fix' },
_react2.default.createElement(
'div',
{ style: styles.previews },
_react2.default.createElement(_PhotoshopPreviews2.default, {
rgb: this.props.rgb,
currentColor: this.state.currentColor
})
),
_react2.default.createElement(
'div',
{ style: styles.actions },
_react2.default.createElement(_PhotoshopButton2.default, { label: 'OK', onClick: this.props.onAccept, active: true }),
_react2.default.createElement(_PhotoshopButton2.default, { label: 'Cancel', onClick: this.props.onCancel }),
_react2.default.createElement(_PhotoshopFields2.default, {
onChange: this.props.onChange,
rgb: this.props.rgb,
hsv: this.props.hsv,
hex: this.props.hex
})
)
)
)
)
);
}
}]);
return Photoshop;
}(_react2.default.Component);
Photoshop.propTypes = {
header: _propTypes2.default.string
};
Photoshop.defaultProps = {
header: 'Color Picker'
};
exports.default = (0, _common.ColorWrap)(Photoshop);
/***/ }),
/***/ "./node_modules/react-color/lib/components/photoshop/PhotoshopButton.js":
/*!******************************************************************************!*\
!*** ./node_modules/react-color/lib/components/photoshop/PhotoshopButton.js ***!
\******************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PhotoshopBotton = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var PhotoshopBotton = exports.PhotoshopBotton = function PhotoshopBotton(_ref) {
var onClick = _ref.onClick,
label = _ref.label,
children = _ref.children,
active = _ref.active;
var styles = (0, _reactcss2.default)({
'default': {
button: {
backgroundImage: 'linear-gradient(-180deg, #FFFFFF 0%, #E6E6E6 100%)',
border: '1px solid #878787',
borderRadius: '2px',
height: '20px',
boxShadow: '0 1px 0 0 #EAEAEA',
fontSize: '14px',
color: '#000',
lineHeight: '20px',
textAlign: 'center',
marginBottom: '10px',
cursor: 'pointer'
}
},
'active': {
button: {
boxShadow: '0 0 0 1px #878787'
}
}
}, { active: active });
return _react2.default.createElement(
'div',
{ style: styles.button, onClick: onClick },
label || children
);
};
exports.default = PhotoshopBotton;
/***/ }),
/***/ "./node_modules/react-color/lib/components/photoshop/PhotoshopFields.js":
/*!******************************************************************************!*\
!*** ./node_modules/react-color/lib/components/photoshop/PhotoshopFields.js ***!
\******************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PhotoshopPicker = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
var _color = __webpack_require__(/*! ../../helpers/color */ "./node_modules/react-color/lib/helpers/color.js");
var _color2 = _interopRequireDefault(_color);
var _common = __webpack_require__(/*! ../common */ "./node_modules/react-color/lib/components/common/index.js");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var PhotoshopPicker = exports.PhotoshopPicker = function PhotoshopPicker(_ref) {
var onChange = _ref.onChange,
rgb = _ref.rgb,
hsv = _ref.hsv,
hex = _ref.hex;
var styles = (0, _reactcss2.default)({
'default': {
fields: {
paddingTop: '5px',
paddingBottom: '9px',
width: '80px',
position: 'relative'
},
divider: {
height: '5px'
},
RGBwrap: {
position: 'relative'
},
RGBinput: {
marginLeft: '40%',
width: '40%',
height: '18px',
border: '1px solid #888888',
boxShadow: 'inset 0 1px 1px rgba(0,0,0,.1), 0 1px 0 0 #ECECEC',
marginBottom: '5px',
fontSize: '13px',
paddingLeft: '3px',
marginRight: '10px'
},
RGBlabel: {
left: '0px',
width: '34px',
textTransform: 'uppercase',
fontSize: '13px',
height: '18px',
lineHeight: '22px',
position: 'absolute'
},
HEXwrap: {
position: 'relative'
},
HEXinput: {
marginLeft: '20%',
width: '80%',
height: '18px',
border: '1px solid #888888',
boxShadow: 'inset 0 1px 1px rgba(0,0,0,.1), 0 1px 0 0 #ECECEC',
marginBottom: '6px',
fontSize: '13px',
paddingLeft: '3px'
},
HEXlabel: {
position: 'absolute',
top: '0px',
left: '0px',
width: '14px',
textTransform: 'uppercase',
fontSize: '13px',
height: '18px',
lineHeight: '22px'
},
fieldSymbols: {
position: 'absolute',
top: '5px',
right: '-7px',
fontSize: '13px'
},
symbol: {
height: '20px',
lineHeight: '22px',
paddingBottom: '7px'
}
}
});
var handleChange = function handleChange(data, e) {
if (data['#']) {
_color2.default.isValidHex(data['#']) && onChange({
hex: data['#'],
source: 'hex'
}, e);
} else if (data.r || data.g || data.b) {
onChange({
r: data.r || rgb.r,
g: data.g || rgb.g,
b: data.b || rgb.b,
source: 'rgb'
}, e);
} else if (data.h || data.s || data.v) {
onChange({
h: data.h || hsv.h,
s: data.s || hsv.s,
v: data.v || hsv.v,
source: 'hsv'
}, e);
}
};
return _react2.default.createElement(
'div',
{ style: styles.fields },
_react2.default.createElement(_common.EditableInput, {
style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel },
label: 'h',
value: Math.round(hsv.h),
onChange: handleChange
}),
_react2.default.createElement(_common.EditableInput, {
style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel },
label: 's',
value: Math.round(hsv.s * 100),
onChange: handleChange
}),
_react2.default.createElement(_common.EditableInput, {
style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel },
label: 'v',
value: Math.round(hsv.v * 100),
onChange: handleChange
}),
_react2.default.createElement('div', { style: styles.divider }),
_react2.default.createElement(_common.EditableInput, {
style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel },
label: 'r',
value: rgb.r,
onChange: handleChange
}),
_react2.default.createElement(_common.EditableInput, {
style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel },
label: 'g',
value: rgb.g,
onChange: handleChange
}),
_react2.default.createElement(_common.EditableInput, {
style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel },
label: 'b',
value: rgb.b,
onChange: handleChange
}),
_react2.default.createElement('div', { style: styles.divider }),
_react2.default.createElement(_common.EditableInput, {
style: { wrap: styles.HEXwrap, input: styles.HEXinput, label: styles.HEXlabel },
label: '#',
value: hex.replace('#', ''),
onChange: handleChange
}),
_react2.default.createElement(
'div',
{ style: styles.fieldSymbols },
_react2.default.createElement(
'div',
{ style: styles.symbol },
'\xB0'
),
_react2.default.createElement(
'div',
{ style: styles.symbol },
'%'
),
_react2.default.createElement(
'div',
{ style: styles.symbol },
'%'
)
)
);
};
exports.default = PhotoshopPicker;
/***/ }),
/***/ "./node_modules/react-color/lib/components/photoshop/PhotoshopPointer.js":
/*!*******************************************************************************!*\
!*** ./node_modules/react-color/lib/components/photoshop/PhotoshopPointer.js ***!
\*******************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PhotoshopPointerCircle = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var PhotoshopPointerCircle = exports.PhotoshopPointerCircle = function PhotoshopPointerCircle() {
var styles = (0, _reactcss2.default)({
'default': {
triangle: {
width: 0,
height: 0,
borderStyle: 'solid',
borderWidth: '4px 0 4px 6px',
borderColor: 'transparent transparent transparent #fff',
position: 'absolute',
top: '1px',
left: '1px'
},
triangleBorder: {
width: 0,
height: 0,
borderStyle: 'solid',
borderWidth: '5px 0 5px 8px',
borderColor: 'transparent transparent transparent #555'
},
left: {
Extend: 'triangleBorder',
transform: 'translate(-13px, -4px)'
},
leftInside: {
Extend: 'triangle',
transform: 'translate(-8px, -5px)'
},
right: {
Extend: 'triangleBorder',
transform: 'translate(20px, -14px) rotate(180deg)'
},
rightInside: {
Extend: 'triangle',
transform: 'translate(-8px, -5px)'
}
}
});
return _react2.default.createElement(
'div',
{ style: styles.pointer },
_react2.default.createElement(
'div',
{ style: styles.left },
_react2.default.createElement('div', { style: styles.leftInside })
),
_react2.default.createElement(
'div',
{ style: styles.right },
_react2.default.createElement('div', { style: styles.rightInside })
)
);
};
exports.default = PhotoshopPointerCircle;
/***/ }),
/***/ "./node_modules/react-color/lib/components/photoshop/PhotoshopPointerCircle.js":
/*!*************************************************************************************!*\
!*** ./node_modules/react-color/lib/components/photoshop/PhotoshopPointerCircle.js ***!
\*************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PhotoshopPointerCircle = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var PhotoshopPointerCircle = exports.PhotoshopPointerCircle = function PhotoshopPointerCircle(_ref) {
var hsl = _ref.hsl;
var styles = (0, _reactcss2.default)({
'default': {
picker: {
width: '12px',
height: '12px',
borderRadius: '6px',
boxShadow: 'inset 0 0 0 1px #fff',
transform: 'translate(-6px, -6px)'
}
},
'black-outline': {
picker: {
boxShadow: 'inset 0 0 0 1px #000'
}
}
}, { 'black-outline': hsl.l > 0.5 });
return _react2.default.createElement('div', { style: styles.picker });
};
exports.default = PhotoshopPointerCircle;
/***/ }),
/***/ "./node_modules/react-color/lib/components/photoshop/PhotoshopPreviews.js":
/*!********************************************************************************!*\
!*** ./node_modules/react-color/lib/components/photoshop/PhotoshopPreviews.js ***!
\********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PhotoshopPreviews = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var PhotoshopPreviews = exports.PhotoshopPreviews = function PhotoshopPreviews(_ref) {
var rgb = _ref.rgb,
currentColor = _ref.currentColor;
var styles = (0, _reactcss2.default)({
'default': {
swatches: {
border: '1px solid #B3B3B3',
borderBottom: '1px solid #F0F0F0',
marginBottom: '2px',
marginTop: '1px'
},
new: {
height: '34px',
background: 'rgb(' + rgb.r + ',' + rgb.g + ', ' + rgb.b + ')',
boxShadow: 'inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 1px 0 #000'
},
current: {
height: '34px',
background: currentColor,
boxShadow: 'inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000'
},
label: {
fontSize: '14px',
color: '#000',
textAlign: 'center'
}
}
});
return _react2.default.createElement(
'div',
null,
_react2.default.createElement(
'div',
{ style: styles.label },
'new'
),
_react2.default.createElement(
'div',
{ style: styles.swatches },
_react2.default.createElement('div', { style: styles.new }),
_react2.default.createElement('div', { style: styles.current })
),
_react2.default.createElement(
'div',
{ style: styles.label },
'current'
)
);
};
exports.default = PhotoshopPreviews;
/***/ }),
/***/ "./node_modules/react-color/lib/components/sketch/Sketch.js":
/*!******************************************************************!*\
!*** ./node_modules/react-color/lib/components/sketch/Sketch.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Sketch = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
var _common = __webpack_require__(/*! ../common */ "./node_modules/react-color/lib/components/common/index.js");
var _SketchFields = __webpack_require__(/*! ./SketchFields */ "./node_modules/react-color/lib/components/sketch/SketchFields.js");
var _SketchFields2 = _interopRequireDefault(_SketchFields);
var _SketchPresetColors = __webpack_require__(/*! ./SketchPresetColors */ "./node_modules/react-color/lib/components/sketch/SketchPresetColors.js");
var _SketchPresetColors2 = _interopRequireDefault(_SketchPresetColors);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var Sketch = exports.Sketch = function Sketch(_ref) {
var width = _ref.width,
rgb = _ref.rgb,
hex = _ref.hex,
hsv = _ref.hsv,
hsl = _ref.hsl,
onChange = _ref.onChange,
onSwatchHover = _ref.onSwatchHover,
disableAlpha = _ref.disableAlpha,
presetColors = _ref.presetColors,
renderers = _ref.renderers,
_ref$className = _ref.className,
className = _ref$className === undefined ? '' : _ref$className;
var styles = (0, _reactcss2.default)({
'default': {
picker: {
width: width,
padding: '10px 10px 0',
boxSizing: 'initial',
background: '#fff',
borderRadius: '4px',
boxShadow: '0 0 0 1px rgba(0,0,0,.15), 0 8px 16px rgba(0,0,0,.15)'
},
saturation: {
width: '100%',
paddingBottom: '75%',
position: 'relative',
overflow: 'hidden'
},
Saturation: {
radius: '3px',
shadow: 'inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)'
},
controls: {
display: 'flex'
},
sliders: {
padding: '4px 0',
flex: '1'
},
color: {
width: '24px',
height: '24px',
position: 'relative',
marginTop: '4px',
marginLeft: '4px',
borderRadius: '3px'
},
activeColor: {
absolute: '0px 0px 0px 0px',
borderRadius: '2px',
background: 'rgba(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ',' + rgb.a + ')',
boxShadow: 'inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)'
},
hue: {
position: 'relative',
height: '10px',
overflow: 'hidden'
},
Hue: {
radius: '2px',
shadow: 'inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)'
},
alpha: {
position: 'relative',
height: '10px',
marginTop: '4px',
overflow: 'hidden'
},
Alpha: {
radius: '2px',
shadow: 'inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)'
}
},
'disableAlpha': {
color: {
height: '10px'
},
hue: {
height: '10px'
},
alpha: {
display: 'none'
}
}
}, { disableAlpha: disableAlpha });
return _react2.default.createElement(
'div',
{ style: styles.picker, className: 'sketch-picker ' + className },
_react2.default.createElement(
'div',
{ style: styles.saturation },
_react2.default.createElement(_common.Saturation, {
style: styles.Saturation,
hsl: hsl,
hsv: hsv,
onChange: onChange
})
),
_react2.default.createElement(
'div',
{ style: styles.controls, className: 'flexbox-fix' },
_react2.default.createElement(
'div',
{ style: styles.sliders },
_react2.default.createElement(
'div',
{ style: styles.hue },
_react2.default.createElement(_common.Hue, {
style: styles.Hue,
hsl: hsl,
onChange: onChange
})
),
_react2.default.createElement(
'div',
{ style: styles.alpha },
_react2.default.createElement(_common.Alpha, {
style: styles.Alpha,
rgb: rgb,
hsl: hsl,
renderers: renderers,
onChange: onChange
})
)
),
_react2.default.createElement(
'div',
{ style: styles.color },
_react2.default.createElement(_common.Checkboard, null),
_react2.default.createElement('div', { style: styles.activeColor })
)
),
_react2.default.createElement(_SketchFields2.default, {
rgb: rgb,
hsl: hsl,
hex: hex,
onChange: onChange,
disableAlpha: disableAlpha
}),
_react2.default.createElement(_SketchPresetColors2.default, {
colors: presetColors,
onClick: onChange,
onSwatchHover: onSwatchHover
})
);
};
Sketch.propTypes = {
disableAlpha: _propTypes2.default.bool,
width: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number])
};
Sketch.defaultProps = {
disableAlpha: false,
width: 200,
presetColors: ['#D0021B', '#F5A623', '#F8E71C', '#8B572A', '#7ED321', '#417505', '#BD10E0', '#9013FE', '#4A90E2', '#50E3C2', '#B8E986', '#000000', '#4A4A4A', '#9B9B9B', '#FFFFFF']
};
exports.default = (0, _common.ColorWrap)(Sketch);
/***/ }),
/***/ "./node_modules/react-color/lib/components/sketch/SketchFields.js":
/*!************************************************************************!*\
!*** ./node_modules/react-color/lib/components/sketch/SketchFields.js ***!
\************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SketchFields = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
var _color = __webpack_require__(/*! ../../helpers/color */ "./node_modules/react-color/lib/helpers/color.js");
var _color2 = _interopRequireDefault(_color);
var _common = __webpack_require__(/*! ../common */ "./node_modules/react-color/lib/components/common/index.js");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/* eslint-disable no-param-reassign */
var SketchFields = exports.SketchFields = function SketchFields(_ref) {
var onChange = _ref.onChange,
rgb = _ref.rgb,
hsl = _ref.hsl,
hex = _ref.hex,
disableAlpha = _ref.disableAlpha;
var styles = (0, _reactcss2.default)({
'default': {
fields: {
display: 'flex',
paddingTop: '4px'
},
single: {
flex: '1',
paddingLeft: '6px'
},
alpha: {
flex: '1',
paddingLeft: '6px'
},
double: {
flex: '2'
},
input: {
width: '80%',
padding: '4px 10% 3px',
border: 'none',
boxShadow: 'inset 0 0 0 1px #ccc',
fontSize: '11px'
},
label: {
display: 'block',
textAlign: 'center',
fontSize: '11px',
color: '#222',
paddingTop: '3px',
paddingBottom: '4px',
textTransform: 'capitalize'
}
},
'disableAlpha': {
alpha: {
display: 'none'
}
}
}, { disableAlpha: disableAlpha });
var handleChange = function handleChange(data, e) {
if (data.hex) {
_color2.default.isValidHex(data.hex) && onChange({
hex: data.hex,
source: 'hex'
}, e);
} else if (data.r || data.g || data.b) {
onChange({
r: data.r || rgb.r,
g: data.g || rgb.g,
b: data.b || rgb.b,
a: rgb.a,
source: 'rgb'
}, e);
} else if (data.a) {
if (data.a < 0) {
data.a = 0;
} else if (data.a > 100) {
data.a = 100;
}
data.a /= 100;
onChange({
h: hsl.h,
s: hsl.s,
l: hsl.l,
a: data.a,
source: 'rgb'
}, e);
}
};
return _react2.default.createElement(
'div',
{ style: styles.fields, className: 'flexbox-fix' },
_react2.default.createElement(
'div',
{ style: styles.double },
_react2.default.createElement(_common.EditableInput, {
style: { input: styles.input, label: styles.label },
label: 'hex',
value: hex.replace('#', ''),
onChange: handleChange
})
),
_react2.default.createElement(
'div',
{ style: styles.single },
_react2.default.createElement(_common.EditableInput, {
style: { input: styles.input, label: styles.label },
label: 'r',
value: rgb.r,
onChange: handleChange,
dragLabel: 'true',
dragMax: '255'
})
),
_react2.default.createElement(
'div',
{ style: styles.single },
_react2.default.createElement(_common.EditableInput, {
style: { input: styles.input, label: styles.label },
label: 'g',
value: rgb.g,
onChange: handleChange,
dragLabel: 'true',
dragMax: '255'
})
),
_react2.default.createElement(
'div',
{ style: styles.single },
_react2.default.createElement(_common.EditableInput, {
style: { input: styles.input, label: styles.label },
label: 'b',
value: rgb.b,
onChange: handleChange,
dragLabel: 'true',
dragMax: '255'
})
),
_react2.default.createElement(
'div',
{ style: styles.alpha },
_react2.default.createElement(_common.EditableInput, {
style: { input: styles.input, label: styles.label },
label: 'a',
value: Math.round(rgb.a * 100),
onChange: handleChange,
dragLabel: 'true',
dragMax: '100'
})
)
);
};
exports.default = SketchFields;
/***/ }),
/***/ "./node_modules/react-color/lib/components/sketch/SketchPresetColors.js":
/*!******************************************************************************!*\
!*** ./node_modules/react-color/lib/components/sketch/SketchPresetColors.js ***!
\******************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SketchPresetColors = undefined;
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; };
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
var _common = __webpack_require__(/*! ../common */ "./node_modules/react-color/lib/components/common/index.js");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var SketchPresetColors = exports.SketchPresetColors = function SketchPresetColors(_ref) {
var colors = _ref.colors,
_ref$onClick = _ref.onClick,
onClick = _ref$onClick === undefined ? function () {} : _ref$onClick,
onSwatchHover = _ref.onSwatchHover;
var styles = (0, _reactcss2.default)({
'default': {
colors: {
margin: '0 -10px',
padding: '10px 0 0 10px',
borderTop: '1px solid #eee',
display: 'flex',
flexWrap: 'wrap',
position: 'relative'
},
swatchWrap: {
width: '16px',
height: '16px',
margin: '0 10px 10px 0'
},
swatch: {
borderRadius: '3px',
boxShadow: 'inset 0 0 0 1px rgba(0,0,0,.15)'
}
},
'no-presets': {
colors: {
display: 'none'
}
}
}, {
'no-presets': !colors || !colors.length
});
var handleClick = function handleClick(hex, e) {
onClick({
hex: hex,
source: 'hex'
}, e);
};
return _react2.default.createElement(
'div',
{ style: styles.colors, className: 'flexbox-fix' },
colors.map(function (colorObjOrString) {
var c = typeof colorObjOrString === 'string' ? { color: colorObjOrString } : colorObjOrString;
var key = '' + c.color + (c.title || '');
return _react2.default.createElement(
'div',
{ key: key, style: styles.swatchWrap },
_react2.default.createElement(_common.Swatch, _extends({}, c, {
style: styles.swatch,
onClick: handleClick,
onHover: onSwatchHover,
focusStyle: {
boxShadow: 'inset 0 0 0 1px rgba(0,0,0,.15), 0 0 4px ' + c.color
}
}))
);
})
);
};
SketchPresetColors.propTypes = {
colors: _propTypes2.default.arrayOf(_propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({
color: _propTypes2.default.string,
title: _propTypes2.default.string
})])).isRequired
};
exports.default = SketchPresetColors;
/***/ }),
/***/ "./node_modules/react-color/lib/components/slider/Slider.js":
/*!******************************************************************!*\
!*** ./node_modules/react-color/lib/components/slider/Slider.js ***!
\******************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Slider = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
var _common = __webpack_require__(/*! ../common */ "./node_modules/react-color/lib/components/common/index.js");
var _SliderSwatches = __webpack_require__(/*! ./SliderSwatches */ "./node_modules/react-color/lib/components/slider/SliderSwatches.js");
var _SliderSwatches2 = _interopRequireDefault(_SliderSwatches);
var _SliderPointer = __webpack_require__(/*! ./SliderPointer */ "./node_modules/react-color/lib/components/slider/SliderPointer.js");
var _SliderPointer2 = _interopRequireDefault(_SliderPointer);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var Slider = exports.Slider = function Slider(_ref) {
var hsl = _ref.hsl,
onChange = _ref.onChange,
pointer = _ref.pointer,
_ref$className = _ref.className,
className = _ref$className === undefined ? '' : _ref$className;
var styles = (0, _reactcss2.default)({
'default': {
hue: {
height: '12px',
position: 'relative'
},
Hue: {
radius: '2px'
}
}
});
return _react2.default.createElement(
'div',
{ className: 'slider-picker ' + className },
_react2.default.createElement(
'div',
{ style: styles.hue },
_react2.default.createElement(_common.Hue, {
style: styles.Hue,
hsl: hsl,
pointer: pointer,
onChange: onChange
})
),
_react2.default.createElement(
'div',
{ style: styles.swatches },
_react2.default.createElement(_SliderSwatches2.default, { hsl: hsl, onClick: onChange })
)
);
};
Slider.defaultProps = {
pointer: _SliderPointer2.default
};
exports.default = (0, _common.ColorWrap)(Slider);
/***/ }),
/***/ "./node_modules/react-color/lib/components/slider/SliderPointer.js":
/*!*************************************************************************!*\
!*** ./node_modules/react-color/lib/components/slider/SliderPointer.js ***!
\*************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SliderPointer = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var SliderPointer = exports.SliderPointer = function SliderPointer() {
var styles = (0, _reactcss2.default)({
'default': {
picker: {
width: '14px',
height: '14px',
borderRadius: '6px',
transform: 'translate(-7px, -1px)',
backgroundColor: 'rgb(248, 248, 248)',
boxShadow: '0 1px 4px 0 rgba(0, 0, 0, 0.37)'
}
}
});
return _react2.default.createElement('div', { style: styles.picker });
};
exports.default = SliderPointer;
/***/ }),
/***/ "./node_modules/react-color/lib/components/slider/SliderSwatch.js":
/*!************************************************************************!*\
!*** ./node_modules/react-color/lib/components/slider/SliderSwatch.js ***!
\************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SliderSwatch = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var SliderSwatch = exports.SliderSwatch = function SliderSwatch(_ref) {
var hsl = _ref.hsl,
offset = _ref.offset,
_ref$onClick = _ref.onClick,
onClick = _ref$onClick === undefined ? function () {} : _ref$onClick,
active = _ref.active,
first = _ref.first,
last = _ref.last;
var styles = (0, _reactcss2.default)({
'default': {
swatch: {
height: '12px',
background: 'hsl(' + hsl.h + ', 50%, ' + offset * 100 + '%)',
cursor: 'pointer'
}
},
'first': {
swatch: {
borderRadius: '2px 0 0 2px'
}
},
'last': {
swatch: {
borderRadius: '0 2px 2px 0'
}
},
'active': {
swatch: {
transform: 'scaleY(1.8)',
borderRadius: '3.6px/2px'
}
}
}, { active: active, first: first, last: last });
var handleClick = function handleClick(e) {
return onClick({
h: hsl.h,
s: 0.5,
l: offset,
source: 'hsl'
}, e);
};
return _react2.default.createElement('div', { style: styles.swatch, onClick: handleClick });
};
exports.default = SliderSwatch;
/***/ }),
/***/ "./node_modules/react-color/lib/components/slider/SliderSwatches.js":
/*!**************************************************************************!*\
!*** ./node_modules/react-color/lib/components/slider/SliderSwatches.js ***!
\**************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SliderSwatches = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
var _SliderSwatch = __webpack_require__(/*! ./SliderSwatch */ "./node_modules/react-color/lib/components/slider/SliderSwatch.js");
var _SliderSwatch2 = _interopRequireDefault(_SliderSwatch);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var SliderSwatches = exports.SliderSwatches = function SliderSwatches(_ref) {
var onClick = _ref.onClick,
hsl = _ref.hsl;
var styles = (0, _reactcss2.default)({
'default': {
swatches: {
marginTop: '20px'
},
swatch: {
boxSizing: 'border-box',
width: '20%',
paddingRight: '1px',
float: 'left'
},
clear: {
clear: 'both'
}
}
});
return _react2.default.createElement(
'div',
{ style: styles.swatches },
_react2.default.createElement(
'div',
{ style: styles.swatch },
_react2.default.createElement(_SliderSwatch2.default, {
hsl: hsl,
offset: '.80',
active: Math.round(hsl.l * 100) / 100 === 0.80 && Math.round(hsl.s * 100) / 100 === 0.50,
onClick: onClick,
first: true
})
),
_react2.default.createElement(
'div',
{ style: styles.swatch },
_react2.default.createElement(_SliderSwatch2.default, {
hsl: hsl,
offset: '.65',
active: Math.round(hsl.l * 100) / 100 === 0.65 && Math.round(hsl.s * 100) / 100 === 0.50,
onClick: onClick
})
),
_react2.default.createElement(
'div',
{ style: styles.swatch },
_react2.default.createElement(_SliderSwatch2.default, {
hsl: hsl,
offset: '.50',
active: Math.round(hsl.l * 100) / 100 === 0.50 && Math.round(hsl.s * 100) / 100 === 0.50,
onClick: onClick
})
),
_react2.default.createElement(
'div',
{ style: styles.swatch },
_react2.default.createElement(_SliderSwatch2.default, {
hsl: hsl,
offset: '.35',
active: Math.round(hsl.l * 100) / 100 === 0.35 && Math.round(hsl.s * 100) / 100 === 0.50,
onClick: onClick
})
),
_react2.default.createElement(
'div',
{ style: styles.swatch },
_react2.default.createElement(_SliderSwatch2.default, {
hsl: hsl,
offset: '.20',
active: Math.round(hsl.l * 100) / 100 === 0.20 && Math.round(hsl.s * 100) / 100 === 0.50,
onClick: onClick,
last: true
})
),
_react2.default.createElement('div', { style: styles.clear })
);
};
exports.default = SliderSwatches;
/***/ }),
/***/ "./node_modules/react-color/lib/components/swatches/Swatches.js":
/*!**********************************************************************!*\
!*** ./node_modules/react-color/lib/components/swatches/Swatches.js ***!
\**********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Swatches = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
var _map = __webpack_require__(/*! lodash/map */ "./node_modules/lodash/map.js");
var _map2 = _interopRequireDefault(_map);
var _color = __webpack_require__(/*! ../../helpers/color */ "./node_modules/react-color/lib/helpers/color.js");
var _color2 = _interopRequireDefault(_color);
var _materialColors = __webpack_require__(/*! material-colors */ "./node_modules/material-colors/dist/colors.es2015.js");
var material = _interopRequireWildcard(_materialColors);
var _common = __webpack_require__(/*! ../common */ "./node_modules/react-color/lib/components/common/index.js");
var _SwatchesGroup = __webpack_require__(/*! ./SwatchesGroup */ "./node_modules/react-color/lib/components/swatches/SwatchesGroup.js");
var _SwatchesGroup2 = _interopRequireDefault(_SwatchesGroup);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var Swatches = exports.Swatches = function Swatches(_ref) {
var width = _ref.width,
height = _ref.height,
onChange = _ref.onChange,
onSwatchHover = _ref.onSwatchHover,
colors = _ref.colors,
hex = _ref.hex,
_ref$className = _ref.className,
className = _ref$className === undefined ? '' : _ref$className;
var styles = (0, _reactcss2.default)({
'default': {
picker: {
width: width,
height: height
},
overflow: {
height: height,
overflowY: 'scroll'
},
body: {
padding: '16px 0 6px 16px'
},
clear: {
clear: 'both'
}
}
});
var handleChange = function handleChange(data, e) {
_color2.default.isValidHex(data) && onChange({
hex: data,
source: 'hex'
}, e);
};
return _react2.default.createElement(
'div',
{ style: styles.picker, className: 'swatches-picker ' + className },
_react2.default.createElement(
_common.Raised,
null,
_react2.default.createElement(
'div',
{ style: styles.overflow },
_react2.default.createElement(
'div',
{ style: styles.body },
(0, _map2.default)(colors, function (group) {
return _react2.default.createElement(_SwatchesGroup2.default, {
key: group.toString(),
group: group,
active: hex,
onClick: handleChange,
onSwatchHover: onSwatchHover
});
}),
_react2.default.createElement('div', { style: styles.clear })
)
)
)
);
};
Swatches.propTypes = {
width: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),
height: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),
colors: _propTypes2.default.arrayOf(_propTypes2.default.arrayOf(_propTypes2.default.string))
/* eslint-disable max-len */
};Swatches.defaultProps = {
width: 320,
height: 240,
colors: [[material.red['900'], material.red['700'], material.red['500'], material.red['300'], material.red['100']], [material.pink['900'], material.pink['700'], material.pink['500'], material.pink['300'], material.pink['100']], [material.purple['900'], material.purple['700'], material.purple['500'], material.purple['300'], material.purple['100']], [material.deepPurple['900'], material.deepPurple['700'], material.deepPurple['500'], material.deepPurple['300'], material.deepPurple['100']], [material.indigo['900'], material.indigo['700'], material.indigo['500'], material.indigo['300'], material.indigo['100']], [material.blue['900'], material.blue['700'], material.blue['500'], material.blue['300'], material.blue['100']], [material.lightBlue['900'], material.lightBlue['700'], material.lightBlue['500'], material.lightBlue['300'], material.lightBlue['100']], [material.cyan['900'], material.cyan['700'], material.cyan['500'], material.cyan['300'], material.cyan['100']], [material.teal['900'], material.teal['700'], material.teal['500'], material.teal['300'], material.teal['100']], ['#194D33', material.green['700'], material.green['500'], material.green['300'], material.green['100']], [material.lightGreen['900'], material.lightGreen['700'], material.lightGreen['500'], material.lightGreen['300'], material.lightGreen['100']], [material.lime['900'], material.lime['700'], material.lime['500'], material.lime['300'], material.lime['100']], [material.yellow['900'], material.yellow['700'], material.yellow['500'], material.yellow['300'], material.yellow['100']], [material.amber['900'], material.amber['700'], material.amber['500'], material.amber['300'], material.amber['100']], [material.orange['900'], material.orange['700'], material.orange['500'], material.orange['300'], material.orange['100']], [material.deepOrange['900'], material.deepOrange['700'], material.deepOrange['500'], material.deepOrange['300'], material.deepOrange['100']], [material.brown['900'], material.brown['700'], material.brown['500'], material.brown['300'], material.brown['100']], [material.blueGrey['900'], material.blueGrey['700'], material.blueGrey['500'], material.blueGrey['300'], material.blueGrey['100']], ['#000000', '#525252', '#969696', '#D9D9D9', '#FFFFFF']]
};
exports.default = (0, _common.ColorWrap)(Swatches);
/***/ }),
/***/ "./node_modules/react-color/lib/components/swatches/SwatchesColor.js":
/*!***************************************************************************!*\
!*** ./node_modules/react-color/lib/components/swatches/SwatchesColor.js ***!
\***************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SwatchesColor = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
var _color = __webpack_require__(/*! ../../helpers/color */ "./node_modules/react-color/lib/helpers/color.js");
var _color2 = _interopRequireDefault(_color);
var _common = __webpack_require__(/*! ../common */ "./node_modules/react-color/lib/components/common/index.js");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var SwatchesColor = exports.SwatchesColor = function SwatchesColor(_ref) {
var color = _ref.color,
_ref$onClick = _ref.onClick,
onClick = _ref$onClick === undefined ? function () {} : _ref$onClick,
onSwatchHover = _ref.onSwatchHover,
first = _ref.first,
last = _ref.last,
active = _ref.active;
var styles = (0, _reactcss2.default)({
'default': {
color: {
width: '40px',
height: '24px',
cursor: 'pointer',
background: color,
marginBottom: '1px'
},
check: {
fill: _color2.default.getContrastingColor(color),
marginLeft: '8px',
display: 'none'
}
},
'first': {
color: {
overflow: 'hidden',
borderRadius: '2px 2px 0 0'
}
},
'last': {
color: {
overflow: 'hidden',
borderRadius: '0 0 2px 2px'
}
},
'active': {
check: {
display: 'block'
}
},
'color-#FFFFFF': {
color: {
boxShadow: 'inset 0 0 0 1px #ddd'
},
check: {
fill: '#333'
}
},
'transparent': {
check: {
fill: '#333'
}
}
}, {
first: first,
last: last,
active: active,
'color-#FFFFFF': color === '#FFFFFF',
'transparent': color === 'transparent'
});
return _react2.default.createElement(
_common.Swatch,
{
color: color,
style: styles.color,
onClick: onClick,
onHover: onSwatchHover,
focusStyle: { boxShadow: '0 0 4px ' + color }
},
_react2.default.createElement(
'div',
{ style: styles.check },
_react2.default.createElement(
'svg',
{ style: { width: '24px', height: '24px' }, viewBox: '0 0 24 24' },
_react2.default.createElement('path', { d: 'M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z' })
)
)
);
};
exports.default = SwatchesColor;
/***/ }),
/***/ "./node_modules/react-color/lib/components/swatches/SwatchesGroup.js":
/*!***************************************************************************!*\
!*** ./node_modules/react-color/lib/components/swatches/SwatchesGroup.js ***!
\***************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SwatchesGroup = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
var _map = __webpack_require__(/*! lodash/map */ "./node_modules/lodash/map.js");
var _map2 = _interopRequireDefault(_map);
var _SwatchesColor = __webpack_require__(/*! ./SwatchesColor */ "./node_modules/react-color/lib/components/swatches/SwatchesColor.js");
var _SwatchesColor2 = _interopRequireDefault(_SwatchesColor);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var SwatchesGroup = exports.SwatchesGroup = function SwatchesGroup(_ref) {
var onClick = _ref.onClick,
onSwatchHover = _ref.onSwatchHover,
group = _ref.group,
active = _ref.active;
var styles = (0, _reactcss2.default)({
'default': {
group: {
paddingBottom: '10px',
width: '40px',
float: 'left',
marginRight: '10px'
}
}
});
return _react2.default.createElement(
'div',
{ style: styles.group },
(0, _map2.default)(group, function (color, i) {
return _react2.default.createElement(_SwatchesColor2.default, {
key: color,
color: color,
active: color.toLowerCase() === active,
first: i === 0,
last: i === group.length - 1,
onClick: onClick,
onSwatchHover: onSwatchHover
});
})
);
};
exports.default = SwatchesGroup;
/***/ }),
/***/ "./node_modules/react-color/lib/components/twitter/Twitter.js":
/*!********************************************************************!*\
!*** ./node_modules/react-color/lib/components/twitter/Twitter.js ***!
\********************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Twitter = undefined;
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactcss = __webpack_require__(/*! reactcss */ "./node_modules/reactcss/lib/index.js");
var _reactcss2 = _interopRequireDefault(_reactcss);
var _map = __webpack_require__(/*! lodash/map */ "./node_modules/lodash/map.js");
var _map2 = _interopRequireDefault(_map);
var _color = __webpack_require__(/*! ../../helpers/color */ "./node_modules/react-color/lib/helpers/color.js");
var _color2 = _interopRequireDefault(_color);
var _common = __webpack_require__(/*! ../common */ "./node_modules/react-color/lib/components/common/index.js");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var Twitter = exports.Twitter = function Twitter(_ref) {
var onChange = _ref.onChange,
onSwatchHover = _ref.onSwatchHover,
hex = _ref.hex,
colors = _ref.colors,
width = _ref.width,
triangle = _ref.triangle,
_ref$className = _ref.className,
className = _ref$className === undefined ? '' : _ref$className;
var styles = (0, _reactcss2.default)({
'default': {
card: {
width: width,
background: '#fff',
border: '0 solid rgba(0,0,0,0.25)',
boxShadow: '0 1px 4px rgba(0,0,0,0.25)',
borderRadius: '4px',
position: 'relative'
},
body: {
padding: '15px 9px 9px 15px'
},
label: {
fontSize: '18px',
color: '#fff'
},
triangle: {
width: '0px',
height: '0px',
borderStyle: 'solid',
borderWidth: '0 9px 10px 9px',
borderColor: 'transparent transparent #fff transparent',
position: 'absolute'
},
triangleShadow: {
width: '0px',
height: '0px',
borderStyle: 'solid',
borderWidth: '0 9px 10px 9px',
borderColor: 'transparent transparent rgba(0,0,0,.1) transparent',
position: 'absolute'
},
hash: {
background: '#F0F0F0',
height: '30px',
width: '30px',
borderRadius: '4px 0 0 4px',
float: 'left',
color: '#98A1A4',
display: 'flex',
alignItems: 'center',
justifyContent: 'center'
},
input: {
width: '100px',
fontSize: '14px',
color: '#666',
border: '0px',
outline: 'none',
height: '28px',
boxShadow: 'inset 0 0 0 1px #F0F0F0',
boxSizing: 'content-box',
borderRadius: '0 4px 4px 0',
float: 'left',
paddingLeft: '8px'
},
swatch: {
width: '30px',
height: '30px',
float: 'left',
borderRadius: '4px',
margin: '0 6px 6px 0'
},
clear: {
clear: 'both'
}
},
'hide-triangle': {
triangle: {
display: 'none'
},
triangleShadow: {
display: 'none'
}
},
'top-left-triangle': {
triangle: {
top: '-10px',
left: '12px'
},
triangleShadow: {
top: '-11px',
left: '12px'
}
},
'top-right-triangle': {
triangle: {
top: '-10px',
right: '12px'
},
triangleShadow: {
top: '-11px',
right: '12px'
}
}
}, {
'hide-triangle': triangle === 'hide',
'top-left-triangle': triangle === 'top-left',
'top-right-triangle': triangle === 'top-right'
});
var handleChange = function handleChange(hexcode, e) {
_color2.default.isValidHex(hexcode) && onChange({
hex: hexcode,
source: 'hex'
}, e);
};
return _react2.default.createElement(
'div',
{ style: styles.card, className: 'twitter-picker ' + className },
_react2.default.createElement('div', { style: styles.triangleShadow }),
_react2.default.createElement('div', { style: styles.triangle }),
_react2.default.createElement(
'div',
{ style: styles.body },
(0, _map2.default)(colors, function (c, i) {
return _react2.default.createElement(_common.Swatch, {
key: i,
color: c,
hex: c,
style: styles.swatch,
onClick: handleChange,
onHover: onSwatchHover,
focusStyle: {
boxShadow: '0 0 4px ' + c
}
});
}),
_react2.default.createElement(
'div',
{ style: styles.hash },
'#'
),
_react2.default.createElement(_common.EditableInput, {
style: { input: styles.input },
value: hex.replace('#', ''),
onChange: handleChange
}),
_react2.default.createElement('div', { style: styles.clear })
)
);
};
Twitter.propTypes = {
width: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),
triangle: _propTypes2.default.oneOf(['hide', 'top-left', 'top-right']),
colors: _propTypes2.default.arrayOf(_propTypes2.default.string)
};
Twitter.defaultProps = {
width: 276,
colors: ['#FF6900', '#FCB900', '#7BDCB5', '#00D084', '#8ED1FC', '#0693E3', '#ABB8C3', '#EB144C', '#F78DA7', '#9900EF'],
triangle: 'top-left'
};
exports.default = (0, _common.ColorWrap)(Twitter);
/***/ }),
/***/ "./node_modules/react-color/lib/helpers/alpha.js":
/*!*******************************************************!*\
!*** ./node_modules/react-color/lib/helpers/alpha.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var calculateChange = exports.calculateChange = function calculateChange(e, skip, props, container) {
e.preventDefault();
var containerWidth = container.clientWidth;
var containerHeight = container.clientHeight;
var x = typeof e.pageX === 'number' ? e.pageX : e.touches[0].pageX;
var y = typeof e.pageY === 'number' ? e.pageY : e.touches[0].pageY;
var left = x - (container.getBoundingClientRect().left + window.pageXOffset);
var top = y - (container.getBoundingClientRect().top + window.pageYOffset);
if (props.direction === 'vertical') {
var a = void 0;
if (top < 0) {
a = 0;
} else if (top > containerHeight) {
a = 1;
} else {
a = Math.round(top * 100 / containerHeight) / 100;
}
if (props.hsl.a !== a) {
return {
h: props.hsl.h,
s: props.hsl.s,
l: props.hsl.l,
a: a,
source: 'rgb'
};
}
} else {
var _a = void 0;
if (left < 0) {
_a = 0;
} else if (left > containerWidth) {
_a = 1;
} else {
_a = Math.round(left * 100 / containerWidth) / 100;
}
if (props.a !== _a) {
return {
h: props.hsl.h,
s: props.hsl.s,
l: props.hsl.l,
a: _a,
source: 'rgb'
};
}
}
return null;
};
/***/ }),
/***/ "./node_modules/react-color/lib/helpers/checkboard.js":
/*!************************************************************!*\
!*** ./node_modules/react-color/lib/helpers/checkboard.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var checkboardCache = {};
var render = exports.render = function render(c1, c2, size, serverCanvas) {
if (typeof document === 'undefined' && !serverCanvas) {
return null;
}
var canvas = serverCanvas ? new serverCanvas() : document.createElement('canvas');
canvas.width = size * 2;
canvas.height = size * 2;
var ctx = canvas.getContext('2d');
if (!ctx) {
return null;
} // If no context can be found, return early.
ctx.fillStyle = c1;
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.fillStyle = c2;
ctx.fillRect(0, 0, size, size);
ctx.translate(size, size);
ctx.fillRect(0, 0, size, size);
return canvas.toDataURL();
};
var get = exports.get = function get(c1, c2, size, serverCanvas) {
var key = c1 + '-' + c2 + '-' + size + (serverCanvas ? '-server' : '');
var checkboard = render(c1, c2, size, serverCanvas);
if (checkboardCache[key]) {
return checkboardCache[key];
}
checkboardCache[key] = checkboard;
return checkboard;
};
/***/ }),
/***/ "./node_modules/react-color/lib/helpers/color.js":
/*!*******************************************************!*\
!*** ./node_modules/react-color/lib/helpers/color.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.red = undefined;
var _each = __webpack_require__(/*! lodash/each */ "./node_modules/lodash/each.js");
var _each2 = _interopRequireDefault(_each);
var _tinycolor = __webpack_require__(/*! tinycolor2 */ "./node_modules/tinycolor2/tinycolor.js");
var _tinycolor2 = _interopRequireDefault(_tinycolor);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = {
simpleCheckForValidColor: function simpleCheckForValidColor(data) {
var keysToCheck = ['r', 'g', 'b', 'a', 'h', 's', 'l', 'v'];
var checked = 0;
var passed = 0;
(0, _each2.default)(keysToCheck, function (letter) {
if (data[letter]) {
checked += 1;
if (!isNaN(data[letter])) {
passed += 1;
}
if (letter === 's' || letter === 'l') {
var percentPatt = /^\d+%$/;
if (percentPatt.test(data[letter])) {
passed += 1;
}
}
}
});
return checked === passed ? data : false;
},
toState: function toState(data, oldHue) {
var color = data.hex ? (0, _tinycolor2.default)(data.hex) : (0, _tinycolor2.default)(data);
var hsl = color.toHsl();
var hsv = color.toHsv();
var rgb = color.toRgb();
var hex = color.toHex();
if (hsl.s === 0) {
hsl.h = oldHue || 0;
hsv.h = oldHue || 0;
}
var transparent = hex === '000000' && rgb.a === 0;
return {
hsl: hsl,
hex: transparent ? 'transparent' : '#' + hex,
rgb: rgb,
hsv: hsv,
oldHue: data.h || oldHue || hsl.h,
source: data.source
};
},
isValidHex: function isValidHex(hex) {
// disable hex4 and hex8
var lh = String(hex).charAt(0) === '#' ? 1 : 0;
return hex.length !== 4 + lh && hex.length < 7 + lh && (0, _tinycolor2.default)(hex).isValid();
},
getContrastingColor: function getContrastingColor(data) {
if (!data) {
return '#fff';
}
var col = this.toState(data);
if (col.hex === 'transparent') {
return 'rgba(0,0,0,0.4)';
}
var yiq = (col.rgb.r * 299 + col.rgb.g * 587 + col.rgb.b * 114) / 1000;
return yiq >= 128 ? '#000' : '#fff';
}
};
var red = exports.red = {
hsl: { a: 1, h: 0, l: 0.5, s: 1 },
hex: '#ff0000',
rgb: { r: 255, g: 0, b: 0, a: 1 },
hsv: { h: 0, s: 1, v: 1, a: 1 }
};
/***/ }),
/***/ "./node_modules/react-color/lib/helpers/hue.js":
/*!*****************************************************!*\
!*** ./node_modules/react-color/lib/helpers/hue.js ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var calculateChange = exports.calculateChange = function calculateChange(e, skip, props, container) {
e.preventDefault();
var containerWidth = container.clientWidth;
var containerHeight = container.clientHeight;
var x = typeof e.pageX === 'number' ? e.pageX : e.touches[0].pageX;
var y = typeof e.pageY === 'number' ? e.pageY : e.touches[0].pageY;
var left = x - (container.getBoundingClientRect().left + window.pageXOffset);
var top = y - (container.getBoundingClientRect().top + window.pageYOffset);
if (props.direction === 'vertical') {
var h = void 0;
if (top < 0) {
h = 359;
} else if (top > containerHeight) {
h = 0;
} else {
var percent = -(top * 100 / containerHeight) + 100;
h = 360 * percent / 100;
}
if (props.hsl.h !== h) {
return {
h: h,
s: props.hsl.s,
l: props.hsl.l,
a: props.hsl.a,
source: 'rgb'
};
}
} else {
var _h = void 0;
if (left < 0) {
_h = 0;
} else if (left > containerWidth) {
_h = 359;
} else {
var _percent = left * 100 / containerWidth;
_h = 360 * _percent / 100;
}
if (props.hsl.h !== _h) {
return {
h: _h,
s: props.hsl.s,
l: props.hsl.l,
a: props.hsl.a,
source: 'rgb'
};
}
}
return null;
};
/***/ }),
/***/ "./node_modules/react-color/lib/helpers/interaction.js":
/*!*************************************************************!*\
!*** ./node_modules/react-color/lib/helpers/interaction.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.handleFocus = undefined;
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; };
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; }; }();
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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; }
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; } /* eslint-disable no-invalid-this */
var handleFocus = exports.handleFocus = function handleFocus(Component) {
var Span = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'span';
return function (_React$Component) {
_inherits(Focus, _React$Component);
function Focus() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, Focus);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Focus.__proto__ || Object.getPrototypeOf(Focus)).call.apply(_ref, [this].concat(args))), _this), _this.state = { focus: false }, _this.handleFocus = function () {
return _this.setState({ focus: true });
}, _this.handleBlur = function () {
return _this.setState({ focus: false });
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Focus, [{
key: 'render',
value: function render() {
return _react2.default.createElement(
Span,
{ onFocus: this.handleFocus, onBlur: this.handleBlur },
_react2.default.createElement(Component, _extends({}, this.props, this.state))
);
}
}]);
return Focus;
}(_react2.default.Component);
};
/***/ }),
/***/ "./node_modules/react-color/lib/helpers/saturation.js":
/*!************************************************************!*\
!*** ./node_modules/react-color/lib/helpers/saturation.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var calculateChange = exports.calculateChange = function calculateChange(e, skip, props, container) {
e.preventDefault();
var _container$getBoundin = container.getBoundingClientRect(),
containerWidth = _container$getBoundin.width,
containerHeight = _container$getBoundin.height;
var x = typeof e.pageX === 'number' ? e.pageX : e.touches[0].pageX;
var y = typeof e.pageY === 'number' ? e.pageY : e.touches[0].pageY;
var left = x - (container.getBoundingClientRect().left + window.pageXOffset);
var top = y - (container.getBoundingClientRect().top + window.pageYOffset);
if (left < 0) {
left = 0;
} else if (left > containerWidth) {
left = containerWidth;
} else if (top < 0) {
top = 0;
} else if (top > containerHeight) {
top = containerHeight;
}
var saturation = left * 100 / containerWidth;
var bright = -(top * 100 / containerHeight) + 100;
return {
h: props.hsl.h,
s: saturation,
v: bright,
a: props.hsl.a,
source: 'rgb'
};
};
/***/ }),
/***/ "./node_modules/react-color/lib/index.js":
/*!***********************************************!*\
!*** ./node_modules/react-color/lib/index.js ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.CustomPicker = exports.TwitterPicker = exports.SwatchesPicker = exports.SliderPicker = exports.SketchPicker = exports.PhotoshopPicker = exports.MaterialPicker = exports.HuePicker = exports.GithubPicker = exports.CompactPicker = exports.ChromePicker = exports.default = exports.CirclePicker = exports.BlockPicker = exports.AlphaPicker = undefined;
var _Alpha = __webpack_require__(/*! ./components/alpha/Alpha */ "./node_modules/react-color/lib/components/alpha/Alpha.js");
Object.defineProperty(exports, 'AlphaPicker', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Alpha).default;
}
});
var _Block = __webpack_require__(/*! ./components/block/Block */ "./node_modules/react-color/lib/components/block/Block.js");
Object.defineProperty(exports, 'BlockPicker', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Block).default;
}
});
var _Circle = __webpack_require__(/*! ./components/circle/Circle */ "./node_modules/react-color/lib/components/circle/Circle.js");
Object.defineProperty(exports, 'CirclePicker', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Circle).default;
}
});
var _Chrome = __webpack_require__(/*! ./components/chrome/Chrome */ "./node_modules/react-color/lib/components/chrome/Chrome.js");
Object.defineProperty(exports, 'ChromePicker', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Chrome).default;
}
});
var _Compact = __webpack_require__(/*! ./components/compact/Compact */ "./node_modules/react-color/lib/components/compact/Compact.js");
Object.defineProperty(exports, 'CompactPicker', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Compact).default;
}
});
var _Github = __webpack_require__(/*! ./components/github/Github */ "./node_modules/react-color/lib/components/github/Github.js");
Object.defineProperty(exports, 'GithubPicker', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Github).default;
}
});
var _Hue = __webpack_require__(/*! ./components/hue/Hue */ "./node_modules/react-color/lib/components/hue/Hue.js");
Object.defineProperty(exports, 'HuePicker', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Hue).default;
}
});
var _Material = __webpack_require__(/*! ./components/material/Material */ "./node_modules/react-color/lib/components/material/Material.js");
Object.defineProperty(exports, 'MaterialPicker', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Material).default;
}
});
var _Photoshop = __webpack_require__(/*! ./components/photoshop/Photoshop */ "./node_modules/react-color/lib/components/photoshop/Photoshop.js");
Object.defineProperty(exports, 'PhotoshopPicker', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Photoshop).default;
}
});
var _Sketch = __webpack_require__(/*! ./components/sketch/Sketch */ "./node_modules/react-color/lib/components/sketch/Sketch.js");
Object.defineProperty(exports, 'SketchPicker', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Sketch).default;
}
});
var _Slider = __webpack_require__(/*! ./components/slider/Slider */ "./node_modules/react-color/lib/components/slider/Slider.js");
Object.defineProperty(exports, 'SliderPicker', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Slider).default;
}
});
var _Swatches = __webpack_require__(/*! ./components/swatches/Swatches */ "./node_modules/react-color/lib/components/swatches/Swatches.js");
Object.defineProperty(exports, 'SwatchesPicker', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Swatches).default;
}
});
var _Twitter = __webpack_require__(/*! ./components/twitter/Twitter */ "./node_modules/react-color/lib/components/twitter/Twitter.js");
Object.defineProperty(exports, 'TwitterPicker', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Twitter).default;
}
});
var _ColorWrap = __webpack_require__(/*! ./components/common/ColorWrap */ "./node_modules/react-color/lib/components/common/ColorWrap.js");
Object.defineProperty(exports, 'CustomPicker', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_ColorWrap).default;
}
});
var _Chrome2 = _interopRequireDefault(_Chrome);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Chrome2.default;
/***/ }),
/***/ "./node_modules/react-datepicker/es/index.js":
/*!***************************************************!*\
!*** ./node_modules/react-datepicker/es/index.js ***!
\***************************************************/
/*! exports provided: CalendarContainer, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CalendarContainer", function() { return CalendarContainer; });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_onclickoutside__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-onclickoutside */ "./node_modules/react-onclickoutside/dist/react-onclickoutside.es.js");
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! moment */ "moment");
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var react_popper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-popper */ "./node_modules/react-popper/lib/esm/index.js");
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;
};
var classCallCheck = function (instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
};
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;
};
}();
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;
};
var inherits = function (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;
};
var possibleConstructorReturn = function (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;
};
function generateYears(year, noOfYear, minDate, maxDate) {
var list = [];
for (var i = 0; i < 2 * noOfYear + 1; i++) {
var newYear = year + noOfYear - i;
var isInRange = true;
if (minDate) {
isInRange = minDate.year() <= newYear;
}
if (maxDate && isInRange) {
isInRange = maxDate.year() >= newYear;
}
if (isInRange) {
list.push(newYear);
}
}
return list;
}
var YearDropdownOptions = function (_React$Component) {
inherits(YearDropdownOptions, _React$Component);
function YearDropdownOptions(props) {
classCallCheck(this, YearDropdownOptions);
var _this = possibleConstructorReturn(this, _React$Component.call(this, props));
_this.renderOptions = function () {
var selectedYear = _this.props.year;
var options = _this.state.yearsList.map(function (year) {
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{
className: selectedYear === year ? "react-datepicker__year-option react-datepicker__year-option--selected_year" : "react-datepicker__year-option",
key: year,
ref: year,
onClick: _this.onChange.bind(_this, year)
},
selectedYear === year ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"span",
{ className: "react-datepicker__year-option--selected" },
"\u2713"
) : "",
year
);
});
var minYear = _this.props.minDate ? _this.props.minDate.year() : null;
var maxYear = _this.props.maxDate ? _this.props.maxDate.year() : null;
if (!maxYear || !_this.state.yearsList.find(function (year) {
return year === maxYear;
})) {
options.unshift(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{
className: "react-datepicker__year-option",
ref: "upcoming",
key: "upcoming",
onClick: _this.incrementYears
},
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", { className: "react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-upcoming" })
));
}
if (!minYear || !_this.state.yearsList.find(function (year) {
return year === minYear;
})) {
options.push(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{
className: "react-datepicker__year-option",
ref: "previous",
key: "previous",
onClick: _this.decrementYears
},
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", { className: "react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-previous" })
));
}
return options;
};
_this.onChange = function (year) {
_this.props.onChange(year);
};
_this.handleClickOutside = function () {
_this.props.onCancel();
};
_this.shiftYears = function (amount) {
var years = _this.state.yearsList.map(function (year) {
return year + amount;
});
_this.setState({
yearsList: years
});
};
_this.incrementYears = function () {
return _this.shiftYears(1);
};
_this.decrementYears = function () {
return _this.shiftYears(-1);
};
var yearDropdownItemNumber = props.yearDropdownItemNumber,
scrollableYearDropdown = props.scrollableYearDropdown;
var noOfYear = yearDropdownItemNumber || (scrollableYearDropdown ? 10 : 5);
_this.state = {
yearsList: generateYears(_this.props.year, noOfYear, _this.props.minDate, _this.props.maxDate)
};
return _this;
}
YearDropdownOptions.prototype.render = function render() {
var dropdownClass = classnames__WEBPACK_IMPORTED_MODULE_2___default()({
"react-datepicker__year-dropdown": true,
"react-datepicker__year-dropdown--scrollable": this.props.scrollableYearDropdown
});
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: dropdownClass },
this.renderOptions()
);
};
return YearDropdownOptions;
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
YearDropdownOptions.propTypes = {
minDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
maxDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
onCancel: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired,
onChange: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired,
scrollableYearDropdown: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
year: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number.isRequired,
yearDropdownItemNumber: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number
};
var dayOfWeekCodes = {
1: "mon",
2: "tue",
3: "wed",
4: "thu",
5: "fri",
6: "sat",
7: "sun"
};
// These functions are not exported so
// that we avoid magic strings like 'days'
function set$1(date, unit, to) {
return date.set(unit, to);
}
function add(date, amount, unit) {
return date.add(amount, unit);
}
function subtract(date, amount, unit) {
return date.subtract(amount, unit);
}
function get$1(date, unit) {
return date.get(unit);
}
function getStartOf(date, unit) {
return date.startOf(unit);
}
// ** Date Constructors **
function newDate(point) {
return moment__WEBPACK_IMPORTED_MODULE_4___default()(point);
}
function newDateWithOffset(utcOffset) {
return moment__WEBPACK_IMPORTED_MODULE_4___default()().utc().utcOffset(utcOffset);
}
function now(maybeFixedUtcOffset) {
if (maybeFixedUtcOffset == null) {
return newDate();
}
return newDateWithOffset(maybeFixedUtcOffset);
}
function cloneDate(date) {
return date.clone();
}
function parseDate(value, _ref) {
var dateFormat = _ref.dateFormat,
locale = _ref.locale;
var m = moment__WEBPACK_IMPORTED_MODULE_4___default()(value, dateFormat, locale || moment__WEBPACK_IMPORTED_MODULE_4___default.a.locale(), true);
return m.isValid() ? m : null;
}
// ** Date "Reflection" **
function isMoment(date) {
return moment__WEBPACK_IMPORTED_MODULE_4___default.a.isMoment(date);
}
function isDate(date) {
return moment__WEBPACK_IMPORTED_MODULE_4___default.a.isDate(date);
}
// ** Date Formatting **
function formatDate(date, format) {
return date.format(format);
}
function safeDateFormat(date, _ref2) {
var dateFormat = _ref2.dateFormat,
locale = _ref2.locale;
return date && date.clone().locale(locale || moment__WEBPACK_IMPORTED_MODULE_4___default.a.locale()).format(Array.isArray(dateFormat) ? dateFormat[0] : dateFormat) || "";
}
// ** Date Setters **
function setTime(date, _ref3) {
var hour = _ref3.hour,
minute = _ref3.minute,
second = _ref3.second;
date.set({ hour: hour, minute: minute, second: second });
return date;
}
function setMonth(date, month) {
return set$1(date, "month", month);
}
function setYear(date, year) {
return set$1(date, "year", year);
}
// ** Date Getters **
function getSecond(date) {
return get$1(date, "second");
}
function getMinute(date) {
return get$1(date, "minute");
}
function getHour(date) {
return get$1(date, "hour");
}
// Returns day of week
function getDay(date) {
return get$1(date, "day");
}
function getWeek(date) {
return get$1(date, "week");
}
function getMonth(date) {
return get$1(date, "month");
}
function getYear(date) {
return get$1(date, "year");
}
// Returns day of month
function getDate(date) {
return get$1(date, "date");
}
function getDayOfWeekCode(day) {
return dayOfWeekCodes[day.isoWeekday()];
}
// *** Start of ***
function getStartOfDay(date) {
return getStartOf(date, "day");
}
function getStartOfWeek(date) {
return getStartOf(date, "week");
}
function getStartOfMonth(date) {
return getStartOf(date, "month");
}
function getStartOfDate(date) {
return getStartOf(date, "date");
}
// *** End of ***
// ** Date Math **
// *** Addition ***
function addMinutes(date, amount) {
return add(date, amount, "minutes");
}
function addHours(date, amount) {
return add(date, amount, "hours");
}
function addDays(date, amount) {
return add(date, amount, "days");
}
function addWeeks(date, amount) {
return add(date, amount, "weeks");
}
function addMonths(date, amount) {
return add(date, amount, "months");
}
function addYears(date, amount) {
return add(date, amount, "years");
}
// *** Subtraction ***
function subtractDays(date, amount) {
return subtract(date, amount, "days");
}
function subtractWeeks(date, amount) {
return subtract(date, amount, "weeks");
}
function subtractMonths(date, amount) {
return subtract(date, amount, "months");
}
function subtractYears(date, amount) {
return subtract(date, amount, "years");
}
// ** Date Comparison **
function isBefore(date1, date2) {
return date1.isBefore(date2);
}
function isAfter(date1, date2) {
return date1.isAfter(date2);
}
function equals(date1, date2) {
return date1.isSame(date2);
}
function isSameYear(date1, date2) {
if (date1 && date2) {
return date1.isSame(date2, "year");
} else {
return !date1 && !date2;
}
}
function isSameMonth(date1, date2) {
if (date1 && date2) {
return date1.isSame(date2, "month");
} else {
return !date1 && !date2;
}
}
function isSameDay(moment1, moment2) {
if (moment1 && moment2) {
return moment1.isSame(moment2, "day");
} else {
return !moment1 && !moment2;
}
}
function isDayInRange(day, startDate, endDate) {
var before = startDate.clone().startOf("day").subtract(1, "seconds");
var after = endDate.clone().startOf("day").add(1, "seconds");
return day.clone().startOf("day").isBetween(before, after);
}
// *** Diffing ***
// ** Date Localization **
function localizeDate(date, locale) {
return date.clone().locale(locale || moment__WEBPACK_IMPORTED_MODULE_4___default.a.locale());
}
function getLocaleData(date) {
return date.localeData();
}
function getLocaleDataForLocale(locale) {
return moment__WEBPACK_IMPORTED_MODULE_4___default.a.localeData(locale);
}
function getFormattedWeekdayInLocale(locale, date, formatFunc) {
return formatFunc(locale.weekdays(date));
}
function getWeekdayMinInLocale(locale, date) {
return locale.weekdaysMin(date);
}
function getWeekdayShortInLocale(locale, date) {
return locale.weekdaysShort(date);
}
// TODO what is this format exactly?
function getMonthInLocale(locale, date, format) {
return locale.months(date, format);
}
function getMonthShortInLocale(locale, date) {
return locale.monthsShort(date);
}
// ** Utils for some components **
function isDayDisabled(day) {
var _ref4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
minDate = _ref4.minDate,
maxDate = _ref4.maxDate,
excludeDates = _ref4.excludeDates,
includeDates = _ref4.includeDates,
filterDate = _ref4.filterDate;
return minDate && day.isBefore(minDate, "day") || maxDate && day.isAfter(maxDate, "day") || excludeDates && excludeDates.some(function (excludeDate) {
return isSameDay(day, excludeDate);
}) || includeDates && !includeDates.some(function (includeDate) {
return isSameDay(day, includeDate);
}) || filterDate && !filterDate(day.clone()) || false;
}
function isOutOfBounds(day) {
var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
minDate = _ref5.minDate,
maxDate = _ref5.maxDate;
return minDate && day.isBefore(minDate, "day") || maxDate && day.isAfter(maxDate, "day");
}
function isTimeDisabled(time, disabledTimes) {
var l = disabledTimes.length;
for (var i = 0; i < l; i++) {
if (disabledTimes[i].get("hours") === time.get("hours") && disabledTimes[i].get("minutes") === time.get("minutes")) {
return true;
}
}
return false;
}
function isTimeInDisabledRange(time, _ref6) {
var minTime = _ref6.minTime,
maxTime = _ref6.maxTime;
if (!minTime || !maxTime) {
throw new Error("Both minTime and maxTime props required");
}
var base = moment__WEBPACK_IMPORTED_MODULE_4___default()().hours(0).minutes(0).seconds(0);
var baseTime = base.clone().hours(time.get("hours")).minutes(time.get("minutes"));
var min = base.clone().hours(minTime.get("hours")).minutes(minTime.get("minutes"));
var max = base.clone().hours(maxTime.get("hours")).minutes(maxTime.get("minutes"));
return !(baseTime.isSameOrAfter(min) && baseTime.isSameOrBefore(max));
}
function allDaysDisabledBefore(day, unit) {
var _ref7 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
minDate = _ref7.minDate,
includeDates = _ref7.includeDates;
var dateBefore = day.clone().subtract(1, unit);
return minDate && dateBefore.isBefore(minDate, unit) || includeDates && includeDates.every(function (includeDate) {
return dateBefore.isBefore(includeDate, unit);
}) || false;
}
function allDaysDisabledAfter(day, unit) {
var _ref8 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
maxDate = _ref8.maxDate,
includeDates = _ref8.includeDates;
var dateAfter = day.clone().add(1, unit);
return maxDate && dateAfter.isAfter(maxDate, unit) || includeDates && includeDates.every(function (includeDate) {
return dateAfter.isAfter(includeDate, unit);
}) || false;
}
function getEffectiveMinDate(_ref9) {
var minDate = _ref9.minDate,
includeDates = _ref9.includeDates;
if (includeDates && minDate) {
return moment__WEBPACK_IMPORTED_MODULE_4___default.a.min(includeDates.filter(function (includeDate) {
return minDate.isSameOrBefore(includeDate, "day");
}));
} else if (includeDates) {
return moment__WEBPACK_IMPORTED_MODULE_4___default.a.min(includeDates);
} else {
return minDate;
}
}
function getEffectiveMaxDate(_ref10) {
var maxDate = _ref10.maxDate,
includeDates = _ref10.includeDates;
if (includeDates && maxDate) {
return moment__WEBPACK_IMPORTED_MODULE_4___default.a.max(includeDates.filter(function (includeDate) {
return maxDate.isSameOrAfter(includeDate, "day");
}));
} else if (includeDates) {
return moment__WEBPACK_IMPORTED_MODULE_4___default.a.max(includeDates);
} else {
return maxDate;
}
}
function getHightLightDaysMap() {
var highlightDates = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
var defaultClassName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "react-datepicker__day--highlighted";
var dateClasses = new Map();
for (var i = 0, len = highlightDates.length; i < len; i++) {
var obj = highlightDates[i];
if (isMoment(obj)) {
var key = obj.format("MM.DD.YYYY");
var classNamesArr = dateClasses.get(key) || [];
if (!classNamesArr.includes(defaultClassName)) {
classNamesArr.push(defaultClassName);
dateClasses.set(key, classNamesArr);
}
} else if ((typeof obj === "undefined" ? "undefined" : _typeof(obj)) === "object") {
var keys = Object.keys(obj);
var className = keys[0];
var arrOfMoments = obj[keys[0]];
if (typeof className === "string" && arrOfMoments.constructor === Array) {
for (var k = 0, _len = arrOfMoments.length; k < _len; k++) {
var _key = arrOfMoments[k].format("MM.DD.YYYY");
var _classNamesArr = dateClasses.get(_key) || [];
if (!_classNamesArr.includes(className)) {
_classNamesArr.push(className);
dateClasses.set(_key, _classNamesArr);
}
}
}
}
}
return dateClasses;
}
function timesToInjectAfter(startOfDay, currentTime, currentMultiplier, intervals, injectedTimes) {
var l = injectedTimes.length;
var times = [];
for (var i = 0; i < l; i++) {
var injectedTime = addMinutes(addHours(cloneDate(startOfDay), getHour(injectedTimes[i])), getMinute(injectedTimes[i]));
var nextTime = addMinutes(cloneDate(startOfDay), (currentMultiplier + 1) * intervals);
if (injectedTime.isBetween(currentTime, nextTime)) {
times.push(injectedTimes[i]);
}
}
return times;
}
var WrappedYearDropdownOptions = Object(react_onclickoutside__WEBPACK_IMPORTED_MODULE_3__["default"])(YearDropdownOptions);
var YearDropdown = function (_React$Component) {
inherits(YearDropdown, _React$Component);
function YearDropdown() {
var _temp, _this, _ret;
classCallCheck(this, YearDropdown);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {
dropdownVisible: false
}, _this.renderSelectOptions = function () {
var minYear = _this.props.minDate ? getYear(_this.props.minDate) : 1900;
var maxYear = _this.props.maxDate ? getYear(_this.props.maxDate) : 2100;
var options = [];
for (var i = minYear; i <= maxYear; i++) {
options.push(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"option",
{ key: i, value: i },
i
));
}
return options;
}, _this.onSelectChange = function (e) {
_this.onChange(e.target.value);
}, _this.renderSelectMode = function () {
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"select",
{
value: _this.props.year,
className: "react-datepicker__year-select",
onChange: _this.onSelectChange
},
_this.renderSelectOptions()
);
}, _this.renderReadView = function (visible) {
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{
key: "read",
style: { visibility: visible ? "visible" : "hidden" },
className: "react-datepicker__year-read-view",
onClick: function onClick(event) {
return _this.toggleDropdown(event);
}
},
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", { className: "react-datepicker__year-read-view--down-arrow" }),
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"span",
{ className: "react-datepicker__year-read-view--selected-year" },
_this.props.year
)
);
}, _this.renderDropdown = function () {
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(WrappedYearDropdownOptions, {
key: "dropdown",
ref: "options",
year: _this.props.year,
onChange: _this.onChange,
onCancel: _this.toggleDropdown,
minDate: _this.props.minDate,
maxDate: _this.props.maxDate,
scrollableYearDropdown: _this.props.scrollableYearDropdown,
yearDropdownItemNumber: _this.props.yearDropdownItemNumber
});
}, _this.renderScrollMode = function () {
var dropdownVisible = _this.state.dropdownVisible;
var result = [_this.renderReadView(!dropdownVisible)];
if (dropdownVisible) {
result.unshift(_this.renderDropdown());
}
return result;
}, _this.onChange = function (year) {
_this.toggleDropdown();
if (year === _this.props.year) return;
_this.props.onChange(year);
}, _this.toggleDropdown = function (event) {
_this.setState({
dropdownVisible: !_this.state.dropdownVisible
}, function () {
if (_this.props.adjustDateOnChange) {
_this.handleYearChange(_this.props.date, event);
}
});
}, _this.handleYearChange = function (date, event) {
_this.onSelect(date, event);
_this.setOpen();
}, _this.onSelect = function (date, event) {
if (_this.props.onSelect) {
_this.props.onSelect(date, event);
}
}, _this.setOpen = function () {
if (_this.props.setOpen) {
_this.props.setOpen(true);
}
}, _temp), possibleConstructorReturn(_this, _ret);
}
YearDropdown.prototype.render = function render() {
var renderedDropdown = void 0;
switch (this.props.dropdownMode) {
case "scroll":
renderedDropdown = this.renderScrollMode();
break;
case "select":
renderedDropdown = this.renderSelectMode();
break;
}
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{
className: "react-datepicker__year-dropdown-container react-datepicker__year-dropdown-container--" + this.props.dropdownMode
},
renderedDropdown
);
};
return YearDropdown;
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
YearDropdown.propTypes = {
adjustDateOnChange: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
dropdownMode: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOf(["scroll", "select"]).isRequired,
maxDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
minDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
onChange: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired,
scrollableYearDropdown: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
year: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number.isRequired,
yearDropdownItemNumber: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number,
date: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
onSelect: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
setOpen: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func
};
var MonthDropdownOptions = function (_React$Component) {
inherits(MonthDropdownOptions, _React$Component);
function MonthDropdownOptions() {
var _temp, _this, _ret;
classCallCheck(this, MonthDropdownOptions);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.renderOptions = function () {
return _this.props.monthNames.map(function (month, i) {
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{
className: _this.props.month === i ? "react-datepicker__month-option --selected_month" : "react-datepicker__month-option",
key: month,
ref: month,
onClick: _this.onChange.bind(_this, i)
},
_this.props.month === i ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"span",
{ className: "react-datepicker__month-option--selected" },
"\u2713"
) : "",
month
);
});
}, _this.onChange = function (month) {
return _this.props.onChange(month);
}, _this.handleClickOutside = function () {
return _this.props.onCancel();
}, _temp), possibleConstructorReturn(_this, _ret);
}
MonthDropdownOptions.prototype.render = function render() {
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: "react-datepicker__month-dropdown" },
this.renderOptions()
);
};
return MonthDropdownOptions;
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
MonthDropdownOptions.propTypes = {
onCancel: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired,
onChange: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired,
month: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number.isRequired,
monthNames: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string.isRequired).isRequired
};
var WrappedMonthDropdownOptions = Object(react_onclickoutside__WEBPACK_IMPORTED_MODULE_3__["default"])(MonthDropdownOptions);
var MonthDropdown = function (_React$Component) {
inherits(MonthDropdown, _React$Component);
function MonthDropdown() {
var _temp, _this, _ret;
classCallCheck(this, MonthDropdown);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {
dropdownVisible: false
}, _this.renderSelectOptions = function (monthNames) {
return monthNames.map(function (M, i) {
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"option",
{ key: i, value: i },
M
);
});
}, _this.renderSelectMode = function (monthNames) {
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"select",
{
value: _this.props.month,
className: "react-datepicker__month-select",
onChange: function onChange(e) {
return _this.onChange(e.target.value);
}
},
_this.renderSelectOptions(monthNames)
);
}, _this.renderReadView = function (visible, monthNames) {
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{
key: "read",
style: { visibility: visible ? "visible" : "hidden" },
className: "react-datepicker__month-read-view",
onClick: _this.toggleDropdown
},
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", { className: "react-datepicker__month-read-view--down-arrow" }),
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"span",
{ className: "react-datepicker__month-read-view--selected-month" },
monthNames[_this.props.month]
)
);
}, _this.renderDropdown = function (monthNames) {
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(WrappedMonthDropdownOptions, {
key: "dropdown",
ref: "options",
month: _this.props.month,
monthNames: monthNames,
onChange: _this.onChange,
onCancel: _this.toggleDropdown
});
}, _this.renderScrollMode = function (monthNames) {
var dropdownVisible = _this.state.dropdownVisible;
var result = [_this.renderReadView(!dropdownVisible, monthNames)];
if (dropdownVisible) {
result.unshift(_this.renderDropdown(monthNames));
}
return result;
}, _this.onChange = function (month) {
_this.toggleDropdown();
if (month !== _this.props.month) {
_this.props.onChange(month);
}
}, _this.toggleDropdown = function () {
return _this.setState({
dropdownVisible: !_this.state.dropdownVisible
});
}, _temp), possibleConstructorReturn(_this, _ret);
}
MonthDropdown.prototype.render = function render() {
var _this2 = this;
var localeData = getLocaleDataForLocale(this.props.locale);
var monthNames = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].map(this.props.useShortMonthInDropdown ? function (M) {
return getMonthShortInLocale(localeData, newDate({ M: M }));
} : function (M) {
return getMonthInLocale(localeData, newDate({ M: M }), _this2.props.dateFormat);
});
var renderedDropdown = void 0;
switch (this.props.dropdownMode) {
case "scroll":
renderedDropdown = this.renderScrollMode(monthNames);
break;
case "select":
renderedDropdown = this.renderSelectMode(monthNames);
break;
}
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{
className: "react-datepicker__month-dropdown-container react-datepicker__month-dropdown-container--" + this.props.dropdownMode
},
renderedDropdown
);
};
return MonthDropdown;
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
MonthDropdown.propTypes = {
dropdownMode: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOf(["scroll", "select"]).isRequired,
locale: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
dateFormat: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string.isRequired,
month: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number.isRequired,
onChange: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired,
useShortMonthInDropdown: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool
};
function generateMonthYears(minDate, maxDate) {
var list = [];
var currDate = getStartOfMonth(cloneDate(minDate));
var lastDate = getStartOfMonth(cloneDate(maxDate));
while (!isAfter(currDate, lastDate)) {
list.push(cloneDate(currDate));
addMonths(currDate, 1);
}
return list;
}
var MonthYearDropdownOptions = function (_React$Component) {
inherits(MonthYearDropdownOptions, _React$Component);
function MonthYearDropdownOptions(props) {
classCallCheck(this, MonthYearDropdownOptions);
var _this = possibleConstructorReturn(this, _React$Component.call(this, props));
_this.renderOptions = function () {
return _this.state.monthYearsList.map(function (monthYear) {
var monthYearPoint = monthYear.valueOf();
var isSameMonthYear = isSameYear(_this.props.date, monthYear) && isSameMonth(_this.props.date, monthYear);
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{
className: isSameMonthYear ? "react-datepicker__month-year-option --selected_month-year" : "react-datepicker__month-year-option",
key: monthYearPoint,
ref: monthYearPoint,
onClick: _this.onChange.bind(_this, monthYearPoint)
},
isSameMonthYear ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"span",
{ className: "react-datepicker__month-year-option--selected" },
"\u2713"
) : "",
formatDate(monthYear, _this.props.dateFormat)
);
});
};
_this.onChange = function (monthYear) {
return _this.props.onChange(monthYear);
};
_this.handleClickOutside = function () {
_this.props.onCancel();
};
_this.state = {
monthYearsList: generateMonthYears(_this.props.minDate, _this.props.maxDate)
};
return _this;
}
MonthYearDropdownOptions.prototype.render = function render() {
var dropdownClass = classnames__WEBPACK_IMPORTED_MODULE_2___default()({
"react-datepicker__month-year-dropdown": true,
"react-datepicker__month-year-dropdown--scrollable": this.props.scrollableMonthYearDropdown
});
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: dropdownClass },
this.renderOptions()
);
};
return MonthYearDropdownOptions;
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
MonthYearDropdownOptions.propTypes = {
minDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object.isRequired,
maxDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object.isRequired,
onCancel: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired,
onChange: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired,
scrollableMonthYearDropdown: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
date: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object.isRequired,
dateFormat: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string.isRequired
};
var WrappedMonthYearDropdownOptions = Object(react_onclickoutside__WEBPACK_IMPORTED_MODULE_3__["default"])(MonthYearDropdownOptions);
var MonthYearDropdown = function (_React$Component) {
inherits(MonthYearDropdown, _React$Component);
function MonthYearDropdown() {
var _temp, _this, _ret;
classCallCheck(this, MonthYearDropdown);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {
dropdownVisible: false
}, _this.renderSelectOptions = function () {
var currDate = getStartOfMonth(localizeDate(_this.props.minDate, _this.props.locale));
var lastDate = getStartOfMonth(localizeDate(_this.props.maxDate, _this.props.locale));
var options = [];
while (!isAfter(currDate, lastDate)) {
var timepoint = currDate.valueOf();
options.push(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"option",
{ key: timepoint, value: timepoint },
formatDate(currDate, _this.props.dateFormat)
));
addMonths(currDate, 1);
}
return options;
}, _this.onSelectChange = function (e) {
_this.onChange(e.target.value);
}, _this.renderSelectMode = function () {
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"select",
{
value: getStartOfMonth(_this.props.date).valueOf(),
className: "react-datepicker__month-year-select",
onChange: _this.onSelectChange
},
_this.renderSelectOptions()
);
}, _this.renderReadView = function (visible) {
var yearMonth = formatDate(localizeDate(newDate(_this.props.date), _this.props.locale), _this.props.dateFormat);
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{
key: "read",
style: { visibility: visible ? "visible" : "hidden" },
className: "react-datepicker__month-year-read-view",
onClick: function onClick(event) {
return _this.toggleDropdown(event);
}
},
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", { className: "react-datepicker__month-year-read-view--down-arrow" }),
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"span",
{ className: "react-datepicker__month-year-read-view--selected-month-year" },
yearMonth
)
);
}, _this.renderDropdown = function () {
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(WrappedMonthYearDropdownOptions, {
key: "dropdown",
ref: "options",
date: _this.props.date,
dateFormat: _this.props.dateFormat,
onChange: _this.onChange,
onCancel: _this.toggleDropdown,
minDate: localizeDate(_this.props.minDate, _this.props.locale),
maxDate: localizeDate(_this.props.maxDate, _this.props.locale),
scrollableMonthYearDropdown: _this.props.scrollableMonthYearDropdown
});
}, _this.renderScrollMode = function () {
var dropdownVisible = _this.state.dropdownVisible;
var result = [_this.renderReadView(!dropdownVisible)];
if (dropdownVisible) {
result.unshift(_this.renderDropdown());
}
return result;
}, _this.onChange = function (monthYearPoint) {
_this.toggleDropdown();
var changedDate = newDate(parseInt(monthYearPoint));
if (isSameYear(_this.props.date, changedDate) && isSameMonth(_this.props.date, changedDate)) {
return;
}
_this.props.onChange(changedDate);
}, _this.toggleDropdown = function () {
return _this.setState({
dropdownVisible: !_this.state.dropdownVisible
});
}, _temp), possibleConstructorReturn(_this, _ret);
}
MonthYearDropdown.prototype.render = function render() {
var renderedDropdown = void 0;
switch (this.props.dropdownMode) {
case "scroll":
renderedDropdown = this.renderScrollMode();
break;
case "select":
renderedDropdown = this.renderSelectMode();
break;
}
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{
className: "react-datepicker__month-year-dropdown-container react-datepicker__month-year-dropdown-container--" + this.props.dropdownMode
},
renderedDropdown
);
};
return MonthYearDropdown;
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
MonthYearDropdown.propTypes = {
dropdownMode: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOf(["scroll", "select"]).isRequired,
dateFormat: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string.isRequired,
locale: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
maxDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object.isRequired,
minDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object.isRequired,
date: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object.isRequired,
onChange: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired,
scrollableMonthYearDropdown: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool
};
var Day = function (_React$Component) {
inherits(Day, _React$Component);
function Day() {
var _temp, _this, _ret;
classCallCheck(this, Day);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleClick = function (event) {
if (!_this.isDisabled() && _this.props.onClick) {
_this.props.onClick(event);
}
}, _this.handleMouseEnter = function (event) {
if (!_this.isDisabled() && _this.props.onMouseEnter) {
_this.props.onMouseEnter(event);
}
}, _this.isSameDay = function (other) {
return isSameDay(_this.props.day, other);
}, _this.isKeyboardSelected = function () {
return !_this.props.disabledKeyboardNavigation && !_this.props.inline && !_this.isSameDay(_this.props.selected) && _this.isSameDay(_this.props.preSelection);
}, _this.isDisabled = function () {
return isDayDisabled(_this.props.day, _this.props);
}, _this.getHighLightedClass = function (defaultClassName) {
var _this$props = _this.props,
day = _this$props.day,
highlightDates = _this$props.highlightDates;
if (!highlightDates) {
return false;
}
// Looking for className in the Map of {'day string, 'className'}
var dayStr = day.format("MM.DD.YYYY");
return highlightDates.get(dayStr);
}, _this.isInRange = function () {
var _this$props2 = _this.props,
day = _this$props2.day,
startDate = _this$props2.startDate,
endDate = _this$props2.endDate;
if (!startDate || !endDate) {
return false;
}
return isDayInRange(day, startDate, endDate);
}, _this.isInSelectingRange = function () {
var _this$props3 = _this.props,
day = _this$props3.day,
selectsStart = _this$props3.selectsStart,
selectsEnd = _this$props3.selectsEnd,
selectingDate = _this$props3.selectingDate,
startDate = _this$props3.startDate,
endDate = _this$props3.endDate;
if (!(selectsStart || selectsEnd) || !selectingDate || _this.isDisabled()) {
return false;
}
if (selectsStart && endDate && selectingDate.isSameOrBefore(endDate)) {
return isDayInRange(day, selectingDate, endDate);
}
if (selectsEnd && startDate && selectingDate.isSameOrAfter(startDate)) {
return isDayInRange(day, startDate, selectingDate);
}
return false;
}, _this.isSelectingRangeStart = function () {
if (!_this.isInSelectingRange()) {
return false;
}
var _this$props4 = _this.props,
day = _this$props4.day,
selectingDate = _this$props4.selectingDate,
startDate = _this$props4.startDate,
selectsStart = _this$props4.selectsStart;
if (selectsStart) {
return isSameDay(day, selectingDate);
} else {
return isSameDay(day, startDate);
}
}, _this.isSelectingRangeEnd = function () {
if (!_this.isInSelectingRange()) {
return false;
}
var _this$props5 = _this.props,
day = _this$props5.day,
selectingDate = _this$props5.selectingDate,
endDate = _this$props5.endDate,
selectsEnd = _this$props5.selectsEnd;
if (selectsEnd) {
return isSameDay(day, selectingDate);
} else {
return isSameDay(day, endDate);
}
}, _this.isRangeStart = function () {
var _this$props6 = _this.props,
day = _this$props6.day,
startDate = _this$props6.startDate,
endDate = _this$props6.endDate;
if (!startDate || !endDate) {
return false;
}
return isSameDay(startDate, day);
}, _this.isRangeEnd = function () {
var _this$props7 = _this.props,
day = _this$props7.day,
startDate = _this$props7.startDate,
endDate = _this$props7.endDate;
if (!startDate || !endDate) {
return false;
}
return isSameDay(endDate, day);
}, _this.isWeekend = function () {
var weekday = getDay(_this.props.day);
return weekday === 0 || weekday === 6;
}, _this.isOutsideMonth = function () {
return _this.props.month !== undefined && _this.props.month !== getMonth(_this.props.day);
}, _this.getClassNames = function (date) {
var dayClassName = _this.props.dayClassName ? _this.props.dayClassName(date) : undefined;
return classnames__WEBPACK_IMPORTED_MODULE_2___default()("react-datepicker__day", dayClassName, "react-datepicker__day--" + getDayOfWeekCode(_this.props.day), {
"react-datepicker__day--disabled": _this.isDisabled(),
"react-datepicker__day--selected": _this.isSameDay(_this.props.selected),
"react-datepicker__day--keyboard-selected": _this.isKeyboardSelected(),
"react-datepicker__day--range-start": _this.isRangeStart(),
"react-datepicker__day--range-end": _this.isRangeEnd(),
"react-datepicker__day--in-range": _this.isInRange(),
"react-datepicker__day--in-selecting-range": _this.isInSelectingRange(),
"react-datepicker__day--selecting-range-start": _this.isSelectingRangeStart(),
"react-datepicker__day--selecting-range-end": _this.isSelectingRangeEnd(),
"react-datepicker__day--today": _this.isSameDay(now(_this.props.utcOffset)),
"react-datepicker__day--weekend": _this.isWeekend(),
"react-datepicker__day--outside-month": _this.isOutsideMonth()
}, _this.getHighLightedClass("react-datepicker__day--highlighted"));
}, _temp), possibleConstructorReturn(_this, _ret);
}
Day.prototype.render = function render() {
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{
className: this.getClassNames(this.props.day),
onClick: this.handleClick,
onMouseEnter: this.handleMouseEnter,
"aria-label": "day-" + getDate(this.props.day),
role: "option"
},
this.props.renderDayContents ? this.props.renderDayContents(getDate(this.props.day)) : getDate(this.props.day)
);
};
return Day;
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
Day.propTypes = {
disabledKeyboardNavigation: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
day: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object.isRequired,
dayClassName: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
endDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
highlightDates: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.instanceOf(Map),
inline: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
month: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number,
onClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
onMouseEnter: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
preSelection: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
selected: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
selectingDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
selectsEnd: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
selectsStart: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
startDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
utcOffset: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string]),
renderDayContents: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func
};
var WeekNumber = function (_React$Component) {
inherits(WeekNumber, _React$Component);
function WeekNumber() {
var _temp, _this, _ret;
classCallCheck(this, WeekNumber);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleClick = function (event) {
if (_this.props.onClick) {
_this.props.onClick(event);
}
}, _temp), possibleConstructorReturn(_this, _ret);
}
WeekNumber.prototype.render = function render() {
var weekNumberClasses = {
"react-datepicker__week-number": true,
"react-datepicker__week-number--clickable": !!this.props.onClick
};
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{
className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(weekNumberClasses),
"aria-label": "week-" + this.props.weekNumber,
onClick: this.handleClick
},
this.props.weekNumber
);
};
return WeekNumber;
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
WeekNumber.propTypes = {
weekNumber: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number.isRequired,
onClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func
};
var Week = function (_React$Component) {
inherits(Week, _React$Component);
function Week() {
var _temp, _this, _ret;
classCallCheck(this, Week);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleDayClick = function (day, event) {
if (_this.props.onDayClick) {
_this.props.onDayClick(day, event);
}
}, _this.handleDayMouseEnter = function (day) {
if (_this.props.onDayMouseEnter) {
_this.props.onDayMouseEnter(day);
}
}, _this.handleWeekClick = function (day, weekNumber, event) {
if (typeof _this.props.onWeekSelect === "function") {
_this.props.onWeekSelect(day, weekNumber, event);
}
}, _this.formatWeekNumber = function (startOfWeek) {
if (_this.props.formatWeekNumber) {
return _this.props.formatWeekNumber(startOfWeek);
}
return getWeek(startOfWeek);
}, _this.renderDays = function () {
var startOfWeek = getStartOfWeek(cloneDate(_this.props.day));
var days = [];
var weekNumber = _this.formatWeekNumber(startOfWeek);
if (_this.props.showWeekNumber) {
var onClickAction = _this.props.onWeekSelect ? _this.handleWeekClick.bind(_this, startOfWeek, weekNumber) : undefined;
days.push(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(WeekNumber, { key: "W", weekNumber: weekNumber, onClick: onClickAction }));
}
return days.concat([0, 1, 2, 3, 4, 5, 6].map(function (offset) {
var day = addDays(cloneDate(startOfWeek), offset);
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(Day, {
key: offset,
day: day,
month: _this.props.month,
onClick: _this.handleDayClick.bind(_this, day),
onMouseEnter: _this.handleDayMouseEnter.bind(_this, day),
minDate: _this.props.minDate,
maxDate: _this.props.maxDate,
excludeDates: _this.props.excludeDates,
includeDates: _this.props.includeDates,
inline: _this.props.inline,
highlightDates: _this.props.highlightDates,
selectingDate: _this.props.selectingDate,
filterDate: _this.props.filterDate,
preSelection: _this.props.preSelection,
selected: _this.props.selected,
selectsStart: _this.props.selectsStart,
selectsEnd: _this.props.selectsEnd,
startDate: _this.props.startDate,
endDate: _this.props.endDate,
dayClassName: _this.props.dayClassName,
utcOffset: _this.props.utcOffset,
renderDayContents: _this.props.renderDayContents,
disabledKeyboardNavigation: _this.props.disabledKeyboardNavigation
});
}));
}, _temp), possibleConstructorReturn(_this, _ret);
}
Week.prototype.render = function render() {
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: "react-datepicker__week" },
this.renderDays()
);
};
return Week;
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
Week.propTypes = {
disabledKeyboardNavigation: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
day: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object.isRequired,
dayClassName: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
endDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
excludeDates: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.array,
filterDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
formatWeekNumber: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
highlightDates: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.instanceOf(Map),
includeDates: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.array,
inline: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
maxDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
minDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
month: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number,
onDayClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
onDayMouseEnter: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
onWeekSelect: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
preSelection: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
selected: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
selectingDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
selectsEnd: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
selectsStart: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
showWeekNumber: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
startDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
utcOffset: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string]),
renderDayContents: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func
};
var FIXED_HEIGHT_STANDARD_WEEK_COUNT = 6;
var Month = function (_React$Component) {
inherits(Month, _React$Component);
function Month() {
var _temp, _this, _ret;
classCallCheck(this, Month);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleDayClick = function (day, event) {
if (_this.props.onDayClick) {
_this.props.onDayClick(day, event);
}
}, _this.handleDayMouseEnter = function (day) {
if (_this.props.onDayMouseEnter) {
_this.props.onDayMouseEnter(day);
}
}, _this.handleMouseLeave = function () {
if (_this.props.onMouseLeave) {
_this.props.onMouseLeave();
}
}, _this.isWeekInMonth = function (startOfWeek) {
var day = _this.props.day;
var endOfWeek = addDays(cloneDate(startOfWeek), 6);
return isSameMonth(startOfWeek, day) || isSameMonth(endOfWeek, day);
}, _this.renderWeeks = function () {
var weeks = [];
var isFixedHeight = _this.props.fixedHeight;
var currentWeekStart = getStartOfWeek(getStartOfMonth(cloneDate(_this.props.day)));
var i = 0;
var breakAfterNextPush = false;
while (true) {
weeks.push(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(Week, {
key: i,
day: currentWeekStart,
month: getMonth(_this.props.day),
onDayClick: _this.handleDayClick,
onDayMouseEnter: _this.handleDayMouseEnter,
onWeekSelect: _this.props.onWeekSelect,
formatWeekNumber: _this.props.formatWeekNumber,
minDate: _this.props.minDate,
maxDate: _this.props.maxDate,
excludeDates: _this.props.excludeDates,
includeDates: _this.props.includeDates,
inline: _this.props.inline,
highlightDates: _this.props.highlightDates,
selectingDate: _this.props.selectingDate,
filterDate: _this.props.filterDate,
preSelection: _this.props.preSelection,
selected: _this.props.selected,
selectsStart: _this.props.selectsStart,
selectsEnd: _this.props.selectsEnd,
showWeekNumber: _this.props.showWeekNumbers,
startDate: _this.props.startDate,
endDate: _this.props.endDate,
dayClassName: _this.props.dayClassName,
utcOffset: _this.props.utcOffset,
disabledKeyboardNavigation: _this.props.disabledKeyboardNavigation,
renderDayContents: _this.props.renderDayContents
}));
if (breakAfterNextPush) break;
i++;
currentWeekStart = addWeeks(cloneDate(currentWeekStart), 1);
// If one of these conditions is true, we will either break on this week
// or break on the next week
var isFixedAndFinalWeek = isFixedHeight && i >= FIXED_HEIGHT_STANDARD_WEEK_COUNT;
var isNonFixedAndOutOfMonth = !isFixedHeight && !_this.isWeekInMonth(currentWeekStart);
if (isFixedAndFinalWeek || isNonFixedAndOutOfMonth) {
if (_this.props.peekNextMonth) {
breakAfterNextPush = true;
} else {
break;
}
}
}
return weeks;
}, _this.getClassNames = function () {
var _this$props = _this.props,
selectingDate = _this$props.selectingDate,
selectsStart = _this$props.selectsStart,
selectsEnd = _this$props.selectsEnd;
return classnames__WEBPACK_IMPORTED_MODULE_2___default()("react-datepicker__month", {
"react-datepicker__month--selecting-range": selectingDate && (selectsStart || selectsEnd)
});
}, _temp), possibleConstructorReturn(_this, _ret);
}
Month.prototype.render = function render() {
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{
className: this.getClassNames(),
onMouseLeave: this.handleMouseLeave,
role: "listbox",
"aria-label": "month-" + this.props.day.format("YYYY-MM")
},
this.renderWeeks()
);
};
return Month;
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
Month.propTypes = {
disabledKeyboardNavigation: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
day: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object.isRequired,
dayClassName: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
endDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
excludeDates: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.array,
filterDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
fixedHeight: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
formatWeekNumber: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
highlightDates: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.instanceOf(Map),
includeDates: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.array,
inline: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
maxDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
minDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
onDayClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
onDayMouseEnter: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
onMouseLeave: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
onWeekSelect: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
peekNextMonth: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
preSelection: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
selected: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
selectingDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
selectsEnd: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
selectsStart: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
showWeekNumbers: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
startDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
utcOffset: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string]),
renderDayContents: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func
};
var Time = function (_React$Component) {
inherits(Time, _React$Component);
function Time() {
var _temp, _this, _ret;
classCallCheck(this, Time);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleClick = function (time) {
if ((_this.props.minTime || _this.props.maxTime) && isTimeInDisabledRange(time, _this.props) || _this.props.excludeTimes && isTimeDisabled(time, _this.props.excludeTimes) || _this.props.includeTimes && !isTimeDisabled(time, _this.props.includeTimes)) {
return;
}
_this.props.onChange(time);
}, _this.liClasses = function (time, currH, currM) {
var classes = ["react-datepicker__time-list-item"];
if (currH === getHour(time) && currM === getMinute(time)) {
classes.push("react-datepicker__time-list-item--selected");
}
if ((_this.props.minTime || _this.props.maxTime) && isTimeInDisabledRange(time, _this.props) || _this.props.excludeTimes && isTimeDisabled(time, _this.props.excludeTimes) || _this.props.includeTimes && !isTimeDisabled(time, _this.props.includeTimes)) {
classes.push("react-datepicker__time-list-item--disabled");
}
if (_this.props.injectTimes && (getHour(time) * 60 + getMinute(time)) % _this.props.intervals !== 0) {
classes.push("react-datepicker__time-list-item--injected");
}
return classes.join(" ");
}, _this.renderTimes = function () {
var times = [];
var format = _this.props.format ? _this.props.format : "hh:mm A";
var intervals = _this.props.intervals;
var activeTime = _this.props.selected ? _this.props.selected : newDate();
var currH = getHour(activeTime);
var currM = getMinute(activeTime);
var base = getStartOfDay(newDate());
var multiplier = 1440 / intervals;
var sortedInjectTimes = _this.props.injectTimes && _this.props.injectTimes.sort(function (a, b) {
return a - b;
});
for (var i = 0; i < multiplier; i++) {
var currentTime = addMinutes(cloneDate(base), i * intervals);
times.push(currentTime);
if (sortedInjectTimes) {
var timesToInject = timesToInjectAfter(base, currentTime, i, intervals, sortedInjectTimes);
times = times.concat(timesToInject);
}
}
return times.map(function (time, i) {
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"li",
{
key: i,
onClick: _this.handleClick.bind(_this, time),
className: _this.liClasses(time, currH, currM),
ref: function ref(li) {
if (currH === getHour(time) && currM === getMinute(time) || currH === getHour(time) && !_this.centerLi) {
_this.centerLi = li;
}
}
},
formatDate(time, format)
);
});
}, _temp), possibleConstructorReturn(_this, _ret);
}
Time.prototype.componentDidMount = function componentDidMount() {
// code to ensure selected time will always be in focus within time window when it first appears
this.list.scrollTop = Time.calcCenterPosition(this.props.monthRef ? this.props.monthRef.clientHeight - this.header.clientHeight : this.list.clientHeight, this.centerLi);
};
Time.prototype.render = function render() {
var _this2 = this;
var height = null;
if (this.props.monthRef && this.header) {
height = this.props.monthRef.clientHeight - this.header.clientHeight;
}
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{
className: "react-datepicker__time-container " + (this.props.todayButton ? "react-datepicker__time-container--with-today-button" : "")
},
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{
className: "react-datepicker__header react-datepicker__header--time",
ref: function ref(header) {
_this2.header = header;
}
},
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: "react-datepicker-time__header" },
this.props.timeCaption
)
),
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: "react-datepicker__time" },
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: "react-datepicker__time-box" },
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"ul",
{
className: "react-datepicker__time-list",
ref: function ref(list) {
_this2.list = list;
},
style: height ? { height: height } : {}
},
this.renderTimes.bind(this)()
)
)
)
);
};
createClass(Time, null, [{
key: "defaultProps",
get: function get$$1() {
return {
intervals: 30,
onTimeChange: function onTimeChange() {},
todayButton: null,
timeCaption: "Time"
};
}
}]);
return Time;
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
Time.propTypes = {
format: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
includeTimes: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.array,
intervals: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number,
selected: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
onChange: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
todayButton: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node,
minTime: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
maxTime: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
excludeTimes: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.array,
monthRef: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
timeCaption: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
injectTimes: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.array
};
Time.calcCenterPosition = function (listHeight, centerLiRef) {
return centerLiRef.offsetTop - (listHeight / 2 - centerLiRef.clientHeight / 2);
};
function CalendarContainer(_ref) {
var className = _ref.className,
children = _ref.children,
_ref$arrowProps = _ref.arrowProps,
arrowProps = _ref$arrowProps === undefined ? {} : _ref$arrowProps;
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: className },
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", _extends({ className: "react-datepicker__triangle" }, arrowProps)),
children
);
}
CalendarContainer.propTypes = {
className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node,
arrowProps: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object // react-popper arrow props
};
var DROPDOWN_FOCUS_CLASSNAMES = ["react-datepicker__year-select", "react-datepicker__month-select", "react-datepicker__month-year-select"];
var isDropdownSelect = function isDropdownSelect() {
var element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var classNames = (element.className || "").split(/\s+/);
return DROPDOWN_FOCUS_CLASSNAMES.some(function (testClassname) {
return classNames.indexOf(testClassname) >= 0;
});
};
var Calendar = function (_React$Component) {
inherits(Calendar, _React$Component);
createClass(Calendar, null, [{
key: "defaultProps",
get: function get$$1() {
return {
onDropdownFocus: function onDropdownFocus() {},
monthsShown: 1,
forceShowMonthNavigation: false,
timeCaption: "Time",
previousMonthButtonLabel: "Previous Month",
nextMonthButtonLabel: "Next Month"
};
}
}]);
function Calendar(props) {
classCallCheck(this, Calendar);
var _this = possibleConstructorReturn(this, _React$Component.call(this, props));
_this.handleClickOutside = function (event) {
_this.props.onClickOutside(event);
};
_this.handleDropdownFocus = function (event) {
if (isDropdownSelect(event.target)) {
_this.props.onDropdownFocus();
}
};
_this.getDateInView = function () {
var _this$props = _this.props,
preSelection = _this$props.preSelection,
selected = _this$props.selected,
openToDate = _this$props.openToDate,
utcOffset = _this$props.utcOffset;
var minDate = getEffectiveMinDate(_this.props);
var maxDate = getEffectiveMaxDate(_this.props);
var current = now(utcOffset);
var initialDate = openToDate || selected || preSelection;
if (initialDate) {
return initialDate;
} else {
if (minDate && isBefore(current, minDate)) {
return minDate;
} else if (maxDate && isAfter(current, maxDate)) {
return maxDate;
}
}
return current;
};
_this.localizeDate = function (date) {
return localizeDate(date, _this.props.locale);
};
_this.increaseMonth = function () {
_this.setState({
date: addMonths(cloneDate(_this.state.date), 1)
}, function () {
return _this.handleMonthChange(_this.state.date);
});
};
_this.decreaseMonth = function () {
_this.setState({
date: subtractMonths(cloneDate(_this.state.date), 1)
}, function () {
return _this.handleMonthChange(_this.state.date);
});
};
_this.handleDayClick = function (day, event) {
return _this.props.onSelect(day, event);
};
_this.handleDayMouseEnter = function (day) {
return _this.setState({ selectingDate: day });
};
_this.handleMonthMouseLeave = function () {
return _this.setState({ selectingDate: null });
};
_this.handleYearChange = function (date) {
if (_this.props.onYearChange) {
_this.props.onYearChange(date);
}
};
_this.handleMonthChange = function (date) {
if (_this.props.onMonthChange) {
_this.props.onMonthChange(date);
}
if (_this.props.adjustDateOnChange) {
if (_this.props.onSelect) {
_this.props.onSelect(date);
}
if (_this.props.setOpen) {
_this.props.setOpen(true);
}
}
};
_this.handleMonthYearChange = function (date) {
_this.handleYearChange(date);
_this.handleMonthChange(date);
};
_this.changeYear = function (year) {
_this.setState({
date: setYear(cloneDate(_this.state.date), year)
}, function () {
return _this.handleYearChange(_this.state.date);
});
};
_this.changeMonth = function (month) {
_this.setState({
date: setMonth(cloneDate(_this.state.date), month)
}, function () {
return _this.handleMonthChange(_this.state.date);
});
};
_this.changeMonthYear = function (monthYear) {
_this.setState({
date: setYear(setMonth(cloneDate(_this.state.date), getMonth(monthYear)), getYear(monthYear))
}, function () {
return _this.handleMonthYearChange(_this.state.date);
});
};
_this.header = function () {
var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.state.date;
var startOfWeek = getStartOfWeek(cloneDate(date));
var dayNames = [];
if (_this.props.showWeekNumbers) {
dayNames.push(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ key: "W", className: "react-datepicker__day-name" },
_this.props.weekLabel || "#"
));
}
return dayNames.concat([0, 1, 2, 3, 4, 5, 6].map(function (offset) {
var day = addDays(cloneDate(startOfWeek), offset);
var localeData = getLocaleData(day);
var weekDayName = _this.formatWeekday(localeData, day);
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ key: offset, className: "react-datepicker__day-name" },
weekDayName
);
}));
};
_this.formatWeekday = function (localeData, day) {
if (_this.props.formatWeekDay) {
return getFormattedWeekdayInLocale(localeData, day, _this.props.formatWeekDay);
}
return _this.props.useWeekdaysShort ? getWeekdayShortInLocale(localeData, day) : getWeekdayMinInLocale(localeData, day);
};
_this.renderPreviousMonthButton = function () {
if (_this.props.renderCustomHeader) {
return;
}
var allPrevDaysDisabled = allDaysDisabledBefore(_this.state.date, "month", _this.props);
if (!_this.props.forceShowMonthNavigation && !_this.props.showDisabledMonthNavigation && allPrevDaysDisabled || _this.props.showTimeSelectOnly) {
return;
}
var classes = ["react-datepicker__navigation", "react-datepicker__navigation--previous"];
var clickHandler = _this.decreaseMonth;
if (allPrevDaysDisabled && _this.props.showDisabledMonthNavigation) {
classes.push("react-datepicker__navigation--previous--disabled");
clickHandler = null;
}
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"button",
{
type: "button",
className: classes.join(" "),
onClick: clickHandler
},
_this.props.previousMonthButtonLabel
);
};
_this.renderNextMonthButton = function () {
if (_this.props.renderCustomHeader) {
return;
}
var allNextDaysDisabled = allDaysDisabledAfter(_this.state.date, "month", _this.props);
if (!_this.props.forceShowMonthNavigation && !_this.props.showDisabledMonthNavigation && allNextDaysDisabled || _this.props.showTimeSelectOnly) {
return;
}
var classes = ["react-datepicker__navigation", "react-datepicker__navigation--next"];
if (_this.props.showTimeSelect) {
classes.push("react-datepicker__navigation--next--with-time");
}
if (_this.props.todayButton) {
classes.push("react-datepicker__navigation--next--with-today-button");
}
var clickHandler = _this.increaseMonth;
if (allNextDaysDisabled && _this.props.showDisabledMonthNavigation) {
classes.push("react-datepicker__navigation--next--disabled");
clickHandler = null;
}
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"button",
{
type: "button",
className: classes.join(" "),
onClick: clickHandler
},
_this.props.nextMonthButtonLabel
);
};
_this.renderCurrentMonth = function () {
var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.state.date;
var classes = ["react-datepicker__current-month"];
if (_this.props.showYearDropdown) {
classes.push("react-datepicker__current-month--hasYearDropdown");
}
if (_this.props.showMonthDropdown) {
classes.push("react-datepicker__current-month--hasMonthDropdown");
}
if (_this.props.showMonthYearDropdown) {
classes.push("react-datepicker__current-month--hasMonthYearDropdown");
}
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: classes.join(" ") },
formatDate(date, _this.props.dateFormat)
);
};
_this.renderYearDropdown = function () {
var overrideHide = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
if (!_this.props.showYearDropdown || overrideHide) {
return;
}
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(YearDropdown, {
adjustDateOnChange: _this.props.adjustDateOnChange,
date: _this.state.date,
onSelect: _this.props.onSelect,
setOpen: _this.props.setOpen,
dropdownMode: _this.props.dropdownMode,
onChange: _this.changeYear,
minDate: _this.props.minDate,
maxDate: _this.props.maxDate,
year: getYear(_this.state.date),
scrollableYearDropdown: _this.props.scrollableYearDropdown,
yearDropdownItemNumber: _this.props.yearDropdownItemNumber
});
};
_this.renderMonthDropdown = function () {
var overrideHide = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
if (!_this.props.showMonthDropdown || overrideHide) {
return;
}
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(MonthDropdown, {
dropdownMode: _this.props.dropdownMode,
locale: _this.props.locale,
dateFormat: _this.props.dateFormat,
onChange: _this.changeMonth,
month: getMonth(_this.state.date),
useShortMonthInDropdown: _this.props.useShortMonthInDropdown
});
};
_this.renderMonthYearDropdown = function () {
var overrideHide = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
if (!_this.props.showMonthYearDropdown || overrideHide) {
return;
}
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(MonthYearDropdown, {
dropdownMode: _this.props.dropdownMode,
locale: _this.props.locale,
dateFormat: _this.props.dateFormat,
onChange: _this.changeMonthYear,
minDate: _this.props.minDate,
maxDate: _this.props.maxDate,
date: _this.state.date,
scrollableMonthYearDropdown: _this.props.scrollableMonthYearDropdown
});
};
_this.renderTodayButton = function () {
if (!_this.props.todayButton || _this.props.showTimeSelectOnly) {
return;
}
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{
className: "react-datepicker__today-button",
onClick: function onClick(e) {
return _this.props.onSelect(getStartOfDate(now(_this.props.utcOffset)), e);
}
},
_this.props.todayButton
);
};
_this.renderDefaultHeader = function (_ref) {
var monthDate = _ref.monthDate,
i = _ref.i;
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: "react-datepicker__header" },
_this.renderCurrentMonth(monthDate),
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{
className: "react-datepicker__header__dropdown react-datepicker__header__dropdown--" + _this.props.dropdownMode,
onFocus: _this.handleDropdownFocus
},
_this.renderMonthDropdown(i !== 0),
_this.renderMonthYearDropdown(i !== 0),
_this.renderYearDropdown(i !== 0)
),
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: "react-datepicker__day-names" },
_this.header(monthDate)
)
);
};
_this.renderCustomHeader = function (_ref2) {
var monthDate = _ref2.monthDate,
i = _ref2.i;
if (i !== 0) {
return null;
}
var prevMonthButtonDisabled = allDaysDisabledBefore(_this.state.date, "month", _this.props);
var nextMonthButtonDisabled = allDaysDisabledAfter(_this.state.date, "month", _this.props);
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{
className: "react-datepicker__header react-datepicker__header--custom",
onFocus: _this.props.onDropdownFocus
},
_this.props.renderCustomHeader(_extends({}, _this.state, {
changeMonth: _this.changeMonth,
changeYear: _this.changeYear,
decreaseMonth: _this.decreaseMonth,
increaseMonth: _this.increaseMonth,
prevMonthButtonDisabled: prevMonthButtonDisabled,
nextMonthButtonDisabled: nextMonthButtonDisabled
})),
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: "react-datepicker__day-names" },
_this.header(monthDate)
)
);
};
_this.renderMonths = function () {
if (_this.props.showTimeSelectOnly) {
return;
}
var monthList = [];
for (var i = 0; i < _this.props.monthsShown; ++i) {
var monthDate = addMonths(cloneDate(_this.state.date), i);
var monthKey = "month-" + i;
monthList.push(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{
key: monthKey,
ref: function ref(div) {
_this.monthContainer = div;
},
className: "react-datepicker__month-container"
},
_this.props.renderCustomHeader ? _this.renderCustomHeader({ monthDate: monthDate, i: i }) : _this.renderDefaultHeader({ monthDate: monthDate, i: i }),
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(Month, {
day: monthDate,
dayClassName: _this.props.dayClassName,
onDayClick: _this.handleDayClick,
onDayMouseEnter: _this.handleDayMouseEnter,
onMouseLeave: _this.handleMonthMouseLeave,
onWeekSelect: _this.props.onWeekSelect,
formatWeekNumber: _this.props.formatWeekNumber,
minDate: _this.props.minDate,
maxDate: _this.props.maxDate,
excludeDates: _this.props.excludeDates,
highlightDates: _this.props.highlightDates,
selectingDate: _this.state.selectingDate,
includeDates: _this.props.includeDates,
inline: _this.props.inline,
fixedHeight: _this.props.fixedHeight,
filterDate: _this.props.filterDate,
preSelection: _this.props.preSelection,
selected: _this.props.selected,
selectsStart: _this.props.selectsStart,
selectsEnd: _this.props.selectsEnd,
showWeekNumbers: _this.props.showWeekNumbers,
startDate: _this.props.startDate,
endDate: _this.props.endDate,
peekNextMonth: _this.props.peekNextMonth,
utcOffset: _this.props.utcOffset,
renderDayContents: _this.props.renderDayContents,
disabledKeyboardNavigation: _this.props.disabledKeyboardNavigation
})
));
}
return monthList;
};
_this.renderTimeSection = function () {
if (_this.props.showTimeSelect && (_this.state.monthContainer || _this.props.showTimeSelectOnly)) {
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(Time, {
selected: _this.props.selected,
onChange: _this.props.onTimeChange,
format: _this.props.timeFormat,
includeTimes: _this.props.includeTimes,
intervals: _this.props.timeIntervals,
minTime: _this.props.minTime,
maxTime: _this.props.maxTime,
excludeTimes: _this.props.excludeTimes,
timeCaption: _this.props.timeCaption,
todayButton: _this.props.todayButton,
showMonthDropdown: _this.props.showMonthDropdown,
showMonthYearDropdown: _this.props.showMonthYearDropdown,
showYearDropdown: _this.props.showYearDropdown,
withPortal: _this.props.withPortal,
monthRef: _this.state.monthContainer,
injectTimes: _this.props.injectTimes
});
}
};
_this.state = {
date: _this.localizeDate(_this.getDateInView()),
selectingDate: null,
monthContainer: null
};
return _this;
}
Calendar.prototype.componentDidMount = function componentDidMount() {
var _this2 = this;
// monthContainer height is needed in time component
// to determine the height for the ul in the time component
// setState here so height is given after final component
// layout is rendered
if (this.props.showTimeSelect) {
this.assignMonthContainer = function () {
_this2.setState({ monthContainer: _this2.monthContainer });
}();
}
};
Calendar.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
if (this.props.preSelection && !isSameDay(this.props.preSelection, prevProps.preSelection)) {
this.setState({
date: this.localizeDate(this.props.preSelection)
});
} else if (this.props.openToDate && !isSameDay(this.props.openToDate, prevProps.openToDate)) {
this.setState({
date: this.localizeDate(this.props.openToDate)
});
}
};
Calendar.prototype.render = function render() {
var Container = this.props.container || CalendarContainer;
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
Container,
{
className: classnames__WEBPACK_IMPORTED_MODULE_2___default()("react-datepicker", this.props.className, {
"react-datepicker--time-only": this.props.showTimeSelectOnly
})
},
this.renderPreviousMonthButton(),
this.renderNextMonthButton(),
this.renderMonths(),
this.renderTodayButton(),
this.renderTimeSection(),
this.props.children
);
};
return Calendar;
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
Calendar.propTypes = {
adjustDateOnChange: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node,
container: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
dateFormat: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.array]).isRequired,
dayClassName: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
disabledKeyboardNavigation: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
dropdownMode: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOf(["scroll", "select"]),
endDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
excludeDates: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.array,
filterDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
fixedHeight: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
formatWeekNumber: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
highlightDates: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.instanceOf(Map),
includeDates: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.array,
includeTimes: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.array,
injectTimes: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.array,
inline: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
locale: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
maxDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
minDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
monthsShown: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number,
onClickOutside: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired,
onMonthChange: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
onYearChange: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
forceShowMonthNavigation: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
onDropdownFocus: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
onSelect: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired,
onWeekSelect: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
showTimeSelect: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
showTimeSelectOnly: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
timeFormat: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
timeIntervals: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number,
onTimeChange: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
minTime: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
maxTime: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
excludeTimes: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.array,
timeCaption: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
openToDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
peekNextMonth: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
scrollableYearDropdown: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
scrollableMonthYearDropdown: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
preSelection: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
selected: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
selectsEnd: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
selectsStart: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
showMonthDropdown: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
showMonthYearDropdown: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
showWeekNumbers: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
showYearDropdown: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
startDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
todayButton: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node,
useWeekdaysShort: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
formatWeekDay: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
withPortal: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
utcOffset: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string]),
weekLabel: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
yearDropdownItemNumber: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number,
setOpen: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
useShortMonthInDropdown: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
showDisabledMonthNavigation: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
previousMonthButtonLabel: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
nextMonthButtonLabel: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
renderCustomHeader: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
renderDayContents: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func
};
var popperPlacementPositions = ["bottom", "bottom-end", "bottom-start", "left", "left-end", "left-start", "right", "right-end", "right-start", "top", "top-end", "top-start"];
var PopperComponent = function (_React$Component) {
inherits(PopperComponent, _React$Component);
function PopperComponent() {
classCallCheck(this, PopperComponent);
return possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
PopperComponent.prototype.render = function render() {
var _props = this.props,
className = _props.className,
hidePopper = _props.hidePopper,
popperComponent = _props.popperComponent,
popperModifiers = _props.popperModifiers,
popperPlacement = _props.popperPlacement,
popperProps = _props.popperProps,
targetComponent = _props.targetComponent;
var popper = void 0;
if (!hidePopper) {
var classes = classnames__WEBPACK_IMPORTED_MODULE_2___default()("react-datepicker-popper", className);
popper = react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
react_popper__WEBPACK_IMPORTED_MODULE_5__["Popper"],
_extends({
modifiers: popperModifiers,
placement: popperPlacement
}, popperProps),
function (_ref) {
var ref = _ref.ref,
style = _ref.style,
placement = _ref.placement,
arrowProps = _ref.arrowProps;
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
_extends({ ref: ref, style: style }, {
className: classes,
"data-placement": placement
}),
react__WEBPACK_IMPORTED_MODULE_0___default.a.cloneElement(popperComponent, { arrowProps: arrowProps })
);
}
);
}
if (this.props.popperContainer) {
popper = react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(this.props.popperContainer, {}, popper);
}
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
react_popper__WEBPACK_IMPORTED_MODULE_5__["Manager"],
null,
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
react_popper__WEBPACK_IMPORTED_MODULE_5__["Reference"],
null,
function (_ref2) {
var ref = _ref2.ref;
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ ref: ref, className: "react-datepicker-wrapper" },
targetComponent
);
}
),
popper
);
};
createClass(PopperComponent, null, [{
key: "defaultProps",
get: function get$$1() {
return {
hidePopper: true,
popperModifiers: {
preventOverflow: {
enabled: true,
escapeWithReference: true,
boundariesElement: "viewport"
}
},
popperProps: {},
popperPlacement: "bottom-start"
};
}
}]);
return PopperComponent;
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
PopperComponent.propTypes = {
className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
hidePopper: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
popperComponent: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.element,
popperModifiers: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object, // <datepicker/> props
popperPlacement: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOf(popperPlacementPositions), // <datepicker/> props
popperContainer: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
popperProps: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
targetComponent: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.element
};
var outsideClickIgnoreClass = "react-datepicker-ignore-onclickoutside";
var WrappedCalendar = Object(react_onclickoutside__WEBPACK_IMPORTED_MODULE_3__["default"])(Calendar);
// Compares dates year+month combinations
function hasPreSelectionChanged(date1, date2) {
if (date1 && date2) {
return getMonth(date1) !== getMonth(date2) || getYear(date1) !== getYear(date2);
}
return date1 !== date2;
}
function hasSelectionChanged(date1, date2) {
if (date1 && date2) {
return !equals(date1, date2);
}
return false;
}
/**
* General datepicker component.
*/
var INPUT_ERR_1 = "Date input not valid.";
var DatePicker = function (_React$Component) {
inherits(DatePicker, _React$Component);
createClass(DatePicker, null, [{
key: "defaultProps",
get: function get$$1() {
return {
allowSameDay: false,
dateFormat: "L",
dateFormatCalendar: "MMMM YYYY",
onChange: function onChange() {},
disabled: false,
disabledKeyboardNavigation: false,
dropdownMode: "scroll",
onFocus: function onFocus() {},
onBlur: function onBlur() {},
onKeyDown: function onKeyDown() {},
onInputClick: function onInputClick() {},
onSelect: function onSelect() {},
onClickOutside: function onClickOutside$$1() {},
onMonthChange: function onMonthChange() {},
preventOpenOnFocus: false,
onYearChange: function onYearChange() {},
onInputError: function onInputError() {},
monthsShown: 1,
readOnly: false,
withPortal: false,
shouldCloseOnSelect: true,
showTimeSelect: false,
timeIntervals: 30,
timeCaption: "Time",
previousMonthButtonLabel: "Previous Month",
nextMonthButtonLabel: "Next month",
renderDayContents: function renderDayContents(date) {
return date;
}
};
}
}]);
function DatePicker(props) {
classCallCheck(this, DatePicker);
var _this = possibleConstructorReturn(this, _React$Component.call(this, props));
_this.getPreSelection = function () {
return _this.props.openToDate ? newDate(_this.props.openToDate) : _this.props.selectsEnd && _this.props.startDate ? newDate(_this.props.startDate) : _this.props.selectsStart && _this.props.endDate ? newDate(_this.props.endDate) : now(_this.props.utcOffset);
};
_this.calcInitialState = function () {
var defaultPreSelection = _this.getPreSelection();
var minDate = getEffectiveMinDate(_this.props);
var maxDate = getEffectiveMaxDate(_this.props);
var boundedPreSelection = minDate && isBefore(defaultPreSelection, minDate) ? minDate : maxDate && isAfter(defaultPreSelection, maxDate) ? maxDate : defaultPreSelection;
return {
open: _this.props.startOpen || false,
preventFocus: false,
preSelection: _this.props.selected ? newDate(_this.props.selected) : boundedPreSelection,
// transforming highlighted days (perhaps nested array)
// to flat Map for faster access in day.jsx
highlightDates: getHightLightDaysMap(_this.props.highlightDates),
focused: false
};
};
_this.clearPreventFocusTimeout = function () {
if (_this.preventFocusTimeout) {
clearTimeout(_this.preventFocusTimeout);
}
};
_this.setFocus = function () {
if (_this.input && _this.input.focus) {
_this.input.focus();
}
};
_this.setBlur = function () {
if (_this.input && _this.input.blur) {
_this.input.blur();
}
if (_this.props.onBlur) {
_this.props.onBlur();
}
_this.cancelFocusInput();
};
_this.setOpen = function (open) {
var skipSetBlur = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
_this.setState({
open: open,
preSelection: open && _this.state.open ? _this.state.preSelection : _this.calcInitialState().preSelection,
lastPreSelectChange: PRESELECT_CHANGE_VIA_NAVIGATE
}, function () {
if (!open) {
_this.setState(function (prev) {
return {
focused: skipSetBlur ? prev.focused : false
};
}, function () {
!skipSetBlur && _this.setBlur();
_this.setState({ inputValue: null });
});
}
});
};
_this.inputOk = function () {
return isMoment(_this.state.preSelection) || isDate(_this.state.preSelection);
};
_this.isCalendarOpen = function () {
return _this.props.open === undefined ? _this.state.open && !_this.props.disabled && !_this.props.readOnly : _this.props.open;
};
_this.handleFocus = function (event) {
if (!_this.state.preventFocus) {
_this.props.onFocus(event);
if (!_this.props.preventOpenOnFocus && !_this.props.readOnly) {
_this.setOpen(true);
}
}
_this.setState({ focused: true });
};
_this.cancelFocusInput = function () {
clearTimeout(_this.inputFocusTimeout);
_this.inputFocusTimeout = null;
};
_this.deferFocusInput = function () {
_this.cancelFocusInput();
_this.inputFocusTimeout = setTimeout(function () {
return _this.setFocus();
}, 1);
};
_this.handleDropdownFocus = function () {
_this.cancelFocusInput();
};
_this.handleBlur = function (event) {
if (_this.state.open && !_this.props.withPortal) {
_this.deferFocusInput();
} else {
_this.props.onBlur(event);
}
_this.setState({ focused: false });
};
_this.handleCalendarClickOutside = function (event) {
if (!_this.props.inline) {
_this.setOpen(false);
}
_this.props.onClickOutside(event);
if (_this.props.withPortal) {
event.preventDefault();
}
};
_this.handleChange = function () {
for (var _len = arguments.length, allArgs = Array(_len), _key = 0; _key < _len; _key++) {
allArgs[_key] = arguments[_key];
}
var event = allArgs[0];
if (_this.props.onChangeRaw) {
_this.props.onChangeRaw.apply(_this, allArgs);
if (typeof event.isDefaultPrevented !== "function" || event.isDefaultPrevented()) {
return;
}
}
_this.setState({
inputValue: event.target.value,
lastPreSelectChange: PRESELECT_CHANGE_VIA_INPUT
});
var date = parseDate(event.target.value, _this.props);
if (date || !event.target.value) {
_this.setSelected(date, event, true);
}
};
_this.handleSelect = function (date, event) {
// Preventing onFocus event to fix issue
// https://github.com/Hacker0x01/react-datepicker/issues/628
_this.setState({ preventFocus: true }, function () {
_this.preventFocusTimeout = setTimeout(function () {
return _this.setState({ preventFocus: false });
}, 50);
return _this.preventFocusTimeout;
});
_this.setSelected(date, event);
if (!_this.props.shouldCloseOnSelect || _this.props.showTimeSelect) {
_this.setPreSelection(date);
} else if (!_this.props.inline) {
_this.setOpen(false);
}
};
_this.setSelected = function (date, event, keepInput) {
var changedDate = date;
if (changedDate !== null && isDayDisabled(changedDate, _this.props)) {
if (isOutOfBounds(changedDate, _this.props)) {
_this.props.onChange(date, event);
_this.props.onSelect(changedDate, event);
}
return;
}
if (!isSameDay(_this.props.selected, changedDate) || _this.props.allowSameDay) {
if (changedDate !== null) {
if (_this.props.selected) {
var selected = _this.props.selected;
if (keepInput) selected = newDate(changedDate);
changedDate = setTime(newDate(changedDate), {
hour: getHour(selected),
minute: getMinute(selected),
second: getSecond(selected)
});
}
if (!_this.props.inline) {
_this.setState({
preSelection: changedDate
});
}
}
_this.props.onChange(changedDate, event);
}
_this.props.onSelect(changedDate, event);
if (!keepInput) {
_this.setState({ inputValue: null });
}
};
_this.setPreSelection = function (date) {
var isDateRangePresent = typeof _this.props.minDate !== "undefined" && typeof _this.props.maxDate !== "undefined";
var isValidDateSelection = isDateRangePresent && date ? isDayInRange(date, _this.props.minDate, _this.props.maxDate) : true;
if (isValidDateSelection) {
_this.setState({
preSelection: date
});
}
};
_this.handleTimeChange = function (time) {
var selected = _this.props.selected ? _this.props.selected : _this.getPreSelection();
var changedDate = setTime(cloneDate(selected), {
hour: getHour(time),
minute: getMinute(time)
});
_this.setState({
preSelection: changedDate
});
_this.props.onChange(changedDate);
if (_this.props.shouldCloseOnSelect) {
_this.setOpen(false);
}
_this.setState({ inputValue: null });
};
_this.onInputClick = function () {
if (!_this.props.disabled && !_this.props.readOnly) {
_this.setOpen(true);
}
_this.props.onInputClick();
};
_this.onInputKeyDown = function (event) {
_this.props.onKeyDown(event);
var eventKey = event.key;
if (!_this.state.open && !_this.props.inline && !_this.props.preventOpenOnFocus) {
if (eventKey === "ArrowDown" || eventKey === "ArrowUp") {
_this.onInputClick();
}
return;
}
var copy = newDate(_this.state.preSelection);
if (eventKey === "Enter") {
event.preventDefault();
if (_this.inputOk() && _this.state.lastPreSelectChange === PRESELECT_CHANGE_VIA_NAVIGATE) {
_this.handleSelect(copy, event);
!_this.props.shouldCloseOnSelect && _this.setPreSelection(copy);
} else {
_this.setOpen(false);
}
} else if (eventKey === "Escape") {
event.preventDefault();
_this.setOpen(false);
if (!_this.inputOk()) {
_this.props.onInputError({ code: 1, msg: INPUT_ERR_1 });
}
} else if (eventKey === "Tab") {
_this.setOpen(false, true);
} else if (!_this.props.disabledKeyboardNavigation) {
var newSelection = void 0;
switch (eventKey) {
case "ArrowLeft":
newSelection = subtractDays(copy, 1);
break;
case "ArrowRight":
newSelection = addDays(copy, 1);
break;
case "ArrowUp":
newSelection = subtractWeeks(copy, 1);
break;
case "ArrowDown":
newSelection = addWeeks(copy, 1);
break;
case "PageUp":
newSelection = subtractMonths(copy, 1);
break;
case "PageDown":
newSelection = addMonths(copy, 1);
break;
case "Home":
newSelection = subtractYears(copy, 1);
break;
case "End":
newSelection = addYears(copy, 1);
break;
}
if (!newSelection) {
if (_this.props.onInputError) {
_this.props.onInputError({ code: 1, msg: INPUT_ERR_1 });
}
return; // Let the input component handle this keydown
}
event.preventDefault();
_this.setState({ lastPreSelectChange: PRESELECT_CHANGE_VIA_NAVIGATE });
if (_this.props.adjustDateOnChange) {
_this.setSelected(newSelection);
}
_this.setPreSelection(newSelection);
}
};
_this.onClearClick = function (event) {
if (event) {
if (event.preventDefault) {
event.preventDefault();
}
}
_this.props.onChange(null, event);
_this.setState({ inputValue: null });
};
_this.clear = function () {
_this.onClearClick();
};
_this.renderCalendar = function () {
if (!_this.props.inline && !_this.isCalendarOpen()) {
return null;
}
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
WrappedCalendar,
{
ref: function ref(elem) {
_this.calendar = elem;
},
locale: _this.props.locale,
adjustDateOnChange: _this.props.adjustDateOnChange,
setOpen: _this.setOpen,
dateFormat: _this.props.dateFormatCalendar,
useWeekdaysShort: _this.props.useWeekdaysShort,
formatWeekDay: _this.props.formatWeekDay,
dropdownMode: _this.props.dropdownMode,
selected: _this.props.selected,
preSelection: _this.state.preSelection,
onSelect: _this.handleSelect,
onWeekSelect: _this.props.onWeekSelect,
openToDate: _this.props.openToDate,
minDate: _this.props.minDate,
maxDate: _this.props.maxDate,
selectsStart: _this.props.selectsStart,
selectsEnd: _this.props.selectsEnd,
startDate: _this.props.startDate,
endDate: _this.props.endDate,
excludeDates: _this.props.excludeDates,
filterDate: _this.props.filterDate,
onClickOutside: _this.handleCalendarClickOutside,
formatWeekNumber: _this.props.formatWeekNumber,
highlightDates: _this.state.highlightDates,
includeDates: _this.props.includeDates,
includeTimes: _this.props.includeTimes,
injectTimes: _this.props.injectTimes,
inline: _this.props.inline,
peekNextMonth: _this.props.peekNextMonth,
showMonthDropdown: _this.props.showMonthDropdown,
useShortMonthInDropdown: _this.props.useShortMonthInDropdown,
showMonthYearDropdown: _this.props.showMonthYearDropdown,
showWeekNumbers: _this.props.showWeekNumbers,
showYearDropdown: _this.props.showYearDropdown,
withPortal: _this.props.withPortal,
forceShowMonthNavigation: _this.props.forceShowMonthNavigation,
showDisabledMonthNavigation: _this.props.showDisabledMonthNavigation,
scrollableYearDropdown: _this.props.scrollableYearDropdown,
scrollableMonthYearDropdown: _this.props.scrollableMonthYearDropdown,
todayButton: _this.props.todayButton,
weekLabel: _this.props.weekLabel,
utcOffset: _this.props.utcOffset,
outsideClickIgnoreClass: outsideClickIgnoreClass,
fixedHeight: _this.props.fixedHeight,
monthsShown: _this.props.monthsShown,
onDropdownFocus: _this.handleDropdownFocus,
onMonthChange: _this.props.onMonthChange,
onYearChange: _this.props.onYearChange,
dayClassName: _this.props.dayClassName,
showTimeSelect: _this.props.showTimeSelect,
showTimeSelectOnly: _this.props.showTimeSelectOnly,
onTimeChange: _this.handleTimeChange,
timeFormat: _this.props.timeFormat,
timeIntervals: _this.props.timeIntervals,
minTime: _this.props.minTime,
maxTime: _this.props.maxTime,
excludeTimes: _this.props.excludeTimes,
timeCaption: _this.props.timeCaption,
className: _this.props.calendarClassName,
container: _this.props.calendarContainer,
yearDropdownItemNumber: _this.props.yearDropdownItemNumber,
previousMonthButtonLabel: _this.props.previousMonthButtonLabel,
nextMonthButtonLabel: _this.props.nextMonthButtonLabel,
disabledKeyboardNavigation: _this.props.disabledKeyboardNavigation,
renderCustomHeader: _this.props.renderCustomHeader,
popperProps: _this.props.popperProps,
renderDayContents: _this.props.renderDayContents
},
_this.props.children
);
};
_this.renderDateInput = function () {
var _classnames, _React$cloneElement;
var className = classnames__WEBPACK_IMPORTED_MODULE_2___default()(_this.props.className, (_classnames = {}, _classnames[outsideClickIgnoreClass] = _this.state.open, _classnames));
var customInput = _this.props.customInput || react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", { type: "text" });
var customInputRef = _this.props.customInputRef || "ref";
var inputValue = typeof _this.props.value === "string" ? _this.props.value : typeof _this.state.inputValue === "string" ? _this.state.inputValue : safeDateFormat(_this.props.selected, _this.props);
return react__WEBPACK_IMPORTED_MODULE_0___default.a.cloneElement(customInput, (_React$cloneElement = {}, _React$cloneElement[customInputRef] = function (input) {
_this.input = input;
}, _React$cloneElement.value = inputValue, _React$cloneElement.onBlur = _this.handleBlur, _React$cloneElement.onChange = _this.handleChange, _React$cloneElement.onClick = _this.onInputClick, _React$cloneElement.onFocus = _this.handleFocus, _React$cloneElement.onKeyDown = _this.onInputKeyDown, _React$cloneElement.id = _this.props.id, _React$cloneElement.name = _this.props.name, _React$cloneElement.autoFocus = _this.props.autoFocus, _React$cloneElement.placeholder = _this.props.placeholderText, _React$cloneElement.disabled = _this.props.disabled, _React$cloneElement.autoComplete = _this.props.autoComplete, _React$cloneElement.className = className, _React$cloneElement.title = _this.props.title, _React$cloneElement.readOnly = _this.props.readOnly, _React$cloneElement.required = _this.props.required, _React$cloneElement.tabIndex = _this.props.tabIndex, _React$cloneElement));
};
_this.renderClearButton = function () {
if (_this.props.isClearable && _this.props.selected != null) {
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", {
type: "button",
className: "react-datepicker__close-icon",
onClick: _this.onClearClick,
title: _this.props.clearButtonTitle,
tabIndex: -1
});
} else {
return null;
}
};
_this.state = _this.calcInitialState();
return _this;
}
DatePicker.prototype.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
if (prevProps.inline && hasPreSelectionChanged(prevProps.selected, this.props.selected)) {
this.setPreSelection(this.props.selected);
}
if (prevProps.highlightDates !== this.props.highlightDates) {
this.setState({
highlightDates: getHightLightDaysMap(this.props.highlightDates)
});
}
if (!prevState.focused && hasSelectionChanged(prevProps.selected, this.props.selected)) {
this.setState({ inputValue: null });
}
};
DatePicker.prototype.componentWillUnmount = function componentWillUnmount() {
this.clearPreventFocusTimeout();
};
DatePicker.prototype.render = function render() {
var calendar = this.renderCalendar();
if (this.props.inline && !this.props.withPortal) {
return calendar;
}
if (this.props.withPortal) {
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
null,
!this.props.inline ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: "react-datepicker__input-container" },
this.renderDateInput(),
this.renderClearButton()
) : null,
this.state.open || this.props.inline ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: "react-datepicker__portal" },
calendar
) : null
);
}
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(PopperComponent, {
className: this.props.popperClassName,
hidePopper: !this.isCalendarOpen(),
popperModifiers: this.props.popperModifiers,
targetComponent: react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: "react-datepicker__input-container" },
this.renderDateInput(),
this.renderClearButton()
),
popperContainer: this.props.popperContainer,
popperComponent: calendar,
popperPlacement: this.props.popperPlacement,
popperProps: this.props.popperProps
});
};
return DatePicker;
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
DatePicker.propTypes = {
adjustDateOnChange: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
allowSameDay: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
autoComplete: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
autoFocus: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
calendarClassName: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
calendarContainer: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node,
className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
customInput: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.element,
customInputRef: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
// eslint-disable-next-line react/no-unused-prop-types
dateFormat: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.array]),
dateFormatCalendar: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
dayClassName: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
disabled: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
disabledKeyboardNavigation: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
dropdownMode: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOf(["scroll", "select"]).isRequired,
endDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
excludeDates: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.array,
filterDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
fixedHeight: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
formatWeekNumber: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
highlightDates: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.array,
id: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
includeDates: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.array,
includeTimes: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.array,
injectTimes: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.array,
inline: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
isClearable: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
locale: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
maxDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
minDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
monthsShown: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number,
name: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
onBlur: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
onChange: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func.isRequired,
onSelect: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
onWeekSelect: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
onClickOutside: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
onChangeRaw: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
onFocus: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
onInputClick: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
onKeyDown: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
onMonthChange: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
onYearChange: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
onInputError: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
open: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
openToDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
peekNextMonth: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
placeholderText: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
popperContainer: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
popperClassName: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, // <PopperComponent/> props
popperModifiers: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object, // <PopperComponent/> props
popperPlacement: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOf(popperPlacementPositions), // <PopperComponent/> props
popperProps: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
preventOpenOnFocus: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
readOnly: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
required: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
scrollableYearDropdown: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
scrollableMonthYearDropdown: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
selected: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
selectsEnd: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
selectsStart: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
showMonthDropdown: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
showMonthYearDropdown: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
showWeekNumbers: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
showYearDropdown: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
forceShowMonthNavigation: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
showDisabledMonthNavigation: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
startDate: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
startOpen: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
tabIndex: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number,
timeCaption: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
title: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
todayButton: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node,
useWeekdaysShort: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
formatWeekDay: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
utcOffset: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string]),
value: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
weekLabel: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
withPortal: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
yearDropdownItemNumber: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number,
shouldCloseOnSelect: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
showTimeSelect: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
showTimeSelectOnly: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
timeFormat: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
timeIntervals: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number,
minTime: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
maxTime: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object,
excludeTimes: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.array,
useShortMonthInDropdown: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool,
clearButtonTitle: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
previousMonthButtonLabel: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
nextMonthButtonLabel: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
renderCustomHeader: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
renderDayContents: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func
};
var PRESELECT_CHANGE_VIA_INPUT = "input";
var PRESELECT_CHANGE_VIA_NAVIGATE = "navigate";
/* harmony default export */ __webpack_exports__["default"] = (DatePicker);
/***/ }),
/***/ "./node_modules/react-onclickoutside/dist/react-onclickoutside.es.js":
/*!***************************************************************************!*\
!*** ./node_modules/react-onclickoutside/dist/react-onclickoutside.es.js ***!
\***************************************************************************/
/*! exports provided: IGNORE_CLASS_NAME, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IGNORE_CLASS_NAME", function() { return IGNORE_CLASS_NAME; });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "react-dom");
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);
function _inheritsLoose(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
subClass.__proto__ = superClass;
}
function _objectWithoutProperties(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
for (i = 0; i < sourceSymbolKeys.length; i++) {
key = sourceSymbolKeys[i];
if (excluded.indexOf(key) >= 0) continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
target[key] = source[key];
}
}
return target;
}
/**
* Check whether some DOM node is our Component's node.
*/
function isNodeFound(current, componentNode, ignoreClass) {
if (current === componentNode) {
return true;
} // SVG <use/> elements do not technically reside in the rendered DOM, so
// they do not have classList directly, but they offer a link to their
// corresponding element, which can have classList. This extra check is for
// that case.
// See: http://www.w3.org/TR/SVG11/struct.html#InterfaceSVGUseElement
// Discussion: https://github.com/Pomax/react-onclickoutside/pull/17
if (current.correspondingElement) {
return current.correspondingElement.classList.contains(ignoreClass);
}
return current.classList.contains(ignoreClass);
}
/**
* Try to find our node in a hierarchy of nodes, returning the document
* node as highest node if our node is not found in the path up.
*/
function findHighest(current, componentNode, ignoreClass) {
if (current === componentNode) {
return true;
} // If source=local then this event came from 'somewhere'
// inside and should be ignored. We could handle this with
// a layered approach, too, but that requires going back to
// thinking in terms of Dom node nesting, running counter
// to React's 'you shouldn't care about the DOM' philosophy.
while (current.parentNode) {
if (isNodeFound(current, componentNode, ignoreClass)) {
return true;
}
current = current.parentNode;
}
return current;
}
/**
* Check if the browser scrollbar was clicked
*/
function clickedScrollbar(evt) {
return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;
}
// ideally will get replaced with external dep
// when rafrex/detect-passive-events#4 and rafrex/detect-passive-events#5 get merged in
var testPassiveEventSupport = function testPassiveEventSupport() {
if (typeof window === 'undefined' || typeof window.addEventListener !== 'function') {
return;
}
var passive = false;
var options = Object.defineProperty({}, 'passive', {
get: function get() {
passive = true;
}
});
var noop = function noop() {};
window.addEventListener('testPassiveEventSupport', noop, options);
window.removeEventListener('testPassiveEventSupport', noop, options);
return passive;
};
function autoInc(seed) {
if (seed === void 0) {
seed = 0;
}
return function () {
return ++seed;
};
}
var uid = autoInc();
var passiveEventSupport;
var handlersMap = {};
var enabledInstances = {};
var touchEvents = ['touchstart', 'touchmove'];
var IGNORE_CLASS_NAME = 'ignore-react-onclickoutside';
/**
* Options for addEventHandler and removeEventHandler
*/
function getEventHandlerOptions(instance, eventName) {
var handlerOptions = null;
var isTouchEvent = touchEvents.indexOf(eventName) !== -1;
if (isTouchEvent && passiveEventSupport) {
handlerOptions = {
passive: !instance.props.preventDefault
};
}
return handlerOptions;
}
/**
* This function generates the HOC function that you'll use
* in order to impart onOutsideClick listening to an
* arbitrary component. It gets called at the end of the
* bootstrapping code to yield an instance of the
* onClickOutsideHOC function defined inside setupHOC().
*/
function onClickOutsideHOC(WrappedComponent, config) {
var _class, _temp;
return _temp = _class =
/*#__PURE__*/
function (_Component) {
_inheritsLoose(onClickOutside, _Component);
function onClickOutside(props) {
var _this;
_this = _Component.call(this, props) || this;
_this.__outsideClickHandler = function (event) {
if (typeof _this.__clickOutsideHandlerProp === 'function') {
_this.__clickOutsideHandlerProp(event);
return;
}
var instance = _this.getInstance();
if (typeof instance.props.handleClickOutside === 'function') {
instance.props.handleClickOutside(event);
return;
}
if (typeof instance.handleClickOutside === 'function') {
instance.handleClickOutside(event);
return;
}
throw new Error('WrappedComponent lacks a handleClickOutside(event) function for processing outside click events.');
};
_this.enableOnClickOutside = function () {
if (typeof document === 'undefined' || enabledInstances[_this._uid]) {
return;
}
if (typeof passiveEventSupport === 'undefined') {
passiveEventSupport = testPassiveEventSupport();
}
enabledInstances[_this._uid] = true;
var events = _this.props.eventTypes;
if (!events.forEach) {
events = [events];
}
handlersMap[_this._uid] = function (event) {
if (_this.props.disableOnClickOutside) return;
if (_this.componentNode === null) return;
if (_this.props.preventDefault) {
event.preventDefault();
}
if (_this.props.stopPropagation) {
event.stopPropagation();
}
if (_this.props.excludeScrollbar && clickedScrollbar(event)) return;
var current = event.target;
if (findHighest(current, _this.componentNode, _this.props.outsideClickIgnoreClass) !== document) {
return;
}
_this.__outsideClickHandler(event);
};
events.forEach(function (eventName) {
document.addEventListener(eventName, handlersMap[_this._uid], getEventHandlerOptions(_this, eventName));
});
};
_this.disableOnClickOutside = function () {
delete enabledInstances[_this._uid];
var fn = handlersMap[_this._uid];
if (fn && typeof document !== 'undefined') {
var events = _this.props.eventTypes;
if (!events.forEach) {
events = [events];
}
events.forEach(function (eventName) {
return document.removeEventListener(eventName, fn, getEventHandlerOptions(_this, eventName));
});
delete handlersMap[_this._uid];
}
};
_this.getRef = function (ref) {
return _this.instanceRef = ref;
};
_this._uid = uid();
return _this;
}
/**
* Access the WrappedComponent's instance.
*/
var _proto = onClickOutside.prototype;
_proto.getInstance = function getInstance() {
if (!WrappedComponent.prototype.isReactComponent) {
return this;
}
var ref = this.instanceRef;
return ref.getInstance ? ref.getInstance() : ref;
};
/**
* Add click listeners to the current document,
* linked to this component's state.
*/
_proto.componentDidMount = function componentDidMount() {
// If we are in an environment without a DOM such
// as shallow rendering or snapshots then we exit
// early to prevent any unhandled errors being thrown.
if (typeof document === 'undefined' || !document.createElement) {
return;
}
var instance = this.getInstance();
if (config && typeof config.handleClickOutside === 'function') {
this.__clickOutsideHandlerProp = config.handleClickOutside(instance);
if (typeof this.__clickOutsideHandlerProp !== 'function') {
throw new Error('WrappedComponent lacks a function for processing outside click events specified by the handleClickOutside config option.');
}
}
this.componentNode = Object(react_dom__WEBPACK_IMPORTED_MODULE_1__["findDOMNode"])(this.getInstance());
this.enableOnClickOutside();
};
_proto.componentDidUpdate = function componentDidUpdate() {
this.componentNode = Object(react_dom__WEBPACK_IMPORTED_MODULE_1__["findDOMNode"])(this.getInstance());
};
/**
* Remove all document's event listeners for this component
*/
_proto.componentWillUnmount = function componentWillUnmount() {
this.disableOnClickOutside();
};
/**
* Can be called to explicitly enable event listening
* for clicks and touches outside of this element.
*/
/**
* Pass-through render
*/
_proto.render = function render() {
// eslint-disable-next-line no-unused-vars
var _props = this.props,
excludeScrollbar = _props.excludeScrollbar,
props = _objectWithoutProperties(_props, ["excludeScrollbar"]);
if (WrappedComponent.prototype.isReactComponent) {
props.ref = this.getRef;
} else {
props.wrappedRef = this.getRef;
}
props.disableOnClickOutside = this.disableOnClickOutside;
props.enableOnClickOutside = this.enableOnClickOutside;
return Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])(WrappedComponent, props);
};
return onClickOutside;
}(react__WEBPACK_IMPORTED_MODULE_0__["Component"]), _class.displayName = "OnClickOutside(" + (WrappedComponent.displayName || WrappedComponent.name || 'Component') + ")", _class.defaultProps = {
eventTypes: ['mousedown', 'touchstart'],
excludeScrollbar: config && config.excludeScrollbar || false,
outsideClickIgnoreClass: IGNORE_CLASS_NAME,
preventDefault: false,
stopPropagation: false
}, _class.getClass = function () {
return WrappedComponent.getClass ? WrappedComponent.getClass() : WrappedComponent;
}, _temp;
}
/* harmony default export */ __webpack_exports__["default"] = (onClickOutsideHOC);
/***/ }),
/***/ "./node_modules/react-popper/lib/esm/Manager.js":
/*!******************************************************!*\
!*** ./node_modules/react-popper/lib/esm/Manager.js ***!
\******************************************************/
/*! exports provided: ManagerContext, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ManagerContext", function() { return ManagerContext; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Manager; });
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ "./node_modules/@babel/runtime/helpers/extends.js");
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inheritsLoose */ "./node_modules/@babel/runtime/helpers/inheritsLoose.js");
/* harmony import */ var _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/defineProperty.js");
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var create_react_context__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! create-react-context */ "./node_modules/create-react-context/lib/index.js");
/* harmony import */ var create_react_context__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(create_react_context__WEBPACK_IMPORTED_MODULE_5__);
var ManagerContext = create_react_context__WEBPACK_IMPORTED_MODULE_5___default()({
getReferenceRef: undefined,
referenceNode: undefined
});
var Manager =
/*#__PURE__*/
function (_React$Component) {
_babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_1___default()(Manager, _React$Component);
function Manager() {
var _this;
_this = _React$Component.call(this) || this;
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this)), "getReferenceRef", function (referenceNode) {
return _this.setState(function (_ref) {
var context = _ref.context;
return {
context: _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, context, {
referenceNode: referenceNode
})
};
});
});
_this.state = {
context: {
getReferenceRef: _this.getReferenceRef,
referenceNode: undefined
}
};
return _this;
}
var _proto = Manager.prototype;
_proto.render = function render() {
return react__WEBPACK_IMPORTED_MODULE_4__["createElement"](ManagerContext.Provider, {
value: this.state.context
}, this.props.children);
};
return Manager;
}(react__WEBPACK_IMPORTED_MODULE_4__["Component"]);
/***/ }),
/***/ "./node_modules/react-popper/lib/esm/Popper.js":
/*!*****************************************************!*\
!*** ./node_modules/react-popper/lib/esm/Popper.js ***!
\*****************************************************/
/*! exports provided: InnerPopper, placements, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InnerPopper", function() { return InnerPopper; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "placements", function() { return placements; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Popper; });
/* harmony import */ var _babel_runtime_helpers_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js");
/* harmony import */ var _babel_runtime_helpers_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ "./node_modules/@babel/runtime/helpers/extends.js");
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inheritsLoose */ "./node_modules/@babel/runtime/helpers/inheritsLoose.js");
/* harmony import */ var _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/defineProperty.js");
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var popper_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! popper.js */ "./node_modules/popper.js/dist/esm/popper.js");
/* harmony import */ var _Manager__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Manager */ "./node_modules/react-popper/lib/esm/Manager.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils */ "./node_modules/react-popper/lib/esm/utils.js");
var initialStyle = {
position: 'absolute',
top: 0,
left: 0,
opacity: 0,
pointerEvents: 'none'
};
var initialArrowStyle = {};
var InnerPopper =
/*#__PURE__*/
function (_React$Component) {
_babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_2___default()(InnerPopper, _React$Component);
function InnerPopper() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this)), "state", {
data: undefined,
placement: undefined
});
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this)), "popperInstance", void 0);
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this)), "popperNode", null);
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this)), "arrowNode", null);
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this)), "setPopperNode", function (popperNode) {
if (!popperNode || _this.popperNode === popperNode) return;
Object(_utils__WEBPACK_IMPORTED_MODULE_8__["safeInvoke"])(_this.props.innerRef, popperNode);
_this.popperNode = popperNode;
_this.updatePopperInstance();
});
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this)), "setArrowNode", function (arrowNode) {
_this.arrowNode = arrowNode;
});
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this)), "updateStateModifier", {
enabled: true,
order: 900,
fn: function fn(data) {
var placement = data.placement;
_this.setState({
data: data,
placement: placement
});
return data;
}
});
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this)), "getOptions", function () {
return {
placement: _this.props.placement,
eventsEnabled: _this.props.eventsEnabled,
positionFixed: _this.props.positionFixed,
modifiers: _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({}, _this.props.modifiers, {
arrow: _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({}, _this.props.modifiers && _this.props.modifiers.arrow, {
enabled: !!_this.arrowNode,
element: _this.arrowNode
}),
applyStyle: {
enabled: false
},
updateStateModifier: _this.updateStateModifier
})
};
});
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this)), "getPopperStyle", function () {
return !_this.popperNode || !_this.state.data ? initialStyle : _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({
position: _this.state.data.offsets.popper.position
}, _this.state.data.styles);
});
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this)), "getPopperPlacement", function () {
return !_this.state.data ? undefined : _this.state.placement;
});
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this)), "getArrowStyle", function () {
return !_this.arrowNode || !_this.state.data ? initialArrowStyle : _this.state.data.arrowStyles;
});
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this)), "getOutOfBoundariesState", function () {
return _this.state.data ? _this.state.data.hide : undefined;
});
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this)), "destroyPopperInstance", function () {
if (!_this.popperInstance) return;
_this.popperInstance.destroy();
_this.popperInstance = null;
});
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this)), "updatePopperInstance", function () {
_this.destroyPopperInstance();
var _assertThisInitialize = _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this)),
popperNode = _assertThisInitialize.popperNode;
var referenceElement = _this.props.referenceElement;
if (!referenceElement || !popperNode) return;
_this.popperInstance = new popper_js__WEBPACK_IMPORTED_MODULE_6__["default"](referenceElement, popperNode, _this.getOptions());
});
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this)), "scheduleUpdate", function () {
if (_this.popperInstance) {
_this.popperInstance.scheduleUpdate();
}
});
return _this;
}
var _proto = InnerPopper.prototype;
_proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
// If the Popper.js options have changed, update the instance (destroy + create)
if (this.props.placement !== prevProps.placement || this.props.referenceElement !== prevProps.referenceElement || this.props.positionFixed !== prevProps.positionFixed) {
this.updatePopperInstance();
} else if (this.props.eventsEnabled !== prevProps.eventsEnabled && this.popperInstance) {
this.props.eventsEnabled ? this.popperInstance.enableEventListeners() : this.popperInstance.disableEventListeners();
} // A placement difference in state means popper determined a new placement
// apart from the props value. By the time the popper element is rendered with
// the new position Popper has already measured it, if the place change triggers
// a size change it will result in a misaligned popper. So we schedule an update to be sure.
if (prevState.placement !== this.state.placement) {
this.scheduleUpdate();
}
};
_proto.componentWillUnmount = function componentWillUnmount() {
Object(_utils__WEBPACK_IMPORTED_MODULE_8__["safeInvoke"])(this.props.innerRef, null);
this.destroyPopperInstance();
};
_proto.render = function render() {
return Object(_utils__WEBPACK_IMPORTED_MODULE_8__["unwrapArray"])(this.props.children)({
ref: this.setPopperNode,
style: this.getPopperStyle(),
placement: this.getPopperPlacement(),
outOfBoundaries: this.getOutOfBoundariesState(),
scheduleUpdate: this.scheduleUpdate,
arrowProps: {
ref: this.setArrowNode,
style: this.getArrowStyle()
}
});
};
return InnerPopper;
}(react__WEBPACK_IMPORTED_MODULE_5__["Component"]);
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(InnerPopper, "defaultProps", {
placement: 'bottom',
eventsEnabled: true,
referenceElement: undefined,
positionFixed: false
});
var placements = popper_js__WEBPACK_IMPORTED_MODULE_6__["default"].placements;
function Popper(_ref) {
var referenceElement = _ref.referenceElement,
props = _babel_runtime_helpers_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0___default()(_ref, ["referenceElement"]);
return react__WEBPACK_IMPORTED_MODULE_5__["createElement"](_Manager__WEBPACK_IMPORTED_MODULE_7__["ManagerContext"].Consumer, null, function (_ref2) {
var referenceNode = _ref2.referenceNode;
return react__WEBPACK_IMPORTED_MODULE_5__["createElement"](InnerPopper, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({
referenceElement: referenceElement !== undefined ? referenceElement : referenceNode
}, props));
});
}
/***/ }),
/***/ "./node_modules/react-popper/lib/esm/Reference.js":
/*!********************************************************!*\
!*** ./node_modules/react-popper/lib/esm/Reference.js ***!
\********************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Reference; });
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ "./node_modules/@babel/runtime/helpers/extends.js");
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inheritsLoose */ "./node_modules/@babel/runtime/helpers/inheritsLoose.js");
/* harmony import */ var _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/defineProperty.js");
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var warning__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! warning */ "./node_modules/warning/warning.js");
/* harmony import */ var warning__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(warning__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _Manager__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Manager */ "./node_modules/react-popper/lib/esm/Manager.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils */ "./node_modules/react-popper/lib/esm/utils.js");
var InnerReference =
/*#__PURE__*/
function (_React$Component) {
_babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_1___default()(InnerReference, _React$Component);
function InnerReference() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this)), "refHandler", function (node) {
Object(_utils__WEBPACK_IMPORTED_MODULE_7__["safeInvoke"])(_this.props.innerRef, node);
Object(_utils__WEBPACK_IMPORTED_MODULE_7__["safeInvoke"])(_this.props.getReferenceRef, node);
});
return _this;
}
var _proto = InnerReference.prototype;
_proto.render = function render() {
warning__WEBPACK_IMPORTED_MODULE_5___default()(this.props.getReferenceRef, '`Reference` should not be used outside of a `Manager` component.');
return Object(_utils__WEBPACK_IMPORTED_MODULE_7__["unwrapArray"])(this.props.children)({
ref: this.refHandler
});
};
return InnerReference;
}(react__WEBPACK_IMPORTED_MODULE_4__["Component"]);
function Reference(props) {
return react__WEBPACK_IMPORTED_MODULE_4__["createElement"](_Manager__WEBPACK_IMPORTED_MODULE_6__["ManagerContext"].Consumer, null, function (_ref) {
var getReferenceRef = _ref.getReferenceRef;
return react__WEBPACK_IMPORTED_MODULE_4__["createElement"](InnerReference, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({
getReferenceRef: getReferenceRef
}, props));
});
}
/***/ }),
/***/ "./node_modules/react-popper/lib/esm/index.js":
/*!****************************************************!*\
!*** ./node_modules/react-popper/lib/esm/index.js ***!
\****************************************************/
/*! exports provided: Popper, placements, Manager, Reference */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _Popper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Popper */ "./node_modules/react-popper/lib/esm/Popper.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Popper", function() { return _Popper__WEBPACK_IMPORTED_MODULE_0__["default"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "placements", function() { return _Popper__WEBPACK_IMPORTED_MODULE_0__["placements"]; });
/* harmony import */ var _Manager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Manager */ "./node_modules/react-popper/lib/esm/Manager.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Manager", function() { return _Manager__WEBPACK_IMPORTED_MODULE_1__["default"]; });
/* harmony import */ var _Reference__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Reference */ "./node_modules/react-popper/lib/esm/Reference.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Reference", function() { return _Reference__WEBPACK_IMPORTED_MODULE_2__["default"]; });
// Public components
// Public types
/***/ }),
/***/ "./node_modules/react-popper/lib/esm/utils.js":
/*!****************************************************!*\
!*** ./node_modules/react-popper/lib/esm/utils.js ***!
\****************************************************/
/*! exports provided: unwrapArray, safeInvoke */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unwrapArray", function() { return unwrapArray; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "safeInvoke", function() { return safeInvoke; });
/**
* Takes an argument and if it's an array, returns the first item in the array,
* otherwise returns the argument. Used for Preact compatibility.
*/
var unwrapArray = function unwrapArray(arg) {
return Array.isArray(arg) ? arg[0] : arg;
};
/**
* Takes a maybe-undefined function and arbitrary args and invokes the function
* only if it is defined.
*/
var safeInvoke = function safeInvoke(fn) {
if (typeof fn === "function") {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
return fn.apply(void 0, args);
}
};
/***/ }),
/***/ "./node_modules/reactcss/lib/autoprefix.js":
/*!*************************************************!*\
!*** ./node_modules/reactcss/lib/autoprefix.js ***!
\*************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.autoprefix = undefined;
var _forOwn2 = __webpack_require__(/*! lodash/forOwn */ "./node_modules/lodash/forOwn.js");
var _forOwn3 = _interopRequireDefault(_forOwn2);
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; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var transforms = {
borderRadius: function borderRadius(value) {
return {
msBorderRadius: value,
MozBorderRadius: value,
OBorderRadius: value,
WebkitBorderRadius: value,
borderRadius: value
};
},
boxShadow: function boxShadow(value) {
return {
msBoxShadow: value,
MozBoxShadow: value,
OBoxShadow: value,
WebkitBoxShadow: value,
boxShadow: value
};
},
userSelect: function userSelect(value) {
return {
WebkitTouchCallout: value,
KhtmlUserSelect: value,
MozUserSelect: value,
msUserSelect: value,
WebkitUserSelect: value,
userSelect: value
};
},
flex: function flex(value) {
return {
WebkitBoxFlex: value,
MozBoxFlex: value,
WebkitFlex: value,
msFlex: value,
flex: value
};
},
flexBasis: function flexBasis(value) {
return {
WebkitFlexBasis: value,
flexBasis: value
};
},
justifyContent: function justifyContent(value) {
return {
WebkitJustifyContent: value,
justifyContent: value
};
},
transition: function transition(value) {
return {
msTransition: value,
MozTransition: value,
OTransition: value,
WebkitTransition: value,
transition: value
};
},
transform: function transform(value) {
return {
msTransform: value,
MozTransform: value,
OTransform: value,
WebkitTransform: value,
transform: value
};
},
absolute: function absolute(value) {
var direction = value && value.split(' ');
return {
position: 'absolute',
top: direction && direction[0],
right: direction && direction[1],
bottom: direction && direction[2],
left: direction && direction[3]
};
},
extend: function extend(name, otherElementStyles) {
var otherStyle = otherElementStyles[name];
if (otherStyle) {
return otherStyle;
}
return {
'extend': name
};
}
};
var autoprefix = exports.autoprefix = function autoprefix(elements) {
var prefixed = {};
(0, _forOwn3.default)(elements, function (styles, element) {
var expanded = {};
(0, _forOwn3.default)(styles, function (value, key) {
var transform = transforms[key];
if (transform) {
expanded = _extends({}, expanded, transform(value));
} else {
expanded[key] = value;
}
});
prefixed[element] = expanded;
});
return prefixed;
};
exports.default = autoprefix;
/***/ }),
/***/ "./node_modules/reactcss/lib/components/active.js":
/*!********************************************************!*\
!*** ./node_modules/reactcss/lib/components/active.js ***!
\********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.active = undefined;
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; };
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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; }
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; }
var active = exports.active = function active(Component) {
var Span = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'span';
return function (_React$Component) {
_inherits(Active, _React$Component);
function Active() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, Active);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Active.__proto__ || Object.getPrototypeOf(Active)).call.apply(_ref, [this].concat(args))), _this), _this.state = { active: false }, _this.handleMouseDown = function () {
return _this.setState({ active: true });
}, _this.handleMouseUp = function () {
return _this.setState({ active: false });
}, _this.render = function () {
return _react2.default.createElement(
Span,
{ onMouseDown: _this.handleMouseDown, onMouseUp: _this.handleMouseUp },
_react2.default.createElement(Component, _extends({}, _this.props, _this.state))
);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
return Active;
}(_react2.default.Component);
};
exports.default = active;
/***/ }),
/***/ "./node_modules/reactcss/lib/components/hover.js":
/*!*******************************************************!*\
!*** ./node_modules/reactcss/lib/components/hover.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.hover = undefined;
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; };
var _react = __webpack_require__(/*! react */ "react");
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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; }
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; }
var hover = exports.hover = function hover(Component) {
var Span = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'span';
return function (_React$Component) {
_inherits(Hover, _React$Component);
function Hover() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, Hover);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Hover.__proto__ || Object.getPrototypeOf(Hover)).call.apply(_ref, [this].concat(args))), _this), _this.state = { hover: false }, _this.handleMouseOver = function () {
return _this.setState({ hover: true });
}, _this.handleMouseOut = function () {
return _this.setState({ hover: false });
}, _this.render = function () {
return _react2.default.createElement(
Span,
{ onMouseOver: _this.handleMouseOver, onMouseOut: _this.handleMouseOut },
_react2.default.createElement(Component, _extends({}, _this.props, _this.state))
);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
return Hover;
}(_react2.default.Component);
};
exports.default = hover;
/***/ }),
/***/ "./node_modules/reactcss/lib/flattenNames.js":
/*!***************************************************!*\
!*** ./node_modules/reactcss/lib/flattenNames.js ***!
\***************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.flattenNames = undefined;
var _isString2 = __webpack_require__(/*! lodash/isString */ "./node_modules/lodash/isString.js");
var _isString3 = _interopRequireDefault(_isString2);
var _forOwn2 = __webpack_require__(/*! lodash/forOwn */ "./node_modules/lodash/forOwn.js");
var _forOwn3 = _interopRequireDefault(_forOwn2);
var _isPlainObject2 = __webpack_require__(/*! lodash/isPlainObject */ "./node_modules/lodash/isPlainObject.js");
var _isPlainObject3 = _interopRequireDefault(_isPlainObject2);
var _map2 = __webpack_require__(/*! lodash/map */ "./node_modules/lodash/map.js");
var _map3 = _interopRequireDefault(_map2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var flattenNames = exports.flattenNames = function flattenNames() {
var things = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
var names = [];
(0, _map3.default)(things, function (thing) {
if (Array.isArray(thing)) {
flattenNames(thing).map(function (name) {
return names.push(name);
});
} else if ((0, _isPlainObject3.default)(thing)) {
(0, _forOwn3.default)(thing, function (value, key) {
value === true && names.push(key);
names.push(key + '-' + value);
});
} else if ((0, _isString3.default)(thing)) {
names.push(thing);
}
});
return names;
};
exports.default = flattenNames;
/***/ }),
/***/ "./node_modules/reactcss/lib/index.js":
/*!********************************************!*\
!*** ./node_modules/reactcss/lib/index.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ReactCSS = exports.loop = exports.handleActive = exports.handleHover = exports.hover = undefined;
var _flattenNames = __webpack_require__(/*! ./flattenNames */ "./node_modules/reactcss/lib/flattenNames.js");
var _flattenNames2 = _interopRequireDefault(_flattenNames);
var _mergeClasses = __webpack_require__(/*! ./mergeClasses */ "./node_modules/reactcss/lib/mergeClasses.js");
var _mergeClasses2 = _interopRequireDefault(_mergeClasses);
var _autoprefix = __webpack_require__(/*! ./autoprefix */ "./node_modules/reactcss/lib/autoprefix.js");
var _autoprefix2 = _interopRequireDefault(_autoprefix);
var _hover2 = __webpack_require__(/*! ./components/hover */ "./node_modules/reactcss/lib/components/hover.js");
var _hover3 = _interopRequireDefault(_hover2);
var _active = __webpack_require__(/*! ./components/active */ "./node_modules/reactcss/lib/components/active.js");
var _active2 = _interopRequireDefault(_active);
var _loop2 = __webpack_require__(/*! ./loop */ "./node_modules/reactcss/lib/loop.js");
var _loop3 = _interopRequireDefault(_loop2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.hover = _hover3.default;
exports.handleHover = _hover3.default;
exports.handleActive = _active2.default;
exports.loop = _loop3.default;
var ReactCSS = exports.ReactCSS = function ReactCSS(classes) {
for (var _len = arguments.length, activations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
activations[_key - 1] = arguments[_key];
}
var activeNames = (0, _flattenNames2.default)(activations);
var merged = (0, _mergeClasses2.default)(classes, activeNames);
return (0, _autoprefix2.default)(merged);
};
exports.default = ReactCSS;
/***/ }),
/***/ "./node_modules/reactcss/lib/loop.js":
/*!*******************************************!*\
!*** ./node_modules/reactcss/lib/loop.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var loopable = function loopable(i, length) {
var props = {};
var setProp = function setProp(name) {
var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
props[name] = value;
};
i === 0 && setProp('first-child');
i === length - 1 && setProp('last-child');
(i === 0 || i % 2 === 0) && setProp('even');
Math.abs(i % 2) === 1 && setProp('odd');
setProp('nth-child', i);
return props;
};
exports.default = loopable;
/***/ }),
/***/ "./node_modules/reactcss/lib/mergeClasses.js":
/*!***************************************************!*\
!*** ./node_modules/reactcss/lib/mergeClasses.js ***!
\***************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.mergeClasses = undefined;
var _forOwn2 = __webpack_require__(/*! lodash/forOwn */ "./node_modules/lodash/forOwn.js");
var _forOwn3 = _interopRequireDefault(_forOwn2);
var _cloneDeep2 = __webpack_require__(/*! lodash/cloneDeep */ "./node_modules/lodash/cloneDeep.js");
var _cloneDeep3 = _interopRequireDefault(_cloneDeep2);
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; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var mergeClasses = exports.mergeClasses = function mergeClasses(classes) {
var activeNames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
var styles = classes.default && (0, _cloneDeep3.default)(classes.default) || {};
activeNames.map(function (name) {
var toMerge = classes[name];
if (toMerge) {
(0, _forOwn3.default)(toMerge, function (value, key) {
if (!styles[key]) {
styles[key] = {};
}
styles[key] = _extends({}, styles[key], toMerge[key]);
});
}
return name;
});
return styles;
};
exports.default = mergeClasses;
/***/ }),
/***/ "./node_modules/select/src/select.js":
/*!*******************************************!*\
!*** ./node_modules/select/src/select.js ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function select(element) {
var selectedText;
if (element.nodeName === 'SELECT') {
element.focus();
selectedText = element.value;
}
else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {
var isReadOnly = element.hasAttribute('readonly');
if (!isReadOnly) {
element.setAttribute('readonly', '');
}
element.select();
element.setSelectionRange(0, element.value.length);
if (!isReadOnly) {
element.removeAttribute('readonly');
}
selectedText = element.value;
}
else {
if (element.hasAttribute('contenteditable')) {
element.focus();
}
var selection = window.getSelection();
var range = document.createRange();
range.selectNodeContents(element);
selection.removeAllRanges();
selection.addRange(range);
selectedText = selection.toString();
}
return selectedText;
}
module.exports = select;
/***/ }),
/***/ "./node_modules/tiny-emitter/index.js":
/*!********************************************!*\
!*** ./node_modules/tiny-emitter/index.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports) {
function E () {
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
}
E.prototype = {
on: function (name, callback, ctx) {
var e = this.e || (this.e = {});
(e[name] || (e[name] = [])).push({
fn: callback,
ctx: ctx
});
return this;
},
once: function (name, callback, ctx) {
var self = this;
function listener () {
self.off(name, listener);
callback.apply(ctx, arguments);
};
listener._ = callback
return this.on(name, listener, ctx);
},
emit: function (name) {
var data = [].slice.call(arguments, 1);
var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
var i = 0;
var len = evtArr.length;
for (i; i < len; i++) {
evtArr[i].fn.apply(evtArr[i].ctx, data);
}
return this;
},
off: function (name, callback) {
var e = this.e || (this.e = {});
var evts = e[name];
var liveEvents = [];
if (evts && callback) {
for (var i = 0, len = evts.length; i < len; i++) {
if (evts[i].fn !== callback && evts[i].fn._ !== callback)
liveEvents.push(evts[i]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
(liveEvents.length)
? e[name] = liveEvents
: delete e[name];
return this;
}
};
module.exports = E;
/***/ }),
/***/ "./node_modules/tinycolor2/tinycolor.js":
/*!**********************************************!*\
!*** ./node_modules/tinycolor2/tinycolor.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_RESULT__;// TinyColor v1.4.1
// https://github.com/bgrins/TinyColor
// Brian Grinstead, MIT License
(function(Math) {
var trimLeft = /^\s+/,
trimRight = /\s+$/,
tinyCounter = 0,
mathRound = Math.round,
mathMin = Math.min,
mathMax = Math.max,
mathRandom = Math.random;
function tinycolor (color, opts) {
color = (color) ? color : '';
opts = opts || { };
// If input is already a tinycolor, return itself
if (color instanceof tinycolor) {
return color;
}
// If we are called as a function, call using new instead
if (!(this instanceof tinycolor)) {
return new tinycolor(color, opts);
}
var rgb = inputToRGB(color);
this._originalInput = color,
this._r = rgb.r,
this._g = rgb.g,
this._b = rgb.b,
this._a = rgb.a,
this._roundA = mathRound(100*this._a) / 100,
this._format = opts.format || rgb.format;
this._gradientType = opts.gradientType;
// Don't let the range of [0,255] come back in [0,1].
// Potentially lose a little bit of precision here, but will fix issues where
// .5 gets interpreted as half of the total, instead of half of 1
// If it was supposed to be 128, this was already taken care of by `inputToRgb`
if (this._r < 1) { this._r = mathRound(this._r); }
if (this._g < 1) { this._g = mathRound(this._g); }
if (this._b < 1) { this._b = mathRound(this._b); }
this._ok = rgb.ok;
this._tc_id = tinyCounter++;
}
tinycolor.prototype = {
isDark: function() {
return this.getBrightness() < 128;
},
isLight: function() {
return !this.isDark();
},
isValid: function() {
return this._ok;
},
getOriginalInput: function() {
return this._originalInput;
},
getFormat: function() {
return this._format;
},
getAlpha: function() {
return this._a;
},
getBrightness: function() {
//http://www.w3.org/TR/AERT#color-contrast
var rgb = this.toRgb();
return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
},
getLuminance: function() {
//http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
var rgb = this.toRgb();
var RsRGB, GsRGB, BsRGB, R, G, B;
RsRGB = rgb.r/255;
GsRGB = rgb.g/255;
BsRGB = rgb.b/255;
if (RsRGB <= 0.03928) {R = RsRGB / 12.92;} else {R = Math.pow(((RsRGB + 0.055) / 1.055), 2.4);}
if (GsRGB <= 0.03928) {G = GsRGB / 12.92;} else {G = Math.pow(((GsRGB + 0.055) / 1.055), 2.4);}
if (BsRGB <= 0.03928) {B = BsRGB / 12.92;} else {B = Math.pow(((BsRGB + 0.055) / 1.055), 2.4);}
return (0.2126 * R) + (0.7152 * G) + (0.0722 * B);
},
setAlpha: function(value) {
this._a = boundAlpha(value);
this._roundA = mathRound(100*this._a) / 100;
return this;
},
toHsv: function() {
var hsv = rgbToHsv(this._r, this._g, this._b);
return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a };
},
toHsvString: function() {
var hsv = rgbToHsv(this._r, this._g, this._b);
var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100);
return (this._a == 1) ?
"hsv(" + h + ", " + s + "%, " + v + "%)" :
"hsva(" + h + ", " + s + "%, " + v + "%, "+ this._roundA + ")";
},
toHsl: function() {
var hsl = rgbToHsl(this._r, this._g, this._b);
return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a };
},
toHslString: function() {
var hsl = rgbToHsl(this._r, this._g, this._b);
var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100);
return (this._a == 1) ?
"hsl(" + h + ", " + s + "%, " + l + "%)" :
"hsla(" + h + ", " + s + "%, " + l + "%, "+ this._roundA + ")";
},
toHex: function(allow3Char) {
return rgbToHex(this._r, this._g, this._b, allow3Char);
},
toHexString: function(allow3Char) {
return '#' + this.toHex(allow3Char);
},
toHex8: function(allow4Char) {
return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);
},
toHex8String: function(allow4Char) {
return '#' + this.toHex8(allow4Char);
},
toRgb: function() {
return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a };
},
toRgbString: function() {
return (this._a == 1) ?
"rgb(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ")" :
"rgba(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ", " + this._roundA + ")";
},
toPercentageRgb: function() {
return { r: mathRound(bound01(this._r, 255) * 100) + "%", g: mathRound(bound01(this._g, 255) * 100) + "%", b: mathRound(bound01(this._b, 255) * 100) + "%", a: this._a };
},
toPercentageRgbString: function() {
return (this._a == 1) ?
"rgb(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%)" :
"rgba(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")";
},
toName: function() {
if (this._a === 0) {
return "transparent";
}
if (this._a < 1) {
return false;
}
return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;
},
toFilter: function(secondColor) {
var hex8String = '#' + rgbaToArgbHex(this._r, this._g, this._b, this._a);
var secondHex8String = hex8String;
var gradientType = this._gradientType ? "GradientType = 1, " : "";
if (secondColor) {
var s = tinycolor(secondColor);
secondHex8String = '#' + rgbaToArgbHex(s._r, s._g, s._b, s._a);
}
return "progid:DXImageTransform.Microsoft.gradient("+gradientType+"startColorstr="+hex8String+",endColorstr="+secondHex8String+")";
},
toString: function(format) {
var formatSet = !!format;
format = format || this._format;
var formattedString = false;
var hasAlpha = this._a < 1 && this._a >= 0;
var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name");
if (needsAlphaFormat) {
// Special case for "transparent", all other non-alpha formats
// will return rgba when there is transparency.
if (format === "name" && this._a === 0) {
return this.toName();
}
return this.toRgbString();
}
if (format === "rgb") {
formattedString = this.toRgbString();
}
if (format === "prgb") {
formattedString = this.toPercentageRgbString();
}
if (format === "hex" || format === "hex6") {
formattedString = this.toHexString();
}
if (format === "hex3") {
formattedString = this.toHexString(true);
}
if (format === "hex4") {
formattedString = this.toHex8String(true);
}
if (format === "hex8") {
formattedString = this.toHex8String();
}
if (format === "name") {
formattedString = this.toName();
}
if (format === "hsl") {
formattedString = this.toHslString();
}
if (format === "hsv") {
formattedString = this.toHsvString();
}
return formattedString || this.toHexString();
},
clone: function() {
return tinycolor(this.toString());
},
_applyModification: function(fn, args) {
var color = fn.apply(null, [this].concat([].slice.call(args)));
this._r = color._r;
this._g = color._g;
this._b = color._b;
this.setAlpha(color._a);
return this;
},
lighten: function() {
return this._applyModification(lighten, arguments);
},
brighten: function() {
return this._applyModification(brighten, arguments);
},
darken: function() {
return this._applyModification(darken, arguments);
},
desaturate: function() {
return this._applyModification(desaturate, arguments);
},
saturate: function() {
return this._applyModification(saturate, arguments);
},
greyscale: function() {
return this._applyModification(greyscale, arguments);
},
spin: function() {
return this._applyModification(spin, arguments);
},
_applyCombination: function(fn, args) {
return fn.apply(null, [this].concat([].slice.call(args)));
},
analogous: function() {
return this._applyCombination(analogous, arguments);
},
complement: function() {
return this._applyCombination(complement, arguments);
},
monochromatic: function() {
return this._applyCombination(monochromatic, arguments);
},
splitcomplement: function() {
return this._applyCombination(splitcomplement, arguments);
},
triad: function() {
return this._applyCombination(triad, arguments);
},
tetrad: function() {
return this._applyCombination(tetrad, arguments);
}
};
// If input is an object, force 1 into "1.0" to handle ratios properly
// String input requires "1.0" as input, so 1 will be treated as 1
tinycolor.fromRatio = function(color, opts) {
if (typeof color == "object") {
var newColor = {};
for (var i in color) {
if (color.hasOwnProperty(i)) {
if (i === "a") {
newColor[i] = color[i];
}
else {
newColor[i] = convertToPercentage(color[i]);
}
}
}
color = newColor;
}
return tinycolor(color, opts);
};
// Given a string or object, convert that input to RGB
// Possible string inputs:
//
// "red"
// "#f00" or "f00"
// "#ff0000" or "ff0000"
// "#ff000000" or "ff000000"
// "rgb 255 0 0" or "rgb (255, 0, 0)"
// "rgb 1.0 0 0" or "rgb (1, 0, 0)"
// "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
// "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
// "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
// "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
// "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
//
function inputToRGB(color) {
var rgb = { r: 0, g: 0, b: 0 };
var a = 1;
var s = null;
var v = null;
var l = null;
var ok = false;
var format = false;
if (typeof color == "string") {
color = stringInputToObject(color);
}
if (typeof color == "object") {
if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
rgb = rgbToRgb(color.r, color.g, color.b);
ok = true;
format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
}
else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
s = convertToPercentage(color.s);
v = convertToPercentage(color.v);
rgb = hsvToRgb(color.h, s, v);
ok = true;
format = "hsv";
}
else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
s = convertToPercentage(color.s);
l = convertToPercentage(color.l);
rgb = hslToRgb(color.h, s, l);
ok = true;
format = "hsl";
}
if (color.hasOwnProperty("a")) {
a = color.a;
}
}
a = boundAlpha(a);
return {
ok: ok,
format: color.format || format,
r: mathMin(255, mathMax(rgb.r, 0)),
g: mathMin(255, mathMax(rgb.g, 0)),
b: mathMin(255, mathMax(rgb.b, 0)),
a: a
};
}
// Conversion Functions
// --------------------
// `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:
// <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>
// `rgbToRgb`
// Handle bounds / percentage checking to conform to CSS color spec
// <http://www.w3.org/TR/css3-color/>
// *Assumes:* r, g, b in [0, 255] or [0, 1]
// *Returns:* { r, g, b } in [0, 255]
function rgbToRgb(r, g, b){
return {
r: bound01(r, 255) * 255,
g: bound01(g, 255) * 255,
b: bound01(b, 255) * 255
};
}
// `rgbToHsl`
// Converts an RGB color value to HSL.
// *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]
// *Returns:* { h, s, l } in [0,1]
function rgbToHsl(r, g, b) {
r = bound01(r, 255);
g = bound01(g, 255);
b = bound01(b, 255);
var max = mathMax(r, g, b), min = mathMin(r, g, b);
var h, s, l = (max + min) / 2;
if(max == min) {
h = s = 0; // achromatic
}
else {
var d = max - min;
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
switch(max) {
case r: h = (g - b) / d + (g < b ? 6 : 0); break;
case g: h = (b - r) / d + 2; break;
case b: h = (r - g) / d + 4; break;
}
h /= 6;
}
return { h: h, s: s, l: l };
}
// `hslToRgb`
// Converts an HSL color value to RGB.
// *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
// *Returns:* { r, g, b } in the set [0, 255]
function hslToRgb(h, s, l) {
var r, g, b;
h = bound01(h, 360);
s = bound01(s, 100);
l = bound01(l, 100);
function hue2rgb(p, q, t) {
if(t < 0) t += 1;
if(t > 1) t -= 1;
if(t < 1/6) return p + (q - p) * 6 * t;
if(t < 1/2) return q;
if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;
return p;
}
if(s === 0) {
r = g = b = l; // achromatic
}
else {
var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
var p = 2 * l - q;
r = hue2rgb(p, q, h + 1/3);
g = hue2rgb(p, q, h);
b = hue2rgb(p, q, h - 1/3);
}
return { r: r * 255, g: g * 255, b: b * 255 };
}
// `rgbToHsv`
// Converts an RGB color value to HSV
// *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
// *Returns:* { h, s, v } in [0,1]
function rgbToHsv(r, g, b) {
r = bound01(r, 255);
g = bound01(g, 255);
b = bound01(b, 255);
var max = mathMax(r, g, b), min = mathMin(r, g, b);
var h, s, v = max;
var d = max - min;
s = max === 0 ? 0 : d / max;
if(max == min) {
h = 0; // achromatic
}
else {
switch(max) {
case r: h = (g - b) / d + (g < b ? 6 : 0); break;
case g: h = (b - r) / d + 2; break;
case b: h = (r - g) / d + 4; break;
}
h /= 6;
}
return { h: h, s: s, v: v };
}
// `hsvToRgb`
// Converts an HSV color value to RGB.
// *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
// *Returns:* { r, g, b } in the set [0, 255]
function hsvToRgb(h, s, v) {
h = bound01(h, 360) * 6;
s = bound01(s, 100);
v = bound01(v, 100);
var i = Math.floor(h),
f = h - i,
p = v * (1 - s),
q = v * (1 - f * s),
t = v * (1 - (1 - f) * s),
mod = i % 6,
r = [v, q, p, p, t, v][mod],
g = [t, v, v, q, p, p][mod],
b = [p, p, t, v, v, q][mod];
return { r: r * 255, g: g * 255, b: b * 255 };
}
// `rgbToHex`
// Converts an RGB color to hex
// Assumes r, g, and b are contained in the set [0, 255]
// Returns a 3 or 6 character hex
function rgbToHex(r, g, b, allow3Char) {
var hex = [
pad2(mathRound(r).toString(16)),
pad2(mathRound(g).toString(16)),
pad2(mathRound(b).toString(16))
];
// Return a 3 character hex if possible
if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {
return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
}
return hex.join("");
}
// `rgbaToHex`
// Converts an RGBA color plus alpha transparency to hex
// Assumes r, g, b are contained in the set [0, 255] and
// a in [0, 1]. Returns a 4 or 8 character rgba hex
function rgbaToHex(r, g, b, a, allow4Char) {
var hex = [
pad2(mathRound(r).toString(16)),
pad2(mathRound(g).toString(16)),
pad2(mathRound(b).toString(16)),
pad2(convertDecimalToHex(a))
];
// Return a 4 character hex if possible
if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {
return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
}
return hex.join("");
}
// `rgbaToArgbHex`
// Converts an RGBA color to an ARGB Hex8 string
// Rarely used, but required for "toFilter()"
function rgbaToArgbHex(r, g, b, a) {
var hex = [
pad2(convertDecimalToHex(a)),
pad2(mathRound(r).toString(16)),
pad2(mathRound(g).toString(16)),
pad2(mathRound(b).toString(16))
];
return hex.join("");
}
// `equals`
// Can be called with any tinycolor input
tinycolor.equals = function (color1, color2) {
if (!color1 || !color2) { return false; }
return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();
};
tinycolor.random = function() {
return tinycolor.fromRatio({
r: mathRandom(),
g: mathRandom(),
b: mathRandom()
});
};
// Modification Functions
// ----------------------
// Thanks to less.js for some of the basics here
// <https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js>
function desaturate(color, amount) {
amount = (amount === 0) ? 0 : (amount || 10);
var hsl = tinycolor(color).toHsl();
hsl.s -= amount / 100;
hsl.s = clamp01(hsl.s);
return tinycolor(hsl);
}
function saturate(color, amount) {
amount = (amount === 0) ? 0 : (amount || 10);
var hsl = tinycolor(color).toHsl();
hsl.s += amount / 100;
hsl.s = clamp01(hsl.s);
return tinycolor(hsl);
}
function greyscale(color) {
return tinycolor(color).desaturate(100);
}
function lighten (color, amount) {
amount = (amount === 0) ? 0 : (amount || 10);
var hsl = tinycolor(color).toHsl();
hsl.l += amount / 100;
hsl.l = clamp01(hsl.l);
return tinycolor(hsl);
}
function brighten(color, amount) {
amount = (amount === 0) ? 0 : (amount || 10);
var rgb = tinycolor(color).toRgb();
rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * - (amount / 100))));
rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * - (amount / 100))));
rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * - (amount / 100))));
return tinycolor(rgb);
}
function darken (color, amount) {
amount = (amount === 0) ? 0 : (amount || 10);
var hsl = tinycolor(color).toHsl();
hsl.l -= amount / 100;
hsl.l = clamp01(hsl.l);
return tinycolor(hsl);
}
// Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
// Values outside of this range will be wrapped into this range.
function spin(color, amount) {
var hsl = tinycolor(color).toHsl();
var hue = (hsl.h + amount) % 360;
hsl.h = hue < 0 ? 360 + hue : hue;
return tinycolor(hsl);
}
// Combination Functions
// ---------------------
// Thanks to jQuery xColor for some of the ideas behind these
// <https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js>
function complement(color) {
var hsl = tinycolor(color).toHsl();
hsl.h = (hsl.h + 180) % 360;
return tinycolor(hsl);
}
function triad(color) {
var hsl = tinycolor(color).toHsl();
var h = hsl.h;
return [
tinycolor(color),
tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }),
tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l })
];
}
function tetrad(color) {
var hsl = tinycolor(color).toHsl();
var h = hsl.h;
return [
tinycolor(color),
tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }),
tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }),
tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l })
];
}
function splitcomplement(color) {
var hsl = tinycolor(color).toHsl();
var h = hsl.h;
return [
tinycolor(color),
tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l}),
tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l})
];
}
function analogous(color, results, slices) {
results = results || 6;
slices = slices || 30;
var hsl = tinycolor(color).toHsl();
var part = 360 / slices;
var ret = [tinycolor(color)];
for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results; ) {
hsl.h = (hsl.h + part) % 360;
ret.push(tinycolor(hsl));
}
return ret;
}
function monochromatic(color, results) {
results = results || 6;
var hsv = tinycolor(color).toHsv();
var h = hsv.h, s = hsv.s, v = hsv.v;
var ret = [];
var modification = 1 / results;
while (results--) {
ret.push(tinycolor({ h: h, s: s, v: v}));
v = (v + modification) % 1;
}
return ret;
}
// Utility Functions
// ---------------------
tinycolor.mix = function(color1, color2, amount) {
amount = (amount === 0) ? 0 : (amount || 50);
var rgb1 = tinycolor(color1).toRgb();
var rgb2 = tinycolor(color2).toRgb();
var p = amount / 100;
var rgba = {
r: ((rgb2.r - rgb1.r) * p) + rgb1.r,
g: ((rgb2.g - rgb1.g) * p) + rgb1.g,
b: ((rgb2.b - rgb1.b) * p) + rgb1.b,
a: ((rgb2.a - rgb1.a) * p) + rgb1.a
};
return tinycolor(rgba);
};
// Readability Functions
// ---------------------
// <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)
// `contrast`
// Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)
tinycolor.readability = function(color1, color2) {
var c1 = tinycolor(color1);
var c2 = tinycolor(color2);
return (Math.max(c1.getLuminance(),c2.getLuminance())+0.05) / (Math.min(c1.getLuminance(),c2.getLuminance())+0.05);
};
// `isReadable`
// Ensure that foreground and background color combinations meet WCAG2 guidelines.
// The third argument is an optional Object.
// the 'level' property states 'AA' or 'AAA' - if missing or invalid, it defaults to 'AA';
// the 'size' property states 'large' or 'small' - if missing or invalid, it defaults to 'small'.
// If the entire object is absent, isReadable defaults to {level:"AA",size:"small"}.
// *Example*
// tinycolor.isReadable("#000", "#111") => false
// tinycolor.isReadable("#000", "#111",{level:"AA",size:"large"}) => false
tinycolor.isReadable = function(color1, color2, wcag2) {
var readability = tinycolor.readability(color1, color2);
var wcag2Parms, out;
out = false;
wcag2Parms = validateWCAG2Parms(wcag2);
switch (wcag2Parms.level + wcag2Parms.size) {
case "AAsmall":
case "AAAlarge":
out = readability >= 4.5;
break;
case "AAlarge":
out = readability >= 3;
break;
case "AAAsmall":
out = readability >= 7;
break;
}
return out;
};
// `mostReadable`
// Given a base color and a list of possible foreground or background
// colors for that base, returns the most readable color.
// Optionally returns Black or White if the most readable color is unreadable.
// *Example*
// tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:false}).toHexString(); // "#112255"
// tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:true}).toHexString(); // "#ffffff"
// tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"large"}).toHexString(); // "#faf3f3"
// tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"small"}).toHexString(); // "#ffffff"
tinycolor.mostReadable = function(baseColor, colorList, args) {
var bestColor = null;
var bestScore = 0;
var readability;
var includeFallbackColors, level, size ;
args = args || {};
includeFallbackColors = args.includeFallbackColors ;
level = args.level;
size = args.size;
for (var i= 0; i < colorList.length ; i++) {
readability = tinycolor.readability(baseColor, colorList[i]);
if (readability > bestScore) {
bestScore = readability;
bestColor = tinycolor(colorList[i]);
}
}
if (tinycolor.isReadable(baseColor, bestColor, {"level":level,"size":size}) || !includeFallbackColors) {
return bestColor;
}
else {
args.includeFallbackColors=false;
return tinycolor.mostReadable(baseColor,["#fff", "#000"],args);
}
};
// Big List of Colors
// ------------------
// <http://www.w3.org/TR/css3-color/#svg-color>
var names = tinycolor.names = {
aliceblue: "f0f8ff",
antiquewhite: "faebd7",
aqua: "0ff",
aquamarine: "7fffd4",
azure: "f0ffff",
beige: "f5f5dc",
bisque: "ffe4c4",
black: "000",
blanchedalmond: "ffebcd",
blue: "00f",
blueviolet: "8a2be2",
brown: "a52a2a",
burlywood: "deb887",
burntsienna: "ea7e5d",
cadetblue: "5f9ea0",
chartreuse: "7fff00",
chocolate: "d2691e",
coral: "ff7f50",
cornflowerblue: "6495ed",
cornsilk: "fff8dc",
crimson: "dc143c",
cyan: "0ff",
darkblue: "00008b",
darkcyan: "008b8b",
darkgoldenrod: "b8860b",
darkgray: "a9a9a9",
darkgreen: "006400",
darkgrey: "a9a9a9",
darkkhaki: "bdb76b",
darkmagenta: "8b008b",
darkolivegreen: "556b2f",
darkorange: "ff8c00",
darkorchid: "9932cc",
darkred: "8b0000",
darksalmon: "e9967a",
darkseagreen: "8fbc8f",
darkslateblue: "483d8b",
darkslategray: "2f4f4f",
darkslategrey: "2f4f4f",
darkturquoise: "00ced1",
darkviolet: "9400d3",
deeppink: "ff1493",
deepskyblue: "00bfff",
dimgray: "696969",
dimgrey: "696969",
dodgerblue: "1e90ff",
firebrick: "b22222",
floralwhite: "fffaf0",
forestgreen: "228b22",
fuchsia: "f0f",
gainsboro: "dcdcdc",
ghostwhite: "f8f8ff",
gold: "ffd700",
goldenrod: "daa520",
gray: "808080",
green: "008000",
greenyellow: "adff2f",
grey: "808080",
honeydew: "f0fff0",
hotpink: "ff69b4",
indianred: "cd5c5c",
indigo: "4b0082",
ivory: "fffff0",
khaki: "f0e68c",
lavender: "e6e6fa",
lavenderblush: "fff0f5",
lawngreen: "7cfc00",
lemonchiffon: "fffacd",
lightblue: "add8e6",
lightcoral: "f08080",
lightcyan: "e0ffff",
lightgoldenrodyellow: "fafad2",
lightgray: "d3d3d3",
lightgreen: "90ee90",
lightgrey: "d3d3d3",
lightpink: "ffb6c1",
lightsalmon: "ffa07a",
lightseagreen: "20b2aa",
lightskyblue: "87cefa",
lightslategray: "789",
lightslategrey: "789",
lightsteelblue: "b0c4de",
lightyellow: "ffffe0",
lime: "0f0",
limegreen: "32cd32",
linen: "faf0e6",
magenta: "f0f",
maroon: "800000",
mediumaquamarine: "66cdaa",
mediumblue: "0000cd",
mediumorchid: "ba55d3",
mediumpurple: "9370db",
mediumseagreen: "3cb371",
mediumslateblue: "7b68ee",
mediumspringgreen: "00fa9a",
mediumturquoise: "48d1cc",
mediumvioletred: "c71585",
midnightblue: "191970",
mintcream: "f5fffa",
mistyrose: "ffe4e1",
moccasin: "ffe4b5",
navajowhite: "ffdead",
navy: "000080",
oldlace: "fdf5e6",
olive: "808000",
olivedrab: "6b8e23",
orange: "ffa500",
orangered: "ff4500",
orchid: "da70d6",
palegoldenrod: "eee8aa",
palegreen: "98fb98",
paleturquoise: "afeeee",
palevioletred: "db7093",
papayawhip: "ffefd5",
peachpuff: "ffdab9",
peru: "cd853f",
pink: "ffc0cb",
plum: "dda0dd",
powderblue: "b0e0e6",
purple: "800080",
rebeccapurple: "663399",
red: "f00",
rosybrown: "bc8f8f",
royalblue: "4169e1",
saddlebrown: "8b4513",
salmon: "fa8072",
sandybrown: "f4a460",
seagreen: "2e8b57",
seashell: "fff5ee",
sienna: "a0522d",
silver: "c0c0c0",
skyblue: "87ceeb",
slateblue: "6a5acd",
slategray: "708090",
slategrey: "708090",
snow: "fffafa",
springgreen: "00ff7f",
steelblue: "4682b4",
tan: "d2b48c",
teal: "008080",
thistle: "d8bfd8",
tomato: "ff6347",
turquoise: "40e0d0",
violet: "ee82ee",
wheat: "f5deb3",
white: "fff",
whitesmoke: "f5f5f5",
yellow: "ff0",
yellowgreen: "9acd32"
};
// Make it easy to access colors via `hexNames[hex]`
var hexNames = tinycolor.hexNames = flip(names);
// Utilities
// ---------
// `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`
function flip(o) {
var flipped = { };
for (var i in o) {
if (o.hasOwnProperty(i)) {
flipped[o[i]] = i;
}
}
return flipped;
}
// Return a valid alpha value [0,1] with all invalid values being set to 1
function boundAlpha(a) {
a = parseFloat(a);
if (isNaN(a) || a < 0 || a > 1) {
a = 1;
}
return a;
}
// Take input from [0, n] and return it as [0, 1]
function bound01(n, max) {
if (isOnePointZero(n)) { n = "100%"; }
var processPercent = isPercentage(n);
n = mathMin(max, mathMax(0, parseFloat(n)));
// Automatically convert percentage into number
if (processPercent) {
n = parseInt(n * max, 10) / 100;
}
// Handle floating point rounding errors
if ((Math.abs(n - max) < 0.000001)) {
return 1;
}
// Convert into [0, 1] range if it isn't already
return (n % max) / parseFloat(max);
}
// Force a number between 0 and 1
function clamp01(val) {
return mathMin(1, mathMax(0, val));
}
// Parse a base-16 hex value into a base-10 integer
function parseIntFromHex(val) {
return parseInt(val, 16);
}
// Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
// <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
function isOnePointZero(n) {
return typeof n == "string" && n.indexOf('.') != -1 && parseFloat(n) === 1;
}
// Check to see if string passed in is a percentage
function isPercentage(n) {
return typeof n === "string" && n.indexOf('%') != -1;
}
// Force a hex value to have 2 characters
function pad2(c) {
return c.length == 1 ? '0' + c : '' + c;
}
// Replace a decimal with it's percentage value
function convertToPercentage(n) {
if (n <= 1) {
n = (n * 100) + "%";
}
return n;
}
// Converts a decimal to a hex value
function convertDecimalToHex(d) {
return Math.round(parseFloat(d) * 255).toString(16);
}
// Converts a hex value to a decimal
function convertHexToDecimal(h) {
return (parseIntFromHex(h) / 255);
}
var matchers = (function() {
// <http://www.w3.org/TR/css3-values/#integers>
var CSS_INTEGER = "[-\\+]?\\d+%?";
// <http://www.w3.org/TR/css3-values/#number-value>
var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
// Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
// Actual matching.
// Parentheses and commas are optional, but not required.
// Whitespace can take the place of commas or opening paren
var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
return {
CSS_UNIT: new RegExp(CSS_UNIT),
rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
};
})();
// `isValidCSSUnit`
// Take in a single string / number and check to see if it looks like a CSS unit
// (see `matchers` above for definition).
function isValidCSSUnit(color) {
return !!matchers.CSS_UNIT.exec(color);
}
// `stringInputToObject`
// Permissive string parsing. Take in a number of formats, and output an object
// based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
function stringInputToObject(color) {
color = color.replace(trimLeft,'').replace(trimRight, '').toLowerCase();
var named = false;
if (names[color]) {
color = names[color];
named = true;
}
else if (color == 'transparent') {
return { r: 0, g: 0, b: 0, a: 0, format: "name" };
}
// Try to match string input using regular expressions.
// Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
// Just return an object and let the conversion functions handle that.
// This way the result will be the same whether the tinycolor is initialized with string or object.
var match;
if ((match = matchers.rgb.exec(color))) {
return { r: match[1], g: match[2], b: match[3] };
}
if ((match = matchers.rgba.exec(color))) {
return { r: match[1], g: match[2], b: match[3], a: match[4] };
}
if ((match = matchers.hsl.exec(color))) {
return { h: match[1], s: match[2], l: match[3] };
}
if ((match = matchers.hsla.exec(color))) {
return { h: match[1], s: match[2], l: match[3], a: match[4] };
}
if ((match = matchers.hsv.exec(color))) {
return { h: match[1], s: match[2], v: match[3] };
}
if ((match = matchers.hsva.exec(color))) {
return { h: match[1], s: match[2], v: match[3], a: match[4] };
}
if ((match = matchers.hex8.exec(color))) {
return {
r: parseIntFromHex(match[1]),
g: parseIntFromHex(match[2]),
b: parseIntFromHex(match[3]),
a: convertHexToDecimal(match[4]),
format: named ? "name" : "hex8"
};
}
if ((match = matchers.hex6.exec(color))) {
return {
r: parseIntFromHex(match[1]),
g: parseIntFromHex(match[2]),
b: parseIntFromHex(match[3]),
format: named ? "name" : "hex"
};
}
if ((match = matchers.hex4.exec(color))) {
return {
r: parseIntFromHex(match[1] + '' + match[1]),
g: parseIntFromHex(match[2] + '' + match[2]),
b: parseIntFromHex(match[3] + '' + match[3]),
a: convertHexToDecimal(match[4] + '' + match[4]),
format: named ? "name" : "hex8"
};
}
if ((match = matchers.hex3.exec(color))) {
return {
r: parseIntFromHex(match[1] + '' + match[1]),
g: parseIntFromHex(match[2] + '' + match[2]),
b: parseIntFromHex(match[3] + '' + match[3]),
format: named ? "name" : "hex"
};
}
return false;
}
function validateWCAG2Parms(parms) {
// return valid WCAG2 parms for isReadable.
// If input parms are invalid, return {"level":"AA", "size":"small"}
var level, size;
parms = parms || {"level":"AA", "size":"small"};
level = (parms.level || "AA").toUpperCase();
size = (parms.size || "small").toLowerCase();
if (level !== "AA" && level !== "AAA") {
level = "AA";
}
if (size !== "small" && size !== "large") {
size = "small";
}
return {"level":level, "size":size};
}
// Node: Export function
if ( true && module.exports) {
module.exports = tinycolor;
}
// AMD/requirejs: Define the module
else if (true) {
!(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {return tinycolor;}).call(exports, __webpack_require__, exports, module),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
}
// Browser: Expose to window
else {}
})(Math);
/***/ }),
/***/ "./node_modules/uuid/lib/bytesToUuid.js":
/*!**********************************************!*\
!*** ./node_modules/uuid/lib/bytesToUuid.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports) {
/**
* Convert array of 16 byte values to UUID string format of the form:
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
*/
var byteToHex = [];
for (var i = 0; i < 256; ++i) {
byteToHex[i] = (i + 0x100).toString(16).substr(1);
}
function bytesToUuid(buf, offset) {
var i = offset || 0;
var bth = byteToHex;
// join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
return ([bth[buf[i++]], bth[buf[i++]],
bth[buf[i++]], bth[buf[i++]], '-',
bth[buf[i++]], bth[buf[i++]], '-',
bth[buf[i++]], bth[buf[i++]], '-',
bth[buf[i++]], bth[buf[i++]], '-',
bth[buf[i++]], bth[buf[i++]],
bth[buf[i++]], bth[buf[i++]],
bth[buf[i++]], bth[buf[i++]]]).join('');
}
module.exports = bytesToUuid;
/***/ }),
/***/ "./node_modules/uuid/lib/rng-browser.js":
/*!**********************************************!*\
!*** ./node_modules/uuid/lib/rng-browser.js ***!
\**********************************************/
/*! no static exports found */
/***/ (function(module, exports) {
// Unique ID creation requires a high quality random # generator. In the
// browser this is a little complicated due to unknown quality of Math.random()
// and inconsistent support for the `crypto` API. We do the best we can via
// feature-detection
// getRandomValues needs to be invoked in a context where "this" is a Crypto
// implementation. Also, find the complete implementation of crypto on IE11.
var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||
(typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));
if (getRandomValues) {
// WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
module.exports = function whatwgRNG() {
getRandomValues(rnds8);
return rnds8;
};
} else {
// Math.random()-based (RNG)
//
// If all else fails, use Math.random(). It's fast, but is of unspecified
// quality.
var rnds = new Array(16);
module.exports = function mathRNG() {
for (var i = 0, r; i < 16; i++) {
if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
}
return rnds;
};
}
/***/ }),
/***/ "./node_modules/uuid/v4.js":
/*!*********************************!*\
!*** ./node_modules/uuid/v4.js ***!
\*********************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var rng = __webpack_require__(/*! ./lib/rng */ "./node_modules/uuid/lib/rng-browser.js");
var bytesToUuid = __webpack_require__(/*! ./lib/bytesToUuid */ "./node_modules/uuid/lib/bytesToUuid.js");
function v4(options, buf, offset) {
var i = buf && offset || 0;
if (typeof(options) == 'string') {
buf = options === 'binary' ? new Array(16) : null;
options = null;
}
options = options || {};
var rnds = options.random || (options.rng || rng)();
// Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
rnds[6] = (rnds[6] & 0x0f) | 0x40;
rnds[8] = (rnds[8] & 0x3f) | 0x80;
// Copy bytes to buffer, if provided
if (buf) {
for (var ii = 0; ii < 16; ++ii) {
buf[i + ii] = rnds[ii];
}
}
return buf || bytesToUuid(rnds);
}
module.exports = v4;
/***/ }),
/***/ "./node_modules/warning/warning.js":
/*!*****************************************!*\
!*** ./node_modules/warning/warning.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Copyright (c) 2014-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* Similar to invariant but only logs a warning if the condition is not met.
* This can be used to log issues in development environments in critical
* paths. Removing the logging code for production environments will keep the
* same logic and follow the same code paths.
*/
var __DEV__ = "development" !== 'production';
var warning = function() {};
if (__DEV__) {
var printWarning = function printWarning(format, args) {
var len = arguments.length;
args = new Array(len > 2 ? len - 2 : 0);
for (var key = 2; key < len; key++) {
args[key - 2] = arguments[key];
}
var argIndex = 0;
var message = 'Warning: ' +
format.replace(/%s/g, function() {
return args[argIndex++];
});
if (typeof console !== 'undefined') {
console.error(message);
}
try {
// --- Welcome to debugging React ---
// This error was thrown as a convenience so that you can use this stack
// to find the callsite that caused this warning to fire.
throw new Error(message);
} catch (x) {}
}
warning = function(condition, format, args) {
var len = arguments.length;
args = new Array(len > 2 ? len - 2 : 0);
for (var key = 2; key < len; key++) {
args[key - 2] = arguments[key];
}
if (format === undefined) {
throw new Error(
'`warning(condition, format, ...args)` requires a warning ' +
'message argument'
);
}
if (!condition) {
printWarning.apply(null, [format].concat(args));
}
};
}
module.exports = warning;
/***/ }),
/***/ "./node_modules/webpack/buildin/global.js":
/*!***********************************!*\
!*** (webpack)/buildin/global.js ***!
\***********************************/
/*! no static exports found */
/***/ (function(module, exports) {
var g;
// This works in non-strict mode
g = (function() {
return this;
})();
try {
// This works if eval is allowed (see CSP)
g = g || new Function("return this")();
} catch (e) {
// This works if the window reference is available
if (typeof window === "object") g = window;
}
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
module.exports = g;
/***/ }),
/***/ "./node_modules/webpack/buildin/module.js":
/*!***********************************!*\
!*** (webpack)/buildin/module.js ***!
\***********************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = function(module) {
if (!module.webpackPolyfill) {
module.deprecate = function() {};
module.paths = [];
// module.parent = undefined by default
if (!module.children) module.children = [];
Object.defineProperty(module, "loaded", {
enumerable: true,
get: function() {
return module.l;
}
});
Object.defineProperty(module, "id", {
enumerable: true,
get: function() {
return module.i;
}
});
module.webpackPolyfill = 1;
}
return module;
};
/***/ }),
/***/ "@wordpress/a11y":
/*!***************************************!*\
!*** external {"this":["wp","a11y"]} ***!
\***************************************/
/*! no static exports found */
/***/ (function(module, exports) {
(function() { module.exports = this["wp"]["a11y"]; }());
/***/ }),
/***/ "@wordpress/api-fetch":
/*!*******************************************!*\
!*** external {"this":["wp","apiFetch"]} ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports) {
(function() { module.exports = this["wp"]["apiFetch"]; }());
/***/ }),
/***/ "@wordpress/compose":
/*!******************************************!*\
!*** external {"this":["wp","compose"]} ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports) {
(function() { module.exports = this["wp"]["compose"]; }());
/***/ }),
/***/ "@wordpress/deprecated":
/*!*********************************************!*\
!*** external {"this":["wp","deprecated"]} ***!
\*********************************************/
/*! no static exports found */
/***/ (function(module, exports) {
(function() { module.exports = this["wp"]["deprecated"]; }());
/***/ }),
/***/ "@wordpress/dom":
/*!**************************************!*\
!*** external {"this":["wp","dom"]} ***!
\**************************************/
/*! no static exports found */
/***/ (function(module, exports) {
(function() { module.exports = this["wp"]["dom"]; }());
/***/ }),
/***/ "@wordpress/element":
/*!******************************************!*\
!*** external {"this":["wp","element"]} ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports) {
(function() { module.exports = this["wp"]["element"]; }());
/***/ }),
/***/ "@wordpress/hooks":
/*!****************************************!*\
!*** external {"this":["wp","hooks"]} ***!
\****************************************/
/*! no static exports found */
/***/ (function(module, exports) {
(function() { module.exports = this["wp"]["hooks"]; }());
/***/ }),
/***/ "@wordpress/i18n":
/*!***************************************!*\
!*** external {"this":["wp","i18n"]} ***!
\***************************************/
/*! no static exports found */
/***/ (function(module, exports) {
(function() { module.exports = this["wp"]["i18n"]; }());
/***/ }),
/***/ "@wordpress/is-shallow-equal":
/*!*************************************************!*\
!*** external {"this":["wp","isShallowEqual"]} ***!
\*************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
(function() { module.exports = this["wp"]["isShallowEqual"]; }());
/***/ }),
/***/ "@wordpress/keycodes":
/*!*******************************************!*\
!*** external {"this":["wp","keycodes"]} ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports) {
(function() { module.exports = this["wp"]["keycodes"]; }());
/***/ }),
/***/ "@wordpress/rich-text":
/*!*******************************************!*\
!*** external {"this":["wp","richText"]} ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports) {
(function() { module.exports = this["wp"]["richText"]; }());
/***/ }),
/***/ "@wordpress/url":
/*!**************************************!*\
!*** external {"this":["wp","url"]} ***!
\**************************************/
/*! no static exports found */
/***/ (function(module, exports) {
(function() { module.exports = this["wp"]["url"]; }());
/***/ }),
/***/ "lodash":
/*!*************************!*\
!*** external "lodash" ***!
\*************************/
/*! no static exports found */
/***/ (function(module, exports) {
(function() { module.exports = this["lodash"]; }());
/***/ }),
/***/ "moment":
/*!*************************!*\
!*** external "moment" ***!
\*************************/
/*! no static exports found */
/***/ (function(module, exports) {
(function() { module.exports = this["moment"]; }());
/***/ }),
/***/ "react":
/*!************************!*\
!*** external "React" ***!
\************************/
/*! no static exports found */
/***/ (function(module, exports) {
(function() { module.exports = this["React"]; }());
/***/ }),
/***/ "react-dom":
/*!***************************!*\
!*** external "ReactDOM" ***!
\***************************/
/*! no static exports found */
/***/ (function(module, exports) {
(function() { module.exports = this["ReactDOM"]; }());
/***/ })
/******/ });
//# sourceMappingURL=components.js.map